Twitter Roberta Base Dec2021 Tweetner7 All
基于Twitter-RoBERTa模型在TweetNER7数据集上微调的命名实体识别模型,专门用于推文中的实体识别。
下载量 6
发布时间 : 7/3/2022
模型简介
该模型是基于Twitter-RoBERTa在TweetNER7数据集上微调的版本,用于识别推文中的命名实体,如人物、地点、公司等。
模型特点
高性能实体识别
在推文数据上表现出色,特别是在识别人物和地点实体方面。
特殊文本处理
支持推文中账户名和URL的特殊格式处理,优化了推文数据的实体识别。
多实体类别支持
能够识别多种实体类别,包括公司、创意作品、事件、团体、地点、人物和产品。
模型能力
推文实体识别
多类别实体分类
特殊格式文本处理
使用案例
社交媒体分析
推文实体提取
从推文中提取人物、地点、公司等实体,用于社交媒体监控和分析。
F1值达到0.6447(微观)
内容推荐
基于实体的内容推荐
通过识别推文中的实体,为用户推荐相关内容或产品。
🚀 tner/twitter-roberta-base-dec2021-tweetner7-all
本模型是 cardiffnlp/twitter-roberta-base-dec2021 在 tner/tweetner7 数据集(train_all
划分)上的微调版本。模型微调通过 T-NER 的超参数搜索完成(更多细节请参阅该仓库)。该模型在2021年测试集上取得了以下成绩:
- F1(微平均):0.6447001005249637
- 精确率(微平均):0.6234607906675308
- 召回率(微平均):0.6674375578168362
- F1(宏平均):0.5982200308213212
- 精确率(宏平均):0.576608821080324
- 召回率(宏平均):0.622268182336741
✨ 主要特性
- 微调模型:基于预训练模型 cardiffnlp/twitter-roberta-base-dec2021 在 tner/tweetner7 数据集上进行微调。
- 多指标评估:在测试集上使用 F1、精确率、召回率等多种指标进行评估,包括微平均和宏平均。
- 支持特定数据集:针对 TweetNER7 数据集进行了优化,该数据集对推文进行了预处理,将账户名和 URL 转换为特殊格式。
📦 安装指南
本模型可以通过 tner 库 使用。通过 pip 安装该库:
pip install tner
💻 使用示例
基础用法
TweetNER7 对推文进行了预处理,将账户名和 URL 转换为特殊格式(更多细节请参阅数据集页面)。因此,我们需要相应地处理推文,然后运行模型预测,示例代码如下:
import re
from urlextract import URLExtract
from tner import TransformersNER
extractor = URLExtract()
def format_tweet(tweet):
# 屏蔽网页链接
urls = extractor.find_urls(tweet)
for url in urls:
tweet = tweet.replace(url, "{{URL}}")
# 格式化推特账户
tweet = re.sub(r"\b(\s*)(@[\S]+)\b", r'\1{\2@}', tweet)
return tweet
text = "Get the all-analog Classic Vinyl Edition of `Takin' Off` Album from @herbiehancock via @bluenoterecords link below: http://bluenote.lnk.to/AlbumOfTheWeek"
text_format = format_tweet(text)
model = TransformersNER("tner/twitter-roberta-base-dec2021-tweetner7-all")
model.predict([text_format])
虽然该模型也可以通过 transformers 库使用,但目前不建议这样做,因为当前不支持 CRF 层。
📚 详细文档
测试集 F1 分数详情
测试集上 F1 分数的按实体细分如下:
- 公司:0.5048128342245989
- 创意作品:0.45297029702970293
- 事件:0.46761313220940554
- 团体:0.6009661835748793
- 地点:0.6592252133946159
- 人物:0.8302430243024302
- 产品:0.6717095310136157
对于 F1 分数,通过自助法获得的置信区间如下:
- F1(微平均):
- 90%:[0.6358921767926183, 0.6542958612061787]
- 95%:[0.6341987223616053, 0.6560992650244356]
- F1(宏平均):
- 90%:[0.6358921767926183, 0.6542958612061787]
- 95%:[0.6341987223616053, 0.6560992650244356]
完整评估结果可在 NER 指标文件 和 实体跨度指标文件 中查看。
训练超参数
训练过程中使用了以下超参数:
属性 | 详情 |
---|---|
数据集 | ['tner/tweetner7'] |
数据集划分 | train_all |
数据集名称 | None |
本地数据集 | None |
模型 | cardiffnlp/twitter-roberta-base-dec2021 |
CRF | True |
最大长度 | 128 |
训练轮数 | 30 |
批次大小 | 32 |
学习率 | 1e-05 |
随机种子 | 0 |
梯度累积步数 | 1 |
权重衰减 | 1e-07 |
学习率热身步数比例 | 0.3 |
最大梯度范数 | 1 |
完整配置可在 微调参数文件 中查看。
🔧 技术细节
模型微调是通过 T-NER 的超参数搜索完成的。在训练过程中,使用了 CRF 层来提高命名实体识别的性能。同时,对推文进行了预处理,将账户名和 URL 转换为特殊格式,以适应 TweetNER7 数据集。
📄 许可证
如果使用该模型,请引用 T-NER 论文和 TweetNER7 论文:
- T-NER
@inproceedings{ushio-camacho-collados-2021-ner,
title = "{T}-{NER}: An All-Round Python Library for Transformer-based Named Entity Recognition",
author = "Ushio, Asahi and
Camacho-Collados, Jose",
booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations",
month = apr,
year = "2021",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2021.eacl-demos.7",
doi = "10.18653/v1/2021.eacl-demos.7",
pages = "53--62",
abstract = "Language model (LM) pretraining has led to consistent improvements in many NLP downstream tasks, including named entity recognition (NER). In this paper, we present T-NER (Transformer-based Named Entity Recognition), a Python library for NER LM finetuning. In addition to its practical utility, T-NER facilitates the study and investigation of the cross-domain and cross-lingual generalization ability of LMs finetuned on NER. Our library also provides a web app where users can get model predictions interactively for arbitrary text, which facilitates qualitative model evaluation for non-expert programmers. We show the potential of the library by compiling nine public NER datasets into a unified format and evaluating the cross-domain and cross- lingual performance across the datasets. The results from our initial experiments show that in-domain performance is generally competitive across datasets. However, cross-domain generalization is challenging even with a large pretrained LM, which has nevertheless capacity to learn domain-specific features if fine- tuned on a combined dataset. To facilitate future research, we also release all our LM checkpoints via the Hugging Face model hub.",
}
- TweetNER7
@inproceedings{ushio-etal-2022-tweet,
title = "{N}amed {E}ntity {R}ecognition in {T}witter: {A} {D}ataset and {A}nalysis on {S}hort-{T}erm {T}emporal {S}hifts",
author = "Ushio, Asahi and
Neves, Leonardo and
Silva, Vitor and
Barbieri, Francesco. and
Camacho-Collados, Jose",
booktitle = "The 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 12th International Joint Conference on Natural Language Processing",
month = nov,
year = "2022",
address = "Online",
publisher = "Association for Computational Linguistics",
}
Indonesian Roberta Base Posp Tagger
MIT
这是一个基于印尼语RoBERTa模型微调的词性标注模型,在indonlu数据集上训练,用于印尼语文本的词性标注任务。
序列标注
Transformers 其他

