示例#1
0
        public TextRankExtractor()
        {
            Span = 5;

            Segmenter    = new JiebaSegmenter();
            PosSegmenter = new PosSegmenter(Segmenter);
            SetStopWords(ConfigManager.StopWordsFile);
            if (StopWords.IsEmpty())
            {
                StopWords.UnionWith(DefaultStopWords);
            }
        }
示例#2
0
        /// <summary>
        /// 文本排序
        /// </summary>
        public TextRankExtractor()
        {
            Span = 5;

            Segmenter    = new Segmenter();
            PosSegmenter = new PosSegmenter(Segmenter);

            StopWords = Dict.StopWords;

            if (StopWords.IsEmpty())
            {
                StopWords.UnionWith(DefaultStopWords);
            }
        }
示例#3
0
        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;
        }
示例#4
0
        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;
        }
示例#5
0
        /// <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;
        }