Some instructions
Browse filesHow to use the model as pipeline
README.md
CHANGED
|
@@ -8,3 +8,30 @@ widget:
|
|
| 8 |
- text: "ואז הוא הלך לטייל בתוך היער השחור והגדול"
|
| 9 |
|
| 10 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
- text: "ואז הוא הלך לטייל בתוך היער השחור והגדול"
|
| 9 |
|
| 10 |
---
|
| 11 |
+
## How to Use the model:
|
| 12 |
+
```python
|
| 13 |
+
from transformers import pipeline
|
| 14 |
+
classifier = pipeline("text-classification",model='orisuchy/Descriptive_Classifier', return_all_scores=True)
|
| 15 |
+
outputs = classifier("מסווג חתיך במיוחד")
|
| 16 |
+
print(outputs)
|
| 17 |
+
|
| 18 |
+
"""
|
| 19 |
+
Output:
|
| 20 |
+
[[
|
| 21 |
+
{'label': 'Descriptive', 'score': 0.9996114373207092},
|
| 22 |
+
{'label': 'Might Descriptive', 'score': 7.421540794894099e-05},
|
| 23 |
+
{'label': 'Not Descriptive', 'score': 0.0003142959321849048}]]
|
| 24 |
+
"""
|
| 25 |
+
```
|
| 26 |
+
#### Or, if you want only the final class:
|
| 27 |
+
```python
|
| 28 |
+
from transformers import pipeline
|
| 29 |
+
classifier = pipeline("text-classification",model='orisuchy/Descriptive_Classifier')
|
| 30 |
+
output = classifier("הלכתי אליו הביתה וחיכיתי")
|
| 31 |
+
print(output)
|
| 32 |
+
|
| 33 |
+
"""
|
| 34 |
+
Output:
|
| 35 |
+
[{'label': 'Not Descriptive', 'score': 0.9998830556869507}]
|
| 36 |
+
"""
|
| 37 |
+
```
|