INNER CODE UNIT · Java

HotelCommentExampleTrain

mayabot/mynlp · mynlp-example/src/main/java/classification/HotelCommentExampleTrain.java:18

public class HotelCommentExampleTrain {


    public static void main(String[] args) throws Exception {

        prepare();

        File trainFile = new File("example.data/hotel/hotel-train-seg.txt");
        File testFile = new File("example.data/hotel/hotel-test-seg.txt");

        InputArgs trainArgs = new InputArgs();
        trainArgs.setLoss(LossName.hs);
        trainArgs.setEpoch(10);
        trainArgs.setDim(100);
        trainArgs.setLr(0.2);

        FastText fastText = FastText.trainSupervised(trainFile, trainArgs);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…