🚀 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 許可證。