Examples of TFIDF


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

Examples of edu.udo.cs.wvtool.generic.vectorcreation.TFIDF

        FileWriter outFile = new FileWriter("wv.txt");
        WordVectorWriter wvw = new WordVectorWriter(outFile, true);

        config.setConfigurationRule(WVTConfiguration.STEP_OUTPUT, new WVTConfigurationFact(wvw));

        config.setConfigurationRule(WVTConfiguration.STEP_VECTOR_CREATION, new WVTConfigurationFact(new TFIDF()));

        // Create the vectors
        wvt.createVectors(list, config, wordList);

        // Alternatively: create word list and vectors together
View Full Code Here

Examples of edu.udo.cs.wvtool.generic.vectorcreation.TFIDF

        //WordVectorWriter wvw = new WordVectorWriter()
        WordVectorWriter wvw = new WordVectorWriter(outFile, true);

        config.setConfigurationRule(WVTConfiguration.STEP_OUTPUT, new WVTConfigurationFact(wvw));

        config.setConfigurationRule(WVTConfiguration.STEP_VECTOR_CREATION, new WVTConfigurationFact(new TFIDF()));

        // Create the vectors
        wvt.createVectors(list, config, wordList);

        // Alternatively: create word list and vectors together
View Full Code Here

Examples of edu.udo.cs.wvtool.generic.vectorcreation.TFIDF

        // new WVTConfigurationFact(new TextInputFilter()));
        setConfigurationRule(STEP_CHAR_MAPPER, new WVTConfigurationFact(new DummyCharConverter()));
        setConfigurationRule(STEP_TOKENIZER, new WVTConfigurationFact(new SimpleTokenizer()));
        setConfigurationRule(STEP_WORDFILTER, new WVTConfigurationFact(new StopWordsWrapper()));
        setConfigurationRule(STEP_STEMMER, new WVTConfigurationFact(new LovinsStemmerWrapper()));
        setConfigurationRule(STEP_VECTOR_CREATION, new WVTConfigurationFact(new TFIDF()));
        setConfigurationRule(STEP_OUTPUT, new WVTConfigurationFact(null));

    }
View Full Code Here

Examples of edu.udo.cs.wvtool.generic.vectorcreation.TFIDF

     */
    public WVTWordVector createVector(String text, WVTWordList wordList) throws WVToolException {

        WVTConfiguration config = new WVTConfiguration();

        config.setConfigurationRule(WVTConfiguration.STEP_VECTOR_CREATION, new WVTConfigurationFact(new TFIDF()));

        return createVector(text, new WVTDocumentInfo("", "", "", ""), config, wordList);

    }
View Full Code Here

Examples of edu.udo.cs.wvtool.generic.vectorcreation.TFIDF

        FileWriter outFile = new FileWriter("wv.txt");
        WordVectorWriter wvw = new WordVectorWriter(outFile, true);

        config.setConfigurationRule(WVTConfiguration.STEP_OUTPUT, new WVTConfigurationFact(wvw));

        config.setConfigurationRule(WVTConfiguration.STEP_VECTOR_CREATION, new WVTConfigurationFact(new TFIDF()));

        // Create the vectors
        wvt.createVectors(list, config, wordList);

        // Alternatively: create word list and vectors together
View Full Code Here

Examples of edu.udo.cs.wvtool.generic.vectorcreation.TFIDF

        FileWriter outFile = new FileWriter("wv.dat");
        WordVectorWriter wvw = new WordVectorWriter(outFile, true, true, true, 1);

        config.setConfigurationRule(WVTConfiguration.STEP_OUTPUT, new WVTConfigurationFact(wvw));

        config.setConfigurationRule(WVTConfiguration.STEP_VECTOR_CREATION, new WVTConfigurationFact(new TFIDF()));

        // Create the vectors
        wvt.createVectors(list, config, wordList);

        // Close the output file
View Full Code Here

Examples of edu.udo.cs.wvtool.generic.vectorcreation.TFIDF

        FileWriter outFile = new FileWriter("wv.txt");
        WordVectorWriter wvw = new WordVectorWriter(outFile, true);

        config.setConfigurationRule(WVTConfiguration.STEP_OUTPUT, new WVTConfigurationFact(wvw));

        config.setConfigurationRule(WVTConfiguration.STEP_VECTOR_CREATION, new WVTConfigurationFact(new TFIDF()));

        // Create the vectors
        wvt.createVectors(list, config, wordList);

        // Alternatively: create word list and vectors together
View Full Code Here

Examples of edu.udo.cs.wvtool.generic.vectorcreation.TFIDF

        FileWriter outFile = new FileWriter("wv.txt");
        WordVectorWriter wvw = new WordVectorWriter(outFile, true);

        config.setConfigurationRule(WVTConfiguration.STEP_OUTPUT, new WVTConfigurationFact(wvw));

        config.setConfigurationRule(WVTConfiguration.STEP_VECTOR_CREATION, new WVTConfigurationFact(new TFIDF()));

        // Create the vectors
        wvt.createVectors(list, config, wordList);

        // Alternatively: create word list and vectors together
View Full Code Here

Examples of edu.udo.cs.wvtool.generic.vectorcreation.TFIDF

        FileWriter outFile = new FileWriter("wv.txt");
        WordVectorWriter wvw = new WordVectorWriter(outFile, true);

        config.setConfigurationRule(WVTConfiguration.STEP_OUTPUT, new WVTConfigurationFact(wvw));

        config.setConfigurationRule(WVTConfiguration.STEP_VECTOR_CREATION, new WVTConfigurationFact(new TFIDF()));

        // Create the vectors
        wvt.createVectors(list, config, wordList);

        // Alternatively: create word list and vectors together
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.