ashaduzzaman commited on
Commit
ffa9989
1 Parent(s): 565ab4c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -6
README.md CHANGED
@@ -3,6 +3,9 @@ license: apache-2.0
3
  base_model: bert-base-cased
4
  tags:
5
  - generated_from_trainer
 
 
 
6
  datasets:
7
  - conll2003
8
  metrics:
@@ -35,6 +38,7 @@ model-index:
35
  - name: Accuracy
36
  type: accuracy
37
  value: 0.9863572143403779
 
38
  ---
39
 
40
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
@@ -59,15 +63,18 @@ This model is a Named Entity Recognition (NER) model built using PyTorch and tra
59
  To use this model, load it through the Hugging Face Transformers library. Below is a basic example:
60
 
61
  ```python
 
62
  from transformers import pipeline
63
 
64
- # Load the NER pipeline
65
- ner_pipeline = pipeline("ner", model="Ashaduzzaman/bert-finetuned-ner")
 
66
 
67
- # Example text
68
- text = "Hugging Face Inc. is based in New York City."
69
 
70
- # Perform NER
 
71
  entities = ner_pipeline(text)
72
 
73
  print(entities)
@@ -115,4 +122,4 @@ These results indicate the model's ability to correctly identify and classify na
115
  - Transformers 4.42.4
116
  - Pytorch 2.3.1+cu121
117
  - Datasets 2.21.0
118
- - Tokenizers 0.19.1
 
3
  base_model: bert-base-cased
4
  tags:
5
  - generated_from_trainer
6
+ - bert-finetuned
7
+ - Named Entity Recognition
8
+ - NER
9
  datasets:
10
  - conll2003
11
  metrics:
 
38
  - name: Accuracy
39
  type: accuracy
40
  value: 0.9863572143403779
41
+ pipeline_tag: token-classification
42
  ---
43
 
44
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
 
63
  To use this model, load it through the Hugging Face Transformers library. Below is a basic example:
64
 
65
  ```python
66
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
67
  from transformers import pipeline
68
 
69
+ # Load the tokenizer and model
70
+ tokenizer = AutoTokenizer.from_pretrained("Ashaduzzaman/bert-finetuned-ner")
71
+ model = AutoModelForTokenClassification.from_pretrained("Ashaduzzaman/bert-finetuned-ner")
72
 
73
+ # Create a pipeline for NER
74
+ ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer)
75
 
76
+ # Example inference
77
+ text = "Hugging Face Inc. is based in New York City."
78
  entities = ner_pipeline(text)
79
 
80
  print(entities)
 
122
  - Transformers 4.42.4
123
  - Pytorch 2.3.1+cu121
124
  - Datasets 2.21.0
125
+ - Tokenizers 0.19.1