我正在寻找我正在实施的两个功能的新想法。 1)文字分割特征:搭配 Ex:
User Query: Resolved Query:
----------- ---------------
It has lotsofwordstogether It has lots of words together
I am using
我有一个包含70,429个文件(296.5 mb)的语料库。我试图通过使用整个语料库来找到双格。我写了下面的代码; allFiles = ""
for dirName in os.listdir(rootDirectory):
for subDir in os.listdir(dirName):
for fileN in os.listdir(subDir):
我有一个语料库,我有一个词。对于语料库中每个单词的出现,我想得到一个包含前面的k个单词和单词后面的k个单词的列表。我正在做这个算法确定(见下文),但我想知道NLTK是否提供了一些功能来满足我错过的需求? def sized_context(word_index, window_radius, corpus):
""" Returns a list containing the windo
我看到多个问题和答案,说NLTK搭配不能超越双克和三克。 例如,这一个 - How to get n-gram collocations and association in python nltk? 我看到有一个叫 nltk.QuadgramCollocationFinder东西 类似 nltk.BigramCollocationFinder和nltk.TrigramCollocationFin