Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
NotificationsYou must be signed in to change notification settings

jiweil/Visualizing-and-Understanding-Neural-Models-in-NLP

Repository files navigation

Implementations of saliency models described in "Visualizing and Understanding Neural Models in NLP" by Jiwei Li, Xinlei Chen, Eduard Hovy and Dan Jurafsky.

Requirements:

GPU

Torch (nn,cutorch,cunn,nngraph)

pythonmatplotlib library (only for matrix plotting purposes)

downloaddata

Run the models:

Run the first-derivative saliency model:

sh saliency_derivative.sh

The saliency matrix will be stored in the file "matrix".

Run the variance saliency model:

sh saliency_variance.sh

The saliency matrix will be stored in the file "matrix".

Alt Text

##Folders and Filesinput.txt: the input sentence.

sentiment_bidi: training bi-directional lstms on the Stanford Sentiment Treebank. You can either download a pretrained model (sentiment_bidi/model) or train it yourself by running sentiment_bidi/main.lua

sentiment_uni: training uni-directional standard recurrent models.

data/dict.txt: word dictionary. Current models only support tokens found in the dictionary. Will fix it soon.

For any pertinent questions, feel free to contactjiweil@stanford.edu

Acknowledgments

Yoon Kim's seq2seq-attn repo

Wojciech Zaremba's lstm repo

Socher et al.,'s Stanford Sentiment Treebank dataset

@article{li2015visualizing,    title={Visualizing and understanding neural models in NLP},    author={Li, Jiwei and Chen, Xinlei and Hovy, Eduard and Jurafsky, Dan},    journal={arXiv preprint arXiv:1506.01066},    year={2015}}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp