vinhkhuc / JFastText

Java interface for fastText

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

print-word-vectors command does not work

muldon opened this issue · comments

I could not be able to test print-word-vectors command. While the original is ./fasttext print-word-vectors model.bin < queries.txt, according to JFastText documentation it should be something like:

JFastText jft = new JFastText();
    jft.runCmd(new String[] {
            "print-word-vectors",
            "src/test/resources/models/cbow.model.bin",
            "<",
            "src/test/resources/data/queries.txt"
    });

I checked the compiled version and the command receives 3 arguments. The same command works using linux terminal:
cat queries.txt | java -jar /PATH/JFastText/target/jfasttext-0.4-SNAPSHOT-jar-with-dependencies.jar print-word-vectors ../models/cbow.model.bin > queries.txt
Is there something wrong with the number of parameters on JFastText implementation ?

I believe the runCmd() method passes arguments to fasttext. The last two arguments you're trying to use ("<" and "src/test/resources/data/queries.txt") are shell parameters, not fasttext parameters.