com.hankcs.hanlp.model.crf
类 CRFModel

java.lang.Object
  继承者 com.hankcs.hanlp.model.crf.CRFModel
所有已实现的接口:
ICacheAble
直接已知子类:
CRFSegmentModel

public class CRFModel
extends Object
implements ICacheAble

作者:
hankcs

字段摘要
protected  String[] id2tag
           
protected  double[][] matrix
          tag的转移矩阵
 
构造方法摘要
CRFModel()
           
CRFModel(ITrie<FeatureFunction> featureFunctionTrie)
          以指定的trie树结构储存内部特征函数
 
方法摘要
protected static double computeScore(LinkedList<double[]> scoreList, int tag)
          给一系列特征函数结合tag打分
 LinkedList<double[]> computeScoreList(Table table, int current)
           
 Integer getTagId(String tag)
          获取某个tag的ID
 boolean load(ByteArray byteArray)
           
static CRFModel loadTxt(String path)
           
static CRFModel loadTxt(String path, CRFModel instance)
           
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
 

字段详细信息

id2tag

protected String[] id2tag

matrix

protected double[][] matrix
tag的转移矩阵

构造方法详细信息

CRFModel

public CRFModel()

CRFModel

public CRFModel(ITrie<FeatureFunction> featureFunctionTrie)
以指定的trie树结构储存内部特征函数

参数:
featureFunctionTrie -
方法详细信息

onLoadTxtFinished

protected void onLoadTxtFinished()

loadTxt

public static CRFModel loadTxt(String path,
                               CRFModel instance)

tag

public void tag(Table table)
维特比后向算法标注

参数:
table -

computeScoreList

public LinkedList<double[]> computeScoreList(Table table,
                                             int current)

computeScore

protected static double computeScore(LinkedList<double[]> scoreList,
                                     int tag)
给一系列特征函数结合tag打分

参数:
scoreList -
tag -
返回:

save

public void save(DataOutputStream out)
          throws Exception
从接口 ICacheAble 复制的描述
写入

指定者:
接口 ICacheAble 中的 save
抛出:
Exception

load

public boolean load(ByteArray byteArray)
指定者:
接口 ICacheAble 中的 load

loadTxt

public static CRFModel loadTxt(String path)

getTagId

public Integer getTagId(String tag)
获取某个tag的ID

参数:
tag -
返回:


Copyright © 2014–2015 码农场. All rights reserved.