我试图从新闻文章中提取摘要。这是我到现在为止所尝试的:
>>> from newspaper import Article
>>> url = 'http://abcnews.go.com/International/wireStory/north-korea-ready-deploy-mass-produce-missile-47552675'
>>> article = Article(url)
>>> article.download()
>>> article.parse()
>>> article.nlp()
>>> article.keywords
['ready', 'north', 'test', 'missiles', 'deploy', 'tested', 'korea', 'missile', 'launch', 'nuclear', 'capable', 'media', 'massproduce']
>>> article.summary
'North Korea says it\'s ready to deploy and start mass-producing a new medium-range missile capable of reaching Japan and major U.S. military bases there following a test launch it claims confirmed the missile\'s combat readiness and is an "answer" to U.S. President Donald Trump\'s policies.\nPyongyang\'s often-stated goal is to perfect a nuclear warhead that it can put on a missile capable of hitting Washington or other U.S. cities.\nAt the request of diplomats from the U.S., Japan and South Korea, a United Nations\' Security Council consultation on the missile test will take place Tuesday.\nNorth Korea a week earlier had successfully tested a new midrange missile — the Hwasong 12 — that it said could carry a heavy nuclear warhead.\nExperts said that rocket flew higher and for a longer time than any other missile previously tested by North Korea and represents another big advance toward a viable ICBM.'
我已经看到上段生成的摘要完全取自新闻文章本身。而我希望实现像人类一样的总结(用自己的话或旋转内容或任何东西,但应该是相关的)。
请注意,建议我或建议我需要做什么,以便我的代码完全符合我的要求?
答案 0 :(得分:0)
有sumy确实提供了几种汇总英语文本的方法。大多数(如果不是全部)算法将从输入文档中提取句子。基于这些句子,您可以对它们进行后处理以拆分和/或合并句子并使用同义词。
除此之外,这个主题在工程领域还不是研究领域。试试AI StackExchange。