com.hankcs.hanlp.summary
类 TextRankSentence
java.lang.Object
com.hankcs.hanlp.summary.TextRankSentence
public class TextRankSentence
- extends Object
TextRank 自动摘要
- 作者:
- hankcs
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextRankSentence
public TextRankSentence(List<List<String>> docs)
getTopSentence
public int[] getTopSentence(int size)
- 获取前几个关键句子
- 参数:
size - 要几个
- 返回:
- 关键句子的下标
main
public static void main(String[] args)
getTopSentenceList
public static List<String> getTopSentenceList(String document,
int size)
- 一句话调用接口
- 参数:
document - 目标文档size - 需要的关键句的个数
- 返回:
- 关键句列表
Copyright © 2014–2015 码农场. All rights reserved.