Code for the paper "Relation of the Relations: A New Formalization of the Relation Extraction Problem"

Overview

This repo contains the code for the EMNLP 2020 paper "Relation of the Relations: A New Paradigm of the Relation Extraction Problem" (Jin et al., 2020).

How to Run

Prepare data and environment

  • SemEval2018 Task 7.2 dataset: You can download the publicly available data by the following command:
bash prep_data_and_env.sh

This command will also prepare the python environment for you. It will install all the packages in requirements.txt.

  • ACE2005 dataset: You can download from its LDC website.

Training

  1. ACE2005:
python main.py --dataset=ace_2005 --auto_hyperparam
  1. SemEval2018 Task 7.2:
python main.py --dataset=semeval_2018_task7 --auto_hyperparam

Outputs

Outputs of SemEval2018 is available at .

For ACE2005, you can request our model's outputs by emailing the authors (Zhijing Jin or Yongyi Yang).

More Questions

Feel free to open a GitHub issue in case of any questions.

Comments
  • No module named 'models.loss_func'

    No module named 'models.loss_func'

    您好: 当我运行:python main.py --dataset=semeval2018_task7 --auto_hyperparam 错误:File "/home/RoR/models/graph_trans.py", line 7, in from .loss_func import * ModuleNotFoundError: No module named 'models.loss_func' 谢谢!

    opened by qiunlp 8
  • About reproducing the Macro F1 score on SemEval2018

    About reproducing the Macro F1 score on SemEval2018

    Hi @zhijing-jin ,

    Sorry for disturbing you, but I already tried to run your source code as guided. However, on SemEval2018, I obtain Macro F1 score is 35.9% (the best result), whereas the reported result is 38.83% with RoR_base. I use the same auto hyper-parameters and the same environment configuration (as in requirement.txt). What should I do to get the reported performance? Thanks so much!

    opened by angelotran05 3
  • How to preprocess the dataset ACE 2005 after downloading it from LDC?

    How to preprocess the dataset ACE 2005 after downloading it from LDC?

    Hi @FFTYYY , thanks for releasing your source code. For the SemEval 2018 Task 7, you guide to use the command: bash prep_data_and_env.sh . I wonder about how to preprocess the ACE_2005 dataset, as I downloaded it from LDC?

    opened by angelotran05 2
  • 为什么在训练的时候只考虑了

    为什么在训练的时候只考虑了"COMPARE"关系?

    很有意思的工作,关系的关系,通过transformer来自动寻找关系间的依赖,很有启发,但是我看完代码有一些不太了解的地方,在dataloader_semeval_2018_task7文件的parse_a_key_file函数里有 if dtype == "train": if rel == "COMPARE": datas[text_id].ans.append(Relation(ent_b , ent_a , rel)) 这里是只考虑了COMPARE这一种关系吗?如果是这是为什么呢?谢谢。

    opened by longlongman 1
  •     tc.cuda.set_device(C.gpus[0]) IndexError: list index out of range :  training with CPU? Is it Feasible?

    tc.cuda.set_device(C.gpus[0]) IndexError: list index out of range : training with CPU? Is it Feasible?

    (base) raphy@pc:~/RoR_relation_extraction$ python main.py --dataset=ace_2005 --auto_hyperparam
    Hyper parameters autoset. | now time: 0s
    ------------------------------------------------------ | now time: 0s
    {'auto_hyperparam': True,
     'binary': False,
     'dataset': 'ace_2005',
     'dropout': 0.0,
     'ensemble': 1,
     'ensemble_size': 5,
     'epoch_numb': 30,
     'gene_file': 'watch/gene',
     'gene_in_data': True,
     'gene_no_rel': False,
     'gnn': True,
     'log_file': 'log.txt',
     'loss': 'loss_1',
     'matrix_nlayer': 4,
     'matrix_trans': True,
     'model_save': 'model_ace.pkl',
     'model_save_2': '',
     'no_log': False,
     'no_rel_name': 'NO_RELATION',
     'no_rel_weight': 0.25,
     'no_valid': True,
     'pos_only': False,
     'pos_thresh': 0.3,
     'rel_weight_norm': False,
     'rel_weight_smooth': 0,
     'scheduler': 'cosine',
     't2g_batch_size': 8,
     't2g_lr': 5e-05,
     't2g_seed': 2333,
     'test_rels': './data/semeval_2018_task7/keys.test.2.txt',
     'test_script': './data/semeval_2018_task7/semeval2018_task7_scorer-v1.2.pl',
     'test_text': './data/ace_2005/ace_05_processed/ace-05-splits/json-pm13/bc_test.json',
     'tmp_file_name': 'tmp_17300649.txt',
     'train_rels_1': './data/semeval_2018_task7/1.1.relations.txt',
     'train_rels_2': './data/semeval_2018_task7/1.2.relations.txt',
     'train_text_1': './data/ace_2005/ace_05_processed/ace-05-splits/json-pm13/bn+nw.json',
     'train_text_2': './data/semeval_2018_task7/1.2.text.xml',
     'valid_metric': 'macro',
     'valid_rels': './data/semeval_2018_task7/keys.test.1.1.txt',
     'valid_text': './data/ace_2005/ace_05_processed/ace-05-splits/json-pm13/bc_dev.json',
     'warmup_prop': 0.02,
     'watch_type': 'test'} | now time: 0s
    ------------------------------------------------------ | now time: 0s
    Seed set. 2333 | now time: 0s
    Traceback (most recent call last):
      File "main.py", line 95, in <module>
        main()
      File "main.py", line 54, in main
        C , logger = get_config()
      File "/home/raphy/RoR_relation_extraction/config.py", line 177, in get_config
        C , logger = after_parse_t2g(before_parse_t2g(argparse.ArgumentParser()).parse_args() , need_logger = True)
      File "/home/raphy/RoR_relation_extraction/config.py", line 168, in after_parse_t2g
        tc.cuda.set_device(C.gpus[0])
    IndexError: list index out of range
    (base) raphy@pc:~/RoR_relation_extraction$ 
    

    I do not have CUDA .....

    opened by raphael10-collab 1
  • AttributeError: module 'fitlog' has no attribute 'add_to_line'

    AttributeError: module 'fitlog' has no attribute 'add_to_line'

    When I run python main.py --dataset=semeval_2018_task7 --auto_hyperparam I got AttributeError: module 'fitlog' has no attribute 'add_to_line' Is there a way to fix it?

    opened by shaonanqinghuaizongshishi 1
