Update README.md
Browse files
README.md
CHANGED
|
@@ -17,6 +17,10 @@ You can employ this model using the Transformers library's pipeline for NER, or
|
|
| 17 |
You can employ this model using the Transformers library's *pipeline* for NER, or incorporate it as a conventional Transformer in the HuggingFace ecosystem.
|
| 18 |
|
| 19 |
```python
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
tokenizer = BertTokenizer.from_pretrained('Nucha/Nucha_SkillNER_BERT')
|
| 21 |
model = BertForTokenClassification.from_pretrained('Nucha/Nucha_SkillNER_BERT', num_labels=5)
|
| 22 |
```
|
|
|
|
| 17 |
You can employ this model using the Transformers library's *pipeline* for NER, or incorporate it as a conventional Transformer in the HuggingFace ecosystem.
|
| 18 |
|
| 19 |
```python
|
| 20 |
+
# Import necessary libraries
|
| 21 |
+
from transformers import BertTokenizer, BertForTokenClassification, AdamW
|
| 22 |
+
|
| 23 |
+
# Load pre-trained BERT model and tokenizer
|
| 24 |
tokenizer = BertTokenizer.from_pretrained('Nucha/Nucha_SkillNER_BERT')
|
| 25 |
model = BertForTokenClassification.from_pretrained('Nucha/Nucha_SkillNER_BERT', num_labels=5)
|
| 26 |
```
|