Views
No views yet
sl, hr, sr, bs, mk, sq, cs, bg, pl, ru, sk, uk@misc{11356/1747,
title = {Training corpus {SUK} 1.0},
author = {Arhar Holdt, {\v S}pela and Krek, Simon and Dobrovoljc, Kaja and Erjavec, Toma{\v z} and Gantar, Polona and {\v C}ibej, Jaka and Pori, Eva and Ter{\v c}on, Luka and Munda, Tina and {\v Z}itnik, Slavko and Robida, Nejc and Blagus, Neli and Mo{\v z}e, Sara and Ledinek, Nina and Holz, Nanika and Zupan, Katja and Kuzman, Taja and Kav{\v c}i{\v c}, Teja and {\v S}krjanec, Iza and Marko, Dafne and Jezer{\v s}ek, Lucija and Zajc, Anja},
url = {http://hdl.handle.net/11356/1747},
note = {Slovenian language resource repository {CLARIN}.{SI}},
copyright = {Creative Commons - Attribution-{NonCommercial}-{ShareAlike} 4.0 International ({CC} {BY}-{NC}-{SA} 4.0)},
issn = {2820-4042},
year = {2022}
}@misc{11356/1183,
title = {Training corpus hr500k 1.0},
author = {Ljube{\v s}i{\'c}, Nikola and Agi{\'c}, {\v Z}eljko and Klubi{\v c}ka, Filip and Batanovi{\'c}, Vuk and Erjavec, Toma{\v z}},
url = {http://hdl.handle.net/11356/1183},
note = {Slovenian language resource repository {CLARIN}.{SI}},
copyright = {Creative Commons - Attribution-{ShareAlike} 4.0 International ({CC} {BY}-{SA} 4.0)},
issn = {2820-4042},
year = {2018}
}@misc{11356/1200,
title = {Training corpus {SETimes}.{SR} 1.0},
author = {Batanovi{\'c}, Vuk and Ljube{\v s}i{\'c}, Nikola and Samard{\v z}i{\'c}, Tanja and Erjavec, Toma{\v z}},
url = {http://hdl.handle.net/11356/1200},
note = {Slovenian language resource repository {CLARIN}.{SI}},
copyright = {Creative Commons - Attribution-{ShareAlike} 4.0 International ({CC} {BY}-{SA} 4.0)},
issn = {2820-4042},
year = {2018}
}@inproceedings{rahimi-etal-2019-massively,
title = "Massively Multilingual Transfer for {NER}",
author = "Rahimi, Afshin and
Li, Yuan and
Cohn, Trevor",
booktitle = "Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics",
month = jul,
year = "2019",
address = "Florence, Italy",
publisher = "Association for Computational Linguistics",
url = "https://www.aclweb.org/anthology/P19-1015",
pages = "151--164",
}@Inbook{Strakova2016,
author="Strakov{\'a}, Jana and Straka, Milan and Haji{\v{c}}, Jan",
editor="Sojka, Petr and Hor{\'a}k, Ale{\v{s}} and Kope{\v{c}}ek, Ivan and Pala, Karel",
title="Neural Networks for Featureless Named Entity Recognition in Czech",
bookTitle="Text, Speech, and Dialogue: 19th International Conference, TSD 2016, Brno, Czech Republic, September 12-16, 2016, Proceedings",
year="2016",
publisher="Springer International Publishing",
address="Cham",
pages="173--181",
isbn="978-3-319-45510-5",
doi="10.1007/978-3-319-45510-5_20",
url="http://dx.doi.org/10.1007/978-3-319-45510-5_20"
}@misc{seqeval,
title={{seqeval}: A Python framework for sequence labeling evaluation},
url={https://github.com/chakki-works/seqeval},
note={Software available from https://github.com/chakki-works/seqeval},
author={Hiroki Nakayama},
year={2018},
}@inproceedings{ramshaw-marcus-1995-text,
title = "Text Chunking using Transformation-Based Learning",
author = "Ramshaw, Lance and
Marcus, Mitch",
booktitle = "Third Workshop on Very Large Corpora",
year = "1995",
url = "https://www.aclweb.org/anthology/W95-0107",
}1import re
2from transformers import pipeline
3
4model_id = "ivlcic/sour-sarma"
5
6ner = pipeline(
7 task="token-classification",
8 model=model_id,
9 tokenizer=model_id,
10 aggregation_strategy="none", # <-
11)
12
13text = " Janez Novak... Metka Kralj,,. in Boris A. Novak živijo v Ljubljani in delajo za Microsoft."
14tokens = re.findall(r"\s+|\w+|[^\w\s]", text, flags=re.UNICODE)
15result = ner(tokens, is_split_into_words=True, delimiter="")
16
17prev = None
18rewritten = []
19for e in result[0]:
20 if prev is not None and prev['end'] == e['start']:
21 rewritten[-1]['entity'] = e['entity'][2:]
22 rewritten[-1]['span'] = text[rewritten[-1]['start']:e['end']]
23 rewritten[-1]['end'] += e['end']
24 else:
25 rewritten.append(e.copy())
26 rewritten[-1].pop('word')
27 rewritten[-1]['entity'] = e['entity'][2:]
28 rewritten[-1]['span'] = text[e['start']:e['end']]
29 prev = e