🚀 XLM-RoBERTa大模型微调CoNLL03英文数据集
本项目基于XLM-RoBERTa大模型,使用CoNLL03英文数据集进行微调,可用于英文的命名实体识别等自然语言处理任务。
🚀 快速开始
使用以下代码开始使用该模型。你可以直接在命名实体识别(NER)的管道中使用此模型。
点击展开
>>> from transformers import AutoTokenizer, AutoModelForTokenClassification
>>> from transformers import pipeline
>>> tokenizer = AutoTokenizer.from_pretrained("xlm-roberta-large-finetuned-conll03-english")
>>> model = AutoModelForTokenClassification.from_pretrained("xlm-roberta-large-finetuned-conll03-english")
>>> classifier = pipeline("ner", model=model, tokenizer=tokenizer)
>>> classifier("Hello I'm Omar and I live in Zürich.")
[{'end': 14,
'entity': 'I-PER',
'index': 5,
'score': 0.9999175,
'start': 10,
'word': '▁Omar'},
{'end': 35,
'entity': 'I-LOC',
'index': 10,
'score': 0.9999906,
'start': 29,
'word': '▁Zürich'}]
✨ 主要特性
模型描述
XLM-RoBERTa模型由Alexis Conneau、Kartikay Khandelwal、Naman Goyal、Vishrav Chaudhary、Guillaume Wenzek、Francisco Guzmán、Edouard Grave、Myle Ott、Luke Zettlemoyer和Veselin Stoyanov在论文Unsupervised Cross-lingual Representation Learning at Scale中提出。它基于Facebook在2019年发布的RoBERTa模型,是一个大型多语言语言模型,在2.5TB经过过滤的CommonCrawl数据上进行训练。此模型是XLM-RoBERTa-large使用conll2003英文数据集进行微调后的版本。
用途
直接使用
该模型是一个语言模型,可用于标记分类,这是一种自然语言理解任务,为文本中的某些标记分配标签。
下游应用
潜在的下游用例包括命名实体识别(NER)和词性标注(PoS)。要了解更多关于标记分类和其他潜在下游用例的信息,请参阅Hugging Face的标记分类文档。
超出适用范围的使用
该模型不应被用于故意为人们创造敌对或排斥的环境。
🔧 技术细节
偏差、风险和局限性
⚠️ 重要提示
读者应该意识到,该模型生成的语言可能会让一些人感到不安或冒犯,并且可能会传播历史和当前的刻板印象。
大量研究已经探讨了语言模型的偏差和公平性问题(例如,见Sheng等人(2021)和Bender等人(2021))。在与该模型相关的任务背景下,Mishra等人(2020)探讨了英文NER系统中的社会偏差,发现现有的NER系统存在系统性偏差,即它们无法识别来自不同人口群体的命名实体(尽管该论文没有研究BERT)。例如,使用Mishra等人(2020)中的一个示例句子:
>>> from transformers import pipeline
>>> tokenizer = AutoTokenizer.from_pretrained("xlm-roberta-large-finetuned-conll03-english")
>>> model = AutoModelForTokenClassification.from_pretrained("xlm-roberta-large-finetuned-conll03-english")
>>> classifier = pipeline("ner", model=model, tokenizer=tokenizer)
>>> classifier("Alya told Jasmine that Andrew could pay with cash..")
[{'end': 2,
'entity': 'I-PER',
'index': 1,
'score': 0.9997861,
'start': 0,
'word': '▁Al'},
{'end': 4,
'entity': 'I-PER',
'index': 2,
'score': 0.9998591,
'start': 2,
'word': 'ya'},
{'end': 16,
'entity': 'I-PER',
'index': 4,
'score': 0.99995816,
'start': 10,
'word': '▁Jasmin'},
{'end': 17,
'entity': 'I-PER',
'index': 5,
'score': 0.9999584,
'start': 16,
'word': 'e'},
{'end': 29,
'entity': 'I-PER',
'index': 7,
'score': 0.99998057,
'start': 23,
'word': '▁Andrew'}]
建议
用户(包括直接用户和下游用户)应该了解该模型的风险、偏差和局限性。
训练
训练数据和训练过程的详细信息请参阅以下资源:
评估
评估细节请参阅相关论文。
环境影响
可以使用Lacoste等人(2019)中提出的机器学习影响计算器来估算碳排放。
属性 |
详情 |
硬件类型 |
500个32GB的Nvidia V100 GPU(来自相关论文) |
使用时长 |
需要更多信息 |
云服务提供商 |
需要更多信息 |
计算区域 |
需要更多信息 |
碳排放 |
需要更多信息 |
技术规格
更多详细信息请参阅相关论文。
📄 许可证
需要更多信息。
📚 详细文档
引用
BibTeX
@article{conneau2019unsupervised,
title={Unsupervised Cross-lingual Representation Learning at Scale},
author={Conneau, Alexis and Khandelwal, Kartikay and Goyal, Naman and Chaudhary, Vishrav and Wenzek, Guillaume and Guzm{\'a}n, Francisco and Grave, Edouard and Ott, Myle and Zettlemoyer, Luke and Stoyanov, Veselin},
journal={arXiv preprint arXiv:1911.02116},
year={2019}
}
APA
- Conneau, A., Khandelwal, K., Goyal, N., Chaudhary, V., Wenzek, G., Guzmán, F., ... & Stoyanov, V. (2019). Unsupervised cross-lingual representation learning at scale. arXiv preprint arXiv:1911.02116.
模型卡片作者
此模型卡片由Hugging Face团队编写。