lizaku / vec2graph

Mini-library for producing graph visualizations from embedding models
MIT License
28 stars 2 forks source link

vec2graph

Mini-library for producing graph visualizations from embedding models

Logo

If you use vec2graph in your research, please cite our paper:

Vec2graph: a Python library for visualizing word embeddings as graphs by Nadezhda Katricheva, Alyaxey Yaskevich, Anastasiya Lisitsyna, Tamara Zhordaniya, Andrey Kutuzov, and Elizaveta Kuzmenko.

Code is available at https://github.com/lizaku/vec2graph

Usage

pip install vec2graph

from vec2graph import visualize

visualize(OUTPUT_DIR, MODEL, WORD, depth=0, topn=10, threshold=0, edge=1, sep=False, library="web")

Example

model = gensim.models.KeyedVectors.load_word2vec_format('googlenews300.bin', binary=True)

visualize('tmp/graphs', model, 'apple')

Required arguments

Optional arguments

We provide an example script to make it easier to start using vec2graph right now.