alBERTo model pre-trained for the classification of linguistic antipatterns on a dataset containing instances of these bad practices of type: "Get" more than accessor, Not implemented condition, Method signature and comment are opposite, Attribute signature and comment are opposite
alBERTo is a model created for the recognition of linguistic antipatterns within python code.
It was created starting from the Microsoft CodeBERT model, on which fine tuning operations were carried out to make it capable of classifying the code as "clean" or containing linguistic antipatterns.
The model is able to classify different classes:
this model can be used for the classification of linguistic antipatters described previously.
The model still has limitations, as it makes classification errors due to the presence of little data for training, therefore its predictions should not be taken as absolute or true regardless
1from transformers import AutoTokenizer, AutoModelForMaskedLM
2
3tokenizer = AutoTokenizer.from_pretrained('alBERTo')
4model = AutoModelForSequenceClassification.from_pretrained("alBERTo")
5
6# prepare input
7text = """
8 """"""
9 create a new object
10 """"""
11 def destroy_object():
12"""
13encoded_input = tokenizer(text, return_tensors='pt')
14
15# forward pass
16output = model(**encoded_input)