BraindeadHermit
commited on
Commit
•
33a11eb
1
Parent(s):
b36975b
insert usage instructions
Browse files
README.md
CHANGED
@@ -29,4 +29,27 @@ It has been trained on a dataset containing instances of the linguistic antipatt
|
|
29 |
## Intended uses & limitations
|
30 |
|
31 |
this model can be used for the classification of linguistic antipatters described previously.
|
32 |
-
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
## Intended uses & limitations
|
30 |
|
31 |
this model can be used for the classification of linguistic antipatters described previously.
|
32 |
+
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
|
33 |
+
|
34 |
+
## Usage
|
35 |
+
|
36 |
+
Here is how to use this model to get the features of a given text in PyTorch:
|
37 |
+
|
38 |
+
```python
|
39 |
+
from transformers import AutoTokenizer, AutoModelForMaskedLM
|
40 |
+
|
41 |
+
tokenizer = AutoTokenizer.from_pretrained('alBERTo')
|
42 |
+
model = AutoModelForMaskedLM.from_pretrained("alBERTo")
|
43 |
+
|
44 |
+
# prepare input
|
45 |
+
text = """
|
46 |
+
""""""
|
47 |
+
create a new object
|
48 |
+
""""""
|
49 |
+
def destroy_object():
|
50 |
+
"""
|
51 |
+
encoded_input = tokenizer(text, return_tensors='pt')
|
52 |
+
|
53 |
+
# forward pass
|
54 |
+
output = model(**encoded_input)
|
55 |
+
```
|