public class Model
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.ArrayList<DocVector> |
docVectors |
static boolean |
isModelCreated |
Constructor and Description |
---|
Model() |
Modifier and Type | Method and Description |
---|---|
static float |
computeCosineSimilarity(DocVector docVector) |
static DocVector |
createDocVector(java.lang.String content,
int mingram,
int maxgram)
Used to create a DocVector from given String text.
|
static void |
createModel(Configuration conf) |
static int[] |
retrieveNgrams(Configuration conf)
Retrieves mingram and maxgram from configuration
|
public static java.util.ArrayList<DocVector> docVectors
public static boolean isModelCreated
public static void createModel(Configuration conf) throws java.io.IOException
java.io.IOException
public static DocVector createDocVector(java.lang.String content, int mingram, int maxgram)
content
- The text to tokenizemingram
- Value of mingram for tokenizingmaxgram
- Value of maxgram for tokenizingpublic static float computeCosineSimilarity(DocVector docVector)
public static int[] retrieveNgrams(Configuration conf)
conf
- Configuration to retrieve mingram and maxgramCopyright © 2018 The Apache Software Foundation