Tha*_*ess 5 python python-3.x gensim
我是NLP的新手。我试图使用Gensim在python中提取段落的摘要。
我遇到一个简短的段落的问题,它给了我以下警告,并且没有给我简短的摘要。
这是我在Python中的代码:
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
from gensim.summarization import summarize
text = "short paragraph"
print ('Summary:')
print (summarize(text))
Run Code Online (Sandbox Code Playgroud)
它给我警告如下:
2018-02-01 17:31:47,247 : WARNING : Input text is expected to have at least 10 sentences.
2018-02-01 17:31:47,253 : INFO : adding document #0 to Dictionary(0 unique tokens: [])
2018-02-01 17:31:47,258 : INFO : built Dictionary(52 unique tokens: ['clearli', 'adult', 'chang', 'member', 'visit']...) from 4 documents (total 70 corpus positions)
2018-02-01 17:31:47,262 : WARNING : Input corpus is expected to have at least 10 documents.
2018-02-01 17:31:47,285 : WARNING : Couldn't get relevant sentences.
Run Code Online (Sandbox Code Playgroud)
输出为(仅打印摘要标签,而不是简短段落的实际摘要):
Summary:
Run Code Online (Sandbox Code Playgroud)
我想念什么吗?是否有其他相同的库。
| 归档时间: |
|
| 查看次数: |
2806 次 |
| 最近记录: |