Twitter Roberta Base Dec2021 Tweetner7 Continuous
该模型是基于RoBERTa架构的Twitter专用命名实体识别模型,在tweetner7数据集上持续微调,用于识别推文中的命名实体。
下载量 20
发布时间 : 7/3/2022
模型简介
该模型专门用于识别Twitter推文中的命名实体,包括人物、地点、组织等类别。通过连续微调优化了在社交媒体文本上的表现。
模型特点
Twitter文本优化
专门针对Twitter文本特点进行优化,能有效处理社交媒体特有的表达方式和格式
连续微调策略
采用先在2020年数据上微调,再在2021年数据上持续微调的两阶段训练策略
多类别实体识别
能识别7类实体:公司、创意作品、事件、团体、地点、人物和产品
模型能力
Twitter文本命名实体识别
社交媒体文本处理
多类别实体分类
使用案例
社交媒体分析
推文实体提取
从Twitter推文中提取人物、地点、组织等实体信息
F1分数达到0.65
社交媒体监控
监测社交媒体中特定实体(如品牌、名人)的提及情况
数据标注
自动标注工具
为社交媒体文本分析提供预标注服务
🚀 tner/twitter-roberta-base-dec2021-tweetner7-continuous
本模型是在 tner/tweetner7 数据集(train_2021
分割)上对 tner/twitter-roberta-base-dec2021-tweetner-2020 进行微调后的版本。该模型先在 train_2020
上进行微调,然后在 train_2021
上继续微调。模型微调通过 T-NER 的超参数搜索完成(更多细节请参阅仓库)。
🚀 快速开始
本模型可通过 tner 库 使用。通过 pip 安装该库:
pip install tner
TweetNER7 对推文进行了预处理,将账户名和 URL 转换为特殊格式(更多细节请参阅数据集页面)。因此,我们需要对推文进行相应处理,然后运行模型预测,示例如下:
import re
from urlextract import URLExtract
from tner import TransformersNER
extractor = URLExtract()
def format_tweet(tweet):
# mask web urls
urls = extractor.find_urls(tweet)
for url in urls:
tweet = tweet.replace(url, "{{URL}}")
# format twitter account
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-continuous")
model.predict([text_format])
也可以通过 transformers 库使用该模型,但目前不推荐,因为暂不支持 CRF 层。
✨ 主要特性
- 基于预训练模型微调,在特定数据集上持续优化。
- 支持对推文进行命名实体识别。
- 提供了详细的评估指标和训练超参数。
📦 安装指南
通过 pip 安装 tner 库:
pip install tner
💻 使用示例
基础用法
import re
from urlextract import URLExtract
from tner import TransformersNER
extractor = URLExtract()
def format_tweet(tweet):
# mask web urls
urls = extractor.find_urls(tweet)
for url in urls:
tweet = tweet.replace(url, "{{URL}}")
# format twitter account
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-continuous")
model.predict([text_format])
📚 详细文档
评估指标
属性 | 详情 |
---|---|
数据集 | tner/tweetner7 |
评估指标 | F1、Precision、Recall、Macro F1、Macro Precision、Macro Recall、Entity Span F1、Entity Span Precision、Entity Span Recall |
测试集 2021 结果 | F1 (micro): 0.6511305152373794;Precision (micro): 0.6512434933487565;Recall (micro): 0.6510175763182239;F1 (macro): 0.6001624572691789;Precision (macro): 0.5998564738871041;Recall (macro): 0.6026065175267361 |
各实体 F1 分数 | corporation: 0.5055066079295154;creative_work: 0.47089601046435575;event: 0.4448705656759348;group: 0.6124532153793807;location: 0.6592689295039165;person: 0.8386047352250136;product: 0.6695371367061357 |
F1 分数置信区间 | F1 (micro) 90%: [0.642462096346594, 0.6609916755115764];F1 (micro) 95%: [0.6408253162283987, 0.6624122690460243];F1 (macro) 90%: [0.642462096346594, 0.6609916755115764];F1 (macro) 95%: [0.6408253162283987, 0.6624122690460243] |
完整评估文件 | NER 指标文件;实体跨度指标文件 |
训练超参数
以下是训练过程中使用的超参数:
- 数据集: ['tner/tweetner7']
- 数据集分割: train_2021
- 数据集名称: None
- 本地数据集: None
- 模型: tner/twitter-roberta-base-dec2021-tweetner-2020
- CRF: True
- 最大长度: 128
- 训练轮数: 30
- 批次大小: 32
- 学习率: 1e-06
- 随机种子: 0
- 梯度累积步数: 1
- 权重衰减: 1e-07
- 学习率热身步数比例: 0.15
- 最大梯度范数: 1
完整配置可在 微调参数文件 中查看。
引用
如果使用该模型,请引用以下论文:
- 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