Giter Site home page Giter Site logo

strategist922 / zs-bert Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dinobby/zs-bert

0.0 1.0 0.0 555 KB

Official implementation of the paper "Towards Zero-Shot Relation Extraction with Attribute Representation Learning."

Python 1.29% HTML 98.71%

zs-bert's Introduction

ZS-BERT

This repository contains the implementation of the NAACL 2021 paper "Towards Zero-Shot Relation Extraction with Attribute Representation Learning".

Dataset

You can download the datasets employed in our work from the following link:

and place them to the /data folder.

Structure

ZS-BERT/
├── model
    ├── model.py
    ├── data_helper.py
    ├── evaluation.py
    ├── train_wiki.py
    └── train_fewrel.py
└── resources/
    ├── property_list.html
└── data/
    ├── wiki_train_new.json
    └── fewrel_all.json

Requirements

python >= 3.6 torch >= 1.4.0 or simply run:

pip install -r requirements.txt

Train ZS-BERT

If you wish to train on the wiki dataset, run:

python3 train_wiki.py --seed 300 --n_unseen 10 --gamma 7.5 --alpha 0.4 --dist_func 'inner' --batch_size 4 --epochs 10

Otherwise to train on FewRel dataset, you can run:

python3 train_fewrel.py --seed 300 --n_unseen 10 --gamma 7.5 --alpha 0.4 --dist_func 'inner' --batch_size 4 --epochs 10

inside the /model folder.

Citing this paper

If you use the code, we appreciate it if you cite the following paper:

@inproceedings{chen2021zsbert,
  title={ZS-BERT: Towards Zero-Shot Relation Extraction with Attribute Representation Learning},
  author={Chih-Yao Chen and Cheng-Te Li},
  booktitle={Proceedings of 2021 Annual Conference of the North American Chapter of the Association for Computational Linguistics (NAACL-2021)},
  year={2021}
}

zs-bert's People

Contributors

dinobby avatar

Watchers

 avatar

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.