### Question:
FastText implements WordVectors, Serializable { public void fit() { String[] cmd = makeArgs(); fastTextImpl.runCmd(cmd); } FastText(File modelPath);  FastText(); void fit(); void loadIterator(); void loadPretrainedVectors(File vectorsFile); void loadBinaryModel(String modelPath); void unloadBinaryModel(); void test(File testFile); String predict(String text); Pair<String, Float> predictProbability(String text); @Override VocabCache vocab(); @Override long vocabSize(); @Override String getUNK(); @Override void setUNK(String input); @Override double[] getWordVector(String word); @Override INDArray getWordVectorMatrixNormalized(String word); @Override INDArray getWordVectorMatrix(String word); @Override INDArray getWordVectors(Collection<String> labels); @Override INDArray getWordVectorsMean(Collection<String> labels); @Override boolean hasWord(String word); @Override Collection<String> wordsNearest(INDArray words, int top); @Override Collection<String> wordsNearestSum(INDArray words, int top); @Override Collection<String> wordsNearestSum(String word, int n); @Override Collection<String> wordsNearestSum(Collection<String> positive, Collection<String> negative, int top); @Override Map<String, Double> accuracy(List<String> questions); @Override int indexOf(String word); @Override List<String> similarWordsInVocabTo(String word, double accuracy); @Override Collection<String> wordsNearest(Collection<String> positive, Collection<String> negative, int top); @Override Collection<String> wordsNearest(String word, int n); @Override double similarity(String word, String word2); @Override WeightLookupTable lookupTable(); @Override void setModelUtils(ModelUtils utils); @Override void loadWeightsInto(INDArray array); @Override int vectorSize(); @Override boolean jsonSerializable(); double getLearningRate(); int getDimension(); int getContextWindowSize(); int getEpoch(); int getNegativesNumber(); int getWordNgrams(); String getLossName(); String getModelName(); int getNumberOfBuckets(); String getLabelPrefix(); @Override boolean outOfVocabularySupported();  }### Answer:
@Test public void testTrainSupervised() throws IOException { File output = testDir.newFile(); FastText fastText = FastText.builder().supervised(true). inputFile(inputFile.getAbsolutePath()). outputFile(output.getAbsolutePath()).build(); log.info("\nTraining supervised model ...\n"); fastText.fit(); }
@Test public void testTrainSkipgram() throws IOException { File output = testDir.newFile(); FastText fastText = FastText.builder().skipgram(true). inputFile(inputFile.getAbsolutePath()). outputFile(output.getAbsolutePath()).build(); log.info("\nTraining supervised model ...\n"); fastText.fit(); }
@Test public void testTrainSkipgramWithBuckets() throws IOException { File output = testDir.newFile(); FastText fastText = FastText.builder().skipgram(true). bucket(150). inputFile(inputFile.getAbsolutePath()). outputFile(output.getAbsolutePath()).build(); log.info("\nTraining supervised model ...\n"); fastText.fit(); }
@Test public void testTrainCBOW() throws IOException { File output = testDir.newFile(); FastText fastText = FastText.builder().cbow(true). inputFile(inputFile.getAbsolutePath()). outputFile(output.getAbsolutePath()).build(); log.info("\nTraining supervised model ...\n"); fastText.fit(); }
@Test public void testPretrainedVectors() throws IOException { File output = testDir.newFile(); FastText fastText = FastText .builder() .supervised(true) .inputFile(inputFile.getAbsolutePath()) .pretrainedVectorsFile(supervisedVectors.getAbsolutePath()) .outputFile(output.getAbsolutePath()) .build(); log.info("\nTraining supervised model ...\n"); fastText.fit(); }