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