模型概述
模型特點
模型能力
使用案例
🚀 雅意IE大模型/YAYI UIE
雅意信息抽取統一大模型(YAYI-UIE)在百萬級高質量信息抽取數據上微調,統一訓練多種信息抽取任務,可在多場景下實現結構化抽取。開源此模型旨在推動中文預訓練大模型開源社區發展,共建雅意大模型生態。
🚀 快速開始
如果您想了解更多關於 YAYI UIE 模型的細節,建議您參閱 GitHub 倉庫。更多技術細節,歡迎閱讀我們的技術報告🔥YAYI-UIE: A Chat-Enhanced Instruction Tuning Framework for Universal Information Extraction。

[[🤗Github Repo](https://github.com/wenge-research)] [[🔗網頁端](https://yayi.wenge.com)]
✨ 主要特性
雅意信息抽取統一大模型 (YAYI-UIE)在百萬級人工構造的高質量信息抽取數據上進行指令微調,統一訓練信息抽取任務包括命名實體識別(NER),關係抽取(RE)和事件抽取(EE),實現通用、安全、金融、生物、醫療、商業、個人、車輛、電影、工業、餐廳、科學等場景下結構化抽取。
💻 使用示例
基礎用法
>>> import torch
>>> from transformers import AutoModelForCausalLM, AutoTokenizer
>>> from transformers.generation.utils import GenerationConfig
>>> tokenizer = AutoTokenizer.from_pretrained("wenge-research/yayi-uie", use_fast=False, trust_remote_code=True)
>>> model = AutoModelForCausalLM.from_pretrained("wenge-research/yayi-uie", device_map="auto", torch_dtype=torch.bfloat16, trust_remote_code=True)
>>> generation_config = GenerationConfig.from_pretrained("wenge-research/yayi-uie")
>>> prompt = "文本:氧化鋯陶瓷以其卓越的物理和化學特性在多個行業中發揮著關鍵作用。這種材料因其高強度、高硬度和優異的耐磨性,廣泛應用於醫療器械、切削工具、磨具以及高端珠寶製品。在製造這種高性能陶瓷時,必須遵循嚴格的製造標準,以確保其最終性能。這些標準涵蓋了從原材料選擇到成品加工的全過程,保障產品的一致性和可靠性。氧化鋯的製造過程通常包括粉末合成、成型、燒結和後處理等步驟。原材料通常是高純度的氧化鋯粉末,通過精確控制的燒結工藝,這些粉末被轉化成具有特定微觀結構的堅硬陶瓷。這種獨特的微觀結構賦予氧化鋯陶瓷其顯著的抗斷裂韌性和耐腐蝕性。此外,氧化鋯陶瓷的熱膨脹係數與鐵類似,使其在高溫應用中展現出良好的熱穩定性。因此,氧化鋯陶瓷不僅在工業領域,也在日常生活中的應用日益增多,成為現代材料科學中的一個重要分支。\n抽取文本中可能存在的實體,並以json{製造品名稱/製造過程/製造材料/工藝參數/應用/生物醫學/工程特性:[實體]}格式輸出。"
>>> # "<reserved_13>" is a reserved token for human, "<reserved_14>" is a reserved token for assistant
>>> prompt = "<reserved_13>" + prompt + "<reserved_14>"
>>> inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
>>> response = model.generate(**inputs, max_new_tokens=512, temperature=0)
>>> print(tokenizer.decode(response[0],skip_special_tokens=True))
指令樣例
1. 實體抽取任務/NER tasks
文本:xx
【實體抽取】抽取文本中可能存在的實體,並以json{人物/機構/地點:[實體]}格式輸出。
Text:
From the given text, extract all the entities and types. Please format the answer in json {person/organization/location:[entities]}.
2. 關係抽取任務/RE tasks
文本:xx
【關係抽取】已知關係列表是[注資,擁有,糾紛,自己,增持,重組,買資,簽約,持股,交易]。根據關係列表抽取關係三元組,按照json[{'relation':'', 'head':'', 'tail':''}, ]的格式輸出。
Text:
From the given text, extract the possible head entities (subjects) and tail entities (objects) and give the corresponding relation triples.The relations are [country of administrative divisions,place of birth,location contains]. Output the result in json[{'relation':'', 'head':'', 'tail':''}, ].
文本:xx
抽取文本中可能存在的關係,並以json[{'關係':'會見/出席', '頭實體':'', '尾實體':''}, ]格式輸出。
3. 事件抽取任務/EE tasks
文本:xx
已知論元角色列表是[質押方,披露時間,質權方,質押物,質押股票/股份數量,事件時間,質押物所屬公司,質押物佔總股比,質押物佔持股比],請根據論元角色列表從給定的輸入中抽取可能的論元,以json{角色:論元,}格式輸出。
Text:
Given the text and the role list [seller, place, beneficiary, buyer], identify event arguments and roles, provide your answer in the format of json{role:name}.
📚 詳細文檔
模型zero-shot評測
1. NER任務
AI,Literature,Music,Politics,Science為英文數據集,boson,clue,weibo為中文數據集。
Model | AI | Literature | Music | Politics | Science | EN Average | boson | clue | ZH Average | |
---|---|---|---|---|---|---|---|---|---|---|
davinci | 2.97 | 9.87 | 13.83 | 18.42 | 10.04 | 11.03 | - | - | - | 31.09 |
ChatGPT 3.5 | 54.4 | 54.07 | 61.24 | 59.12 | 63 | 58.37 | 38.53 | 25.44 | 29.3 | |
UIE | 31.14 | 38.97 | 33.91 | 46.28 | 41.56 | 38.37 | 40.64 | 34.91 | 40.79 | 38.78 |
USM | 28.18 | 56 | 44.93 | 36.1 | 44.09 | 41.86 | - | - | - | - |
InstructUIE | 49 | 47.21 | 53.16 | 48.15 | 49.3 | 49.36 | - | - | - | - |
DeepKE-LLM | 13.76 | 20.18 | 14.78 | 33.86 | 9.19 | 18.35 | 25.96 | 4.44 | 25.2 | 18.53 |
YAYI-UIE | 52.4 | 45.99 | 51.2 | 51.82 | 50.53 | 50.39 | 49.25 | 36.46 | 36.78 | 40.83 |
2. RE任務
FewRe,Wiki-ZSL為英文數據集, SKE 2020,COAE2016,IPRE為中文數據集。
Model | FewRel | Wiki-ZSL | EN Average | SKE 2020 | COAE2016 | IPRE | ZH Average |
---|---|---|---|---|---|---|---|
ChatGPT 3.5 | 9.96 | 13.14 | 11.55 24.47 | 19.31 | 6.73 | 16.84 | |
ZETT(T5-small) | 30.53 | 31.74 | 31.14 | - | - | - | - |
ZETT(T5-base) | 33.71 | 31.17 | 32.44 | - | - | - | - |
InstructUIE | 39.55 | 35.2 | 37.38 | - | - | - | - |
DeepKE-LLM | 17.46 | 15.33 | 16.40 | 0.4 | 6.56 | 9.75 | 5.57 |
YAYI-UIE | 36.09 | 41.07 | 38.58 | 70.8 | 19.97 | 22.97 | 37.91 |
3. EE任務
commodity news為英文數據集,FewFC,ccf_law為中文數據集。
EET(事件類型判別 Event Type Extraction)
模型 | commodity news | FewFC | ccf_law | ZH Average |
---|---|---|---|---|
ChatGPT 3.5 | 1.41 | 16.15 | 0 | 8.08 |
UIE | - | 50.23 | 2.16 | 26.20 |
InstructUIE | 23.26 | - | - | - |
YAYI-UIE | 12.45 | 81.28 | 12.87 | 47.08 |
EEA(事件論元抽取 Event Arguments Extraction)
模型 | commodity news | FewFC | ccf_law | ZH Average |
---|---|---|---|---|
ChatGPT 3.5 | 8.6 | 44.4 | 44.57 | 44.49 |
UIE | - | 43.02 | 60.85 | 51.94 |
InstructUIE | 21.78 | - | - | - |
YAYI-UIE | 19.74 | 63.06 | 59.42 | 61.24 |
🔧 技術細節
侷限性
基於當前數據和基礎模型訓練得到的SFT模型,在效果上仍存在以下問題:
- 抽取的信息可能會產生違背事實的錯誤回答。
- 對於具備危害性的指令無法很好的鑑別,可能會產生危害性言論。
- 在一些涉及段落級長文本的場景下模型的抽取能力仍有待提高。
開源協議
本項目中的代碼和數據依照 Apache-2.0 協議開源,社區使用YAYI UIE模型或其衍生品請遵循Baichuan2的社區協議和商用協議。
免責聲明
基於以上模型侷限性,我們要求開發者僅將我們開源的代碼、數據、模型及後續用此項目生成的衍生物用於研究目的,不得用於商業用途,以及其他會對社會帶來危害的用途。請謹慎鑑別和使用雅意大模型生成的內容,請勿將生成的有害內容傳播至互聯網。若產生不良後果,由傳播者自負。 本項目僅可應用於研究目的,項目開發者不承擔任何因使用本項目(包含但不限於數據、模型、代碼等)導致的危害或損失。詳細請參考免責聲明。
📄 許可證
@article{YAYI-UIE,
author = {Xinglin Xiao, Yijie Wang, Nan Xu, Yuqi Wang, Hanxuan Yang, Minzheng Wang, Yin Luo, Lei Wang, Wenji Mao, Dajun Zeng}},
title = {YAYI-UIE: A Chat-Enhanced Instruction Tuning Framework for Universal Information Extraction},
journal = {arXiv preprint arXiv:2312.15548},
url = {https://arxiv.org/abs/2312.15548},
year = {2023}
}
⚠️ 重要提示
基於當前數據和基礎模型訓練得到的SFT模型,抽取的信息可能會產生違背事實的錯誤回答;對於具備危害性的指令無法很好的鑑別,可能會產生危害性言論;在一些涉及段落級長文本的場景下模型的抽取能力仍有待提高。
💡 使用建議
開發者僅將開源的代碼、數據、模型及後續用此項目生成的衍生物用於研究目的,不得用於商業用途,以及其他會對社會帶來危害的用途。請謹慎鑑別和使用雅意大模型生成的內容,請勿將生成的有害內容傳播至互聯網。



