Visualization tool for word vectors
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
scripts
tests
tsneplot
.gitignore
LICENSE
Makefile
README.md
display_all.png
display_words.png
requirements.dev.txt
requirements.txt
setup.py

README.md

tsneplot - t-SNE for Humans

CLI tool/library for quick & dirty visualizations of word2vec models. Uses the t-SNE (t-Distributed Stochastic Neighbor Embedding) method provided in scikit-learn.

Inspiration for some of the code comes from this blog post.

Install

cd tsneplot

python setup.py install --user

Usage

As CLI

# Display a scatterplot of all words in the vocab (takes a while, depending).
tsneplot display_all --model <path_to_model>

# Display the neighborhood of a particular word or words
tsneplot display_words --model <path_to_model> chicken salad parmesan

As a library

import tsneplot

model = tsneplot.load_model('<path_to_model>')

tsneplot.display_all(model)
tsneplot.display_words(model, ['chicken', 'salad', 'parmesan'])

Screenshots

Display All Chicken and beef