Twitter Roberta Base Dec2021 Tweetner7 Random
該模型是基於Twitter數據預訓練的RoBERTa模型,在tner/tweetner7數據集上微調,用於推文中的命名實體識別。
下載量 43
發布時間 : 7/11/2022
模型概述
專門針對推文優化的命名實體識別模型,能夠識別推文中的公司、創意作品、事件、團體、地點、人物和產品等實體類別。
模型特點
推文優化處理
模型針對推文進行了特殊處理,能夠正確處理賬戶名和URL等推文特有格式。
多類別實體識別
能夠識別7種不同類型的實體,包括人物、地點、公司等。
CRF增強
模型使用條件隨機場(CRF)層來提高序列標註的準確性。
模型能力
推文實體識別
多類別實體分類
社交媒體文本分析
使用案例
社交媒體分析
推文實體提取
從推文中提取人名、公司名等實體信息
F1值達到0.63
社交媒體監控
監控社交媒體中提及的品牌、產品和人物
🚀 tner/twitter-roberta-base-dec2021-tweetner7-random
本模型是在 tner/tweetner7 數據集(train_random
劃分)上對 cardiffnlp/twitter-roberta-base-dec2021 進行微調後的版本。模型微調通過 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-random")
model.predict([text_format])
該模型也可通過 transformers 庫使用,但由於目前不支持 CRF 層,因此不建議使用。
✨ 主要特性
- 微調模型:基於 cardiffnlp/twitter-roberta-base-dec2021 在 tner/tweetner7 數據集上微調。
- 多指標評估:在測試集上提供了 F1、Precision、Recall 等多種指標的評估結果。
- 支持多種使用方式:可通過 tner 庫 或 transformers 庫使用。
📦 安裝指南
通過 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-random")
model.predict([text_format])
📚 詳細文檔
評估結果
該模型在 2021 年測試集上取得了以下結果:
- F1 (micro): 0.6321284238886395
- Precision (micro): 0.6142015706806283
- Recall (micro): 0.6511332099907493
- F1 (macro): 0.583682304736069
- Precision (macro): 0.5654677691354458
- Recall (macro): 0.6047150410746663
測試集上 F1 分數的按實體細分結果如下:
- corporation: 0.5019685039370079
- creative_work: 0.41401273885350315
- event: 0.4564727108705458
- group: 0.5892444737710327
- location: 0.6486486486486486
- person: 0.8268075031870332
- product: 0.6486215538847118
對於 F1 分數,通過自助法獲得的置信區間如下:
- F1 (micro):
- 90%: [0.6245116881258609, 0.6411928894306437]
- 95%: [0.6221686986039963, 0.642603475030015]
- F1 (macro):
- 90%: [0.6245116881258609, 0.6411928894306437]
- 95%: [0.6221686986039963, 0.642603475030015]
完整評估結果可在 NER 指標文件 和 實體跨度指標文件 中查看。
訓練超參數
訓練過程中使用了以下超參數:
屬性 | 詳情 |
---|---|
數據集 | ['tner/tweetner7'] |
數據集劃分 | train_random |
數據集名稱 | None |
本地數據集 | None |
模型 | cardiffnlp/twitter-roberta-base-dec2021 |
CRF | True |
最大長度 | 128 |
訓練輪數 | 30 |
批次大小 | 32 |
學習率 | 0.0001 |
隨機種子 | 0 |
梯度累積步數 | 1 |
權重衰減 | 1e-07 |
學習率熱身步數比例 | 0.15 |
最大梯度範數 | 1 |
完整配置可在 微調參數文件 中查看。
🔧 技術細節
模型微調通過 T-NER 的超參數搜索完成。在訓練過程中,使用了 CRF 層來提升模型性能。同時,對推文進行了預處理,將賬號名和 URL 轉換為特殊格式,以適應 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