5roop commited on
Commit
cde7fe0
1 Parent(s): 05e2c70

Added use examples

Browse files
Files changed (1) hide show
  1. README.md +22 -1
README.md CHANGED
@@ -38,4 +38,25 @@ Comparison with `xlm-roberta-base`:
38
  | --- | --- | --- |
39
  |Wilcoxon|0.00781|0.00781|
40
  |Mann Whithney U test|0.00108|0.00108|
41
- |Student t-test |9.46e-11|6.94e-11|
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  | --- | --- | --- |
39
  |Wilcoxon|0.00781|0.00781|
40
  |Mann Whithney U test|0.00108|0.00108|
41
+ |Student t-test |9.46e-11|6.94e-11|
42
+ ## Use examples
43
+
44
+ ```python
45
+ from simpletransformers.classification import ClassificationModel
46
+ model_args = {
47
+ "num_train_epochs": 14,
48
+ "learning_rate": 1e-5,
49
+ "train_batch_size": 21,
50
+ }
51
+
52
+ model = ClassificationModel(
53
+ "bert", "5roop/bcms-bertic-frenk-hate", use_cuda=True,
54
+ args=model_args
55
+
56
+ )
57
+
58
+ predictions, logit_output = model.predict(["Silva, ti si grda in neprijazna.", "Naša hiša ima dimnik."])
59
+ predictions
60
+ ### Output:
61
+ ### array([1, 0])
62
+ ```