mirror of
https://github.com/fccapria/scientify.git
synced 2026-01-12 02:36:10 +00:00
Initial release
This commit is contained in:
commit
ae5e4b8873
52 changed files with 17572 additions and 0 deletions
6
backend/app/utils/nlp.py
Normal file
6
backend/app/utils/nlp.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import yake
|
||||
|
||||
def extract_keywords(text: str, num_keywords: int = 5) -> list:
|
||||
kw_extractor = yake.KeywordExtractor(lan="en", n=1, top=num_keywords)
|
||||
keywords = kw_extractor.extract_keywords(text)
|
||||
return [kw for kw, _ in keywords]
|
||||
Loading…
Add table
Add a link
Reference in a new issue