【发布时间】:2021-12-08 13:58:32
【问题描述】:
我想使用PyTextRank 进行关键词提取。如何将 500 万个文档(每个文档由几个段落组成)馈送到包中?
这是我在official tutorial 上看到的示例。
text = "Compatibility of systems of linear constraints over the set of natural numbers. Criteria of compatibility of a system of linear Diophantine equations, strict inequations, and nonstrict inequations are considered. Upper bounds for components of a minimal set of solutions and algorithms of construction of minimal generating sets of solutions for all types of systems are given. These criteria and the corresponding algorithms for constructing a minimal supporting set of solutions can be used in solving all the considered types systems and systems of mixed types.\n"
doc = nlp(text)
for phrase in doc._.phrases:
ic(phrase.rank, phrase.count, phrase.text)
ic(phrase.chunks)
我是否只能将数百万个文档连接成一个字符串并将其传递给nlp(text)?我不认为我可以使用nlp.pipe(texts),因为我想通过计算所有文档中的单词/短语来创建一个网络。
【问题讨论】:
标签: spacy keyword-extraction pytextrank