MatteoFasulo commited on
Commit
c29bfea
·
verified ·
1 Parent(s): 666e82d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +122 -14
README.md CHANGED
@@ -3,7 +3,10 @@ library_name: transformers
3
  license: apache-2.0
4
  base_model: answerdotai/ModernBERT-base
5
  tags:
6
- - generated_from_trainer
 
 
 
7
  metrics:
8
  - precision
9
  - recall
@@ -11,7 +14,30 @@ metrics:
11
  - accuracy
12
  model-index:
13
  - name: ModernBERT-base-NER
14
- results: []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  ---
16
 
17
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
@@ -19,25 +45,48 @@ should probably proofread and complete it, then remove this comment. -->
19
 
20
  # ModernBERT-base-NER
21
 
22
- This model is a fine-tuned version of [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) on an unknown dataset.
23
- It achieves the following results on the evaluation set:
24
- - Loss: 0.0638
25
- - Precision: 0.8986
26
- - Recall: 0.9295
27
- - F1: 0.9138
28
- - Accuracy: 0.9840
29
 
30
- ## Model description
 
 
31
 
32
- More information needed
 
 
 
33
 
34
- ## Intended uses & limitations
35
 
36
- More information needed
 
 
 
 
 
 
 
 
 
37
 
38
  ## Training and evaluation data
39
 
40
- More information needed
 
 
 
 
 
 
 
 
 
41
 
42
  ## Training procedure
43
 
@@ -69,3 +118,62 @@ The following hyperparameters were used during training:
69
  - Pytorch 2.7.0a0+ecf3bae40a.nv25.02
70
  - Datasets 4.5.0
71
  - Tokenizers 0.22.2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  license: apache-2.0
4
  base_model: answerdotai/ModernBERT-base
5
  tags:
6
+ - enerated_from_trainer
7
+ - named-entity-recognition
8
+ - token-classification
9
+ - modernbert
10
  metrics:
11
  - precision
12
  - recall
 
14
  - accuracy
15
  model-index:
16
  - name: ModernBERT-base-NER
17
+ results:
18
+ - task:
19
+ type: token-classification
20
+ dataset:
21
+ name: conll2003
22
+ type: conll2003
23
+ metrics:
24
+ - name: Precision
25
+ type: Precision
26
+ value: 0.8986
27
+ - name: Recall
28
+ type: Recall
29
+ value: 0.9295
30
+ - name: F1
31
+ type: F1
32
+ value: 0.9138
33
+ - name: Accuracy
34
+ type: Accuracy
35
+ value: 0.984
36
+ datasets:
37
+ - lhoestq/conll2003
38
+ language:
39
+ - en
40
+ pipeline_tag: token-classification
41
  ---
42
 
43
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
 
45
 
46
  # ModernBERT-base-NER
47
 
48
+ This model is a fine-tuned version of [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) for Named Entity Recognition (NER) tasks on [conll2003](https://huggingface.co/datasets/lhoestq/conll2003) dataset.
49
+
50
+ ## Model Description
51
+
52
+ ModernBERT-base-NER is a token classification model trained to identify and categorize named entities in text. Built on the ModernBERT-base architecture, this model leverages modern transformer optimizations for efficient and accurate entity extraction.
53
+
54
+ ## Intended Uses
55
 
56
+ **Primary Use Cases:**
57
+ - Named Entity Recognition in text documents
58
+ - Information extraction pipelines
59
 
60
+ **Intended Users:**
61
+ - NLP researchers and practitioners
62
+ - Data scientists working with text data
63
+ - Developers building information extraction systems
64
 
65
+ ## Limitations
66
 
67
+ **Known Limitations:**
68
+ - Performance may vary on domains significantly different from the training data
69
+ - Entity boundaries might be imperfect for complex or nested entities
70
+ - May require domain-specific fine-tuning for specialized applications (medical, legal, etc.)
71
+ - Performance on low-resource languages or code-switched text not evaluated
72
+
73
+ **Out-of-Scope Uses:**
74
+ - Real-time processing of sensitive personal information without proper privacy safeguards
75
+ - High-stakes decision making without human oversight
76
+ - Applications requiring 100% accuracy in entity detection
77
 
78
  ## Training and evaluation data
79
 
80
+ The model was trained on a dataset for named entity recognition. Specific details about the dataset composition, size, and entity types are not publicly disclosed in this release.
81
+
82
+ ## Performance
83
+
84
+ It achieves the following results on the evaluation set:
85
+ - Loss: 0.0638
86
+ - Precision: 0.8986
87
+ - Recall: 0.9295
88
+ - F1: 0.9138
89
+ - Accuracy: 0.9840
90
 
91
  ## Training procedure
92
 
 
118
  - Pytorch 2.7.0a0+ecf3bae40a.nv25.02
119
  - Datasets 4.5.0
120
  - Tokenizers 0.22.2
121
+
122
+ ## How to Use
123
+
124
+ ```python
125
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
126
+ from transformers import pipeline
127
+
128
+ # Load model and tokenizer
129
+ tokenizer = AutoTokenizer.from_pretrained("MatteoFasulo/ModernBERT-base-NER")
130
+ model = AutoModelForTokenClassification.from_pretrained("MatteoFasulo/ModernBERT-base-NER")
131
+
132
+ # Create NER pipeline
133
+ ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="simple")
134
+
135
+ # Example usage
136
+ text = "Apple Inc. was founded by Steve Jobs in Cupertino, California."
137
+ entities = ner_pipeline(text)
138
+
139
+ for entity in entities:
140
+ print(f"{entity['word']}: {entity['entity_group']} (confidence: {entity['score']:.4f})")
141
+ ```
142
+
143
+ ## Ethical Considerations
144
+
145
+ **Privacy:** This model may extract personal information (names, locations, organizations) from text. Users should:
146
+ - Implement appropriate data protection measures
147
+ - Comply with relevant privacy regulations (GDPR, CCPA, etc.)
148
+ - Obtain necessary consent before processing personal data
149
+
150
+ **Bias:** The model's performance may reflect biases present in the training data, potentially affecting:
151
+ - Recognition rates across different demographic groups
152
+ - Entity detection in various cultural contexts
153
+ - Performance on minority or underrepresented entities
154
+
155
+ Users should validate the model's performance on their specific use cases and implement bias mitigation strategies as needed.
156
+
157
+ ## Citation
158
+
159
+ If you use this model in your research, please cite ModernBERT model:
160
+
161
+ ```bibtex
162
+ @misc{modernbert,
163
+ title={Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder for Fast, Memory Efficient, and Long Context Finetuning and Inference},
164
+ author={Benjamin Warner and Antoine Chaffin and Benjamin Clavié and Orion Weller and Oskar Hallström and Said Taghadouini and Alexis Gallagher and Raja Biswas and Faisal Ladhak and Tom Aarsen and Nathan Cooper and Griffin Adams and Jeremy Howard and Iacopo Poli},
165
+ year={2024},
166
+ eprint={2412.13663},
167
+ archivePrefix={arXiv},
168
+ primaryClass={cs.CL},
169
+ url={https://arxiv.org/abs/2412.13663},
170
+ }
171
+ ```
172
+
173
+ ## License
174
+
175
+ This model is released under the Apache 2.0 License. See the [LICENSE](LICENSE) file for details.
176
+
177
+ ## Acknowledgments
178
+
179
+ This model was built using the ModernBERT-base architecture from Answer.AI and trained using the Hugging Face Transformers library.