Token Classification
GLiNER
PyTorch
multilingual
wjbmattingly commited on
Commit
413e21c
1 Parent(s): 9a75faf

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +70 -3
README.md CHANGED
@@ -1,3 +1,70 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - multilingual
5
+ library_name: gliner
6
+ datasets:
7
+ - medieval-data/medieval-latin-ner-HOME-Alcar-sents
8
+ pipeline_tag: token-classification
9
+ ---
10
+
11
+ # About
12
+
13
+ This is a GLiNER model finetuned on medieval Latin. It was trained to improve the identification of PERSON and LOC. It was finetuned from [urchade/gliner_multi-v2.1](https://huggingface.co/urchade/gliner_multi-v2.1). The model was finetuned on 1,500 annotations from the [Home Alcar sentences](https://huggingface.co/datasets/medieval-data/medieval-latin-ner-HOME-Alcar-sents). Only 1,500 were selected to prevent catastrophic forgetting.
14
+
15
+ GLiNER is a Named Entity Recognition (NER) model capable of identifying any entity type using a bidirectional transformer encoder (BERT-like). It provides a practical alternative to traditional NER models, which are limited to predefined entities, and Large Language Models (LLMs) that, despite their flexibility, are costly and large for resource-constrained scenarios.
16
+
17
+ ## Installation
18
+ To use this model, you must install the GLiNER Python library:
19
+ ```
20
+ !pip install gliner
21
+ ```
22
+
23
+ ## Usage
24
+ Once you've downloaded the GLiNER library, you can import the GLiNER class. You can then load this model using `GLiNER.from_pretrained` and predict entities with `predict_entities`.
25
+
26
+ ```python
27
+ from gliner import GLiNER
28
+
29
+ model = GLiNER.from_pretrained("medieval-data/gliner_multi-v2.1-medieval-latin")
30
+
31
+ text = """
32
+ Testes : magister Stephanus cantor Autissiodorensis , Petrus capellanus comitis , Gaufridus clericus , Hugo de Argenteolo , Milo Filluns , Johannes Maleherbe , Nivardus de Argenteolo , Columbus tunc prepositus Tornodorensis , Johannes prepositus Autissiodorensis , Johannes Brisebarra .
33
+ """
34
+
35
+ labels = ["PERSON", "LOC"]
36
+
37
+ entities = model.predict_entities(text, labels)
38
+
39
+ for entity in entities:
40
+ print(entity["text"], "=>", entity["label"])
41
+ ```
42
+
43
+ ```
44
+ Stephanus => PERSON
45
+ Autissiodorensis => LOC
46
+ Petrus => PERSON
47
+ Gaufridus => PERSON
48
+ Hugo de Argenteolo => PERSON
49
+ Milo Filluns => PERSON
50
+ Johannes Maleherbe => PERSON
51
+ Nivardus de Argenteolo => PERSON
52
+ Columbus => PERSON
53
+ Tornodorensis => LOC
54
+ Johannes => PERSON
55
+ Autissiodorensis => LOC
56
+ Johannes Brisebarra => PERSON
57
+ ```
58
+
59
+
60
+ ## Citation to Original GLiNER Model
61
+ ```bibtex
62
+ @misc{zaratiana2023gliner,
63
+ title={GLiNER: Generalist Model for Named Entity Recognition using Bidirectional Transformer},
64
+ author={Urchade Zaratiana and Nadi Tomeh and Pierre Holat and Thierry Charnois},
65
+ year={2023},
66
+ eprint={2311.08526},
67
+ archivePrefix={arXiv},
68
+ primaryClass={cs.CL}
69
+ }
70
+ ```