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