public class TfidfVectorizer extends BaseTextVectorizer implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
TfidfVectorizer.Builder |
cache, docIter, labels, minWordFrequency, sentenceIterator, stopWords, tokenizerFactory, trainingSystem| Modifier | Constructor and Description |
|---|---|
|
TfidfVectorizer() |
protected |
TfidfVectorizer(VocabCache cache,
TokenizerFactory tokenizerFactory,
List<String> stopWords,
int layerSize,
int minWordFrequency,
DocumentIterator docIter,
SentenceIterator sentenceIterator,
List<String> labels,
InvertedIndex index) |
| Modifier and Type | Method and Description |
|---|---|
org.nd4j.linalg.api.ndarray.INDArray |
transform(String text)
Transforms the matrix
|
org.nd4j.linalg.dataset.DataSet |
vectorize() |
org.nd4j.linalg.dataset.DataSet |
vectorize(File input,
String label) |
org.nd4j.linalg.dataset.DataSet |
vectorize(InputStream is,
String label)
Text coming from an input stream considered as one document
|
org.nd4j.linalg.dataset.DataSet |
vectorize(String text,
String label)
Vectorizes the passed in text treating it as one document
|
fit, getCache, getDocIter, getLayerSize, getMinWordFrequency, getSentenceIterator, getStopWords, getTokenizerFactory, index, numWordsEncountered, setCache, setDocIter, setLayerSize, setMinWordFrequency, setSentenceIterator, setStopWords, setTokenizerFactory, vocabpublic TfidfVectorizer()
protected TfidfVectorizer(VocabCache cache, TokenizerFactory tokenizerFactory, List<String> stopWords, int layerSize, int minWordFrequency, DocumentIterator docIter, SentenceIterator sentenceIterator, List<String> labels, InvertedIndex index)
public org.nd4j.linalg.dataset.DataSet vectorize(InputStream is, String label)
TextVectorizervectorize in interface TextVectorizeris - the input stream to read fromlabel - the label to assignpublic org.nd4j.linalg.dataset.DataSet vectorize(String text, String label)
TextVectorizervectorize in interface TextVectorizertext - the text to vectorizelabel - the label of the textpublic org.nd4j.linalg.dataset.DataSet vectorize(File input, String label)
vectorize in interface TextVectorizerinput - the text to vectorizelabel - the label of the textpublic org.nd4j.linalg.api.ndarray.INDArray transform(String text)
transform in interface TextVectorizertext - public org.nd4j.linalg.dataset.DataSet vectorize()
vectorize in interface VectorizerCopyright © 2014. All rights reserved.