自然语言处理(NLP)-第三方库(工具包):summa【抽取文本中的“关键词”、“关键句” 】【基于TextRank】

from summa import summarizer
from summa import keywords

if __name__ == "__main__":
    text = """
        Automatic summarization is the process of reducing a text document with a computer program in order to create a summary that retains the most important points of the original document. 
        As the problem of information overload has grown, and as the quantity of data has increased, so has interest in automatic summarization. 
        Technologies that can make a coherent summary take into account variables such as length, writing style and syntax. 
        An example of the use of summarization technology is search engines such as Google. 
        Document summarization is another.
        """

    my_summary = summarizer.summarize(text)
    my_keywords = keywords.keywords(text)

    print("my_summary = \n{0}".format(my_summary))
    print("my_keywords = \n{0}".format(my_keywords))

打印结果:

my_summary = 
Automatic summarization is the process of reducing a text document with a computer program in order to create a summary that retains the most important points of the original document.

my_keywords = 
document
automatic summarization
technologies
technology

Process finished with exit code 0
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值