I am trying to calculate collocations within a document. Is there a possibility to define a window size for it within the NLTK function (as it is with the function "from_words")? Or instead of the window size the border of a sentence or the whole document? Any hints are appreciated! Or is there a library, which can replace NLTK?
finder = BigramCollocationFinder.from_words(str(sentences).split(), window_size = 5)
finder = BigramCollocationFinder.from_documents(documents)