Update README.md
Browse files
README.md
CHANGED
@@ -8,7 +8,7 @@ tags: ['bart-base','sentiment classification','tweeter','binary classification']
|
|
8 |
<!-- Provide a quick summary of what the model is/does. -->
|
9 |
This is a fine-tune of `bart-base` to a sentiment classification dataset.
|
10 |
|
11 |
-
```
|
12 |
|
13 |
from transformers import BartTokenizer, AutoModelForSequenceClassification
|
14 |
model = AutoModelForSequenceClassification.from_pretrained('mylonasc/bart-base-twitter-sent-ft-001')
|
@@ -18,13 +18,16 @@ _phrases = [
|
|
18 |
'this is a great model! I really like it!',
|
19 |
'Do you call this a model? This is not even 1B parameters! Get outta here!',
|
20 |
'Fine tuning transformers is very easy if you use all the right tools!',
|
21 |
-
"John
|
22 |
]
|
23 |
toks = tokenizer(_phrases, return_tensors='pt', padding = 'longest')
|
24 |
with torch.no_grad():
|
25 |
res = model(**toks)[0]
|
26 |
is_positive = res.softmax(1)[:,1]
|
27 |
is_positive
|
|
|
|
|
|
|
28 |
```
|
29 |
|
30 |
## Model Details
|
|
|
8 |
<!-- Provide a quick summary of what the model is/does. -->
|
9 |
This is a fine-tune of `bart-base` to a sentiment classification dataset.
|
10 |
|
11 |
+
```python
|
12 |
|
13 |
from transformers import BartTokenizer, AutoModelForSequenceClassification
|
14 |
model = AutoModelForSequenceClassification.from_pretrained('mylonasc/bart-base-twitter-sent-ft-001')
|
|
|
18 |
'this is a great model! I really like it!',
|
19 |
'Do you call this a model? This is not even 1B parameters! Get outta here!',
|
20 |
'Fine tuning transformers is very easy if you use all the right tools!',
|
21 |
+
"John couldn't write two correct lines of code without ChatGPT if his life depended on it..."
|
22 |
]
|
23 |
toks = tokenizer(_phrases, return_tensors='pt', padding = 'longest')
|
24 |
with torch.no_grad():
|
25 |
res = model(**toks)[0]
|
26 |
is_positive = res.softmax(1)[:,1]
|
27 |
is_positive
|
28 |
+
|
29 |
+
|
30 |
+
>> tensor([0.9994, 0.1362, 0.9995, 0.3840])
|
31 |
```
|
32 |
|
33 |
## Model Details
|