Pooya-Fallah commited on
Commit
ec6e7b5
1 Parent(s): 6fd4a94

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +15 -1
README.md CHANGED
@@ -15,7 +15,8 @@ should probably proofread and complete it, then remove this comment. -->
15
 
16
  # ParsBERT-nli-FarsTail-FarSick
17
 
18
- This model is a fine-tuned version of [HooshvareLab/bert-fa-zwnj-base](https://huggingface.co/HooshvareLab/bert-fa-zwnj-base) on the None dataset.
 
19
  It achieves the following results on the evaluation set:
20
  - Loss: 0.8730
21
  - Accuracy: 0.8055
@@ -29,7 +30,20 @@ It achieves the following results on the evaluation set:
29
  ## How to use
30
 
31
  ``` python
 
 
 
32
 
 
 
 
 
 
 
 
 
 
 
33
  ```
34
 
35
  ### Training hyperparameters
 
15
 
16
  # ParsBERT-nli-FarsTail-FarSick
17
 
18
+ This model is a fine-tuned version of [HooshvareLab/bert-fa-zwnj-base](https://huggingface.co/HooshvareLab/bert-fa-zwnj-base) on the [FarsTail](https://github.com/dml-qom/FarsTail/tree/master)
19
+ and [FarSick](https://github.com/ZahraGhasemi-AI/FarSick/tree/main) datasets.
20
  It achieves the following results on the evaluation set:
21
  - Loss: 0.8730
22
  - Accuracy: 0.8055
 
30
  ## How to use
31
 
32
  ``` python
33
+ import torch
34
+ import transformers
35
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
36
 
37
+ model_name_or_path = "parsi-ai-nlpclass/ParsBERT-nli-FarsTail-FarSick"
38
+ config = transformers.AutoConfig.from_pretrained(model_name_or_path)
39
+ tokenizer_pb = transformers.AutoTokenizer.from_pretrained(model_name_or_path)
40
+ model_pb = transformers.AutoModelForSequenceClassification.from_pretrained(model_name_or_path,
41
+ num_labels=3)
42
+ premise = "سلام خوبی؟"
43
+ hypothesis = "آره خوبم"
44
+ print(model_pb(**tokenizer_pb(premise, hypothesis, return_tensors='pt')))
45
+
46
+ model_pb.to(device)
47
  ```
48
 
49
  ### Training hyperparameters