techthiyanes
commited on
Commit
·
af2d1b0
1
Parent(s):
4541b64
Update README.md
Browse files0 negative
1 neutral
2 positive
README.md
CHANGED
@@ -1 +1,9 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
2 |
+
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
3 |
+
model = AutoModelForSequenceClassification.from_pretrained('techthiyanes/Bert_Bahasa_Sentiment')
|
4 |
+
inputs = tokenizer("saya tidak", return_tensors="pt")
|
5 |
+
labels = torch.tensor([1]).unsqueeze(0)
|
6 |
+
outputs = model(**inputs, labels=labels)
|
7 |
+
loss = outputs.loss
|
8 |
+
logits = outputs.logits
|
9 |
+
outputs
|