Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,39 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- zh
|
4 |
+
tags:
|
5 |
+
- relation extraction
|
6 |
license: apache-2.0
|
7 |
+
datasets:
|
8 |
+
- DuIE
|
9 |
+
metrics:
|
10 |
+
- micro f1
|
11 |
---
|
12 |
+
|
13 |
+
# GPLinker关系抽取模型
|
14 |
+
|
15 |
+
## 模型介绍
|
16 |
+
|
17 |
+
+ 数据集:百度 `DUIE2.0` 信息抽取
|
18 |
+
|
19 |
+
+ 模型方法:[GPLinker:基于GlobalPointer的实体关系联合抽取](https://kexue.fm/archives/8888)
|
20 |
+
|
21 |
+
## 使用方法
|
22 |
+
|
23 |
+
```commandline
|
24 |
+
pip install litie
|
25 |
+
```
|
26 |
+
|
27 |
+
```python
|
28 |
+
from pprint import pprint
|
29 |
+
from litie.pipelines import EventExtractionPipeline
|
30 |
+
|
31 |
+
pipeline = EventExtractionPipeline("gplinker", model_name_or_path="xusenlin/duee-gplinker", model_type="bert")
|
32 |
+
text = "油服巨头哈里伯顿裁员650人 因美国油气开采活动放缓。"
|
33 |
+
pprint(pipeline(text))
|
34 |
+
|
35 |
+
# 输出
|
36 |
+
|
37 |
+
```
|
38 |
+
|
39 |
+
模型训练和推理的详细代码见 [litie](https://github.com/xusenlinzy/lit-ie)
|