public class Occurrence extends Object implements Serializable
| Constructor and Description |
|---|
Occurrence() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(List<Element> words) |
void |
addColRow(Collection<String> rows,
Collection<String> cols) |
void |
addWords(Collection<String> words) |
void |
computeTFIDF()
tf/idf 计算分数
|
List<Map.Entry<String,Double>> |
distance(String word)
得到两个词的距离
|
double |
distance(String word1,
String word2)
得到两个词的距离
|
List<Map.Entry<String,Double>> |
distanceLogFreq(String word) |
List<Map.Entry<String,Double>> |
distanceLogFreq1(String word) |
Map<String,Count> |
getWord2Mc() |
static Occurrence |
loadModel(String filePath)
读取模型
|
void |
saveModel(String filePath)
保存模型
|
public void addWords(Collection<String> words)
public void addColRow(Collection<String> rows, Collection<String> cols)
public void computeTFIDF()
public void saveModel(String filePath) throws IOException
IOExceptionpublic static Occurrence loadModel(String filePath) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionCopyright © 2017. All rights reserved.