Code Monkey home page Code Monkey logo

relation-autoencoder's Introduction

relation-autoencoder

This is the code used in the paper Discrete-State Variational Autoencoders for Joint Discovery and Factorization of Relations by Diego Marcheggiani and Ivan Titov.

If you use this code, please cite us.

Dependencies

Data Processing

To run the model the first thing to do is create a dataset. You need a file like data-sample.txt. The file must be tab-separated an with the following fields:

lexicalized dependency path between arguments (entities) of the relation, first entity second entity entity types of the first and second entity trigger word id of the sentence raw sentence pos tags of the entire sentence relation between the two entities if any (used only for evaluation)

In order to create the dataset you need the OiePreprocessor.py script once for each dataset partition: train, dev, and test.


python processing/OiePreprocessor.py --batch-name train data-sample.txt sample.pk 
python processing/OiePreprocessor.py --batch-name dev data-sample.txt sample.pk
python processing/OiePreprocessor.py --batch-name test data-sample.txt sample.pk

Now, your dataset with all the indexed features is in sample.pk

Training Models

To train the model run the OieInduction.py file with all the required arguments:


python learning/OieInduction.py --pickled_dataset sample.pk --model_name discrete-autoencoder --model AC --optimization 1 --epochs 10 --batch_size 100 --relations_number 10 --negative_samples_number 5 --l2_regularization 0.1 --alpha 0.1 --seed 2 --embed_size 10 --learning_rate 0.1

For any questions, please drop me a mail at marcheggiani [at] uva [dot] nl.

relation-autoencoder's People

Watchers

James Cloos avatar KollyJ 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.