🚀 古希腊语命名实体识别
本项目提供了一个预训练的古希腊语命名实体识别(NER)标签模型,能够有效识别古希腊语文本中的各类实体。
🚀 快速开始
你可以通过以下步骤快速使用该模型:
- 打开此 Colab 笔记本,其中包含了使用模型所需的代码。
- 运行以下代码示例:
from transformers import pipeline
ner = pipeline('ner', model="UGARIT/grc-ner-xlmr", aggregation_strategy = 'first')
ner("ταῦτα εἴπας ὁ Ἀλέξανδρος παρίζει Πέρσῃ ἀνδρὶ ἄνδρα Μακεδόνα ὡς γυναῖκα τῷ λόγῳ · οἳ δέ , ἐπείτε σφέων οἱ Πέρσαι ψαύειν ἐπειρῶντο , διεργάζοντο αὐτούς .")
输出示例
[{'entity_group': 'PER',
'score': 0.9999428,
'word': '',
'start': 13,
'end': 14},
{'entity_group': 'PER',
'score': 0.99994195,
'word': 'Ἀλέξανδρος',
'start': 14,
'end': 24},
{'entity_group': 'NORP',
'score': 0.9087087,
'word': 'Πέρσῃ',
'start': 32,
'end': 38},
{'entity_group': 'NORP',
'score': 0.97572577,
'word': 'Μακεδόνα',
'start': 50,
'end': 59},
{'entity_group': 'NORP',
'score': 0.9993412,
'word': 'Πέρσαι',
'start': 104,
'end': 111}]
✨ 主要特性
- 专门为古希腊语设计的预训练 NER 模型。
- 基于可用的古希腊语标注语料库进行训练,具有较高的准确性。
📦 安装指南
文档未提及安装步骤,可参考 Colab 笔记本 中的代码进行使用。
💻 使用示例
基础用法
from transformers import pipeline
ner = pipeline('ner', model="UGARIT/grc-ner-xlmr", aggregation_strategy = 'first')
ner("ταῦτα εἴπας ὁ Ἀλέξανδρος παρίζει Πέρσῃ ἀνδρὶ ἄνδρα Μακεδόνα ὡς γυναῖκα τῷ λόγῳ · οἳ δέ , ἐπείτε σφέων οἱ Πέρσαι ψαύειν ἐπειρῶντο , διεργάζοντο αὐτούς .")
📚 详细文档
数据
我们在可用的古希腊语标注语料库上训练了这些模型。目前只有两个规模较大的古希腊语标注数据集,它们目前正在发布中:
- 第一个是由 Berti 2023 开发的,包含了对 Athenaeus 的 Deipnosophists 的全文标注,该数据集是在数字 Athenaeus 项目的背景下开发的。
- 第二个是由 Foka 等人 2020 开发的,是对 Pausanias 的 Periegesis Hellados 的全文标注,该数据集是在数字 Periegesis 项目的背景下开发的。
此外,我们还使用了学生和学者在 Recogito 上标注的较小语料库:
- 由 Kemp 2021 标注的《奥德赛》。
- 一个混合语料库,包括归于 Apollodorus 的《图书馆》和 Strabo 的《地理学》的节选,由 Chiara Palladino 标注。
- 由 Thomas Visser 创建的 Xenophon 的《远征记》第 1 卷。
- 由 Rachel Milio 创建的 Demosthenes 的《反奈亚拉》。
训练数据集
数据集 |
人物 |
地点 |
民族/宗教/政治团体 |
其他 |
《奥德赛》 |
2469 |
698 |
0 |
0 |
《智者之宴》 |
14921 |
2699 |
5110 |
3060 |
《希腊游记》 |
10205 |
8670 |
4972 |
0 |
其他数据集 |
3283 |
2040 |
1089 |
0 |
总计 |
30878 |
14107 |
11171 |
3060 |
验证数据集
数据集 |
人物 |
地点 |
民族/宗教/政治团体 |
其他 |
《远征记》 |
1190 |
796 |
857 |
0 |
结果
类别 |
指标 |
测试集 |
验证集 |
地点 |
精确率 |
83.33% |
88.66% |
|
召回率 |
81.27% |
88.94% |
|
F1 值 |
82.29% |
88.80% |
其他 |
精确率 |
83.25% |
0 |
|
召回率 |
81.21% |
0 |
|
F1 值 |
82.22% |
0 |
民族/宗教/政治团体 |
精确率 |
88.71% |
94.76% |
|
召回率 |
90.76% |
94.50% |
|
F1 值 |
89.73% |
94.63% |
人物 |
精确率 |
91.72% |
94.22% |
|
召回率 |
94.42% |
96.06% |
|
F1 值 |
93.05% |
95.13% |
总体 |
精确率 |
88.83% |
92.91% |
|
召回率 |
89.99% |
93.72% |
|
F1 值 |
89.41% |
93.32% |
|
准确率 |
97.50% |
98.87% |
引用
@inproceedings{palladino-yousef-2024-development,
title = "Development of Robust {NER} Models and Named Entity Tagsets for {A}ncient {G}reek",
author = "Palladino, Chiara and
Yousef, Tariq",
editor = "Sprugnoli, Rachele and
Passarotti, Marco",
booktitle = "Proceedings of the Third Workshop on Language Technologies for Historical and Ancient Languages (LT4HALA) @ LREC-COLING-2024",
month = may,
year = "2024",
address = "Torino, Italia",
publisher = "ELRA and ICCL",
url = "https://aclanthology.org/2024.lt4hala-1.11",
pages = "89--97",
abstract = "This contribution presents a novel approach to the development and evaluation of transformer-based models for Named Entity Recognition and Classification in Ancient Greek texts. We trained two models with annotated datasets by consolidating potentially ambiguous entity types under a harmonized set of classes. Then, we tested their performance with out-of-domain texts, reproducing a real-world use case. Both models performed very well under these conditions, with the multilingual model being slightly superior on the monolingual one. In the conclusion, we emphasize current limitations due to the scarcity of high-quality annotated corpora and to the lack of cohesive annotation strategies for ancient languages.",
}
📄 许可证
本项目采用 MIT 许可证。