xusenlin commited on
Commit
d709c2e
·
1 Parent(s): 09aea6b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +47 -0
README.md CHANGED
@@ -1,3 +1,50 @@
1
  ---
 
 
 
 
 
2
  license: apache-2.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - zh
4
+ tags:
5
+ - infomation extraction
6
+ - uie
7
  license: apache-2.0
8
  ---
9
+
10
+ # UIE信息抽取模型(Pytorch)
11
+
12
+ ## 模型介绍
13
+
14
+ + [UIE(Universal Information Extraction)](https://arxiv.org/pdf/2203.12277.pdf):Yaojie Lu等人在ACL-2022中提出了通用信息抽取统一框架 `UIE`。
15
+
16
+ + 该框架实现了实体抽取、关系抽取、事件抽取、情感分析等任务的统一建模,并使得不同任务间具备良好的迁移和泛化能力。
17
+
18
+ + 为了方便大家使用 `UIE` 的强大能力,[PaddleNLP](https://github.com/PaddlePaddle/PaddleNLP)借鉴该论文的方法,基于 `ERNIE 3.0` 知识增强预训练模型,训练并开源了首个中文通用信息抽取模型 `UIE`。
19
+
20
+ + 该模型可以支持不限定行业领域和抽取目标的关键信息抽取,实现零样本快速冷启动,并具备优秀的小样本微调能力,快速适配特定的抽取目标。
21
+
22
+ ## 使用方法
23
+
24
+ ```commandline
25
+ pip install lightningnlp
26
+ ```
27
+
28
+ ```python
29
+ from pprint import pprint
30
+ from lightningnlp.task.uie import UIEPredictor
31
+
32
+ # 实体识别
33
+ schema = ['时间', '选手', '赛事名称']
34
+ uie = UIEPredictor("xusenlin/uie-base", schema=schema)
35
+ pprint(uie("2月8日上午北京冬奥会自由式滑雪女子大跳台决赛中中国选手谷爱凌以188.25分获得金牌!")) # Better print results using pprint
36
+
37
+ # 输出
38
+ [{'时间': [{'end': 6,
39
+ 'probability': 0.9857378532924486,
40
+ 'start': 0,
41
+ 'text': '2月8日上午'}],
42
+ '赛事名称': [{'end': 23,
43
+ 'probability': 0.8503089953268272,
44
+ 'start': 6,
45
+ 'text': '北京冬奥会自由式滑雪女子大跳台决赛'}],
46
+ '选手': [{'end': 31,
47
+ 'probability': 0.8981548639781138,
48
+ 'start': 28,
49
+ 'text': '谷爱凌'}]}]
50
+ ```