GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - flypythoncom/TreeLSTMSentiment: Pytorch implementation of Sentiment Classification in Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
lib
lib
 
 
saved_model
saved_model
 
 
scripts
scripts
 
 
.gitignore
.gitignore
 
 
Constants.py
Constants.py
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
config.py
config.py
 
 
dataset.py
dataset.py
 
 
fetch_and_preprocess.sh
fetch_and_preprocess.sh
 
 
metrics.py
metrics.py
 
 
model.py
model.py
 
 
run.sh
run.sh
 
 
sentiment.py
sentiment.py
 
 
trainer.py
trainer.py
 
 
tree.py
tree.py
 
 
utils.py
utils.py
 
 
vocab.py
vocab.py
 
 

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:

  • Stanford Sentiment Treebank (sentiment classification task)
  • Glove word vectors (Common Crawl 840B) -- Warning: this is a 2GB download!

and the following libraries:

  • Stanford Parser
  • Stanford POS Tagger

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

Readme
MIT license
Activity
Custom properties

Stars

4 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.