Owner
YYY
荠与麦兮夏零,兰桂践霜逾馨
YYY
Inference code for "StylePeople: A Generative Model of Fullbody Human Avatars" paper. This code is for the part of the paper describing video-based avatars.

NeuralTextures This is repository with inference code for paper "StylePeople: A Generative Model of Fullbody Human Avatars" (CVPR21). This code is for

Visual Understanding Lab @ Samsung AI Center Moscow 18 Oct 6, 2022
This is the official source code for SLATE. We provide the code for the model, the training code, and a dataset loader for the 3D Shapes dataset. This code is implemented in Pytorch.

SLATE This is the official source code for SLATE. We provide the code for the model, the training code and a dataset loader for the 3D Shapes dataset.

Gautam Singh 66 Dec 26, 2022
Code for paper ECCV 2020 paper: Who Left the Dogs Out? 3D Animal Reconstruction with Expectation Maximization in the Loop.

Who Left the Dogs Out? Evaluation and demo code for our ECCV 2020 paper: Who Left the Dogs Out? 3D Animal Reconstruction with Expectation Maximization

Benjamin Biggs 29 Dec 28, 2022
TensorFlow code for the neural network presented in the paper: "Structural Language Models of Code" (ICML'2020)

SLM: Structural Language Models of Code This is an official implementation of the model described in: "Structural Language Models of Code" [PDF] To ap

null 73 Nov 6, 2022
Code for the prototype tool in our paper "CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning".

CoProtector Code for the prototype tool in our paper "CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning".

Zhensu Sun 1 Oct 26, 2021
Code to use Augmented Shapiro Wilks Stopping, as well as code for the paper "Statistically Signifigant Stopping of Neural Network Training"

This codebase is being actively maintained, please create and issue if you have issues using it Basics All data files are included under losses and ea

J K Terry 32 Nov 9, 2021
Code for our method RePRI for Few-Shot Segmentation. Paper at http://arxiv.org/abs/2012.06166

Region Proportion Regularized Inference (RePRI) for Few-Shot Segmentation In this repo, we provide the code for our paper : "Few-Shot Segmentation Wit

Malik Boudiaf 138 Dec 12, 2022
Code for ACM MM 2020 paper "NOH-NMS: Improving Pedestrian Detection by Nearby Objects Hallucination"

NOH-NMS: Improving Pedestrian Detection by Nearby Objects Hallucination The offical implementation for the "NOH-NMS: Improving Pedestrian Detection by

Tencent YouTu Research 64 Nov 11, 2022
Official TensorFlow code for the forthcoming paper

~ Efficient-CapsNet ~ Are you tired of over inflated and overused convolutional neural networks? You're right! It's time for CAPSULES :)

