nadbordrozd / blog_stuff Goto Github PK
View Code? Open in Web Editor NEWexperiments and snippets used on the blog
experiments and snippets used on the blog
Hi Nadbor Drozd,
First of all: thank you for sharing this code, it is helping me a lot!
I was wondering if you could clarify to following code in the tranform functions of the MeanEmbeddingVectorizer and TfidfEmbeddingVectorizer classes:
[self.word2vec[w] * self.word2weight[w] for w in words if w in self.word2vec] or [np.zeros(self.dim)]
More specifically, I don't understand what the or [np.zeros(self.dim)]
does.
I realize this is probably a question regarding general python syntax, but I can't seem to find an explanation in the python docs or on Stackoverflow.
Thanks again for the code!
why using the glove_small when defining the vectorizers? Is here
self.dim=len(word2vec)
not enough? I don't get the next/iter and glove_small part...
Does benchmarking_python3.ipynb have a rewritten version of GPU?
Hi,
Thank you for your work on the PGB code and your "Hello World" blogpost, those helped me a lot!
I am embedding a small graph, but while programming the PGB method I read through the open source project of PGB by facebookresearch, where they state;
“PBG is not optimized for small graphs” and “PyTorch-BigGraph ... may not produce high-quality embeddings for small graphs without careful tuning.”. I managed to implement the code and retrieve embeddings for the nodes in my graph, but based on their comments on small graphs I am unsure whether I have produced high-quality embeddings.
Do you have any tips for choosing the parameters for small graphs, or should I just use the parameter settings you proposed in the blogpost?
Thanks in advance!
Is multi_multi_kernel_nb.py missing the transform method?
Hi, thanks for your code in classification_w2v/benchmarking_python3.ipynb, it helps me a lot.
Now, there is some advice for it because of the new edition of sklearn.
my python version is 3.5.6 and sklearn version is 0.20.0
the first one:
now in code
from sklearn.cross_validation import cross_val_score
from sklearn.cross_validation import StratifiedShuffleSplit
suggest
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import StratifiedShuffleSplit
the second one:
now in code
for train, test in StratifiedShuffleSplit(y, n_iter=5, test_size=test_size):
suggest
for train, test in StratifiedShuffleSplit(n_splits=5, test_size=test_size).split(X, y):
besides, the following code might move to %%bash.
wget http://nlp.stanford.edu/data/glove.6B.zip
wget http://nlp.stanford.edu/data/glove.840B.300d.zip
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.