|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcom.hankcs.hanlp.model.crf.CRFModel
public class CRFModel
| 字段摘要 | |
|---|---|
protected String[] |
id2tag
id转标签 |
protected double[][] |
matrix
tag的二元转移矩阵,适用于BiGram Feature |
| 构造方法摘要 | |
|---|---|
CRFModel()
|
|
CRFModel(ITrie<FeatureFunction> featureFunctionTrie)
以指定的trie树结构储存内部特征函数 |
|
| 方法摘要 | |
|---|---|
protected static double |
computeScore(LinkedList<double[]> scoreList,
int tag)
给一系列特征函数结合tag打分 |
protected LinkedList<double[]> |
computeScoreList(Table table,
int current)
根据特征函数计算输出 |
Integer |
getTagId(String tag)
获取某个tag的ID |
boolean |
load(ByteArray byteArray)
载入 |
static CRFModel |
load(String path)
加载CRF++模型 如果存在缓存的话,优先读取缓存,否则读取txt,并且建立缓存 |
static CRFModel |
loadBin(String path)
加载Bin形式的CRF++模型 |
static CRFModel |
loadTxt(String path)
加载Txt形式的CRF++模型 同时生成path.bin模型缓存 |
static CRFModel |
loadTxt(String path,
CRFModel instance)
加载Txt形式的CRF++模型 |
protected void |
onLoadTxtFinished()
|
void |
save(DataOutputStream out)
写入 |
void |
tag(Table table)
维特比后向算法标注 |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
protected String[] id2tag
protected double[][] matrix
| 构造方法详细信息 |
|---|
public CRFModel()
public CRFModel(ITrie<FeatureFunction> featureFunctionTrie)
featureFunctionTrie - | 方法详细信息 |
|---|
protected void onLoadTxtFinished()
public static CRFModel loadTxt(String path,
CRFModel instance)
path - 模型路径instance - 模型的实例(这里允许用户构造不同的CRFModel来储存最终读取的结果)
public void tag(Table table)
table -
protected LinkedList<double[]> computeScoreList(Table table,
int current)
table - current -
protected static double computeScore(LinkedList<double[]> scoreList,
int tag)
scoreList - tag -
public void save(DataOutputStream out)
throws Exception
ICacheAble 复制的描述
ICacheAble 中的 saveExceptionpublic boolean load(ByteArray byteArray)
ICacheAble 复制的描述
ICacheAble 中的 loadpublic static CRFModel loadTxt(String path)
path - 模型路径
public static CRFModel load(String path)
path - txt的路径,即使不存在.txt,只存在.bin,也应传入txt的路径,方法内部会自动加.bin后缀
public static CRFModel loadBin(String path)
path -
public Integer getTagId(String tag)
tag -
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||