Giter VIP home page Giter VIP logo

git's Introduction

Document-level Event Extraction via Heterogeneous Graph-based Interaction Model with a Tracker

Source code for ACL-IJCNLP 2021 Long paper: Document-level Event Extraction via Heterogeneous Graph-based Interaction Model with a Tracker.

Our code is based on Doc2EDAG.

0. Introduction

Document-level event extraction aims to extract events within a document. Different from sentence-level event extraction, the arguments of an event record may scatter across sentences, which requires a comprehensive understanding of the cross-sentence context. Besides, a document may express several correlated events simultaneously, and recognizing the interdependency among them is fundamental to successful extraction. To tackle the aforementioned two challenges, We propose a novel heterogeneous Graph-based Interaction Model with a Tracker (GIT). A graph-based interaction network is introduced to capture the global context for the scattered event arguments across sentences with different heterogeneous edges. We also decode event records with a Tracker module, which tracks the extracted event records, so that the interdependency among events is taken into consideration. Our approach delivers better results over the state-of-the-art methods, especially in cross-sentence events and multiple events scenarios.

  • Architecture model overview

  • Overall Results

1. Package Description

GIT/
├─ dee/
    ├── __init__.py
    ├── base_task.py
    ├── dee_task.py
    ├── ner_task.py
    ├── dee_helper.py: data features constrcution and evaluation utils
    ├── dee_metric.py: data evaluation utils
    ├── config.py: process command arguments
    ├── dee_model.py: GIT model
    ├── ner_model.py
    ├── transformer.py: transformer module
    ├── utils.py: utils
├─ run_dee_task.py: the main entry
├─ train_multi.sh
├─ run_train.sh: script for training (including evaluation)
├─ run_eval.sh: script for evaluation
├─ Exps/: experiment outputs
├─ Data.zip
├─ Data: unzip Data.zip
├─ LICENSE
├─ README.md

2. Environments

  • python (3.6.9)
  • cuda (11.1)
  • Ubuntu-18.0.4 (5.4.0-73-generic)

3. Dependencies

  • numpy (1.19.5)
  • torch (1.8.1+cu111)
  • pytorch-pretrained-bert (0.4.0)
  • dgl-cu111 (0.6.1)
  • tensorboardX (2.2)

PS: The environments and dependencies listed here is different from what we use in our paper, so the results may be a bit different.

4. Preparation

  • Unzip Data.zip and you can get an Data folder, where the training/dev/test data locate.

5. Training

>> bash run_train.sh

6. Evaluation

>> bash run_eval.sh

(The evaluation is also conducted after the training)

7. License

This project is licensed under the MIT License - see the LICENSE file for details.

8. Citation

If you use this work or code, please kindly cite the following paper:

@inproceedings{xu-etal-2021-git,
    title = "Document-level Event Extraction via Heterogeneous Graph-based Interaction Model with a Tracker",
    author = "Runxin Xu  and
      Tianyu Liu  and
      Lei Li and
      Baobao Chang",
    booktitle = "The Joint Conference of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (ACL-IJCNLP 2021)",
    year = "2021",
    publisher = "Association for Computational Linguistics",
}

git's People

Contributors

runxinxu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

git's Issues

您好,我想问一下gcn输出的计算

您好,我正在阅读您的代码和文章,有一些看不懂,希望您帮我解惑
截屏2022-03-30 上午10 44 55
请问这个公式怎么理解呢,
还有
截屏2022-03-30 上午10 47 01
是把L层拼接起来计算这个节点的最后一层embedding嘛

a query about role embedding

Hi, when I read the paper, I notice the words "role embedding" as follows. I read your codes carefully, but I still can't understand how to get it. Is it embedded by role_idx mapping? Moreover, I'd appreciate it if you could tell me where it is implemented in the code. Thanks!

image

Why does NER module in GIT use the encoder-decoder transformer rather than the encoder part only(like BERT used in Doc2EDAG)

Thanks for the excellent paper. But I have a question for the experiment setting:
As a sequence labeling task, we always use transformer encoder(like BERT) to solve the NER problem, for example, the author in Doc2EDAG use BERT as the first step backbone. However, in the paper, it is said that the vanilla transformer(encoder-decoder structure) is used in NER module, which confuse me a lot. I am wondering wher the decoder part of transformer is used for? Thanks.
Screen Shot 2021-08-11 at 5 52 07 PM

A problem occurred at runtime

subprocess.CalledProcessError: Command '['/opt/anaconda3/envs/Doc2edag/bin/python', '-u', 'run_dee_task.py', '--local_rank=1', '--resume_latest_cpt', 'True', '--save_cpt_flag', 'True', '--data_dir', './Data', '--exp_dir', './Exps', '--task_name', 'try', '--num_train_epochs', '50', '--train_batch_size', '64', '--gradient_accumulation_steps', '8', '--eval_batch_size', '2', '--cpt_file_name', 'GIT']' returned non-zero exit status 1.

May I ask why this problem is? In addition, I have successfully reproduced Doc2EDAG, but the extraction results of event parameters are all numbers and cannot be visualized. How do you solve this problem

结果文件如何解析成数据集的样式

您好,在尝试用您的模型跑出结果后,得到如:./Exps/try/Output/dee_eval.test.pred_span.GIT.5.pkl的结果文件,其中一条数据是:
'''
(0, [0, 0, 1, 1, 0], [None, None, [[None, None, None, None, None, None]], [[(3330, 1290), None, None, None, None, None]], None], DocSpanInfo(span_token_tup_list=[(121, 121, 121, 127, 121, 126), (3943, 3862, 5500, 819), (4507,), (3330, 1290)], span_dranges_list=[[(0, 5, 11)], [(0, 16, 20)], [(9, 0, 1)], [(12, 10, 12), (13, 8, 10)]], span_mention_range_list=[(0, 1), (1, 2), (2, 3), (3, 5)], mention_drange_list=[(0, 5, 11), (0, 16, 20), (9, 0, 1), (12, 10, 12), (13, 8, 10)], mention_type_list=[1, 3, 5, 7, 7], event_dag_info=[None, None, None, None, [{(): {None}}, {(None,): {None}}, {(None, None): {None}}, {(None, None, None): {None}}, {(None, None, None, None): {None}}, {(None, None, None, None, None): {None}}, {(None, None, None, None, None, None): {None}}, {(None, None, None, None, None, None, None): {None}}, {(None, None, None, None, None, None, None, None): {None}}]], missed_sent_idx_list=[1, 4, 7, 8, 9, 10, 12, 13, 14, 16, 19]), [None, None, [(None, None, None, None, None, None)], [(3, None, None, None, None, None)], None])
'''
请问如何对上述数据进行解析,得到数据集中
'''
"recguid_eventname_eventdict_list": [
[
0,
"EquityPledge",
{
"Pledger": "李华青",
"PledgedShares": "1188600股",
"Pledgee": "海通证券股份有限公司",
"TotalHoldingShares": "22619999股",
"TotalHoldingRatio": "6.41%",
"TotalPledgedShares": "18200000股",
"StartDate": "2018年9月6日",
"EndDate": null,
"ReleasedDate": null
}
],
[
1,
"EquityPledge",
{
"Pledger": "李华青",
"PledgedShares": "12151000股",
"Pledgee": "海通证券股份有限公司",
"TotalHoldingShares": null,
"TotalHoldingRatio": "6.41%",
"TotalPledgedShares": "12151000股",
"StartDate": "2017年12月7日",
"EndDate": null,
"ReleasedDate": null
}
]
]
'''
的结果?
是否有结果解析的相关代码方便提供?
谢谢!

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.