课程: Hands-On Natural Language Processing

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Text extraction for summarization

Text extraction for summarization

- [Instructor] Let's demonstrate how the extractive text summarization method works, using the Python library Sumy. We'll be using a snippet of the blog article by LinkedIn Learning as our data set. First, we install Sumy using pip. Then we input all the necessary modules including LexRank summarizer and LSA summarizer, which provide us with the paths in summarization algorithms. We then create a variable called sample_text to save the text. And to confirm the number of words in the sample_text is 606. We then pass those string using plain text summarizer with English as a tokenizer. Tokenization is the process of breaking down sentences into words. And that is why we have to specify in what language we want that to occur. Next, we instantiate the LexRank summarizer and generate the summary with a sentence count of 20. Voila! We have a summary. Note that we can increase or decrease the sentence count…

内容