Seymasa commited on
Commit
785a807
1 Parent(s): 943c3db

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +11 -4
README.md CHANGED
@@ -50,17 +50,24 @@ Accuracy : 0.975
50
  **!IMPORTANT_HINT: The sentence given to pipe must not contain Turkish characters.**
51
 
52
  ```sh
53
- from transformers import AutoTokenizer, TextClassificationPipeline, TFBertForSequenceClassification
54
 
55
  tokenizer = AutoTokenizer.from_pretrained("nanelimon/bert-base-turkish-job-advertisement")
56
- model = TFBertForSequenceClassification.from_pretrained("nanelimon/bert-base-turkish-job-advertisement", from_pt=True)
57
  pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer)
58
 
59
- print(pipe('Bu bir denemedir hadi sende dene!'))
 
 
 
 
 
 
 
60
  ```
61
  Result;
62
  ```sh
63
- [{'label': 'Is Ilani Degil', 'score': 0.9999035596847534}]
64
  ```
65
  - label= It shows which class the sent Turkish text belongs to according to the model.
66
  - score= It shows the compliance rate of the Turkish text sent to the label found.
 
50
  **!IMPORTANT_HINT: The sentence given to pipe must not contain Turkish characters.**
51
 
52
  ```sh
53
+ from transformers import AutoTokenizer, TextClassificationPipeline, AutoModelForSequenceClassification
54
 
55
  tokenizer = AutoTokenizer.from_pretrained("nanelimon/bert-base-turkish-job-advertisement")
56
+ model = AutoModelForSequenceClassification.from_pretrained("nanelimon/bert-base-turkish-job-advertisement")
57
  pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer)
58
 
59
+
60
+ def set_sentence(sentence: str):
61
+ result = sentence.lower().replace('ö', 'o').replace('ı', 'i').replace('ü', 'u').replace('ç', 'c').replace('ğ', 'g').replace('ş', 's')
62
+ return result
63
+
64
+
65
+ print(pipe(set_sentence('Fiziği düzgün 17 yaş kızlar aranıyor')))
66
+
67
  ```
68
  Result;
69
  ```sh
70
+ output: [{'label': 'Mustehcen', 'score': 0.9992677569389343}]
71
  ```
72
  - label= It shows which class the sent Turkish text belongs to according to the model.
73
  - score= It shows the compliance rate of the Turkish text sent to the label found.