public TextRankExtractor() { Span = 5; Segmenter = new JiebaSegmenter(); PosSegmenter = new PosSegmenter(Segmenter); SetStopWords(ConfigManager.StopWordsFile); if (StopWords.IsEmpty()) { StopWords.UnionWith(DefaultStopWords); } }
/// <summary> /// 文本排序 /// </summary> public TextRankExtractor() { Span = 5; Segmenter = new Segmenter(); PosSegmenter = new PosSegmenter(Segmenter); StopWords = Dict.StopWords; if (StopWords.IsEmpty()) { StopWords.UnionWith(DefaultStopWords); } }
public TfidfExtractor() { Segmenter = new JiebaSegmenter(); PosSegmenter = new PosSegmenter(Segmenter); SetStopWords(ConfigManager.StopWordsFile); if (StopWords.IsEmpty()) { StopWords.UnionWith(DefaultStopWords); } Loader = new IdfLoader(DefaultIdfFile); IdfFreq = Loader.IdfFreq; MedianIdf = Loader.MedianIdf; }
public TfidfExtractor(JiebaSegmenter segmenter = null) { Segmenter = segmenter.IsNull() ? new JiebaSegmenter() : segmenter; PosSegmenter = new PosSegmenter(Segmenter); //SetStopWords(ConfigManager.StopWordsFile); SetFromResources(); if (StopWords.IsEmpty()) { StopWords.UnionWith(DefaultStopWords); } //Loader = new IdfLoader(DefaultIdfFile); Loader = new IdfLoader(); Loader.LoadFromResources(); IdfFreq = Loader.IdfFreq; MedianIdf = Loader.MedianIdf; }
/// <summary> /// TF-IDF /// </summary> /// <param name="segmenter"></param> public TfidfExtractor(Segmenter segmenter = null) { if (segmenter.IsNull()) { Segmenter = new Segmenter(); } else { Segmenter = segmenter; } PosSegmenter = new PosSegmenter(Segmenter); StopWords = Dict.StopWords; if (StopWords.IsEmpty()) { StopWords.UnionWith(DefaultStopWords); } Loader = new IdfLoader(); IdfFreq = Loader.IdfFreq; MedianIdf = Loader.MedianIdf; }
public TfidfExtractor(JiebaSegment segment = null) { if (segment.IsNull()) { Segment = new JiebaSegment(); } else { Segment = segment; } PosSegmenter = new PosSegmenter(Segment); SetStopWords(ConfigManager.StopWordsFile); if (StopWords.IsEmpty()) { StopWords.UnionWith(DefaultStopWords); } Loader = new IdfLoader(DefaultIdfFile); IdfFreq = Loader.IdfFreq; MedianIdf = Loader.MedianIdf; }