fransis3 commited on
Commit
12dd364
·
verified ·
1 Parent(s): b28efb7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +160 -3
README.md CHANGED
@@ -1,3 +1,160 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - 'no'
4
+ - nb
5
+ - nn
6
+ license: apache-2.0
7
+ library_name: transformers
8
+ tags:
9
+ - token-classification
10
+ - named-entity-recognition
11
+ - ner
12
+ - norwegian
13
+ - bokmal
14
+ - nynorsk
15
+ - norbert
16
+ base_model: ltg/norbert4-xlarge
17
+ datasets:
18
+ - NbAiLab/norne
19
+ metrics:
20
+ - precision
21
+ - recall
22
+ - f1
23
+ pipeline_tag: token-classification
24
+ model-index:
25
+ - name: norbert4-xlarge-NorNER
26
+ results:
27
+ - task:
28
+ type: token-classification
29
+ name: Named Entity Recognition
30
+ dataset:
31
+ name: NorNE
32
+ type: ltg/norne
33
+ split: test
34
+ metrics:
35
+ - type: precision
36
+ value: 0.9069
37
+ - type: recall
38
+ value: 0.9164
39
+ - type: f1
40
+ value: 0.9116
41
+ name: Entity-level F1 (seqeval)
42
+ ---
43
+
44
+ # norbert4-xlarge-NorNER
45
+
46
+ A Norwegian named entity recognition model fine-tuned from [ltg/norbert4-xlarge](https://huggingface.co/ltg/norbert4-xlarge) on the [NorNE](https://huggingface.co/datasets/NbAiLab/norne) dataset, covering both Bokmål and Nynorsk.
47
+
48
+ ## Model Details
49
+
50
+ - **Author:** Fransis Nyka Kolstø
51
+ - **Base model:** [ltg/norbert4-xlarge](https://huggingface.co/ltg/norbert4-xlarge)
52
+ - **Language(s):** Norwegian Bokmål (nb), Norwegian Nynorsk (nn)
53
+ - **Task:** Token classification / Named Entity Recognition
54
+ - **Tagging scheme:** IOB2
55
+ - **License:** Apache 2.0
56
+
57
+ ## Entity Types
58
+
59
+ The model predicts 9 entity types using the IOB2 scheme described in the [NbAiLab norne dataset](https://huggingface.co/datasets/NbAiLab/norne#annotations)
60
+
61
+ ## Intended Use
62
+
63
+ The model is intended for named entity recognition on Norwegian text (Bokmål and Nynorsk), including news, blog posts, parliamentary proceedings, and government reports — reflecting the genre distribution of the NorNE data.
64
+
65
+ ## Training Procedure
66
+
67
+ Training was done in two phases on the NorNE dataset:
68
+
69
+ 1. **Phase 1 — Optimal-step search:** The model was trained on the train split with the dev split used for evaluation and early stopping. Training proceeded through a curriculum of increasing input context lengths, allowing the model to adapt progressively from sentence-level to longer multi-sentence contexts.
70
+
71
+ 2. **Phase 2 — Final training:** The base model was re-initialized and trained on the combined train + development splits, replaying the same curriculum and learning-rate trajectory as Phase 1, but stopping each stage at the best steps identified in phase 1. This allows the final model to benefit from the additional development data without re-tuning.
72
+
73
+ ## Evaluation
74
+
75
+ Evaluated on the NorNE **test** split (Bokmål and Nynorsk combined), with entity-level metrics computed via `seqeval`:
76
+
77
+ | Metric | Score |
78
+ |---|---|
79
+ | Precision | 0.9069 |
80
+ | Recall | 0.9164 |
81
+ | **F1** | **0.9116** |
82
+
83
+ ## Usage
84
+
85
+ ```python
86
+ from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
87
+
88
+ model_id = "fransis3/norbert4-xlarge-NorNER"
89
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
90
+ model = AutoModelForTokenClassification.from_pretrained(model_id, trust_remote_code=True)
91
+
92
+ ner = pipeline("token-classification", model=model, tokenizer=tokenizer, aggregation_strategy="simple")
93
+ ner("Erna Solberg besøkte Universitetet i Oslo forrige uke.")
94
+ ```
95
+
96
+ ## Limitations
97
+
98
+ - Performance is reported on NorNE's test distribution (news, blogs, parliamentary text, government reports). Generalization to other domains (e.g., social media, clinical text, historical Norwegian) is not guaranteed.
99
+ - The model inherits any biases present in its pretraining data (EuroBERT) and in NorNE's source texts.
100
+ - The base model is loaded with `trust_remote_code=True` as required by EuroBERT.
101
+
102
+ ## Dataset
103
+
104
+ [NorNE](https://huggingface.co/datasets/NbAiLab/norne) is a named entity annotation layer over the Norwegian Dependency Treebank, covering both Bokmål and Nynorsk.
105
+
106
+ ## License
107
+
108
+ This model is released under the **Apache 2.0** license, matching the base model. The NorNE annotations used for training are released under CC0 1.0.
109
+
110
+ ## Citation
111
+
112
+ If you use this model, please cite the underlying resources:
113
+
114
+ ```bibtex
115
+ @inproceedings{charpentier-samuel-2024-bert,
116
+ title = "{GPT} or {BERT}: why not both?",
117
+ author = "Charpentier, Lucas Georges Gabriel and
118
+ Samuel, David",
119
+ booktitle = "The 2nd BabyLM Challenge at the 28th Conference on Computational Natural Language Learning",
120
+ month = nov,
121
+ year = "2024",
122
+ address = "Miami, FL, USA",
123
+ publisher = "Association for Computational Linguistics",
124
+ url = "https://aclanthology.org/2024.conll-babylm.24/",
125
+ pages = "262--283"
126
+ }
127
+ ```
128
+
129
+ ```bibtex
130
+ @inproceedings{samuel-etal-2023-norbench,
131
+ title = "{N}or{B}ench {--} A Benchmark for {N}orwegian Language Models",
132
+ author = "Samuel, David and
133
+ Kutuzov, Andrey and
134
+ Touileb, Samia and
135
+ Velldal, Erik and
136
+ {\O}vrelid, Lilja and
137
+ R{\o}nningstad, Egil and
138
+ Sigdel, Elina and
139
+ Palatkina, Anna",
140
+ booktitle = "Proceedings of the 24th Nordic Conference on Computational Linguistics (NoDaLiDa)",
141
+ month = may,
142
+ year = "2023",
143
+ address = "T{\'o}rshavn, Faroe Islands",
144
+ publisher = "University of Tartu Library",
145
+ url = "https://aclanthology.org/2023.nodalida-1.61",
146
+ pages = "618--633"
147
+ }
148
+ ```
149
+
150
+ ```bibtex
151
+ @misc{jørgensen2020norneannotatingnamedentities,
152
+ title={NorNE: Annotating Named Entities for Norwegian},
153
+ author={Fredrik Jørgensen and Tobias Aasmoe and Anne-Stine Ruud Husevåg and Lilja Øvrelid and Erik Velldal},
154
+ year={2020},
155
+ eprint={1911.12146},
156
+ archivePrefix={arXiv},
157
+ primaryClass={cs.CL},
158
+ url={https://arxiv.org/abs/1911.12146},
159
+ }
160
+ ```