ksirts commited on
Commit
d0f027d
1 Parent(s): 0674e52

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +22 -0
README.md CHANGED
@@ -43,6 +43,28 @@ It achieves the following results on the test split:
43
  - Loss: 2.7633
44
  - Accuracy: 0.7479
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  ## Model description
47
 
48
  A single linear layer classifier is fit on top of the last layer [CLS] token representation of the EstBERT model. The model is fully fine-tuned during training.
 
43
  - Loss: 2.7633
44
  - Accuracy: 0.7479
45
 
46
+ ## How to use?
47
+
48
+ You can use this model with the Transformers pipeline for text classification.
49
+
50
+ ```
51
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
52
+ from transformers import pipeline
53
+
54
+ tokenizer = AutoTokenizer.from_pretrained("tartuNLP/EstBERT128_sentiment")
55
+ model = AutoModelForSequenceClassification.from_pretrained("tartuNLP/EstBERT128_sentiment")
56
+
57
+ nlp = pipeline("text-classification", model=model, tokenizer=tokenizer)
58
+ text = "Viimastel nädalatel on üha valjemaks muutunud hääled, mis läbisegi süüdistavad regionaalminister Madis Kallast röövretke korraldamises rikastesse valdadesse ja teisalt tegevusetuses."
59
+ result = nlp(text)
60
+
61
+ print(result)
62
+ ```
63
+
64
+ ```
65
+ [{'label': 'negatiivne', 'score': 0.9999992847442627}]
66
+ ```
67
+
68
  ## Model description
69
 
70
  A single linear layer classifier is fit on top of the last layer [CLS] token representation of the EstBERT model. The model is fully fine-tuned during training.