Update README.md
Browse files
README.md
CHANGED
|
@@ -59,10 +59,11 @@ classifier = pipeline("text-classification", model="atahanuz/bert-offensive-clas
|
|
| 59 |
text = "Bu harika bir filmdi, çok beğendim."
|
| 60 |
result = classifier(text)[0]
|
| 61 |
|
| 62 |
-
# Convert LABEL_1 -> Offensive, LABEL_0 -> Not Offensive
|
| 63 |
label = "Offensive" if result['label'] == "LABEL_1" else "Not Offensive"
|
| 64 |
|
| 65 |
print(f"Prediction: {label} (Score: {result['score']:.4f})")
|
|
|
|
|
|
|
| 66 |
```
|
| 67 |
|
| 68 |
### Method 2: Manual PyTorch Implementation
|
|
|
|
| 59 |
text = "Bu harika bir filmdi, çok beğendim."
|
| 60 |
result = classifier(text)[0]
|
| 61 |
|
|
|
|
| 62 |
label = "Offensive" if result['label'] == "LABEL_1" else "Not Offensive"
|
| 63 |
|
| 64 |
print(f"Prediction: {label} (Score: {result['score']:.4f})")
|
| 65 |
+
|
| 66 |
+
#Prediction: Not Offensive (Score: 1.0000)
|
| 67 |
```
|
| 68 |
|
| 69 |
### Method 2: Manual PyTorch Implementation
|