vinhkhuc / JFastText

Java interface for fastText

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Load model file from resource

ssaltin opened this issue · comments

After quantization feature of fasttext, it is possible to have a small size model files so I can put them in resource folder of a jar. Is it possible to load this model files from jar resource folder directly?

Did you solve it ?

You may create a temporal file and copy the model file in resource folder to it. Next, you can read the temporal model file. If the model file is large, saying 20MB+, I'd recommend not putting it in the resource folder. Check https://github.com/lidalei/JFastText/blob/master/src/main/java/com/github/jfasttext/JFastText.java#L51