Skip to content

added support word2vec training with additional data - #18636

Closed
lpapenme wants to merge 2 commits into
apache:masterfrom
lpapenme:master
Closed

added support word2vec training with additional data#18636
lpapenme wants to merge 2 commits into
apache:masterfrom
lpapenme:master

Conversation

@lpapenme

Copy link
Copy Markdown

What changes were proposed in this pull request?

Word2Vec is trained unsupervised. The more data it is trained on, the more "accurate" are the word vectors. Hence, Word2Vec should support to be fit on additional data.

How was this patch tested?

Additional unit test.

Please review http://spark.apache.org/contributing.html before opening a pull request.

@MLnick

Copy link
Copy Markdown
Contributor

Hi there - I don't see the value here of adding a few words in a String array to the training. You're effectively adding a second (non-distributed, therefore limited in size) corpus to the training.

Word2Vec is more aimed at training on a larger corpus of text. If you want more accuracy train on a larger training set.

Could you close this PR please?

@lpapenme

Copy link
Copy Markdown
Author

At the moment, it is not possible to improve a models accuracy by incorporating additional data. I think this should be supported since it can increase a classifiers performance significantly. With this implementation, I was able to train unsupervised on a Wikipedia Dump, which is pretty large. However, distributing the set is a good point.

@MLnick

Copy link
Copy Markdown
Contributor

I'm sorry but I still don't understand the intention here. You can already train on a Wikipedia dump (or any other dataset) by passing that dataset as the input DataFrame to Word2Vec.

If you want to "incorporate additional data" why not just union the additional sentences / documents together with your other training set?

@lpapenme

Copy link
Copy Markdown
Author

The problem emerges in cases where you built a whole pipeline. You have a set of documents you want to classify. These documents have some additional features and they are preprocessed in the pipeline. When coming to Word2Vec, you want to vectorize your documents. However, you see bad performance of your word vectors and you want to tune them by adding additional documents. You don't want these documents to be part of the whole pipeline, because they are unable to pass the previous preprocessing steps.

That was my intention to add this. Probably, it is a very rare usecase. I don't know.

@AmplabJenkins

Copy link
Copy Markdown

Can one of the admins verify this patch?

@HyukjinKwonHyukjinKwon mentioned this pull request Nov 11, 2018
zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 22, 2025
Closesapache#21766Closesapache#21679Closesapache#21161Closesapache#20846Closesapache#19434Closesapache#18080Closesapache#17648Closesapache#17169
Add:
Closesapache#22813Closesapache#21994Closesapache#22005Closesapache#22463
Add:
Closesapache#15899
Add:
Closesapache#22539Closesapache#21868Closesapache#21514Closesapache#21402Closesapache#21322Closesapache#21257Closesapache#20163Closesapache#19691Closesapache#18697Closesapache#18636Closesapache#17176Closesapache#23001 from wangyum/CloseStalePRs.
Authored-by: Yuming Wang <yumwang@ebay.com>
Signed-off-by: hyukjinkwon <gurwls223@apache.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@lpapenme@MLnick@AmplabJenkins