JFastText icon indicating copy to clipboard operation
JFastText copied to clipboard

hi exception: java.lang.IndexOutOfBoundsException

Open beibeii opened this issue 7 years ago • 7 comments

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)

beibeii avatar Jun 27 '17 08:06 beibeii

Have you solved the problem?

L-glory avatar Aug 29 '17 05:08 L-glory

Have you solved the problem?

chenjun0210 avatar Sep 15 '17 10:09 chenjun0210

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

sandove avatar Nov 06 '17 07:11 sandove

+1

shayts7 avatar Dec 04 '17 13:12 shayts7

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

sandove avatar Dec 16 '17 06:12 sandove

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;
  }

lidalei avatar Jan 06 '18 13:01 lidalei

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)

enochmonightsky avatar Jul 12 '18 12:07 enochmonightsky