Update README.md
Browse files
README.md
CHANGED
@@ -18,11 +18,11 @@ This model is a fine-tuned version of the [bert-base-uncased](https://huggingfac
|
|
18 |
You can use the model with the following code.
|
19 |
|
20 |
```python
|
21 |
-
from transformers import
|
22 |
|
23 |
model_path = "JungleLee/bert-toxic-comment-classification"
|
24 |
-
tokenizer =
|
25 |
-
model =
|
26 |
|
27 |
pipeline = TextClassificationPipeline(model=model, tokenizer=tokenizer)
|
28 |
print(pipeline("You're a fucking nerd."))
|
|
|
18 |
You can use the model with the following code.
|
19 |
|
20 |
```python
|
21 |
+
from transformers import BertForSequenceClassification, BertTokenizer, TextClassificationPipeline
|
22 |
|
23 |
model_path = "JungleLee/bert-toxic-comment-classification"
|
24 |
+
tokenizer = BertTokenizer.from_pretrained(model_path)
|
25 |
+
model = BertForSequenceClassification.from_pretrained(model_path, num_labels=2)
|
26 |
|
27 |
pipeline = TextClassificationPipeline(model=model, tokenizer=tokenizer)
|
28 |
print(pipeline("You're a fucking nerd."))
|