ennp commited on
Commit
894a927
·
1 Parent(s): c7ed993

Upload README (1).md

Browse files
Files changed (1) hide show
  1. README (1).md +34 -0
README (1).md ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Bu model https://github.com/stefan-it/turkish-bert'in; aşağıdaki 5 kategorinin olduğu metin sınıflandırma verilerine göre fine-tuned edilmiş halidir.
3
+
4
+ code_to_label={
5
+
6
+ 'LABEL_0': 'INSULT ',
7
+
8
+ 'LABEL_1': 'RACIST ',
9
+
10
+ 'LABEL_2': 'SEXIST',
11
+
12
+ 'LABEL_3': 'PROFANITY ',
13
+
14
+ 'LABEL_4': 'OTHER' }
15
+
16
+ ```python
17
+
18
+ from transformers import pipeline, AutoModelForTokenClassification, AutoTokenizer, AutoModelForSequenceClassification
19
+ tokenizer= AutoTokenizer.from_pretrained("ennp/bert-turkish-text-classification-cased")
20
+
21
+ model= AutoModelForSequenceClassification.from_pretrained("ennp/bert-turkish-text-classification-cased")
22
+
23
+ nlp=pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
24
+
25
+ code_to_label={
26
+ 'LABEL_0': 'INSULT ',
27
+ 'LABEL_1': 'RACIST ',
28
+ 'LABEL_2': 'SEXIST',
29
+ 'LABEL_3': 'PROFANITY ',
30
+ 'LABEL_4': 'OTHER' }
31
+
32
+ code_to_label[nlp("kıl herif gibi davranma")[0]['label']]
33
+ ```
34
+