Upload 2 files
Browse files
README.md
CHANGED
@@ -17,7 +17,7 @@ tags:
|
|
17 |
- entity recognition
|
18 |
---
|
19 |
# GLiNER-X
|
20 |
-
 model capable of identifying any entity type using a bidirectional transformer encoders (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.
|
23 |
|
@@ -35,6 +35,33 @@ pip install gliner -U
|
|
35 |
```
|
36 |
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`.
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
<details>
|
39 |
<summary>Spanish</summary>
|
40 |
|
@@ -66,6 +93,347 @@ Liga de Campeones => competiciones
|
|
66 |
```
|
67 |
</details>
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
### Benchmarks
|
70 |
Below you can see the table with benchmarking results (F1 score) on various maltilingual named entity recognition datasets:
|
71 |
|
|
|
17 |
- entity recognition
|
18 |
---
|
19 |
# GLiNER-X
|
20 |
+

|
21 |
|
22 |
GLiNER is a Named Entity Recognition (NER) model capable of identifying any entity type using a bidirectional transformer encoders (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.
|
23 |
|
|
|
35 |
```
|
36 |
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`.
|
37 |
|
38 |
+
```python
|
39 |
+
from gliner import GLiNER
|
40 |
+
model = GLiNER.from_pretrained("knowledgator/gliner-x-size-v0.5")
|
41 |
+
text = """
|
42 |
+
Cristiano Ronaldo dos Santos Aveiro (Portuguese pronunciation: [kɾiʃˈtjɐnu ʁɔˈnaldu]; born 5 February 1985) is a Portuguese professional footballer who plays as a forward for and captains both Saudi Pro League club Al Nassr and the Portugal national team. Widely regarded as one of the greatest players of all time, Ronaldo has won five Ballon d'Or awards,[note 3] a record three UEFA Men's Player of the Year Awards, and four European Golden Shoes, the most by a European player. He has won 33 trophies in his career, including seven league titles, five UEFA Champions Leagues, the UEFA European Championship and the UEFA Nations League. Ronaldo holds the records for most appearances (183), goals (140) and assists (42) in the Champions League, goals in the European Championship (14), international goals (128) and international appearances (205). He is one of the few players to have made over 1,200 professional career appearances, the most by an outfield player, and has scored over 850 official senior career goals for club and country, making him the top goalscorer of all time.
|
43 |
+
"""
|
44 |
+
labels = ["person", "award", "date", "competitions", "teams"]
|
45 |
+
entities = model.predict_entities(text, labels, threshold=0.5)
|
46 |
+
for entity in entities:
|
47 |
+
print(entity["text"], "=>", entity["label"])
|
48 |
+
```
|
49 |
+
|
50 |
+
```
|
51 |
+
Cristiano Ronaldo dos Santos Aveiro => persona
|
52 |
+
5 de febrero de 1985 => fecha
|
53 |
+
Al Nassr de la Liga Profesional Saudí => equipos
|
54 |
+
selección nacional de Portugal => equipos
|
55 |
+
Balón de Oro => premio
|
56 |
+
Jugador del Año de la UEFA => premio
|
57 |
+
Botas de Oro europeas => premio
|
58 |
+
33 trofeos => premio
|
59 |
+
Ligas de Campeones de la UEFA => competiciones
|
60 |
+
Eurocopa => competiciones
|
61 |
+
Liga de Naciones de la UEFA => competiciones
|
62 |
+
Liga de Campeones => competiciones
|
63 |
+
```
|
64 |
+
|
65 |
<details>
|
66 |
<summary>Spanish</summary>
|
67 |
|
|
|
93 |
```
|
94 |
</details>
|
95 |
|
96 |
+
<details>
|
97 |
+
<summary>Danish</summary>
|
98 |
+
|
99 |
+
```python
|
100 |
+
from gliner import GLiNER
|
101 |
+
model = GLiNER.from_pretrained("knowledgator/gliner-x-size-v0.5")
|
102 |
+
text = """
|
103 |
+
Cristiano Ronaldo dos Santos Aveiro (portugisisk udtale: [kɾiʃˈtjɐnu ʁɔˈnaldu]; født 5. februar 1985) er en portugisisk professionel fodboldspiller, der spiller som angriber for og er anfører for både den saudiske Pro League-klub Al Nassr og det portugisiske landshold. Bredt anerkendt som en af de største spillere gennem tiderne har Ronaldo vundet fem Ballon d'Or-priser, en rekord på tre UEFA Men's Player of the Year-priser og fire europæiske Guldstøvler – flest af en europæisk spiller. Han har vundet 33 trofæer i sin karriere, herunder syv ligatitler, fem UEFA Champions League-titler, EM og UEFA Nations League. Ronaldo har rekorderne for flest optrædener (183), mål (140) og assists (42) i Champions League, mål ved EM (14), internationale mål (128) og internationale optrædener (205). Han er en af de få spillere, der har spillet over 1.200 professionelle kampe – flest af en markspiller – og har scoret over 850 officielle mål i sin seniorkarriere for klub og land, hvilket gør ham til historiens mest scorende spiller.
|
104 |
+
"""
|
105 |
+
labels = ["person", "pris", "dato", "turneringer", "hold"]
|
106 |
+
entities = model.predict_entities(text, labels, threshold=0.5)
|
107 |
+
for entity in entities:
|
108 |
+
print(entity["text"], "=>", entity["label"])
|
109 |
+
```
|
110 |
+
|
111 |
+
```
|
112 |
+
Cristiano Ronaldo dos Santos Aveiro => person
|
113 |
+
5. februar 1985 => dato
|
114 |
+
Pro League-klub => hold
|
115 |
+
Al Nassr => hold
|
116 |
+
portugisiske landshold => hold
|
117 |
+
Ballon d'Or-priser => pris
|
118 |
+
UEFA Men's Player of the Year-priser => turneringer
|
119 |
+
Guldstøvler => pris
|
120 |
+
UEFA Champions League-titler => turneringer
|
121 |
+
EM => turneringer
|
122 |
+
UEFA Nations League => turneringer
|
123 |
+
Champions League => turneringer
|
124 |
+
EM => turneringer
|
125 |
+
```
|
126 |
+
</details>
|
127 |
+
|
128 |
+
<details>
|
129 |
+
<summary>Swedish</summary>
|
130 |
+
|
131 |
+
```python
|
132 |
+
from gliner import GLiNER
|
133 |
+
model = GLiNER.from_pretrained("knowledgator/gliner-x-size-v0.5")
|
134 |
+
text = """
|
135 |
+
Cristiano Ronaldo dos Santos Aveiro (portugisisk uttal: [kɾiʃˈtjɐnu ʁɔˈnaldu]; född 5 februari 1985) är en portugisisk professionell fotbollsspelare som spelar som anfallare för och är kapten för både Saudi Pro League-klubben Al Nassr och Portugals landslag. Allmänt ansedd som en av de största spelarna genom tiderna har Ronaldo vunnit fem Ballon d'Or-utmärkelser, ett rekord på tre UEFA:s Årets spelare och fyra europeiska Gyllene skor – flest av en europeisk spelare. Han har vunnit 33 troféer under sin karriär, inklusive sju ligatitlar, fem UEFA Champions League-titlar, UEFA:s europamästerskap och UEFA Nations League. Ronaldo innehar rekorden för flest framträdanden (183), mål (140) och assist (42) i Champions League, mål i EM (14), landslagsmål (128) och landslagsframträdanden (205). Han är en av få spelare som spelat över 1 200 professionella matcher, flest av en utespelare, och har gjort över 850 officiella seniormål för klubb och landslag, vilket gör honom till den främsta målskytten genom tiderna.
|
136 |
+
"""
|
137 |
+
labels = ["person", "utmärkelse", "datum", "tävlingar", "lag"]
|
138 |
+
entities = model.predict_entities(text, labels, threshold=0.5)
|
139 |
+
for entity in entities:
|
140 |
+
print(entity["text"], "=>", entity["label"])
|
141 |
+
```
|
142 |
+
|
143 |
+
```
|
144 |
+
Cristiano Ronaldo dos Santos Aveiro => person
|
145 |
+
5 februari 1985 => datum
|
146 |
+
Saudi Pro League-klubben => lag
|
147 |
+
Al Nassr => lag
|
148 |
+
Portugals landslag => lag
|
149 |
+
Ballon d'Or-utmärkelser => utmärkelse
|
150 |
+
Årets spelare => utmärkelse
|
151 |
+
Gyllene skor => utmärkelse
|
152 |
+
33 troféer => utmärkelse
|
153 |
+
sju ligatitlar => utmärkelse
|
154 |
+
UEFA Champions League-titlar => tävlingar
|
155 |
+
UEFA:s europamästerskap => tävlingar
|
156 |
+
UEFA Nations League => tävlingar
|
157 |
+
Champions League => tävlingar
|
158 |
+
EM => tävlingar
|
159 |
+
```
|
160 |
+
</details>
|
161 |
+
|
162 |
+
<details>
|
163 |
+
<summary>Norwegian</summary>
|
164 |
+
|
165 |
+
```python
|
166 |
+
from gliner import GLiNER
|
167 |
+
model = GLiNER.from_pretrained("knowledgator/gliner-x-size-v0.5")
|
168 |
+
text = """
|
169 |
+
Cristiano Ronaldo dos Santos Aveiro (portugisisk uttale: [kɾiʃˈtjɐnu ʁɔˈnaldu]; født 5. februar 1985) er en portugisisk profesjonell fotballspiller som spiller som spiss og er kaptein både for den saudiarabiske klubben Al Nassr og det portugisiske landslaget. Bredt ansett som en av tidenes beste spillere, har Ronaldo vunnet fem Ballon d'Or-priser, en rekord på tre UEFA Årets Spiller-priser, og fire europeiske Gullstøvler – flest av alle europeiske spillere. Han har vunnet 33 troféer i løpet av karrieren, inkludert syv ligatitler, fem UEFA Champions League-titler, EM og UEFA Nations League. Ronaldo innehar rekordene for flest opptredener (183), mål (140) og målgivende pasninger (42) i Champions League, mål i EM (14), landslagsmål (128) og landskamper (205). Han er en av få spillere med over 1200 profesjonelle kamper, flest for en utespiller, og har scoret over 850 mål i offisielle seniorkamper for klubb og landslag, noe som gjør ham til tidenes toppscorer.
|
170 |
+
"""
|
171 |
+
labels = ["person", "pris", "dato", "konkurranser", "lag"]
|
172 |
+
entities = model.predict_entities(text, labels, threshold=0.5)
|
173 |
+
for entity in entities:
|
174 |
+
print(entity["text"], "=>", entity["label"])
|
175 |
+
```
|
176 |
+
|
177 |
+
```
|
178 |
+
Cristiano Ronaldo dos Santos Aveiro => person
|
179 |
+
5. februar 1985 => dato
|
180 |
+
Al Nassr => lag
|
181 |
+
portugisiske landslaget => lag
|
182 |
+
Ballon d'Or-priser => pris
|
183 |
+
UEFA Årets Spiller-priser => konkurranser
|
184 |
+
Gullstøvler => konkurranser
|
185 |
+
33 troféer => pris
|
186 |
+
syv ligatitler => pris
|
187 |
+
UEFA Champions League-titler => konkurranser
|
188 |
+
EM => konkurranser
|
189 |
+
UEFA Nations League => konkurranser
|
190 |
+
Champions League => konkurranser
|
191 |
+
EM => konkurranser
|
192 |
+
```
|
193 |
+
</details>
|
194 |
+
|
195 |
+
<details>
|
196 |
+
<summary>Czech</summary>
|
197 |
+
|
198 |
+
```python
|
199 |
+
from gliner import GLiNER
|
200 |
+
model = GLiNER.from_pretrained("knowledgator/gliner-x-size-v0.5")
|
201 |
+
text = """
|
202 |
+
Cristiano Ronaldo dos Santos Aveiro (portugalská výslovnost: [kɾiʃˈtjɐnu ʁɔˈnaldu]; narozen 5. února 1985) je portugalský profesionální fotbalista, který hraje jako útočník a je kapitánem jak klubu Al Nassr v Saúdské profesionální lize, tak portugalského národního týmu. Široce považován za jednoho z nejlepších hráčů všech dob, Ronaldo získal pět ocenění Ballon d'Or, rekordní tři ocenění UEFA Hráč roku a čtyři Zlaté kopačky, což je nejvíce ze všech evropských hráčů. Ve své kariéře vyhrál 33 trofejí, včetně sedmi ligových titulů, pěti Lig mistrů UEFA, Mistrovství Evropy UEFA a Ligy národů UEFA. Ronaldo drží rekordy v počtu startů (183), gólů (140) a asistencí (42) v Lize mistrů, gólů na mistrovství Evropy (14), mezinárodních gólů (128) a mezinárodních startů (205). Je jedním z mála hráčů, kteří odehráli více než 1 200 profesionálních zápasů, což je nejvíce mezi hráči v poli, a vstřelil přes 850 oficiálních gólů na klubové a reprezentační úrovni, čímž se stal nejlepším střelcem všech dob.
|
203 |
+
"""
|
204 |
+
labels = ["osoba", "ocenění", "datum", "soutěže", "týmy"]
|
205 |
+
entities = model.predict_entities(text, labels, threshold=0.5)
|
206 |
+
for entity in entities:
|
207 |
+
print(entity["text"], "=>", entity["label"])
|
208 |
+
```
|
209 |
+
|
210 |
+
```
|
211 |
+
Cristiano Ronaldo dos Santos Aveiro => osoba
|
212 |
+
5. února 1985 => datum
|
213 |
+
Al Nassr => týmy
|
214 |
+
Saúdské profesionální lize => týmy
|
215 |
+
Ballon d'Or => ocenění
|
216 |
+
rekordní tři ocenění UEFA Hráč roku => ocenění
|
217 |
+
Zlaté kopačky => ocenění
|
218 |
+
33 trofejí => ocenění
|
219 |
+
sedmi ligových titulů => ocenění
|
220 |
+
Lig mistrů UEFA => soutěže
|
221 |
+
Mistrovství Evropy UEFA => soutěže
|
222 |
+
Ligy národů UEFA => soutěže
|
223 |
+
Lize mistrů => soutěže
|
224 |
+
mistrovství Evropy => soutěže
|
225 |
+
```
|
226 |
+
</details>
|
227 |
+
|
228 |
+
<details>
|
229 |
+
<summary>Polish</summary>
|
230 |
+
|
231 |
+
```python
|
232 |
+
from gliner import GLiNER
|
233 |
+
model = GLiNER.from_pretrained("knowledgator/gliner-x-size-v0.5")
|
234 |
+
text = """
|
235 |
+
Cristiano Ronaldo dos Santos Aveiro (wymowa portugalska: [kɾiʃˈtjɐnu ʁɔˈnaldu]; ur. 5 lutego 1985) to portugalski piłkarz grający na pozycji napastnika, kapitan klubu Al Nassr z saudyjskiej ligi oraz reprezentacji Portugalii. Uważany za jednego z najwybitniejszych zawodników w historii, Ronaldo zdobył pięć Złotych Piłek, rekordowe trzy nagrody UEFA dla najlepszego piłkarza roku oraz cztery Złote Buty, najwięcej wśród europejskich zawodników. W swojej karierze zdobył 33 trofea, w tym siedem tytułów mistrza ligi, pięć Lig Mistrzów UEFA, mistrzostwo Europy i Ligę Narodów UEFA. Ronaldo posiada rekordy w liczbie występów (183), goli (140) i asyst (42) w Lidze Mistrzów, bramek na Mistrzostwach Europy (14), goli międzynarodowych (128) oraz meczów międzynarodowych (205). Jest jednym z nielicznych piłkarzy z ponad 1200 oficjalnymi występami w karierze — najwięcej spośród graczy z pola — oraz zdobywcą ponad 850 goli dla klubów i reprezentacji, co czyni go najlepszym strzelcem wszech czasów.
|
236 |
+
"""
|
237 |
+
labels = ["osoba", "nagroda", "data", "rozgrywki", "drużyny"]
|
238 |
+
entities = model.predict_entities(text, labels, threshold=0.5)
|
239 |
+
for entity in entities:
|
240 |
+
print(entity["text"], "=>", entity["label"])
|
241 |
+
```
|
242 |
+
|
243 |
+
```
|
244 |
+
Cristiano Ronaldo dos Santos Aveiro => osoba
|
245 |
+
5 lutego 1985 => data
|
246 |
+
Al Nassr => drużyny
|
247 |
+
reprezentacji Portugalii => drużyny
|
248 |
+
Złotych Piłek => nagroda
|
249 |
+
Złote Buty => nagroda
|
250 |
+
Lig Mistrzów UEFA => rozgrywki
|
251 |
+
mistrzostwo Europy => rozgrywki
|
252 |
+
Ligę Narodów UEFA => rozgrywki
|
253 |
+
Mistrzostwach Europy => rozgrywki
|
254 |
+
```
|
255 |
+
</details>
|
256 |
+
|
257 |
+
<details>
|
258 |
+
<summary>Lithuanian</summary>
|
259 |
+
|
260 |
+
```python
|
261 |
+
from gliner import GLiNER
|
262 |
+
model = GLiNER.from_pretrained("knowledgator/gliner-x-size-v0.5")
|
263 |
+
text = """
|
264 |
+
Cristiano Ronaldo dos Santos Aveiro (portugališka tarimo forma: [kɾiʃˈtjɐnu ʁɔˈnaldu]; gimė 1985 m. vasario 5 d.) yra portugalų profesionalus futbolininkas, žaidžiantis puolėjo pozicijoje ir esantis tiek Saudo Arabijos „Pro League“ klubo „Al Nassr“, tiek Portugalijos nacionalinės rinktinės kapitonas. Plačiai laikomas vienu geriausių visų laikų žaidėjų, Ronaldo yra laimėjęs penkis „Ballon d'Or“ apdovanojimus, rekordiškai tris UEFA metų žaidėjo apdovanojimus ir keturis Europos „Auksinius batelius“ – daugiausiai tarp Europos žaidėjų. Savo karjeroje jis laimėjo 33 trofėjus, įskaitant septynis lygos titulus, penkis UEFA Čempionų lygos titulus, UEFA Europos čempionatą ir UEFA Tautų lygą. Ronaldo priklauso rekordai pagal daugiausiai pasirodymų (183), įvarčių (140) ir rezultatyvių perdavimų (42) Čempionų lygoje, įvarčių Europos čempionate (14), tarptautinių įvarčių (128) ir tarptautinių pasirodymų (205). Jis yra vienas iš nedaugelio žaidėjų, sužaidusių daugiau nei 1200 profesionalių rungtynių – daugiausiai tarp aikštės žaidėjų – ir pelnęs daugiau nei 850 oficialių įvarčių klubų ir rinktinės lygiu, tapdamas rezultatyviausiu visų laikų žaidėju.
|
265 |
+
"""
|
266 |
+
labels = ["asmuo", "apdovanojimas", "data", "varžybos", "komandos"]
|
267 |
+
entities = model.predict_entities(text, labels, threshold=0.5)
|
268 |
+
for entity in entities:
|
269 |
+
print(entity["text"], "=>", entity["label"])
|
270 |
+
```
|
271 |
+
|
272 |
+
```
|
273 |
+
Cristiano Ronaldo dos Santos Aveiro => asmuo
|
274 |
+
1985 m. vasario 5 d. => data
|
275 |
+
Al Nassr => komandos
|
276 |
+
Ballon d'Or => apdovanojimas
|
277 |
+
UEFA metų žaidėjo apdovanojimus => apdovanojimas
|
278 |
+
Europos „Auksinius batelius => apdovanojimas
|
279 |
+
UEFA Čempionų lygos => varžybos
|
280 |
+
UEFA Europos čempionatą => varžybos
|
281 |
+
UEFA Tautų lygą => varžybos
|
282 |
+
```
|
283 |
+
</details>
|
284 |
+
|
285 |
+
<details>
|
286 |
+
<summary>Estonian</summary>
|
287 |
+
|
288 |
+
```python
|
289 |
+
from gliner import GLiNER
|
290 |
+
model = GLiNER.from_pretrained("knowledgator/gliner-x-size-v0.5")
|
291 |
+
text = """
|
292 |
+
Cristiano Ronaldo dos Santos Aveiro (portugali hääldus: [kɾiʃˈtjɐnu ʁɔˈnaldu]; sündinud 5. veebruaril 1985) on Portugali elukutseline jalgpallur, kes mängib ründajana ja on kapteniks nii Saudi Araabia Pro League'i klubis Al Nassr kui ka Portugali rahvuskoondises. Teda peetakse laialdaselt üheks aegade parimaks mängijaks. Ronaldo on võitnud viis Ballon d'Or auhinda, kolm UEFA Aasta Meesmängija auhinda ning neli Euroopa Kuldset Saapa auhinda – enim Euroopa mängijate seas. Ta on oma karjääri jooksul võitnud 33 trofeed, sealhulgas seitse liigatiitlit, viis UEFA Meistrite Liigat, UEFA Euroopa meistrivõistlused ja UEFA Rahvuste Liiga. Ronaldol on Meistrite Liigas enim mänge (183), väravaid (140) ja resultatiivseid sööte (42), Euroopa meistrivõistlustel enim väravaid (14), rahvusvahelisi väravaid (128) ja rahvusvahelisi mänge (205). Ta on üks vähestest mängijatest, kes on pidanud üle 1200 ametliku mängu ning löönud üle 850 värava klubide ja koondise eest, olles kõigi aegade parim väravakütt.
|
293 |
+
"""
|
294 |
+
labels = ["isik", "auhind", "kuupäev", "võistlused", "meeskonnad"]
|
295 |
+
entities = model.predict_entities(text, labels, threshold=0.5)
|
296 |
+
for entity in entities:
|
297 |
+
print(entity["text"], "=>", entity["label"])
|
298 |
+
```
|
299 |
+
|
300 |
+
```
|
301 |
+
Cristiano Ronaldo dos Santos Aveiro => isik
|
302 |
+
5. veebruaril 1985 => kuupäev
|
303 |
+
Al Nassr => meeskonnad
|
304 |
+
Portugali rahvuskoondises => meeskonnad
|
305 |
+
Ballon d'Or auhinda => auhind
|
306 |
+
UEFA Aasta Meesmängija auhinda => auhind
|
307 |
+
Euroopa Kuldset Saapa auhinda => auhind
|
308 |
+
UEFA Meistrite Liigat => võistlused
|
309 |
+
UEFA Euroopa meistrivõistlused => võistlused
|
310 |
+
UEFA Rahvuste Liiga => võistlused
|
311 |
+
```
|
312 |
+
</details>
|
313 |
+
|
314 |
+
<details>
|
315 |
+
<summary>Latvian</summary>
|
316 |
+
|
317 |
+
```python
|
318 |
+
from gliner import GLiNER
|
319 |
+
model = GLiNER.from_pretrained("knowledgator/gliner-x-size-v0.5")
|
320 |
+
text = """
|
321 |
+
Kristiānu Ronaldu dušu Santušu Aveiru (portugāļu izruna: [kɾiʃˈtjɐnu ʁɔˈnaldu]; dzimis 1985. gada 5. februārī) ir portugāļu profesionāls futbolists, kurš spēlē kā uzbrucējs un ir kapteinis gan Saūda Arābijas Pro līgas klubā "Al Nassr", gan Portugāles izlasē. Plaši tiek uzskatīts par vienu no visu laiku izcilākajiem spēlētājiem. Ronaldu ir ieguvis piecas Ballon d'Or balvas, rekorda trīs UEFA Gada spēlētāja balvas un četras Eiropas Zelta bučus – visvairāk starp Eiropas spēlētājiem. Viņš savas karjeras laikā ir izcīnījis 33 trofejas, tostarp septiņus līgas titulus, piecas UEFA Čempionu līgas, UEFA Eiropas čempionātu un UEFA Nāciju līgu. Ronaldu pieder rekordi pēc dalību skaita (183), vārtu guvumiem (140) un piespēlēm (42) Čempionu līgā, vārtiem Eiropas čempionātā (14), vārtiem starptautiskā līmenī (128) un spēļu skaita izlasē (205). Viņš ir viens no nedaudzajiem spēlētājiem ar vairāk nekā 1200 profesionālām spēlēm, visvairāk starp laukuma spēlētājiem, un ir guvis vairāk nekā 850 oficiālus vārtus klubos un izlasē, padarot viņu par visu laiku rezultatīvāko spēlētāju.
|
322 |
+
"""
|
323 |
+
labels = ["persona", "balva", "datums", "sacensības", "komandas"]
|
324 |
+
entities = model.predict_entities(text, labels, threshold=0.5)
|
325 |
+
for entity in entities:
|
326 |
+
print(entity["text"], "=>", entity["label"])
|
327 |
+
```
|
328 |
+
|
329 |
+
```
|
330 |
+
Kristiānu Ronaldu => persona
|
331 |
+
Santušu Aveiru => persona
|
332 |
+
1985. gada 5. februārī => datums
|
333 |
+
Al Nassr => komandas
|
334 |
+
Portugāles izlasē => komandas
|
335 |
+
Ballon d'Or balvas => balva
|
336 |
+
UEFA Gada spēlētāja balvas => balva
|
337 |
+
Eiropas Zelta bučus => balva
|
338 |
+
UEFA Čempionu līgas => sacensības
|
339 |
+
UEFA Eiropas čempionātu => sacensības
|
340 |
+
UEFA Nāciju līgu => sacensības
|
341 |
+
```
|
342 |
+
</details>
|
343 |
+
|
344 |
+
<details>
|
345 |
+
<summary>Finnish</summary>
|
346 |
+
|
347 |
+
```python
|
348 |
+
from gliner import GLiNER
|
349 |
+
model = GLiNER.from_pretrained("knowledgator/gliner-x-size-v0.5")
|
350 |
+
text = """
|
351 |
+
Cristiano Ronaldo dos Santos Aveiro (lausutaan portugaliksi: [kɾiʃˈtjɐnu ʁɔˈnaldu]; syntynyt 5. helmikuuta 1985) on portugalilainen ammattilaisjalkapalloilija, joka pelaa hyökkääjänä ja toimii kapteenina sekä Saudi Pro League -seura Al Nassrissa että Portugalin maajoukkueessa. Häntä pidetään laajalti yhtenä kaikkien aikojen parhaista pelaajista. Ronaldo on voittanut viisi Ballon d'Or -palkintoa, ennätykselliset kolme UEFA:n Vuoden Pelaaja -palkintoa ja neljä Euroopan Kultakenkää – eniten eurooppalaispelaajista. Hän on urallaan voittanut 33 pokaalia, mukaan lukien seitsemän sarjamestaruutta, viisi UEFA Mestarien liigaa, UEFA:n Euroopan-mestaruuden ja UEFA Nations Leaguen. Ronaldo pitää hallussaan ennätyksiä Mestarien liigassa pelien (183), maalien (140) ja syöttöjen (42) määrässä, EM-kisojen maaleissa (14), maaottelumaaleissa (128) ja maaotteluiden määrässä (205). Hän on yksi harvoista pelaajista, joka on pelannut yli 1 200 ammattilaisottelua – eniten kenttäpelaajista – ja tehnyt yli 850 virallista maalia seurassa ja maajoukkueessa, mikä tekee hänestä kaikkien aikojen maalikuninkaan.
|
352 |
+
"""
|
353 |
+
labels = ["henkilö", "palkinto", "päivämäärä", "kilpailut", "joukkueet"]
|
354 |
+
entities = model.predict_entities(text, labels, threshold=0.5)
|
355 |
+
for entity in entities:
|
356 |
+
print(entity["text"], "=>", entity["label"])
|
357 |
+
```
|
358 |
+
|
359 |
+
```
|
360 |
+
Cristiano Ronaldo dos Santos Aveiro => henkilö
|
361 |
+
5. helmikuuta 1985 => päivämäärä
|
362 |
+
Saudi Pro League => joukkueet
|
363 |
+
Al Nassrissa => joukkueet
|
364 |
+
Portugalin maajoukkueessa => joukkueet
|
365 |
+
Ballon d'Or -palkintoa => palkinto
|
366 |
+
UEFA:n Vuoden Pelaaja -palkintoa => palkinto
|
367 |
+
Euroopan Kultakenkää => palkinto
|
368 |
+
UEFA Mestarien liigaa => kilpailut
|
369 |
+
UEFA:n Euroopan-mestaruuden => kilpailut
|
370 |
+
UEFA Nations Leaguen => kilpailut
|
371 |
+
EM-kisojen => kilpailut
|
372 |
+
```
|
373 |
+
</details>
|
374 |
+
|
375 |
+
<details>
|
376 |
+
<summary>German</summary>
|
377 |
+
|
378 |
+
```python
|
379 |
+
from gliner import GLiNER
|
380 |
+
model = GLiNER.from_pretrained("knowledgator/gliner-x-size-v0.5")
|
381 |
+
text = """
|
382 |
+
Cristiano Ronaldo dos Santos Aveiro (portugiesische Aussprache: [kɾiʃˈtjɐnu ʁɔˈnaldu]; geboren am 5. Februar 1985) ist ein portugiesischer Profifußballer, der als Stürmer spielt und sowohl für den Verein Al Nassr in der Saudi Pro League als auch für die portugiesische Nationalmannschaft Kapitän ist. Allgemein gilt er als einer der größten Spieler aller Zeiten. Ronaldo hat fünf Ballon-d'Or-Auszeichnungen, einen Rekord von drei UEFA-Auszeichnungen als Spieler des Jahres und vier europäische Goldene Schuhe gewonnen – die meisten für einen europäischen Spieler. In seiner Karriere hat er 33 Trophäen gewonnen, darunter sieben Ligatitel, fünf UEFA-Champions-League-Titel, die UEFA-Europameisterschaft und die UEFA Nations League. Ronaldo hält die Rekorde für die meisten Einsätze (183), Tore (140) und Assists (42) in der Champions League, Tore bei Europameisterschaften (14), Länderspieltore (128) und Länderspieleinsätze (205). Er ist einer der wenigen Spieler, die über 1.200 Einsätze in ihrer Profikarriere absolviert haben – die meisten eines Feldspielers – und hat über 850 offizielle Tore für Verein und Land erzielt, womit er der erfolgreichste Torschütze aller Zeiten ist.
|
383 |
+
"""
|
384 |
+
labels = ["person", "auszeichnung", "datum", "wettbewerbe", "teams"]
|
385 |
+
entities = model.predict_entities(text, labels, threshold=0.5)
|
386 |
+
for entity in entities:
|
387 |
+
print(entity["text"], "=>", entity["label"])
|
388 |
+
```
|
389 |
+
|
390 |
+
```
|
391 |
+
Cristiano Ronaldo dos Santos Aveiro => person
|
392 |
+
5. Februar 1985 => datum
|
393 |
+
Al Nassr => teams
|
394 |
+
Saudi Pro League => wettbewerbe
|
395 |
+
portugiesische Nationalmannschaft => teams
|
396 |
+
Ballon-d'Or-Auszeichnungen => auszeichnung
|
397 |
+
UEFA-Auszeichnungen => auszeichnung
|
398 |
+
Spieler des Jahres => auszeichnung
|
399 |
+
europäische Goldene Schuhe => auszeichnung
|
400 |
+
UEFA-Champions-League-Titel => wettbewerbe
|
401 |
+
UEFA-Europameisterschaft => wettbewerbe
|
402 |
+
UEFA Nations League => wettbewerbe
|
403 |
+
```
|
404 |
+
</details>
|
405 |
+
|
406 |
+
<details>
|
407 |
+
<summary>French</summary>
|
408 |
+
|
409 |
+
```python
|
410 |
+
from gliner import GLiNER
|
411 |
+
model = GLiNER.from_pretrained("knowledgator/gliner-x-size-v0.5")
|
412 |
+
text = """
|
413 |
+
Cristiano Ronaldo dos Santos Aveiro (prononciation portugaise : [kɾiʃˈtjɐnu ʁɔˈnaldu] ; né le 5 février 1985) est un footballeur professionnel portugais qui joue comme attaquant et est capitaine à la fois du club d'Al Nassr en Saudi Pro League et de l'équipe nationale du Portugal. Largement considéré comme l’un des plus grands joueurs de tous les temps, Ronaldo a remporté cinq Ballons d’Or, un record de trois prix du Joueur de l’année UEFA et quatre Souliers d’or européens, le plus grand nombre pour un joueur européen. Il a remporté 33 trophées dans sa carrière, dont sept titres de championnat, cinq Ligues des champions de l’UEFA, le Championnat d'Europe et la Ligue des nations de l’UEFA. Ronaldo détient les records du plus grand nombre d'apparitions (183), de buts (140) et de passes décisives (42) en Ligue des champions, de buts dans le Championnat d'Europe (14), de buts internationaux (128) et d'apparitions internationales (205). Il est l’un des rares joueurs à avoir disputé plus de 1 200 matchs professionnels en carrière, le plus grand nombre pour un joueur de champ, et a marqué plus de 850 buts officiels en carrière en club et en sélection, ce qui fait de lui le meilleur buteur de tous les temps.
|
414 |
+
"""
|
415 |
+
labels = ["personne", "récompense", "date", "compétitions", "équipes"]
|
416 |
+
entities = model.predict_entities(text, labels, threshold=0.5)
|
417 |
+
for entity in entities:
|
418 |
+
print(entity["text"], "=>", entity["label"])
|
419 |
+
```
|
420 |
+
|
421 |
+
```
|
422 |
+
Cristiano Ronaldo dos Santos Aveiro => personne
|
423 |
+
5 février 1985 => date
|
424 |
+
Al Nassr => équipes
|
425 |
+
Saudi Pro League => compétitions
|
426 |
+
équipe nationale du Portugal => équipes
|
427 |
+
Ballons d’Or => récompense
|
428 |
+
Joueur de l’année UEFA => récompense
|
429 |
+
Souliers d’or européens => récompense
|
430 |
+
Ligues des champions de l’UEFA => compétitions
|
431 |
+
Championnat d'Europe => compétitions
|
432 |
+
Ligue des nations de l’UEFA => compétitions
|
433 |
+
```
|
434 |
+
</details>
|
435 |
+
|
436 |
+
|
437 |
### Benchmarks
|
438 |
Below you can see the table with benchmarking results (F1 score) on various maltilingual named entity recognition datasets:
|
439 |
|
image.png
ADDED
![]() |