MaartenGr / KeyBERT

Minimal keyword extraction with BERT
https://MaartenGr.github.io/KeyBERT/
MIT License
3.53k stars 349 forks source link

Varibale keyphrase length? #9

Closed failable closed 3 years ago

failable commented 3 years ago

Does this library support variable keyphrase length?

MaartenGr commented 3 years ago

Yes! You can change the length of the extracted keyphrases with model.extract_keywords(doc, keyphrase_length=3, stop_words=None) where keyphrase_length is the number of words in your keyphrase. Note that although it is possible to set a variable keyphrase length between two values, for example between 2 and 5 words, the model is highly likely to select the longest phrase. Therefore, it is advised to choose a length and experiment yourself with the length that suits your application best.

failable commented 3 years ago

Thank you for the hints!