BotSharp/BotSharp.NLP/Models/CRFLite/CRFSharpHelper.cs

42 lines
1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using BotSharp.Models.CRFLite.Decoder;
using System;
using System.Collections.Generic;
using System.Text;
namespace BotSharp.Models.CRFLite
{
public class SegToken
{
public int offset;
public int length;
public string strTag; //CRF对应于term组合后的Tag字符串
public double fWeight; //对应属性id的概率值或者得分
};
public class crf_seg_out : CRFTermOut
{
//Segmented token by merging raw CRF model output
public int termTotalLength; // the total term length in character
public List<SegToken> tokenList;
public int Count
{
get { return tokenList.Count; }
}
public void Clear()
{
termTotalLength = 0;
tokenList.Clear();
}
public crf_seg_out(int max_word_num = BaseUtils.DEFAULT_CRF_MAX_WORD_NUM):
base(max_word_num)
{
termTotalLength = 0;
tokenList = new List<SegToken>();
}
};
}