🚀 gliner_medium_news-v2.1 模型卡片
本模型是对 GLiNER 进行微调后的版本,旨在提高其在广泛主题上的准确性,尤其在长上下文新闻实体提取方面表现出色。如下表所示,在 18 个基准数据集上,这些微调使基础 GLiNER 模型的零样本准确率最高提升了 7.5%。

基础数据集 AskNews-NER-v0 的设计目标是通过强制实现国家、语言、主题和时间的多样性,来丰富全球视角。用于微调此模型的所有数据均为合成生成。使用 WizardLM 13B v1.2 对开放网络新闻文章进行翻译和总结,使用 Llama3 70b instruct 进行实体提取。多样性和微调方法均在我们发表于 ArXiv 的论文中有所阐述。
🚀 快速开始
使用以下代码即可开始使用该模型:
from gliner import GLiNER
model = GLiNER.from_pretrained("EmergentMethods/gliner_medium_news-v2.1")
text = """
The Chihuahua State Public Security Secretariat (SSPE) arrested 35-year-old Salomón C. T. in Ciudad Juárez, found in possession of a stolen vehicle, a white GMC Yukon, which was reported stolen in the city's streets. The arrest was made by intelligence and police analysis personnel during an investigation in the border city. The arrest is related to a previous detention on February 6, which involved armed men in a private vehicle. The detainee and the vehicle were turned over to the Chihuahua State Attorney General's Office for further investigation into the case.
"""
labels = ["person", "location", "date", "event", "facility", "vehicle", "number", "organization"]
entities = model.predict_entities(text, labels)
for entity in entities:
print(entity["text"], "=>", entity["label"])
输出:
Chihuahua State Public Security Secretariat => organization
SSPE => organization
35-year-old => number
Salomón C. T. => person
Ciudad Juárez => location
GMC Yukon => vehicle
February 6 => date
Chihuahua State Attorney General's Office => organization
✨ 主要特性
- 对 GLiNER 进行微调,提高了在广泛主题上的准确性,特别是长上下文新闻实体提取。
- 在 18 个基准数据集上,零样本准确率最高提升 7.5%。
- 基础数据集具有国家、语言、主题和时间的多样性。
- 模型紧凑,适用于高吞吐量的生产场景。
📦 安装指南
暂未提供相关安装步骤。
💻 使用示例
基础用法
from gliner import GLiNER
model = GLiNER.from_pretrained("EmergentMethods/gliner_medium_news-v2.1")
text = """
The Chihuahua State Public Security Secretariat (SSPE) arrested 35-year-old Salomón C. T. in Ciudad Juárez, found in possession of a stolen vehicle, a white GMC Yukon, which was reported stolen in the city's streets. The arrest was made by intelligence and police analysis personnel during an investigation in the border city. The arrest is related to a previous detention on February 6, which involved armed men in a private vehicle. The detainee and the vehicle were turned over to the Chihuahua State Attorney General's Office for further investigation into the case.
"""
labels = ["person", "location", "date", "event", "facility", "vehicle", "number", "organization"]
entities = model.predict_entities(text, labels)
for entity in entities:
print(entity["text"], "=>", entity["label"])
高级用法
暂未提供高级用法示例。
📚 详细文档
模型描述
此新闻微调模型的合成数据来自 AskNews API。我们在国家、语言、主题和时间上实现了多样性。
国家分布:

实体类型:

主题分布:

模型来源
使用方式
直接使用
顾名思义,该模型旨在进行通用实体提取。尽管我们使用新闻数据对其进行微调,但它在 18 个基准数据集上的准确率最高提升了 7.5%。这意味着广泛且多样化的基础数据集有助于它识别和提取更多类型的实体。
该模型非常紧凑,可用于高吞吐量的生产场景。这也是我们将其许可为 Apache 2.0 的另一个原因。目前,AskNews 正在其系统中使用此微调模型进行实体提取。
偏差、风险和局限性
尽管数据集的目标是减少偏差并提高多样性,但它仍然偏向于西方语言和国家。这一局限性源于 Llama2 在翻译和总结生成方面的能力。此外,由于使用 Llama2 对开放网络文章进行总结,Llama2 训练数据中的任何偏差也会存在于该数据集中。同样,由于使用 Llama3 从总结中提取实体,Llama3 中存在的任何偏差也会出现在当前数据集中。

模型入门指南
使用以下代码即可开始使用该模型。
训练详情
训练数据集为 AskNews-NER-v0。
其他训练详情可在 配套论文 中找到。
环境影响
- 硬件类型:1xA4500
- 使用时长:10 小时
- 碳排放:0.6 千克(根据 机器学习影响计算器)
引用信息
BibTeX:待添加
APA:待添加
模型作者
Elin Törnquist,Emergent Methods,elin at emergentmethods.ai
Robert Caulk,Emergent Methods,rob at emergentmethods.ai
模型联系方式
Elin Törnquist,Emergent Methods,elin at emergentmethods.ai
Robert Caulk,Emergent Methods,rob at emergentmethods.ai
📄 许可证
本模型使用 Apache 2.0 许可证。