Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

NLP text summarization with Luhn

from sumy.summarizers.luhn
import LuhnSummarizer
def lunh_method(text):
  parser = PlaintextParser.from_string(text, Tokenizer("english"))
summarizer_luhn = LuhnSummarizer()
summary_1 = summarizer_luhn(parser.document, 2)
dp = []
for i in summary_1:
  lp = str(i)
dp.append(lp)
final_sentence = ' '.join(dp)
return final_sentence
Source by www.topcoder.com #
 
PREVIOUS NEXT
Tagged: #NLP #text #summarization #Luhn
ADD COMMENT
Topic
Name
6+1 =