The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Using 'external' word2vec models
Hi there, might be overlooking something but when I tried to use some word2vec models generated using colab I got an error message as below :
Message: Expected a space in the first line of file '/data/models/word2vec/tryout': 'タcgensim.models.word2vec'
Does this mean we cannot really use word2vec models generated outside of rapidminer, even if they are generated 'according to the rules'?
Or is there a way to bypass these errors?
I could in the end regenerate the model in rapidminer also, but it's a bit less friendly on server resources and limits sharing across different apps so I'd prefer to be able to create once and share many.
Tagged:
0
Best Answer
-
MartinLiebig Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,533 RM Data ScientistHi @kayman,
the current implementation only supports binary files. This is the format used by google: https://code.google.com/archive/p/word2vec/ .
I am not sure which format gensim uses, but maybe you can change it?
BR,
Martin- Sr. Director Data Solutions, Altair RapidMiner -
Dortmund, Germany5
Answers
did you try the read word2vec model operator on the file?
BR,
Martin
Dortmund, Germany
Gensim is also using binaries, but I went through some of the documentation and they state as follows :
The training algorithms were originally ported from the C package https://code.google.com/p/word2vec/ and extended with additional functionality and optimizations over the years.
So probably the changes are what causes the incompatibility problem.
Thanks anyway, I'll dig deeper in the documentation to understand if there is a way to get a more 'core' format output , and otherwise it's just working with duplicates.
we will probably touch word2vec "soon". I'll add gensim compatibility to the todo list.
BR,
Martin
Dortmund, Germany
Anyway, some further diving into the gensim code learned me that with using alternative load and save methods using KeyedVectors the model can be interchangeable after all.
For the ones interested, loading a rapidminer generated model with gensim word2vec can be done like this :
Saving a model from gensim to be used with rapidminer requires the save_word2vec_format, rather than using the 'gensim optimised' save procedures.