Giter VIP home page Giter VIP logo

semi-sdp's Introduction

Semi-SDP

Semi-supervised parser for semantic dependency parsing.

This repo contains the code used for the semi-supervised semantic dependency parser in Jia et al. (2020), Semi-Supervised Semantic Dependency Parsing Using CRF Autoencoders. Part of the codebase is extended from Parser-v3.

Requirement

python3
tensorflow-gpu=1.13.1

How to use

Training

Our semi-sdp parser can be trained by simply running

python3 main.py train UnlabelGraphParserNetwork  --force --config_file $CONFIGFILE

CONFIGFILE contains all hyperparameters of the model, we give an example file in the directory 'config/'. By default, if the save directory already exists, you'll get a prompt warning you that the system will delete it if you continue and giving you one last chance to opt-out. If you are debugging or want to run the program in the background, add the --force flag.
Our model was trained with Glove embedding.
To train with the unlabeled data, note the parameters in Flag subsection in the config file. Set fix_label_data=True under the Flag and the labeled_num means how many sentences have labels in your training set (Need to put labeled data in front of unlabeled data). For other parameters that need to be modified, please refer to the paper and code.

Data

Format of datasets used in this code is CoNLL-U, we give an example in the directory 'data/'. The path of training/develop set is set in the CONFIGFILE, these can be changed according to yourself setting. Depending on the memory size (24G) of the running platform, we use labeled sentences less than 60 in length. Script that filters sentence according to lengths is simple, we give an exampel in the directory 'scripts/select_sents.py'.

Parsing

The trained model can be run by calling

python main.py --save_dir $SAVEDIR run --output_dir TestResult $DATAFILE

This will save parsed sentences in DATAFILE to the TestResult/ directory--make sure no files in different directories have the same basename though, or one will get overwritten! The sentences in DATAFILE is in CoNLL-U format. SAVEDIR is the directory that your trained model saved.

semi-sdp's People

Contributors

jzxxx avatar

Stargazers

Henry avatar  avatar xiaocao~ avatar Mayn avatar Kewei Tu avatar  avatar  avatar  avatar Jacob Zhou avatar yanzhh avatar  avatar hmjw avatar Xinyu Wang avatar

Watchers

Kewei Tu avatar  avatar paper2code - bot avatar

Forkers

robby927

semi-sdp's Issues

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.