Added use example
Browse files
README.md
CHANGED
@@ -42,4 +42,26 @@ Comparison with `xlm-roberta-base`:
|
|
42 |
| --- | --- | --- |
|
43 |
|Wilcoxon|0.00781|0.00781|
|
44 |
|Mann Whithney|0.00107|0.00108|
|
45 |
-
|Student t-test |4.83e-11 | 5.61e-11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
| --- | --- | --- |
|
43 |
|Wilcoxon|0.00781|0.00781|
|
44 |
|Mann Whithney|0.00107|0.00108|
|
45 |
+
|Student t-test |4.83e-11 | 5.61e-11 |
|
46 |
+
|
47 |
+
## Use examples
|
48 |
+
|
49 |
+
```python
|
50 |
+
from simpletransformers.classification import ClassificationModel
|
51 |
+
model_args = {
|
52 |
+
"num_train_epochs": 12,
|
53 |
+
"learning_rate": 1e-5,
|
54 |
+
"train_batch_size": 74}
|
55 |
+
|
56 |
+
model = ClassificationModel(
|
57 |
+
"bert", "5roop/bcms-bertic-frenk-hate", use_cuda=True,
|
58 |
+
args=model_args
|
59 |
+
|
60 |
+
)
|
61 |
+
|
62 |
+
predictions, logit_output = model.predict(['Ne odbacujem da će RH primiti još migranata iz Afganistana, no neće biti novog vala',
|
63 |
+
"Potpredsjednik Vlade i ministar branitelja Tomo Medved komentirao je Vladine planove za zakonsku zabranu pozdrava 'za dom spremni' "])
|
64 |
+
predictions
|
65 |
+
### Output:
|
66 |
+
### array([0, 0])
|
67 |
+
```
|