Skip to content
프로젝트

소개

트리 구조 Long Short-Term Memory 네트워크(http://arxiv.org/abs/1503.00075)

시스템 및 인프라

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Tree-Structured Long Short-Term Memory Networks

An implementation of the Tree-LSTM architectures described in the paper Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks by Kai Sheng Tai, Richard Socher, and Christopher Manning.

Requirements

The Torch/Lua dependencies can be installed using luarocks. For example:

luarocks install nngraph

Usage

First run the following script:

./fetch_and_preprocess.sh

This downloads the following data:

and the following libraries:

The preprocessing script generates dependency parses of the SICK dataset using the Stanford Neural Network Dependency Parser.

Alternatively, the download and preprocessing scripts can be called individually.

Semantic Relatedness

The goal of this task is to predict similarity ratings for pairs of sentences. We train and evaluate our models on the Sentences Involving Compositional Knowledge (SICK) dataset.

To train models for the semantic relatedness prediction task on the SICK dataset, run:

th relatedness/main.lua --model <dependency|constituency|lstm|bilstm> --layers <num_layers> --dim <mem_dim> --epochs <num_epochs>

where:

  • model: the LSTM variant to train (default: dependency, i.e. the Dependency Tree-LSTM)
  • layers: the number of layers (default: 1, ignored for Tree-LSTMs)
  • dim: the LSTM memory dimension (default: 150)
  • epochs: the number of training epochs (default: 10)

Sentiment Classification

The goal of this task is to predict sentiment labels for sentences. For this task, we use the Stanford Sentiment Treebank dataset. Here, there are two sub-tasks: binary and fine-grained. In the binary sub-task, the sentences are labeled positive or negative. In the fine-grained sub-task, the sentences are labeled very positive, positive, neutral, negative or very negative.

To train models for the sentiment classification task on the Stanford Sentiment Treebank, run:

th sentiment/main.lua --model <constituency|dependency|lstm|bilstm> --layers <num_layers> --dim <mem_dim> --epochs <num_epochs>

This trains a Constituency Tree-LSTM model for the "fine-grained" 5-class classification sub-task.

For the binary classification sub-task, run with the -b or --binary flag, for example:

th sentiment/main.lua -m constituency -b

Predictions are written to the predictions directory and trained model parameters are saved to the trained_models directory.

See the paper for more details on these experiments.

Third-party Implementations

관련 프로젝트 살펴보기

불러오는 중…