boudinfl / pke

Python Keyphrase Extraction module
GNU General Public License v3.0
1.57k stars 291 forks source link

Created function to compute gap that never returns 0 (TopicRank et al.) #229

Closed ygorg closed 1 year ago

ygorg commented 1 year ago

Linked to #207 #176 etc... This time it should be good. The only missing case was when candidates started at the same offset (that only happen with ngram_selection). I simplified the function that already worked well, but didn't account for the following 1/gap.

SrijanSriv commented 1 year ago

Other than refactoring the code, I believe the important change made was to prevent gap from being 0 by simply making it 1. This in turn should assign a unit weight to the edge between that pair of candidates, essentially making it sure that they are chosen together always. I hope that is in the right direction?

Thanks a lot for making this change by the way 🐳