Seymasa commited on
Commit
1de617a
1 Parent(s): 4aaf171

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +9 -3
README.md CHANGED
@@ -41,13 +41,19 @@ pip install tensorflow
41
  ```
42
  ## Example
43
  ```sh
44
- from transformers import AutoTokenizer, TextClassificationPipeline, TFBertForSequenceClassification
45
 
46
- tokenizer = AutoTokenizer.from_pretrained("nanelimon/bert-base-turkish-offensive")
47
- model = TFBertForSequenceClassification.from_pretrained("nanelimon/bert-base-turkish-offensive", from_pt=True)
 
 
 
 
48
  pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True, top_k=2)
49
 
 
50
  print(pipe('Bu bir denemedir hadi sende dene!'))
 
51
  ```
52
  Result;
53
  ```sh
 
41
  ```
42
  ## Example
43
  ```sh
44
+ from transformers import AutoTokenizer, TFAutoModelForSequenceClassification, TextClassificationPipeline
45
 
46
+ # Load the tokenizer and model
47
+ model_name = "dbmdz/bert-base-turkish-uncased"
48
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
49
+ model = TFAutoModelForSequenceClassification.from_pretrained(model_name)
50
+
51
+ # Create the pipeline
52
  pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True, top_k=2)
53
 
54
+ # Test the pipeline
55
  print(pipe('Bu bir denemedir hadi sende dene!'))
56
+
57
  ```
58
  Result;
59
  ```sh