I
w11wo
2.2M
7
Bert Base NER
MIT
基于BERT微调的命名实体识别模型,可识别四类实体:地点(LOC)、组织机构(ORG)、人名(PER)和杂项(MISC)
序列标注 英语
B
dslim
1.8M
592
Deid Roberta I2b2
MIT
该模型是基于RoBERTa微调的序列标注模型,用于识别和移除医疗记录中的受保护健康信息(PHI/PII)。
序列标注
Transformers 支持多种语言

D
obi
1.1M
33
Ner English Fast
Flair自带的英文快速4类命名实体识别模型,基于Flair嵌入和LSTM-CRF架构,在CoNLL-03数据集上达到92.92的F1分数。
序列标注
PyTorch 英语
N
flair
978.01k
24
French Camembert Postag Model
基于Camembert-base的法语词性标注模型,使用free-french-treebank数据集训练
序列标注
Transformers 法语

F
gilf
950.03k
9
Xlm Roberta Large Ner Spanish
基于XLM-Roberta-large架构微调的西班牙语命名实体识别模型,在CoNLL-2002数据集上表现优异。
序列标注
Transformers 西班牙语

X
MMG
767.35k
29
Nusabert Ner V1.3
MIT
基于NusaBert-v1.3在印尼语NER任务上微调的命名实体识别模型
序列标注
Transformers 其他

N
cahya
759.09k
3
Ner English Large
Flair框架内置的英文4类大型NER模型,基于文档级XLM-R嵌入和FLERT技术,在CoNLL-03数据集上F1分数达94.36。
序列标注
PyTorch 英语
N
flair
749.04k
44
Punctuate All
MIT
基于xlm-roberta-base微调的多语言标点符号预测模型,支持12种欧洲语言的标点符号自动补全
序列标注
Transformers

P
kredor
728.70k
20
Xlm Roberta Ner Japanese
MIT
基于xlm-roberta-base微调的日语命名实体识别模型
序列标注
Transformers 支持多种语言

X
tsmatz
630.71k
25
精选推荐AI模型
Llama 3 Typhoon V1.5x 8b Instruct
专为泰语设计的80亿参数指令模型,性能媲美GPT-3.5-turbo,优化了应用场景、检索增强生成、受限生成和推理任务
大型语言模型
Transformers 支持多种语言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一个基于SODA数据集训练的超小型对话模型,专为边缘设备推理设计,体积仅为Cosmo-3B模型的2%左右。
对话系统
Transformers 英语

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基于RoBERTa架构的中文抽取式问答模型,适用于从给定文本中提取答案的任务。
问答系统 中文
R
uer
2,694
98