vinhkhuc / JFastText

Java interface for fastText
Other
229 stars 100 forks source link

Load model file from resource #10

Open ssaltin opened 7 years ago

ssaltin commented 7 years ago

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?

SamMohel commented 7 years ago

Did you solve it ?

lidalei commented 6 years ago

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