public class Model extends Object
Modifier and Type | Field and Description |
---|---|
static ArrayList<DocVector> |
docVectors |
static boolean |
isModelCreated |
Constructor and Description |
---|
Model() |
Modifier and Type | Method and Description |
---|---|
static float |
computeCosineSimilarity(DocVector docVector) |
static DocVector |
createDocVector(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 void createModel(Configuration conf) throws IOException
IOException
public static DocVector createDocVector(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 © 2021 The Apache Software Foundation