lizaku / vec2graph Goto Github PK
View Code? Open in Web Editor NEWMini-library for producing graph visualizations from embedding models
License: MIT License
Mini-library for producing graph visualizations from embedding models
License: MIT License
Always one page for the query token is generated
No alerts with depth=-0.5 (depth must be integer and positive.
Attempt to run vec2graph
with gensim=4.0.0 produces error:
Traceback (most recent call last):
File "graphs.py", line 13, in
visualize('graphs', model, 'party')
File "C:\Anaconda\lib\site-packages\vec2graph\genviz.py", line 146, in visualize
data = get_data(model, words, depth=depth, topn=topn)
File "C:\Anaconda\lib\site-packages\vec2graph\genviz.py", line 23, in get_data
if word not in model.vocab:
File "C:\Anaconda\lib\site-packages\gensim-4.0.1-py3.8-win-amd64.egg\gensim\models\keyedvectors.py", line 645, in vocab
raise AttributeError(
AttributeError: The vocab attribute was removed from KeyedVector in Gensim 4.0.0.
Use KeyedVector's .key_to_index dict, .index_to_key list, and methods .get_vecattr(key, attr) and .set_vecattr(key, attr, new_val) instead.
See https://github.com/RaRe-Technologies/gensim/wiki/Migrating-from-Gensim-3.x-to-4
Function 'visualize' works only with existing output directory.
Example:
visualize('new_dir', model, 'мама_NOUN')
Error:
[Errno 2] No such file or directory: 'new_dir/genviz.js'
It would be great to get some JSON representation of a graph in output (to export into custom graph editor).
Also, have an idea to add some filters for similar words array.
I will try to do mods by myself, but it wouldn't be soon.
Example:
visualize('test', model, 'мама', sep=True)
Output:
мама is not in model
Visualizations written to test
Result: no page "мама.html" in 'test'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.