Code Monkey home page Code Monkey logo

sentence-representation-for-classification-pytorch's Introduction

Deep learning models for sentence representation on classification in PyTorch

This repository contains some popular deep learning models for sentence representation (also apply for document-level text) that built in PyTorch. Intended for learning PyTorch, this repo is made understandable for someone with basic python and deep learning knowledge. Links to some papers are also given.

Requirement

  • python 2.7
  • pytorch 0.2
  • torchtext 0.2

Usage

python train.py -conf [config file] 

Choose the config file that used to set the datasets and models.

Folder Structure

  • model file:
    • model/model.py, contains the deep models for sentence representation.
  • training framework: train.py - preprocesses the data and trains the model.
  • configuration files:
    • i.e. trec/trec.conf, the config file used to set the datasets and models.
  • help function: utils/utils.py. some helper functions.

Models [IN PROGRESS]

For now, the models listed bellow are add into this repo. Some benchmarks for these models are also given (the hyper-parameters are far from being optimal, the performances of these models can be improved with carefully tuning).

Model TREC6-valid1 TREC6-test SST2-valid2 SST2-test
LSTM - 94.6 84.98 85.45
Bi-LSTM - 94.4 85.21 86.44
CNN - 95.2 84.63 84.73
SelfAttn - 96.0 85.44 86.66
BCN+CoVe - 95.0 87.55 87.84

1: The best accuracy on test set is reported since it has no development set.

2: Only the sentence-level training samples are used.

LSTMs

CNNs

Self-Attentive Sentence Embedding

Learned in Translation: Contextualized Word Vectors

sentence-representation-for-classification-pytorch's People

Contributors

chanrom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

chunlinx

sentence-representation-for-classification-pytorch's Issues

SST-2 almost same config best val acc 82

Hi thank you for the repo. I have a question about reproducing the results.

I have cloned the repo and used almost the same config, except for embedding I used 6B instead of 840B. My best val set acc is around 82-83. Do you think 840B would account for the performance difference?

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.