Code Monkey home page Code Monkey logo

Comments (7)

codekansas avatar codekansas commented on July 29, 2024 3

I went ahead and added the word embeddings I've been using to Github

from keras-language-modeling.

codekansas avatar codekansas commented on July 29, 2024

Did you download the dataset from here? I'm not sure which resource it could be. Could you reproduce the error message?

Yep, the word2vec_100_dim.h5 was the output of using Gensim's Word2Vec model merged with the result of training a 100-dimension EmbeddingModel. I haven't formalized this yet, mostly I've been trying out different word embeddings to see what works. I think once something works well I will put the weight file on Github for general use.

I'd appreciate it if you wanted to open a PR for a stand-alone script. Let me know if you have more questions.

from keras-language-modeling.

saj1919 avatar saj1919 commented on July 29, 2024

Which word2vec output you are considering here ?
When we save gensim word2vec model we get typically following files -
outfilename, outfilename.syn1neg, outfilename.syn0.np, outfilename.syn1.np

Which one maps to ".h5" you mentioned above or word2vec_100_dim.embeddings you uploaded ?
Also couldn't see "word_embeddings.py" where you might have written something related to this.

from keras-language-modeling.

codekansas avatar codekansas commented on July 29, 2024

syn0 is the equivalent of the Keras embedding layer I believe, that's what I've been using. It's really these lines:

weights = np.load('word2vec_100_dim.embeddings')
language_model = model.prediction_model.layers[2]
language_model.layers[2].set_weights([weights])

from keras-language-modeling.

jim-kukla avatar jim-kukla commented on July 29, 2024

@codekansas Yes, I did have the insurance_qa_python repo cloned and had all the data_paths set properly.

Thanks for adding those .h5 entries. I'll take a look shortly and let you know if everything's working for me.

from keras-language-modeling.

wailoktam avatar wailoktam commented on July 29, 2024

Hi, do you mean outfilename.syn0.np = word2vec_100_dim.embeddings?

from keras-language-modeling.

codekansas avatar codekansas commented on July 29, 2024

It might be different depending on your version

from keras-language-modeling.

Related Issues (20)

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.