Git Product home page Git Product logo

pytorch-starspace's Introduction

PyTorch implementation of StarSpace

Based on the approach described in StarSpace: Embed All The Things! by Ledell Wu, Adam Fisch, Sumit Chopra, Keith Adams, Antoine Bordes and Jason Weston

NOTE: The current version is work in progress and doesn't yet match the functionality of the original implementation.

The C++ version maintained and developed by the authors can be found here.

Installation

Tested on Pyton 3.6.1 and PyTorch 0.3.1

  • Install PyTorch via conda or pip
  • Install dependencies
    $ pip install -r requirements.txt

Usage

The commandline interface resembles the one used by the C++ version.

To train and validate a StarSpace model on the AG news corpus, run the following commands:

Train a model

$ ./starspace train \
    --train-file "<DATSET_PATH>/train.csv" \
    --model-path "<MODELDIR>/" \
    --file-format ag_news \
    --d-embed=10 \
    --lr=0.01 \
    --epochs=5

Validate the trained model

$ ./starspace test \
    --test-file "<DATSET_PATH>/test.csv" \
    --model-path "<MODELDIR>/" \
    --file-format ag_news

pytorch-starspace's People

Contributors

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