Downloads · 30 days
13
0% of all-time downloads
NTUYG/DeepSCC-RoBERTa
DeepSCC-RoBERTa is a text classification model from NTUYG. Use it when you need a label for a piece of text. It is set up for transformers.
Downloads · 30 days
13
0% of all-time downloads
All-time downloads
10.8K
Public
Repo size
2.5 GB
Likes
0
Public
Click a slice to open those files.
.bin501 MB · 50%
From the Hugging Face model README
from simpletransformers.classification import ClassificationModel, ClassificationArgs
name_file = ['bash', 'c', 'c#', 'c++','css', 'haskell', 'java', 'javascript', 'lua', 'objective-c', 'perl', 'php', 'python','r','ruby', 'scala', 'sql', 'swift', 'vb.net']
deep_scc_model_args = ClassificationArgs(num_train_epochs=10,max_seq_length=300,use_multiprocessing=False)
deep_scc_model = ClassificationModel("roberta", "NTUYG/DeepSCC-RoBERTa", num_labels=19, args=deep_scc_model_args,use_cuda=True)
code = ''' public static double getSimilarity(String phrase1, String phrase2) {
return (getSC(phrase1, phrase2) + getSC(phrase2, phrase1)) / 2.0;
}'''
code = code.replace('\n',' ').replace('\r',' ')
predictions, raw_outputs = model.predict([code])
predict = name_file[predictions[0]]
print(predict)