Github user insidedctm commented on the issue:
https://github.com/apache/spark/pull/13735
This seems to work fine with small model such as that produced by
demo_word.sh in the word2vec code repository however I get problems when trying
a large model such as
[GoogleNews-vectors-negative300.bin](https://drive.google.com/file/d/0B7XkCwpI5KDYNlNUTTlSS21pQmM/edit?usp=sharing).
I can successfully load the model using this code (albeit I needed to give
the driver 12GB of memory):
`import org.apache.spark.ml.feature.Word2VecModel`
`val path = "file:///Downloads/GoogleNews-vectors-negative300.bin"`
`val model = Word2VecModel.loadGoogleModel(path)`
However synonyms are not found for a typical lookup e.g.
`model.findSynonyms("spark",20).show`
responds with
`java.lang.IllegalStateException: spark not in vocabulary`
However the distance tool from the word2vec toolkit, loading the same model
gives:
<img width="594" alt="screen shot 2016-09-15 at 12 57 03"
src="https://cloud.githubusercontent.com/assets/5909684/18549055/0a60f9da-7b44-11e6-895c-88ee018ed1a9.png">
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]