Update README.md
Browse files
README.md
CHANGED
@@ -25,13 +25,14 @@ model = AutoModelForSequenceClassification.from_pretrained("bucketresearch/polit
|
|
25 |
|
26 |
|
27 |
inputs = tokenizer(text, return_tensors="pt")
|
|
|
28 |
outputs = model(**inputs, labels=labels)
|
29 |
loss, logits = outputs[:2]
|
30 |
|
31 |
# [0] -> left
|
32 |
# [1] -> center
|
33 |
# [2] -> right
|
34 |
-
print(logits)
|
35 |
|
36 |
```
|
37 |
## References
|
|
|
25 |
|
26 |
|
27 |
inputs = tokenizer(text, return_tensors="pt")
|
28 |
+
labels = torch.tensor([0])
|
29 |
outputs = model(**inputs, labels=labels)
|
30 |
loss, logits = outputs[:2]
|
31 |
|
32 |
# [0] -> left
|
33 |
# [1] -> center
|
34 |
# [2] -> right
|
35 |
+
print(logits.softmax(dim=-1)[0].tolist())
|
36 |
|
37 |
```
|
38 |
## References
|