MatteoFasulo commited on
Commit
c217705
·
verified ·
1 Parent(s): d885d4c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -4
README.md CHANGED
@@ -123,18 +123,24 @@ The following hyperparameters were used during training:
123
 
124
  ```python
125
  import torch
126
- from transformers import AutoTokenizer, AutoModelForTokenClassification
127
- from transformers import pipeline
128
 
129
  # Create NER pipeline
130
- ner_pipeline = pipeline("token-classification", model="MatteoFasulo/ModernBERT-base-NER", aggregation_strategy="simple", dtype=torch.bfloat16)
 
 
 
 
 
131
 
132
  # Example usage
133
  text = "Apple Inc. was founded by Steve Jobs in Cupertino, California."
134
  entities = ner_pipeline(text)
135
 
136
  for entity in entities:
137
- print(f"{entity['word']}: {entity['entity_group']} (confidence: {entity['score']:.4f})")
 
 
138
  ```
139
 
140
  ## Ethical Considerations
 
123
 
124
  ```python
125
  import torch
126
+ from transformers import AutoModelForTokenClassification, AutoTokenizer, pipeline
 
127
 
128
  # Create NER pipeline
129
+ ner_pipeline = pipeline(
130
+ "token-classification",
131
+ model="MatteoFasulo/ModernBERT-base-NER",
132
+ aggregation_strategy="simple",
133
+ dtype=torch.bfloat16,
134
+ )
135
 
136
  # Example usage
137
  text = "Apple Inc. was founded by Steve Jobs in Cupertino, California."
138
  entities = ner_pipeline(text)
139
 
140
  for entity in entities:
141
+ print(
142
+ f"{entity['word']}: {entity['entity_group']} (confidence: {entity['score']:.4f})"
143
+ )
144
  ```
145
 
146
  ## Ethical Considerations