Documentation of 'smile.nlp.collocation.AprioriPhraseExtractor' Java class
AprioriPhraseExtractor
smile.nlp.collocation

Class AprioriPhraseExtractor



  • public class AprioriPhraseExtractor
    extends java.lang.Object
    An Apiori-like algorithm to extract n-gram phrases. The algorithm was proposed in "A Study Using n-gram Features for Text Categorization" by Johannes Furnkranz.

    The algorithm takes a collection of sentences and generates all n-grams of length at most MaxNGramSize that occur at least MinFrequency times in the sentences.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.util.ArrayList<java.util.ArrayList<NGram>> extract(java.util.Collection<java.lang.String[]> sentences, int maxNGramSize, int minFrequency)
      Extracts n-gram phrases.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AprioriPhraseExtractor

        public AprioriPhraseExtractor()
    • Method Detail

      • extract

        public java.util.ArrayList<java.util.ArrayList<NGram>> extract(java.util.Collection<java.lang.String[]> sentences,
                                                                       int maxNGramSize,
                                                                       int minFrequency)
        Extracts n-gram phrases.
        Parameters:
        sentences - A collection of sentences (already split).
        maxNGramSize - The maximum length of n-gram
        minFrequency - The minimum frequency of n-gram in the sentences.
        Returns:
        An array list of sets of n-grams. The i-th entry is the set of i-grams.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.