Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

NLP text summarization with sumy

# Load Packages
from sumy.parsers.plaintext
import PlaintextParser
from sumy.nlp.tokenizers
import Tokenizer

# Creating text parser using tokenization
parser = PlaintextParser.from_string(text, Tokenizer("english"))

from sumy.summarizers.text_rank
import TextRankSummarizer

# Summarize using sumy TextRank
summarizer = TextRankSummarizer()
summary = summarizer(parser.document, 2)

text_summary = ""
for sentence in summary:
  text_summary += str(sentence)

print(text_summary)
Source by www.topcoder.com #
 
PREVIOUS NEXT
Tagged: #NLP #text #summarization #sumy
ADD COMMENT
Topic
Name
4+6 =