TreeLSTMSentiment
Pytorch implementation of Sentiment Classification in Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks
Install / Use
/learn @ttpro1995/TreeLSTMSentimentREADME
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
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:
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 <br> Pytorch team for Python library<br> Riddhiman Dasgupta for his implement on sentiment relatedness https://github.com/dasguptar/treelstm.pytorch which I based on as starter code.
License
MIT
Related Skills
node-connect
337.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
83.3kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
83.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
337.7kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
