vinhkhuc / JFastText

Java interface for fastText
Other
228 stars 100 forks source link

hi exception: java.lang.IndexOutOfBoundsException #13

Open beibeii opened 7 years ago

beibeii commented 7 years ago

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.get(ArrayList.java:429) at com.github.jfasttext.JFastText.predictProba(JFastText.java:60)

L-glory commented 7 years ago

Have you solved the problem?

chenjun0210 commented 7 years ago

Have you solved the problem?

sandove commented 6 years ago

Came across the same problem. Could anyone help with this?

shayts7 commented 6 years ago

+1

sandove commented 6 years ago

Finally I use this instead: https://github.com/ivanhk/fastText_java

lidalei commented 6 years ago

Could you release the code that caused the problem. I tried predictProba and it works fine. Look at the code

  public JFastText.ProbLabel predictProba(String text) {
    List<JFastText.ProbLabel> probaPredictions = this.predictProba(text, 1);
    return probaPredictions.size() > 0 ? (JFastText.ProbLabel)probaPredictions.get(0) : null;
  }
enochmonightsky commented 6 years ago

i wonder what is the rule of the text to be predict,i test text,text+"\t"+text,text+"\n"+text,etc,all of them come to index out of bounds.and the problem is also at com.github.jfasttext.JFastText.predictProba(JFastText.java:60)