vinhkhuc / JFastText

Java interface for fastText

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hi exception: java.lang.IndexOutOfBoundsException

beibeii opened this issue · 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)

Have you solved the problem?

commented

Have you solved the problem?

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

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

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

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)