amannagrawall002 commited on
Commit
034dda3
·
verified ·
1 Parent(s): 332d0b3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -0
README.md CHANGED
@@ -93,3 +93,16 @@ The following hyperparameters were used during training:
93
  - Pytorch 2.3.1+cu121
94
  - Datasets 2.20.0
95
  - Tokenizers 0.19.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  - Pytorch 2.3.1+cu121
94
  - Datasets 2.20.0
95
  - Tokenizers 0.19.1
96
+
97
+ ### How to use and it's democase
98
+
99
+ from transformers import pipeline
100
+
101
+ model_checkpoint = "amannagrawall002/bert-finetuned-ner"
102
+ token_classifier = pipeline(
103
+ "token-classification", model=model_checkpoint, aggregation_strategy="simple"
104
+ )
105
+
106
+ print(token_classifier("My name is Sylvain and I work at Hugging Face in Brooklyn."))
107
+ # [{'entity_group': 'PER', 'score': 0.9997023, 'word': 'Sylvain', 'start': 11, 'end': 18}, {'entity_group': 'ORG', 'score': 0.995275, 'word': 'Hugging Face', 'start': 33, 'end': 45}, {'entity_group': 'LOC', 'score': 0.9987465, 'word': 'Brooklyn', 'start': 49, 'end': 57}]
108
+