smile.nlp.collocation
Class AprioriPhraseExtractor
- java.lang.Object
-
- smile.nlp.collocation.AprioriPhraseExtractor
-
public class AprioriPhraseExtractor extends java.lang.ObjectAn 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.
-
-
Constructor Summary
Constructors Constructor and Description AprioriPhraseExtractor()
-
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.
-
-
-
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-gramminFrequency- 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