资源算法pytorch-starspace

pytorch-starspace

2019-12-30 | |  86 |   0 |   0

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


上一篇:deep-dream-generator

下一篇:starspace_utils

用户评价
全部评价

热门资源

  • allennlp-server

    allennlp-server Serve allennlp services as sep...

  • ubuntu-allennlp

    ubuntu-allennlp AllenAI AllenNLP image based o...

  • allennlp_extras

    allennlp_extras Some utilities build on top of...

  • allennlp-dureader

    An Apache 2.0 NLP research library, built on Py...

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...