Skip to content

Instantly share code, notes, and snippets.

@robgon-art
Created May 7, 2022 17:41
Show Gist options
  • Select an option

  • Save robgon-art/7d438f3fcb3d012af594bfd7e2313549 to your computer and use it in GitHub Desktop.

Select an option

Save robgon-art/7d438f3fcb3d012af594bfd7e2313549 to your computer and use it in GitHub Desktop.
from keybert import KeyBERT
kw_model = KeyBERT()
summary = "After leaving her fiancé, Barry, at the altar, Rachel finds herself in Central Perk Café, soaking wet in her wedding dress."
theme = kw_model.extract_keywords(summary, keyphrase_ngram_range=(1, 3))[0][0]
print(theme)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment