KeyBERT icon indicating copy to clipboard operation
KeyBERT copied to clipboard

Highligth n_grams index error

Open aucan opened this issue 3 years ago • 3 comments

https://github.com/MaartenGr/KeyBERT/blob/6ab9af1cfe74a126e709539a2467426d0881945c/keybert/_highlight.py#L94

this line should be skip = skip - 2

aucan avatar Nov 10 '21 22:11 aucan

Thank you for the issue. However, if I were to make it skip = skip - 2 a significant portion of the text will actually not be seen as skip will go into negative values. Could you go into more depth with respect to your issue and create a reproducible example?

MaartenGr avatar Nov 11 '21 06:11 MaartenGr

The error was not small enough to be solved with a variable. An example code : https://gist.github.com/aucan/57134dc83531c8e29c3e69577ed72eae

aucan avatar Nov 11 '21 11:11 aucan

Thank you for the reproducible code. I will have to look into this as it seems that the nskip, which I prefer to be automatically calculated, to not fully solve the issue.

MaartenGr avatar Nov 12 '21 07:11 MaartenGr