Vittorio Mazzia 203 Jan 8, 2023
This is the code for the paper "Contrastive Clustering" (AAAI 2021)

Contrastive Clustering (CC) This is the code for the paper "Contrastive Clustering" (AAAI 2021) Dependency python>=3.7 pytorch>=1.6.0 torchvision>=0.8

Yunfan Li 210 Dec 30, 2022
Code for the paper Learning the Predictability of the Future

Learning the Predictability of the Future Code from the paper Learning the Predictability of the Future. Website of the project in hyperfuture.cs.colu

Computer Vision Lab at Columbia University 139 Nov 18, 2022
PyTorch code for the paper: FeatMatch: Feature-Based Augmentation for Semi-Supervised Learning

FeatMatch: Feature-Based Augmentation for Semi-Supervised Learning This is the PyTorch implementation of our paper: FeatMatch: Feature-Based Augmentat

null 43 Nov 19, 2022
Code for the paper A Theoretical Analysis of the Repetition Problem in Text Generation

A Theoretical Analysis of the Repetition Problem in Text Generation This repository share the code for the paper "A Theoretical Analysis of the Repeti

Zihao Fu 37 Nov 21, 2022
Code for our ICASSP 2021 paper: SA-Net: Shuffle Attention for Deep Convolutional Neural Networks

SA-Net: Shuffle Attention for Deep Convolutional Neural Networks (paper) By Qing-Long Zhang and Yu-Bin Yang [State Key Laboratory for Novel Software T

Qing-Long Zhang 199 Jan 8, 2023
Open source repository for the code accompanying the paper 'Non-Rigid Neural Radiance Fields Reconstruction and Novel View Synthesis of a Deforming Scene from Monocular Video'.

Non-Rigid Neural Radiance Fields This is the official repository for the project "Non-Rigid Neural Radiance Fields: Reconstruction and Novel View Synt

Facebook Research 296 Dec 29, 2022
Code for the Shortformer model, from the paper by Ofir Press, Noah A. Smith and Mike Lewis.

Shortformer This repository contains the code and the final checkpoint of the Shortformer model. This file explains how to run our experiments on the

Ofir Press 138 Apr 15, 2022
PyTorch code for ICLR 2021 paper Unbiased Teacher for Semi-Supervised Object Detection

Unbiased Teacher for Semi-Supervised Object Detection This is the PyTorch implementation of our paper: Unbiased Teacher for Semi-Supervised Object Detection

Facebook Research 366 Dec 28, 2022
Official code for paper "Optimization for Oriented Object Detection via Representation Invariance Loss".

Optimization for Oriented Object Detection via Representation Invariance Loss By Qi Ming, Zhiqiang Zhou, Lingjuan Miao, Xue Yang, and Yunpeng Dong. Th

ming71 56 Nov 28, 2022
Code for our CVPR 2021 paper "MetaCam+DSCE"

Joint Noise-Tolerant Learning and Meta Camera Shift Adaptation for Unsupervised Person Re-Identification (CVPR'21) Introduction Code for our CVPR 2021

FlyingRoastDuck 59 Oct 31, 2022