vinhkhuc / JFastText

Java interface for fastText
Other
228 stars 100 forks source link

ngram embedding access #26

Open ali3assi opened 6 years ago

ali3assi commented 6 years ago

There is any way to get the ngram for a given word. suppose the word is music and that this music belongs to vocab (we have the embedding of music). How can i get the embedding of the ngram of music, e.g embedding of mus, usi, sic?

lidalei commented 6 years ago

Check https://github.com/lidalei/JFastText/blob/master/src/main/cpp/fasttext_wrapper.h#L29, https://github.com/lidalei/JFastText/blob/master/src/main/cpp/fasttext_wrapper.cc#L89 and https://github.com/lidalei/JFastText/blob/master/src/main/java/com/github/jfasttext/JFastText.java#L100