Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Accuracy: 0.9098119858989424
|
| 2 |
+
precision recall f1-score support
|
| 3 |
+
|
| 4 |
+
0 0.9058 0.9148 0.9103 1702
|
| 5 |
+
1 0.9139 0.9048 0.9094 1702
|
| 6 |
+
|
| 7 |
+
accuracy 0.9098 3404
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
macro avg 0.9099 0.9098 0.9098 3404
|
| 11 |
+
weighted avg 0.9099 0.9098 0.9098 3404
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
**Test Set**
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
Accuracy: 0.8763517649459294
|
| 19 |
+
precision recall f1-score support
|
| 20 |
+
|
| 21 |
+
0 0.7650 0.8786 0.8179 3097
|
| 22 |
+
1 0.9398 0.8753 0.9064 6705
|
| 23 |
+
|
| 24 |
+
accuracy 0.8764 9802
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
macro avg 0.8524 0.8770 0.8621 9802
|
| 28 |
+
weighted avg 0.8846 0.8764 0.8784 9802
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
</details>
|
| 32 |
+
|
| 33 |
+
---
|
| 34 |
+
|
| 35 |
+
## 🧪 How to Use
|
| 36 |
+
|
| 37 |
+
### **Python (PyTorch)**
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 41 |
+
import torch
|
| 42 |
+
|
| 43 |
+
model_name = "nihad-ask/Arabert-EOU-detection-model"
|
| 44 |
+
|
| 45 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 46 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
| 47 |
+
|
| 48 |
+
text = "تمام و بعدين؟"
|
| 49 |
+
|
| 50 |
+
inputs = tokenizer(text, return_tensors="pt")
|
| 51 |
+
outputs = model(**inputs)
|
| 52 |
+
prediction = torch.argmax(outputs.logits, dim=1).item()
|
| 53 |
+
|
| 54 |
+
if prediction == 1:
|
| 55 |
+
print("End of turn")
|
| 56 |
+
else:
|
| 57 |
+
print("Speaker will continue")
|