🚀 土耳其命名实体识别 (NER) 模型
本模型是基于 “dbmdz/bert-base-turkish-cased” 微调得到的模型,使用了知名土耳其 NER 数据集的审核版本(https://github.com/stefan-it/turkish-bert/files/4558187/nerdata.txt)。
🚀 快速开始
本模型是一个用于土耳其语命名实体识别的工具,借助微调后的 BERT 模型,能高效准确地识别文本中的实体。
✨ 主要特性
- 基于 “dbmdz/bert-base-turkish-cased” 模型微调,适配土耳其语命名实体识别任务。
- 经过特定数据集训练,在多个评估指标上表现出色。
📦 安装指南
本部分未提及具体安装命令,因此跳过。
💻 使用示例
基础用法
model = AutoModelForTokenClassification.from_pretrained("akdeniz27/bert-base-turkish-cased-ner")
tokenizer = AutoTokenizer.from_pretrained("akdeniz27/bert-base-turkish-cased-ner")
ner = pipeline('ner', model=model, tokenizer=tokenizer, aggregation_strategy="first")
ner("your text here")
请参考 “https://huggingface.co/transformers/_modules/transformers/pipelines/token_classification.html” 了解使用 aggregation_strategy
参数进行实体分组的方法。
📚 详细文档
微调参数
task = "ner"
model_checkpoint = "dbmdz/bert-base-turkish-cased"
batch_size = 8
label_list = ['O', 'B-PER', 'I-PER', 'B-ORG', 'I-ORG', 'B-LOC', 'I-LOC']
max_length = 512
learning_rate = 2e-5
num_train_epochs = 3
weight_decay = 0.01
参考测试结果
- 准确率:0.9933935699477056
- F1 值:0.9592969472710453
- 精确率:0.9543530277931161
- 召回率:0.9642923563325274
使用论文 "Küçük, D., Küçük, D., Arıcı, N. 2016. Türkçe Varlık İsmi Tanıma için bir Veri Kümesi ("A Named Entity Recognition Dataset for Turkish"). IEEE Sinyal İşleme, İletişim ve Uygulamaları Kurultayı. Zonguldak, Türkiye." 中提出的测试集进行评估,结果如下:
测试集 |
准确率 |
精确率 |
召回率 |
F1 分数 |
20010000 |
0.9946 |
0.9871 |
0.9463 |
0.9662 |
20020000 |
0.9928 |
0.9134 |
0.9206 |
0.9170 |
20030000 |
0.9942 |
0.9814 |
0.9186 |
0.9489 |
20040000 |
0.9943 |
0.9660 |
0.9522 |
0.9590 |
20050000 |
0.9971 |
0.9539 |
0.9932 |
0.9732 |
20060000 |
0.9993 |
0.9942 |
0.9942 |
0.9942 |
20070000 |
0.9970 |
0.9806 |
0.9439 |
0.9619 |
20080000 |
0.9988 |
0.9821 |
0.9649 |
0.9735 |
20090000 |
0.9977 |
0.9891 |
0.9479 |
0.9681 |
20100000 |
0.9961 |
0.9684 |
0.9293 |
0.9485 |
总体 |
0.9961 |
0.9720 |
0.9516 |
0.9617 |
📄 许可证
本项目采用 MIT 许可证。