vinhkhuc / JFastText

Java interface for fastText
Other
228 stars 100 forks source link

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 jft.predict #7

Closed dutyhong closed 7 years ago

dutyhong commented 7 years ago

hello , when i use the predict function to predict my label , it except the java.lang.IndexOutOfBoundsException error , how can i solve it ? thank you

vinhkhuc commented 7 years ago

Instead of calling predict(text), can you call predict(text, 1) and check its output? I guess the output would be an empty list.

If so, probably your training data doesn't have correct format. Here is an example of how it should look like.

dutyhong commented 7 years ago

thank you for your suggestion, my problem has been solved

vinhkhuc commented 7 years ago

No problem. Glad that it helps.