Code Monkey home page Code Monkey logo

word2vec_commented's People

Contributors

chrisjmccormick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

word2vec_commented's Issues

questions with subsampling

Hi , I read over your comment on the subsampling part.
The c implementation is
(sqrt(vocab[word].cn / (sample * train_words)) + 1) * (sample * train_words) / vocab[word].cn

However, in your comment, you says

Using the default 'sample' value of 0.001, the equation for ran is:
ran = (sqrt(x / 0.001) + 1) * (0.001 / x)

Should it be ran = (sqrt(x / 0.001 *train_words ) + 1) * (0.001 * train_words / x) instead ?

Thank you

Formatting issue in Readme.md

Hey, I was just going through your code, and I think it's great! Just a minor correction here.
The Formatting of the markdown for the header seems to be off.

Regards

error

In word2vec.c file,it seems that variabe d is not declared.

hash function example in the comment seems to be wrong.

Hi ,
First of all, Thanks for the great post and commentary. The example in the word2phrase.c - getWordHash function seems wrong to me.

Line 108 in word2phrase.c

hash = ((((h * 257) + a) * 257) + t) % 30E6

i guess the correct version should be :

hash = (((((hash * 257) + h) * 257) + a)*257+t) % 30E6

Please correct me if i am wrong.

Weighing scheme for the context words in word2vec

Dear Chris

I came across papers saying word2vec (SGNS) weighs context word different based on the distance to the centered word (higher weight for closer ones). I am quite curious on that and want to check their code, but had a hard time to figure this out...

I find your word2vec repo with many great comments. If possible, could you please point me/make a comment on where that weighing scheme is implemented in word2vec.c? (Or maybe they did not implement this at all...)

Thanks,
Matt

Modifiction: Why do we put back Newline Character

I think there's a small mistake in your writeup.

So, we do not require all sentences to be separated by two newline characters. Since we unget(ch) whenever ch == '\n', a single newline character will suffice. That is, when we encounter a single newline character, we put it back. In the next invocation of ReadWord(), we start at a=0 and immediately find our old newline character, so we return the EOS token.

Therefore, it suffices for every sentence to be on a line by itself.

I usually add a space to the end of the line before adding the newline character, but that's just my personal preference.

Let me know if I'm wrong, but this was my understanding of the code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.