Instructions to use orisuchy/Descriptive_Classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use orisuchy/Descriptive_Classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="orisuchy/Descriptive_Classifier")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("orisuchy/Descriptive_Classifier") model = AutoModelForSequenceClassification.from_pretrained("orisuchy/Descriptive_Classifier") - Notebooks
- Google Colab
- Kaggle
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 |
+
```
|