Code Monkey home page Code Monkey logo

definition_extraction's Introduction

Codebase for our AAAI paper A Joint Model for Definition Extraction with Syntactic Connection and Semantic Consistency.

Requirements

  • Python 3
  • PyTorch
  • tqdm
  • sklearn
  • pytorch-crf

Training

To train the model, run:

bash train.sh model_name

Model checkpoints and logs will be saved to ./saved_models/model_name.

For the complete list of parameters see train.py.

Evaluation

To run evaluation on the test set, run:

python eval.py saved_models/model_name --dataset test

This will use the best_model.pt file by default. Use --model checkpoint_epoch_10.pt to specify a model checkpoint file.

The evaluation script will print results of different metrics. We use the macro-f1 from sklearn as our main metric to compare the models.

Retrain

Reload a pretrained model and finetune it, run:

python train.py --load --model_file saved_models/model_name/best_model.pt --optim sgd --lr 0.001

License

CC BY-NC-SA 4.0.

Citation

If you use the code released in this repo, please cite our paper:

@inproceedings{veyseh2020joint,
  title={A joint model for definition extraction with syntactic connection and semantic consistency},
  author={Veyseh, Amir and Dernoncourt, Franck and Dou, Dejing and Nguyen, Thien},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  volume={34},
  number={05},
  pages={9098--9105},
  year={2020}
}

definition_extraction's People

Contributors

amirveyseh avatar panoslin avatar yuhaozhang avatar franck-dernoncourt avatar pencoa 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.