Giter Site home page Giter Site logo

trimf's Introduction

README

Code for TriMF: "A Trigger-Sense Memory Flow Framework for Joint Entity and Relation Extraction". accepted at WWW 2021. For details of the model and experiments, please see our paper.

Setup

Requirements

pip install -r requirements.txt

Datasets

We use the DyGIE and SpERT scripts to pre-process the datasets, see and follow their README: DyGIE and SpERT.

Dataset format:

[
    {
        "tokens": ["allan", "chernoff", "live", "from", "the", "new", "york", "stock", "exchange", "with", "more", "."], 
        "entities": [{"type": "PER", "start": 0, "end": 2}, {"type": "FAC", "start": 5, "end": 9}], 
        "relations": [{"type": "PHYS", "head": 0, "tail": 1}], "orig_id": "CNN_ENG_20030530_130025.12-4", 
        "dependency": [{"tail": 0, "head": 1, "type": "nsubj"}, {"tail": 1, "head": 1, "type": "ROOT"}, {"tail": 2, "head": 1, "type": "advmod"}, {"tail": 3, "head": 2, "type": "prep"}, {"tail": 4, "head": 8, "type": "det"}, {"tail": 5, "head": 8, "type": "amod"}, {"tail": 6, "head": 7, "type": "compound"}, {"tail": 7, "head": 8, "type": "compound"}, {"tail": 8, "head": 3, "type": "pobj"}, {"tail": 9, "head": 1, "type": "prep"}, {"tail": 10, "head": 9, "type": "pobj"}, {"tail": 11, "head": 1, "type": "punct"}], 
        "ltokens": ["aol", "time", "warner", "and", "microsoft", "are", "burying", "the", "hatchet", "."], 
        "rtokens": ["bring", "us", "up", "to", "speed", "."]
    }
]

Examples

Train:

After pre-processing the data, save the datasets under data, and run:

python trimf.py train --config configs/example.conf

Evaluate:

Download checkpoints from this link, and save in the data folder, and run:

python trimf.py eval --config configs/batch_eval.conf

Citation

If you have any questions related to the code or the paper, feel free to email [email protected].

@inproceedings{10.1145/3442381.3449895,
author = {Shen, Yongliang and Ma, Xinyin and Tang, Yechun and Lu, Weiming},
title = {A Trigger-Sense Memory Flow Framework for Joint Entity and Relation Extraction},
year = {2021},
isbn = {9781450383127},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3442381.3449895},
doi = {10.1145/3442381.3449895},
booktitle = {Proceedings of the Web Conference 2021},
pages = {1704–1715},
numpages = {12},
location = {Ljubljana, Slovenia},
series = {WWW '21}
}

Acknowledgement

DyGIE from https://github.com/luanyi/DyGIE

SpERT from https://github.com/markus-eberts/spert.git

SciBERT from https://github.com/allenai/scibert

trimf's People

Contributors

tricktreat 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

Watchers

 avatar  avatar

trimf's Issues

datasets 和你的输入设置无法一致

我按照你的数据处理要求根据两篇论文的数据方法处理了数据,但是仍然会出现不匹配的问题。请问是否可以提供可以运行的数据集,很想复现你的工作,还望能给予解惑

datasets

where are the datasets? Can you provide it?

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.