Update README.md
Browse files
README.md
CHANGED
@@ -12,61 +12,20 @@ tags:
|
|
12 |
---
|
13 |
# Model Card for Model ID
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
18 |
|
19 |
## Model Details
|
|
|
20 |
|
21 |
-
### Model Description
|
22 |
-
|
23 |
-
<!-- Provide a longer summary of what this model is. -->
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
- **Developed by:** [More Information Needed]
|
28 |
-
- **Funded by [optional]:** [More Information Needed]
|
29 |
-
- **Shared by [optional]:** [More Information Needed]
|
30 |
-
- **Model type:** [More Information Needed]
|
31 |
-
- **Language(s) (NLP):** [More Information Needed]
|
32 |
-
- **License:** [More Information Needed]
|
33 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
34 |
-
|
35 |
-
### Model Sources [optional]
|
36 |
-
|
37 |
-
<!-- Provide the basic links for the model. -->
|
38 |
-
|
39 |
-
- **Repository:** [More Information Needed]
|
40 |
-
- **Paper [optional]:** [More Information Needed]
|
41 |
-
- **Demo [optional]:** [More Information Needed]
|
42 |
-
|
43 |
-
## Uses
|
44 |
-
|
45 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
46 |
-
|
47 |
-
### Direct Use
|
48 |
-
|
49 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
50 |
-
|
51 |
-
[More Information Needed]
|
52 |
-
|
53 |
-
### Downstream Use [optional]
|
54 |
-
|
55 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
56 |
-
|
57 |
-
[More Information Needed]
|
58 |
-
|
59 |
-
### Out-of-Scope Use
|
60 |
-
|
61 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
62 |
-
|
63 |
-
[More Information Needed]
|
64 |
|
65 |
## Bias, Risks, and Limitations
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
[More Information Needed]
|
70 |
|
71 |
### Recommendations
|
72 |
|
@@ -80,13 +39,17 @@ Users (both direct and downstream) should be made aware of the risks, biases and
|
|
80 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
81 |
from transformers import pipeline
|
82 |
|
83 |
-
model_name = "
|
84 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
85 |
model = AutoModelForTokenClassification.from_pretrained(model_name)
|
86 |
|
87 |
ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer)
|
88 |
|
89 |
-
text =
|
|
|
|
|
|
|
|
|
90 |
|
91 |
entities = ner_pipeline(text)
|
92 |
|
@@ -115,13 +78,12 @@ for entity in entities:
|
|
115 |
|
116 |
#### Training Hyperparameters
|
117 |
|
118 |
-
-
|
|
|
|
|
|
|
119 |
|
120 |
-
#### Speeds, Sizes, Times [optional]
|
121 |
|
122 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
123 |
-
|
124 |
-
[More Information Needed]
|
125 |
|
126 |
## Evaluation
|
127 |
|
@@ -135,9 +97,6 @@ for entity in entities:
|
|
135 |
|
136 |
[More Information Needed]
|
137 |
|
138 |
-
#### Factors
|
139 |
-
|
140 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
141 |
|
142 |
[More Information Needed]
|
143 |
|
@@ -151,72 +110,16 @@ for entity in entities:
|
|
151 |
|
152 |
[More Information Needed]
|
153 |
|
154 |
-
#### Summary
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
## Model Examination [optional]
|
159 |
-
|
160 |
-
<!-- Relevant interpretability work for the model goes here -->
|
161 |
-
|
162 |
-
[More Information Needed]
|
163 |
-
|
164 |
-
## Environmental Impact
|
165 |
-
|
166 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
167 |
-
|
168 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
169 |
-
|
170 |
-
- **Hardware Type:** [More Information Needed]
|
171 |
-
- **Hours used:** [More Information Needed]
|
172 |
-
- **Cloud Provider:** [More Information Needed]
|
173 |
-
- **Compute Region:** [More Information Needed]
|
174 |
-
- **Carbon Emitted:** [More Information Needed]
|
175 |
-
|
176 |
-
## Technical Specifications [optional]
|
177 |
-
|
178 |
-
### Model Architecture and Objective
|
179 |
-
|
180 |
-
[More Information Needed]
|
181 |
-
|
182 |
-
### Compute Infrastructure
|
183 |
-
|
184 |
-
[More Information Needed]
|
185 |
-
|
186 |
-
#### Hardware
|
187 |
-
|
188 |
-
[More Information Needed]
|
189 |
-
|
190 |
-
#### Software
|
191 |
-
|
192 |
-
[More Information Needed]
|
193 |
-
|
194 |
-
## Citation [optional]
|
195 |
-
|
196 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
197 |
-
|
198 |
-
**BibTeX:**
|
199 |
-
|
200 |
-
[More Information Needed]
|
201 |
-
|
202 |
-
**APA:**
|
203 |
-
|
204 |
-
[More Information Needed]
|
205 |
-
|
206 |
-
## Glossary [optional]
|
207 |
-
|
208 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
209 |
-
|
210 |
-
[More Information Needed]
|
211 |
-
|
212 |
-
## More Information [optional]
|
213 |
-
|
214 |
-
[More Information Needed]
|
215 |
|
216 |
## Model Card Authors [optional]
|
217 |
|
218 |
-
|
219 |
-
|
220 |
-
|
|
|
|
|
|
|
|
|
|
|
221 |
|
222 |
-
|
|
|
12 |
---
|
13 |
# Model Card for Model ID
|
14 |
|
15 |
+
This is a Named Entity Recognition model fine-tuned for public entities:
|
16 |
+
- Politicians
|
17 |
+
- Parties
|
18 |
+
- Authorities
|
19 |
+
- Media
|
20 |
+
- Journalists
|
21 |
|
22 |
## Model Details
|
23 |
+
Public Entity Recognition (PER). PER is a domainspecific version of NER, that is trained for five entities types that are common to public discourse: politicians, parties, authorities, media, and journalists. PER can be used for preprocessing documents, in a pipeline with other classifiers or directly for analyzing information in texts. The taxonomy for PER is taken from the database of (German) public speakers (Schmidt et al., 2023) and aims at low-threshold integration into computational social science research.
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
## Bias, Risks, and Limitations
|
27 |
|
28 |
+
The performance for female entities (only applying to politicians and journalists) is slightly below that for male entities. This applies to entities that are referred to by name (Anna-Lena Baerbock/Olaf Scholz) or by profession (Innenministerin/Innenminister).
|
|
|
|
|
29 |
|
30 |
### Recommendations
|
31 |
|
|
|
39 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
40 |
from transformers import pipeline
|
41 |
|
42 |
+
model_name = "Sami92/XLM-PER-B"
|
43 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
44 |
model = AutoModelForTokenClassification.from_pretrained(model_name)
|
45 |
|
46 |
ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer)
|
47 |
|
48 |
+
text = '''
|
49 |
+
Nach dem Treffen mit Außenministerin Baerbock betont Israels Premier die Eigenständigkeit seines Landes.
|
50 |
+
Baerbock hatte zur Zurückhaltung aufgerufen.
|
51 |
+
Nach seinem Treffen mit Außenministerin Annalena Baerbock und dem britischen Außenminister David Cameron dringt der israelische Ministerpräsident Benjamin Netanjahu auf die Unabhängigkeit seines Landes.
|
52 |
+
'''
|
53 |
|
54 |
entities = ner_pipeline(text)
|
55 |
|
|
|
78 |
|
79 |
#### Training Hyperparameters
|
80 |
|
81 |
+
- Learning Rate = 5e-6
|
82 |
+
- Scheduler = Reduce learning rate on plateau
|
83 |
+
- Batch size = 8
|
84 |
+
- Epochs = 20
|
85 |
|
|
|
86 |
|
|
|
|
|
|
|
87 |
|
88 |
## Evaluation
|
89 |
|
|
|
97 |
|
98 |
[More Information Needed]
|
99 |
|
|
|
|
|
|
|
100 |
|
101 |
[More Information Needed]
|
102 |
|
|
|
110 |
|
111 |
[More Information Needed]
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
|
114 |
## Model Card Authors [optional]
|
115 |
|
116 |
+
@misc{your_model_name,
|
117 |
+
author = {Nenno, Sai},
|
118 |
+
title = {Public Entity Recognition Model},
|
119 |
+
year = {2024},
|
120 |
+
publisher = {HuggingFace},
|
121 |
+
journal = {HuggingFace Model Repository},
|
122 |
+
url = {https://huggingface.co/Sami92/XLM-PER-B}
|
123 |
+
}
|
124 |
|
125 |
+
´
|