我是NLP的新手。我试图在python中使用Gensim提取段落的摘要。
我遇到一个短段问题,它给了我一个警告,如下所示,并没有给我一个短段的摘要。
这是我在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))
它给了我如下警告:
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.
输出为(仅打印摘要标签而不是短段的实际摘要):
Summary:
我错过了什么吗?是否还有其他库。