Update README.md
Browse files
README.md
CHANGED
@@ -41,13 +41,19 @@ pip install tensorflow
|
|
41 |
```
|
42 |
## Example
|
43 |
```sh
|
44 |
-
from transformers import AutoTokenizer,
|
45 |
|
46 |
-
tokenizer
|
47 |
-
|
|
|
|
|
|
|
|
|
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
|