예제 #1
0
파일: HanLP.cs 프로젝트: shibox/JShibo.NLP
 /**
  * 自动摘要
  * @param document 目标文档
  * @param max_length 需要摘要的长度
  * @return 摘要文本
  */
 public static String getSummary(String document, int max_length)
 {
     // Parameter size in this method refers to the string length of the summary required;
     // The actual length of the summary generated may be short than the required length, but never longer;
     return(TextRankSentence.getSummary(document, max_length));
 }
예제 #2
0
파일: HanLP.cs 프로젝트: shibox/JShibo.NLP
        /**
         * 依存文法分析
         * @param sentence 待分析的句子
         * @return CoNLL格式的依存关系树
         */
        //public static CoNLLSentence parseDependency(String sentence)
        //{
        //    return NeuralNetworkDependencyParser.compute(sentence);
        //}

        /**
         * 提取短语
         * @param text 文本
         * @param size 需要多少个短语
         * @return 一个短语列表,大小 <= size
         */
        //public static List<String> extractPhrase(String text, int size)
        //{
        //    IPhraseExtractor extractor = new MutualInformationEntropyPhraseExtractor();
        //    return extractor.extractPhrase(text, size);
        //}

        /**
         * 提取关键词
         * @param document 文档内容
         * @param size 希望提取几个关键词
         * @return 一个列表
         */
        //public static List<String> extractKeyword(String document, int size)
        //{
        //    return TextRankKeyword.getKeywordList(document, size);
        //}

        /**
         * 自动摘要
         * @param document 目标文档
         * @param size 需要的关键句的个数
         * @return 关键句列表
         */
        public static List <String> extractSummary(String document, int size)
        {
            return(TextRankSentence.getTopSentenceList(document, size));
        }