File size: 1,040 Bytes
b72bd18
1cc79ed
 
 
3773d14
b72bd18
1cc79ed
3773d14
1cc79ed
3773d14
b72bd18
1cc79ed
468b310
1cc79ed
 
 
468b310
1cc79ed
468b310
1cc79ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6e51e08
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1cc79ed
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
language:
- zh
tags:
- event extraction
license: apache-2.0
datasets:
- DuEE
metrics:
- f1
---

# GPLinker事件抽取模型

## 模型介绍

+ 数据集:百度 `DUEE` 信息抽取

+ 模型方法:[GPLinker:基于GlobalPointer的事件联合抽取](https://spaces.ac.cn/archives/8926)

## 使用方法

```commandline
pip install litie
```

```python
from pprint import pprint
from litie.pipelines import EventExtractionPipeline

pipeline = EventExtractionPipeline("gplinker", model_name_or_path="xusenlin/duee-gplinker", model_type="bert")
text = "油服巨头哈里伯顿裁员650人 因美国油气开采活动放缓。"
pprint(pipeline(text))

# 输出
[
  [
    {
      "event_type": "组织关系-裁员",
      "arguments": [
        {
          "role": "裁员人数",
          "argument": "650人"
        },
        {
          "role": "裁员方",
          "argument": "油服巨头哈里伯顿"
        }
      ]
    }
  ]
]
```

模型训练和推理的详细代码见 [litie](https://github.com/xusenlinzy/lit-ie)