All Projects → weizhepei → Casrel

weizhepei / Casrel

Licence: mit
A Novel Cascade Binary Tagging Framework for Relational Triple Extraction. Accepted by ACL 2020.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Casrel

knowledge-graph-nlp-in-action
从模型训练到部署,实战知识图谱(Knowledge Graph)&自然语言处理(NLP)。涉及 Tensorflow, Bert+Bi-LSTM+CRF,Neo4j等 涵盖 Named Entity Recognition,Text Classify,Information Extraction,Relation Extraction 等任务。
Stars: ✭ 58 (-82.37%)
Mutual labels:  information-extraction, knowledge-graph, relation-extraction
Knowledge Graph Wander
A collection of papers, codes, projects, tutorials ... for Knowledge Graph and other NLP methods
Stars: ✭ 26 (-92.1%)
Mutual labels:  information-extraction, knowledge-graph
news-graph
Key information extraction from text and graph visualization
Stars: ✭ 83 (-74.77%)
Mutual labels:  information-extraction, knowledge-graph
Gcn Over Pruned Trees
Graph Convolution over Pruned Dependency Trees Improves Relation Extraction (authors' PyTorch implementation)
Stars: ✭ 312 (-5.17%)
Mutual labels:  relation-extraction, information-extraction
DocuNet
Code and dataset for the IJCAI 2021 paper "Document-level Relation Extraction as Semantic Segmentation".
Stars: ✭ 84 (-74.47%)
Mutual labels:  information-extraction, relation-extraction
CogIE
CogIE: An Information Extraction Toolkit for Bridging Text and CogNet. ACL 2021
Stars: ✭ 47 (-85.71%)
Mutual labels:  information-extraction, relation-extraction
Multiple Relations Extraction Only Look Once
Multiple-Relations-Extraction-Only-Look-Once. Just look at the sentence once and extract the multiple pairs of entities and their corresponding relations. 端到端联合多关系抽取模型,可用于 http://lic2019.ccf.org.cn/kg 信息抽取。
Stars: ✭ 269 (-18.24%)
Mutual labels:  relation-extraction, information-extraction
Bert Attributeextraction
USING BERT FOR Attribute Extraction in KnowledgeGraph. fine-tuning and feature extraction. 使用基于bert的微调和特征提取方法来进行知识图谱百度百科人物词条属性抽取。
Stars: ✭ 224 (-31.91%)
Mutual labels:  knowledge-graph, relation-extraction
KGPool
[ACL 2021] KGPool: Dynamic Knowledge Graph Context Selection for Relation Extraction
Stars: ✭ 33 (-89.97%)
Mutual labels:  knowledge-graph, relation-extraction
IE Paper Notes
Paper notes for Information Extraction, including Relation Extraction (RE), Named Entity Recognition (NER), Entity Linking (EL), Event Extraction (EE), Named Entity Disambiguation (NED).
Stars: ✭ 14 (-95.74%)
Mutual labels:  information-extraction, relation-extraction
PSPE
Pretrained Span and span Pair Encoder, code for "Pre-training Entity Relation Encoder with Intra-span and Inter-spanInformation.", EMNLP2020. It is based on our NERE toolkit (https://github.com/Receiling/NERE).
Stars: ✭ 17 (-94.83%)
Mutual labels:  information-extraction, relation-extraction
ReQuest
Indirect Supervision for Relation Extraction Using Question-Answer Pairs (WSDM'18)
Stars: ✭ 26 (-92.1%)
Mutual labels:  information-extraction, relation-extraction
lima
The Libre Multilingual Analyzer, a Natural Language Processing (NLP) C++ toolkit.
Stars: ✭ 75 (-77.2%)
Mutual labels:  information-extraction, relation-extraction
Tacred Relation
PyTorch implementation of the position-aware attention model for relation extraction
Stars: ✭ 271 (-17.63%)
Mutual labels:  relation-extraction, information-extraction
Agriculture knowledgegraph
农业知识图谱(AgriKG):农业领域的信息检索,命名实体识别,关系抽取,智能问答,辅助决策
Stars: ✭ 2,957 (+798.78%)
Mutual labels:  knowledge-graph, relation-extraction
Shukongdashi
使用知识图谱,自然语言处理,卷积神经网络等技术,基于python语言,设计了一个数控领域故障诊断专家系统
Stars: ✭ 109 (-66.87%)
Mutual labels:  knowledge-graph, relation-extraction
Knowledgegraph
This repository for Web Crawling, Information Extraction, and Knowledge Graph build up.
Stars: ✭ 28 (-91.49%)
Mutual labels:  knowledge-graph, information-extraction
Bbw
Semantic annotator: Matching CSV to a Wikibase instance (e.g., Wikidata) via Meta-lookup
Stars: ✭ 42 (-87.23%)
Mutual labels:  knowledge-graph, relation-extraction
InformationExtractionSystem
Information Extraction System can perform NLP tasks like Named Entity Recognition, Sentence Simplification, Relation Extraction etc.
Stars: ✭ 27 (-91.79%)
Mutual labels:  information-extraction, relation-extraction
Oie Resources
A curated list of Open Information Extraction (OIE) resources: papers, code, data, etc.
Stars: ✭ 283 (-13.98%)
Mutual labels:  relation-extraction, information-extraction

A Novel Cascade Binary Tagging Framework for Relational Triple Extraction

This repository contains the source code and dataset for the paper: A Novel Cascade Binary Tagging Framework for Relational Triple Extraction. Zhepei Wei, Jianlin Su, Yue Wang, Yuan Tian and Yi Chang. ACL 2020. [pdf]

Overview

At the core of the proposed CasRel framework is the fresh perspective that instead of treating relations as discrete labels on entity pairs, we actually model the relations as functions that map subjects to objects. More precisely, instead of learning relation classifiers f(s,o) -> r, we learn relation-specific taggers f_{r}(s) -> o, each of which recognizes the possible object(s) of a given subject under a specific relation. Under this framework, relational triple extraction is a two-step process: first we identify all possible subjects in a sentence; then for each subject, we apply relation-specific taggers to simultaneously identify all possible relations and the corresponding objects.

overview

Requirements

This repo was tested on Python 3.7 and Keras 2.2.4. The main requirements are:

  • tqdm
  • codecs
  • keras-bert = 0.80.0
  • tensorflow-gpu = 1.13.1

Datasets

Usage

  1. Get pre-trained BERT model for Keras

    Download Google's pre-trained BERT model (BERT-Base, Cased). Then decompress it under pretrained_bert_models/. More pre-trained models are available here.

  2. Build dataset in the form of triples

    Take the NYT dataset for example:

    a) Switch to the corresponding directory and download the dataset

    cd CasRel/data/NYT/raw_NYT
    

    b) Follow the instructions at the same directory, and just run

    python generate.py
    

    c) Finally, build dataset in the form of triples

    cd CasRel/data/NYT
    python build_data.py
    

    This will convert the raw numerical dataset into a proper format for our model and generate train.json, test.json and val.json(if not provided in the raw dataset, it will randomly sample 5% or 10% data from the train.json or test.json to create val.json as in line with previous works). Then split the test dataset by type and num for in-depth analysis on different scenarios of overlapping triples.

  3. Specify the experimental settings

    By default, we use the following settings in run.py:

    {
        "bert_model": "cased_L-12_H-768_A-12",
        "max_len": 100,
        "learning_rate": 1e-5,
        "batch_size": 6,
        "epoch_num": 100,
    }
    
  4. Train and select the model

    Specify the running mode and dataset at the command line

    python run.py ---train=True --dataset=NYT
    

    The model weights that lead to the best performance on validation set will be stored in saved_weights/DATASET/.

  5. Evaluate on the test set

    Specify the test dataset at the command line

    python run.py --dataset=NYT
    

    The extracted result will be saved in results/DATASET/ with the following format:

    {
        "text": "Tim Brooke-Taylor was the star of Bananaman , an STV series first aired on 10/03/1983 and created by Steve Bright .",
        "triple_list_gold": [
            {
                "subject": "Bananaman",
                "relation": "starring",
                "object": "Tim Brooke-Taylor"
            },
            {
                "subject": "Bananaman",
                "relation": "creator",
                "object": "Steve Bright"
            }
        ],
        "triple_list_pred": [
            {
                "subject": "Bananaman",
                "relation": "starring",
                "object": "Tim Brooke-Taylor"
            },
            {
                "subject": "Bananaman",
                "relation": "creator",
                "object": "Steve Bright"
            }
        ],
        "new": [],
        "lack": []
    }
    

Citation

@inproceedings{wei2020CasRel,
  title={A Novel Cascade Binary Tagging Framework for Relational Triple Extraction},
  author={Wei, Zhepei and Su, Jianlin and Wang, Yue and Tian, Yuan and Chang, Yi},
  booktitle={Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics},
  pages={1476--1488},
  year={2020}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].