Git Product home page Git Product logo

cup's Introduction

CUP: JIT Comment UPdater

Directory Structure

  • baselines: the implementation of nnupdater and scripts for running baselines
  • models: neural models
  • scripts: the scripts for conducting experiments

Prepare Requirements

  • Java 8
  • Install python dependencies through conda
  • Install nlg-eval and setup
conda env create -f environment.yml

pip install git+https://github.com/Maluuba/nlg-eval.git@master
# set the data_path
nlg-eval --setup ${data_path}

Download Dataset

  • Our dataset, trained model and archived results can be downloaded from here
  • Another archive of this project can be found at https://tinyurl.com/jitcomment
  • By default, we store the dataset in ../dataset

Train

cd scripts
# 0 for GPU 0
./train_model.sh 0 CoAttnBPBAUpdater models.updater.CoAttnBPBAUpdater ../dataset

Infer and Evaluate

cd scripts
./infer_eval.sh 0 CoAttnBPBAUpdater models.updater.CoAttnBPBAUpdater ../dataset

Build Vocab Yourself

You can also build the vocabularies by yourself instead of using the one provided with our dataset.

# download fastText pre-trained model
cd ../dataset
wget https://dl.fbaipublicfiles.com/fasttext/vectors-crawl/cc.en.300.bin.gz
gunzip cc.en.300.bin.gz

cd scripts
./build_vocab.sh ../../dataset/cc.en.300.bin

Run Baselines

  • Clone FracoUpdater:
# clone FracoUpdater
git clone https://github.com/Tbabm/FracoUpdater
  • Install FracoUpdater's dependencies according to its README
  • Run
python -m baselines.run_baselines run_all_baselines

The results will be placed in the dataset directory, and can be evaluated using CUP/eval.py

Run CUP's Variants

cd scripts
# 0 for GPU 0
./run_variants.sh 0

Get Readable Result

python -m tools dump_all_readables

readable files can be found in results

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.