Coder Social home page Coder Social logo

cclauss / graph2seq Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ibm/graph2seq

0.0 2.0 0.0 17.13 MB

Graph2Seq is a simple code for building a graph-encoder and sequence-decoder for NLP and other AI/ML/DL tasks.

License: Apache License 2.0

Python 100.00%

graph2seq's Introduction

Graph2Seq

Graph2Seq is a simple code for building a graph-encoder and sequence-decoder for NLP and other AI/ML/DL tasks.

How To Run The Codes

To train your graph-to-sequence model, you need:

(1) Prepare your train/dev/test data which the form of:

each line is a json object whose keys are "seq", "g_ids", "g_id_features", "g_adj":
"seq" is a text which is supposed to be the output of the decoder
"g_ids" is a mapping from the node ID to its ID in the graph
"g_id_features" is a mapping from the node ID to its text features
"g_adj" is a mapping from the node ID to its adjacent nodes (represented as thier IDs)

See data/no_cycle/train.data as examples.

(2) Modify some hyper-parameters according to your task in the main/configure.py

(3) train the model by running the following code "python run_model.py train -sample_size_per_layer=xxx -sample_layer_size=yyy" The model that performs the best on the dev data will be saved in the dir "saved_model"

(4) test the model by running the following code "python run_model.py test -sample_size_per_layer=xxx -sample_layer_size=yyy" The prediction result will be saved in saved_model/prediction.txt

How To Cite The Codes

Please cite our work if you like or are using our codes for your projects!

Kun Xu, Lingfei Wu, Zhiguo Wang, Yansong Feng, Michael Witbrock, and Vadim Sheinin (first and second authors contributed equally), "Graph2Seq: Graph to Sequence Learning with Attention-based Neural Networks", arXiv preprint arXiv:1804.00823.

@article{xu2018graph2seq,
title={Graph2Seq: Graph to Sequence Learning with Attention-based Neural Networks},
author={Xu, Kun and Wu, Lingfei and Wang, Zhiguo and Feng, Yansong and Witbrock, Michael and Sheinin, Vadim},
journal={arXiv preprint arXiv:1804.00823},
year={2018}
}


Contributors: Kun Xu, Lingfei Wu
Created date: November 4, 2018
Last update: November 4, 2018

graph2seq's People

Contributors

stevemart avatar

Watchers

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