GithubHelp home page GithubHelp logo

Comments (6)

monipip3 avatar monipip3 commented on September 24, 2024

so now I ran process.py after and then
from gensim.models import Word2Vec w2v_model = Word2Vec.load("mat2vec/training/models/model_example") and it seemed to work because I did not get an error message.

I used a word from the corpus I used to train on in the most_similar function and it said that word is not in the vocabulary. How is that possible? Also getting a lot of stop words as most similar to most words in my corpus.
Screen Shot 2020-01-29 at 7 14 17 AM

from mat2vec.

ViktoriiaBaib avatar ViktoriiaBaib commented on September 24, 2024

To have the word in the vocabulary, it should appear more than 5 times in your corpus by default.
Option 1: expand your corpus - add more articles containing the desired word.
Option 2: change this parameter using the flag "--min_count". For example, if you want to build a vocabulary containing all words run the following:
python phrase2vec.py --corpus=data/your_corpus --model_name=your_model --min_count=1

from mat2vec.

ViktoriiaBaib avatar ViktoriiaBaib commented on September 24, 2024

Make sure that all the paths are correct and you do the following in the given order:

  1. Do all the steps from the "Set up" section of the README
  2. Go to mat2vec/mat2vec/training/data and create 'my_corpus' file containing abstracts (for the reference look at the content of 'corpus_example')
  3. Go to mat2vec/mat2vec/training and build the vocabulary for your corpus running python phrase2vec.py --corpus=data/my_corpus --model_name=my_model. This command takes existing file 'data/my_corpus' and generate new file 'models/my_model'.
  4. Go to mat2vec, run python interactive shell and try some of the steps from the "Processing" section of the README but importing 'my_model', like: w2v_my_model = Word2Vec.load("mat2vec/training/models/my_model")

from mat2vec.

vtshitoyan avatar vtshitoyan commented on September 24, 2024

To add to this, the processing needs to be done before creating the corpus file. The corpus file should contain pre-processed, tokenized abstracts, one per line. Tokens should be separated by spaces. As to how to test the model, it depends what you want to test. Some examples are in README, also check out some of the other issues in this repo which might have helpful tips.

from mat2vec.

hasan-sayeed avatar hasan-sayeed commented on September 24, 2024

Is it possible to load the "pretrained model" and then train it again on my custom corpus? I've tried using w2v_model = Word2Vec.load("mat2vec/training/models/pretrained_embeddings") and then w2v_model.train('corpus_example', total_examples=w2v_model.corpus_count, epochs=20). But after the training I tried to find the vector for a word from my corpus and it said the word is not in the vocabulary. Also all the vectors stays the same as the previous model. What am I doing wrong?

from mat2vec.

jdagdelen avatar jdagdelen commented on September 24, 2024

from mat2vec.

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.