Skip to content

Pytorch implementation of Sentiment Classification in Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks

License

Notifications You must be signed in to change notification settings

flypythoncom/TreeLSTMSentiment

 
 

Repository files navigation

12/16/2019

fix to pytorch >=1.0.0


Tree-Structured Long Short-Term Memory Networks

A PyTorch based implementation of Tree-LSTM from Kai Sheng Tai's paper Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks.

Requirements

  • PyTorch Deep learning library
  • tqdm: display progress bar
  • meowlogtool: a logger that write everything on console to file
  • Java >= 8 (for Stanford CoreNLP utilities)
  • Python >= 3

Usage

First run the script ./fetch_and_preprocess.sh

hints: you should set java bin in $PATH to run javac

This downloads the following data:

and the following libraries:

Sentiment classification

python sentiment.py --name <name_of_log_file> --model_name <constituency|dependency> --epochs 10

We have not fully test on fine grain classification yet. Binary classification accuracy on both model are the same in original paper.

Acknowledgements

Kai Sheng Tai for the original LuaTorch implementation
Pytorch team for Python library
Riddhiman Dasgupta for his implement on sentiment relatedness https://github.com/dasguptar/treelstm.pytorch which I based on as starter code.

License

MIT

About

Pytorch implementation of Sentiment Classification in Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 81.8%
  • Java 17.8%
  • Shell 0.4%