Roberta Base Tweetner7 All
基于roberta-base在tweetner7数据集上微调的命名实体识别模型,专门用于推特文本中的实体识别。
下载量 30
发布时间 : 7/11/2022
模型简介
该模型是一个基于RoBERTa架构的命名实体识别模型,专门针对推特文本进行优化,能够识别推特中的各类命名实体。
模型特点
推特文本优化
专门针对推特文本进行微调,能够有效处理推特的非正式语言和特殊格式。
多实体识别
能够识别推特中的多种实体类型,包括人名、组织名、URL等。
高精度实体跨度识别
在实体跨度识别任务上表现优异,F1值达到0.789。
模型能力
推特文本处理
命名实体识别
多类别实体分类
使用案例
社交媒体分析
推特用户分析
识别推特文本中提及的人物和组织,用于用户行为分析。
F1值0.652
品牌监测
监测推特中提及的品牌和组织名称。
实体跨度F1值0.789
信息提取
URL提取
从推文中提取分享的链接。
包含在实体识别范围内
🚀 tner/roberta-base-tweetner7-all
该模型是基于 roberta-base 在 tner/tweetner7 数据集(train_all
分割)上进行微调的版本。模型微调通过 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/roberta-base-tweetner7-all")
model.predict([text_format])
该模型也可以通过 transformers 库使用,但由于目前不支持 CRF 层,因此不建议这样做。
✨ 主要特性
- 微调模型:基于
roberta-base
在tner/tweetner7
数据集上微调,提升了在特定任务上的性能。 - 多指标评估:在测试集上提供了丰富的评估指标,包括 F1、Precision、Recall 等,且提供了每个实体类别的 F1 分数和置信区间。
📚 详细文档
评估结果
该模型在 2021 年测试集上取得了以下结果:
指标 | 值 |
---|---|
F1 (micro) | 0.6515831894070236 |
Precision (micro) | 0.6488190781930749 |
Recall (micro) | 0.6543709528214616 |
F1 (macro) | 0.6081318073591985 |
Precision (macro) | 0.6024892144112918 |
Recall (macro) | 0.6155807376978756 |
测试集上每个实体类别的 F1 分数细分如下:
实体类别 | F1 分数 |
---|---|
corporation | 0.5174234424498415 |
creative_work | 0.466403162055336 |
event | 0.46727272727272723 |
group | 0.6071197411003236 |
location | 0.6832786885245901 |
person | 0.8377301195672804 |
product | 0.6776947705442904 |
对于 F1 分数,通过自助法获得的置信区间如下:
- F1 (micro):
- 90%: [0.6426248846161623, 0.6611146727643068]
- 95%: [0.6408583849998567, 0.6629609445072536]
- F1 (macro):
- 90%: [0.6426248846161623, 0.6611146727643068]
- 95%: [0.6408583849998567, 0.6629609445072536]
完整的评估结果可在 NER 指标文件 和 实体跨度指标文件 中查看。
训练超参数
训练过程中使用的超参数如下:
属性 | 详情 |
---|---|
数据集 | ['tner/tweetner7'] |
数据集分割 | train_all |
数据集名称 | None |
本地数据集 | None |
模型 | roberta-base |
CRF | True |
最大长度 | 128 |
轮数 | 30 |
批次大小 | 32 |
学习率 | 1e-05 |
随机种子 | 0 |
梯度累积步数 | 1 |
权重衰减 | 1e-07 |
学习率热身步数比例 | 0.3 |
最大梯度范数 | 1 |
完整的配置可在 微调参数文件 中查看。
引用
如果您使用了该模型,请引用 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