Package com.github.pmerienne.trident.ml.nlp

Examples of com.github.pmerienne.trident.ml.nlp.TFIDF


    List<String> d4 = tokenizer.tokenize(FLOWER_WIKI);
    List<String> d5 = tokenizer.tokenize(LILIUM_WIKI);
    List<String> d6 = tokenizer.tokenize(ROSE_WIKI);
    List<List<String>> training = Arrays.asList(d1, d2, d4, d5);

    TFIDF tfidf = new TFIDF();

    // When
    tfidf.init(training, 20);

    // Then
    // System.out.println(Arrays.toString(tfidf.extractFeatures(d3)));
    // System.out.println(Arrays.toString(tfidf.extractFeatures(d6)));
    assertNotNull(tfidf.extractFeatures(d3));
    assertNotNull(tfidf.extractFeatures(d6));

  }
View Full Code Here

TOP

Related Classes of com.github.pmerienne.trident.ml.nlp.TFIDF

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.