2017-05-22 7 views
0

뉴스 기사에서 요약본을 추출하려고합니다. 다음은 지금까지 시도한 내용입니다.Python3 : 기사 작성하기

>>> 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

힘든 작업입니다. 나는 당신이 원하는 것을 수행 할 수있는 파이썬 라이브러리가 있다는 것을 의심 스럽다. – lenz

+0

두 번째로, 나는 ai.stackexchange.com – amirouche

답변

0

영어 텍스트를 요약하는 여러 가지 방법을 제공하는 sumy이 있습니다. 이러한 알고리즘 중 대부분 (전부는 아님)은 입력 문서에서 문장을 추출합니다. 이러한 문장을 바탕으로 문장을 분할 및/또는 병합하고 동의어를 사용하여 후 처리 할 수 ​​있습니다.

이외에도이 주제는 아직 공학 분야가 아니지만 연구 대상입니다. AI StackExchange을 시도해보십시오.

+0

으로 이사해야한다는 질문을 던졌지 만 추상 또는 내 자신의 말로 출력을 제공하지는 않습니다. 이것은 추출 기반의 요약 라이브러리와 같습니다. –

+0

죄송합니다, "맞춤 단어"문제에 대해 잊어 버렸습니다. 나는 대답을 업데이트했다. – amirouche