文档中的搭配,窗口大小

2024-04-26 01:04:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图计算文档中的搭配。是否有可能在NLTK函数中定义窗口大小(就像“from_words”函数一样)?或者用句子或整个文档的边框代替窗口大小?如有任何提示,不胜感激!或者有没有一个可以代替NLTK的库?在

finder = BigramCollocationFinder.from_words(str(sentences).split(), window_size = 5)

finder = BigramCollocationFinder.from_documents(documents)

Tags: 函数from文档定义findersentenceswindowdocuments