GithubHelp home page GithubHelp logo

coep's Introduction

CoEP

The implementation of CoEP model.

FEG

To run future event generation experiment, follow there instructions:

First Step

Prepare pre-trained models.

The key components of Inference Model (IM) and Generation Model (GM) are inherited from a pre-trained BART model. It can be downloaded from huggingface.co/facebook. Or you can just use the code in the following to initialize the modules:

from transformers import BartTokenizer, BartModel

tokenizer = BartTokenizer.from_pretrained('facebook/bart-base')
model = BartModel.from_pretrained('facebook/bart-base')

Then install dependencies

pytorch == 1.7.1
transformers = 4.2.1

Fine-tuning IM and GM with ATOMIC and ConceptNet

Run the script to train IM with the additional CLS HEAD on ATOMIC and do evaluations

python train_bart_model.py --data_name v4_atomic --add_cls

Run the script to train GM on sequential ConceptNet and do evaluations

python train_bart_model.py --data_name conceptnet_seq

Test the fine-tuned model by running the following script

python test_bart_model.py --data_name v4_atomic/conceptnet_seq --resume_path MODEL_PATH --resume_epoch MODEL_ITER

Train CoEP with fine-tuned models

Run the following script to train CoEP on fine-tuned IM and GM

python train_CoEP.py --load_kg_model_with_cls --pretrain_GM --data_name event_story

Run the script to test the performance of future event generation on CommonEvent

python test_CoEP.py --data_name event_story --train_data event_story --resume_path MODEL_PATH --resume_epoch MODEL_ITER

Playing Around in Interactive Mode

Run the script to interavtive input context and event in the terminal and generate future events

python interactive_generate.py

coep's People

Contributors

veralily avatar

Stargazers

 avatar  avatar Xuming Hu 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.