Views
No views yet
1from transformers import pipeline
2
3
4model = "SlavicNLP/slavicner-ner-cross-topic-large"
5
6text = """Nie jest za późno, aby powstrzymać Brexit, a Wielka Brytania wciąż
7może zmienić zdanie - powiedział przewodniczący Rady Europejskiej
8eurodeputowanym w Strasburgu"""
9
10pipe = pipeline("ner", model, aggregation_strategy="simple")
11
12entities = pipe(text)
13
14print(*entities, sep="\n")
15# {'entity_group': 'EVT', 'score': 0.99720407, 'word': 'Brexit', 'start': 35, 'end': 41}
16# {'entity_group': 'LOC', 'score': 0.9656372, 'word': 'Wielka Brytania', 'start': 45, 'end': 60}
17# {'entity_group': 'ORG', 'score': 0.9977708, 'word': 'Rady Europejskiej', 'start': 115, 'end': 132}
18# {'entity_group': 'LOC', 'score': 0.95184135, 'word': 'Strasburgu', 'start': 151, 'end': 161}1@inproceedings{piskorski-etal-2024-cross-lingual,
2 title = "Cross-lingual Named Entity Corpus for {S}lavic Languages",
3 author = "Piskorski, Jakub and
4 Marci{\'n}czuk, Micha{\l} and
5 Yangarber, Roman",
6 editor = "Calzolari, Nicoletta and
7 Kan, Min-Yen and
8 Hoste, Veronique and
9 Lenci, Alessandro and
10 Sakti, Sakriani and
11 Xue, Nianwen",
12 booktitle = "Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)",
13 month = may,
14 year = "2024",
15 address = "Torino, Italy",
16 publisher = "ELRA and ICCL",
17 url = "https://aclanthology.org/2024.lrec-main.369",
18 pages = "4143--4157",
19 abstract = "This paper presents a corpus manually annotated with named entities for six Slavic languages {---} Bulgarian, Czech, Polish, Slovenian, Russian,
20 and Ukrainian. This work is the result of a series of shared tasks, conducted in 2017{--}2023 as a part of the Workshops on Slavic Natural
21 Language Processing. The corpus consists of 5,017 documents on seven topics. The documents are annotated with five classes of named entities.
22 Each entity is described by a category, a lemma, and a unique cross-lingual identifier. We provide two train-tune dataset splits
23 {---} single topic out and cross topics. For each split, we set benchmarks using a transformer-based neural network architecture
24 with the pre-trained multilingual models {---} XLM-RoBERTa-large for named entity mention recognition and categorization,
25 and mT5-large for named entity lemmatization and linking.",
26}