Update README.md
Browse files
README.md
CHANGED
@@ -36,13 +36,13 @@ from transformers import AutoTokenizer, TextClassificationPipeline, TFBertForSeq
|
|
36 |
|
37 |
tokenizer = AutoTokenizer.from_pretrained("nanelimon/bert-base-turkish-bullying")
|
38 |
model = TFBertForSequenceClassification.from_pretrained("nanelimon/bert-base-turkish-bullying", from_pt=True)
|
39 |
-
pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer)
|
40 |
|
41 |
print(pipe('Bu bir denemedir hadi sende dene!'))
|
42 |
```
|
43 |
Result;
|
44 |
```sh
|
45 |
-
[{'label': 'Nötr', 'score': 0.999175488948822}]
|
46 |
```
|
47 |
- label= It shows which class the sent Turkish text belongs to according to the model.
|
48 |
- score= It shows the compliance rate of the Turkish text sent to the label found.
|
|
|
36 |
|
37 |
tokenizer = AutoTokenizer.from_pretrained("nanelimon/bert-base-turkish-bullying")
|
38 |
model = TFBertForSequenceClassification.from_pretrained("nanelimon/bert-base-turkish-bullying", from_pt=True)
|
39 |
+
pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True, top_k=2)
|
40 |
|
41 |
print(pipe('Bu bir denemedir hadi sende dene!'))
|
42 |
```
|
43 |
Result;
|
44 |
```sh
|
45 |
+
[[{'label': 'Nötr', 'score': 0.999175488948822}, {'label': 'Cinsiyetçi Zorbalık', 'score': 0.00042115405085496604}]]
|
46 |
```
|
47 |
- label= It shows which class the sent Turkish text belongs to according to the model.
|
48 |
- score= It shows the compliance rate of the Turkish text sent to the label found.
|