JFastText icon indicating copy to clipboard operation
JFastText copied to clipboard

print-word-vectors command does not work

Open muldon opened this issue 7 years ago • 1 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 ?

muldon avatar Aug 16 '18 12:08 muldon

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.

kkrugler avatar Nov 21 '18 00:11 kkrugler