GithubHelp home page GithubHelp logo

uniie's Introduction

UniIE模型使用说明

一、文章介绍

二、概要

  • 功能: 实体抽取、关系抽取、事件抽取
  • 模型: UniIE
  • 分支介绍
.
├── master                        # 项目主分支, 版本较为稳定

三、目录结构

.
├── data/                         # 数据路径
├── config/                       # 配置文件
├── nets/                         # 模型/功能代码 (基础)
├── utils/                        # 功能函数
├── run_train.py                  # Python 训练文件入口
├── run_predict.py                # Python 预测文件入口
├── requirements.txt              # Python 依赖包文件
├── README.md                     # 说明文件

四、数据说明

文件格式

  • UIE的标注格式: XXX_uie.json 文件
  • duee的标注格式: XXX_standard.json 文件

数据样例

  • 实体识别任务(ner): data/ner_sample
  • 关系抽取任务(ie): data/ie_sample
  • 事件抽取任务(ee): data/ee_sample

注: 目前的 UniIE 训练/预测 仅支持standard后缀的文件格式输入

五、模型训练

  • UniIE入口文件: run_train.py
  • 配置文件: config文件夹下
  • 启动命令: python run_train.py --config_file config/config_uniie_sample.ini

六、推理预测

  • UniIE入口文件: run_predict.py
  • 配置文件: config文件夹下
  • 启动命令: python run_predict.py --config_file config/config_uniie_sample.ini

七、任务微调模型

model path passcode
CCKS2022微调模型(base、large) https://pan.baidu.com/s/1E5_eZ03Ddzs7GPWAnH6q-Q?pwd=2u2p 2u2p
title2event微调模型(base、large) https://pan.baidu.com/s/13A3-PQxe4tLzDt1qRZlYgA?pwd=e67l e67l

注:

  1. 模型保存时没有去掉分布式训练的.module,如果需要直接在模型初始化加载,需要手动去掉.module后再重新加载
  2. 训练、预测 均默认随机初始化,然后 加载该模型(去掉.module)

八、模型评估效果

1、CCKS2022 通用信息抽取常规赛 (链接)

线上得分 人生信息 机构信息 体育竞赛 灾害意外 影视情感 金融信息 金融舆情 金融监管 医患对话 流调信息
base 57.11 36.76 39.25 67.47 68.98 50.26 77.45 74.97 77.76 13.52 64.65
large 60.14 37.71 40 70.19 71.19 52.76 79.12 78.01 81.84 18.05 72.49
base-en 10.89922 40.734 39.559 0 0 0 0 0 0 28.7 0

注:

  • "base"与"large"在提交时均未纳入实体抽取的结果,所以分数会偏低, 影响的评测任务有"人生信息"、"机构信息"、"医患对话";"base-en"代表base版本的实体抽取分数
  • schema类型负采样时,如果存在多个相同的关系不同类型的subejct和object,最好将关系类型加入数字等进行区分,保持训练等一致,否则,解码阶段需要一些特殊处理
  • 全部任务仅使用一个模型训练推理,推理阶段需要遍历各个数据集的schema类型,速度较慢,可以使用其他抽取、schema分类模型提供schema类型,降低推理成本
  • 全部数据集(抽取+实体) 2080Ti large版本 需要20小时左右
  • 少样本数据集 可以尝试数据duplicate, ccks22比赛以及通用电力抽取比赛均dup=20

2、Title2Event 数据集

model metric precision recall f1 params
UniIE triple ** 53.27** 54.43 53.84 330M
UniIE triple 51.75 52.26 52.01 110M
ST-Seq2SeqMRC triple 49.8 50.1 49.9 330M
ST-SpanMRC triple 44.5 44.8 44.7 110M
SeqTag triple 41.1 41.3 41.2 110M
UniIE argument 75.77 77.26 76.51 330M
UniIE argument 74.85 75.55 75.20 110M
ST-Seq2SeqMRC argument 57.9 58.6 58.2 330M
ST-SpanMRC argument 60.1 54.9 57.4 110M
SeqTag argument 50.8 51.2 51.0 110M
UniIE trigger 72.91 74.452 73.67 330M
UniIE trigger 72.01 72.64 72.32 110M
ST-Seq2SeqMRC trigger - - - 330M
ST-SpanMRC trigger - - - 110M
SeqTag trigger 69.5 69.9 69.7 110M

注:

  • title2event 的数据集 与 通用事件属性抽取数据集 类似
  • 主体、客体、动作 均存在 不连续 即 由原文中的多个连续片段(整体不连续)按照位置拼接而成
  • 本方案基于最大匹配将 原文中不能严格匹配的结果 分割为 原文中的片段即一个要素类型存在多个要素值
  • 推理后,根据位置进行合并再进行评估
  • 其他方法的结果均从原文copy

uniie's People

Contributors

boy56 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.