Git Product home page Git Product logo

randsent's Introduction

RandSent

Various methods for random sentence representations, from the paper No Training Required: Exploring Random Encoders for Sentence Classification.

Getting started

If you don't have SentEval yet, download it:

git clone https://github.com/facebookresearch/SentEval.git

Download the evaluation data and place SentEval in the current directory, or provide the path using --senteval_path.

In the paper, we use GloVe embeddings (but nothing stops you from running RandSent with different embeddings):

wget http://nlp.stanford.edu/data/glove.840B.300d.zip

Place glove.840B.300d.txt in the current directory, or provide the path using --word_emb_path.

Requirements

RandSent requires:

  • Python 3
  • Pytorch 1.0
  • Numpy

Examples

These are some example commands:

ESN:

python -u randsent.py --model esn --pooling mean --pos_enc 0 --output_dim 2048 --zero 1 --spectral_radius 1.0 --leaky 0 --concat_inp 0 --stdv 0.1 --activation None --bidirectional 1 --sparsity 0.5 --gpu 1

Random projection (BOREP):

python -u randsent.py --model borep --pooling mean --projection same --pos_enc 0 --bidirectional 0 --output_dim 4096 --activation nn.ReLU --zero 1 --gpu 1

Random LSTM:

python -u randsent.py --model lstm --pooling mean --pos_enc 0 --bidirectional 1 --output_dim 2048 --zero 1 --num_layers 1 --activation None --gpu 1

License

RandSent is CC-NC licensed, as found in the LICENSE file.

randsent's People

Contributors

douwekiela avatar jwieting avatar

Watchers

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