Update README.md
Browse files
README.md
CHANGED
|
@@ -49,3 +49,21 @@ Test kümesi üzerinde elde edilen sonuçlar:
|
|
| 49 |
accuracy 0.93 638
|
| 50 |
macro avg 0.84 0.88 0.86 638
|
| 51 |
weighted avg 0.93 0.93 0.93 638
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
accuracy 0.93 638
|
| 50 |
macro avg 0.84 0.88 0.86 638
|
| 51 |
weighted avg 0.93 0.93 0.93 638
|
| 52 |
+
|
| 53 |
+
## 🚀 Kullanım Örneği
|
| 54 |
+
|
| 55 |
+
```python
|
| 56 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 57 |
+
import torch
|
| 58 |
+
|
| 59 |
+
model = AutoModelForSequenceClassification.from_pretrained("melique/query-classifier")
|
| 60 |
+
tokenizer = AutoTokenizer.from_pretrained("melique/query-classifier")
|
| 61 |
+
|
| 62 |
+
text = "Yaşam"
|
| 63 |
+
inputs = tokenizer(text, return_tensors="pt")
|
| 64 |
+
outputs = model(**inputs)
|
| 65 |
+
|
| 66 |
+
pred = torch.argmax(outputs.logits, dim=1).item()
|
| 67 |
+
labels = ["keyword", "semantic"]
|
| 68 |
+
print(f"Tahmin edilen sınıf: {labels[pred]}")
|
| 69 |
+
|