midas-research / dlkp

A deep learning library for identifying keyphrases from text
MIT License
25 stars 3 forks source link

Usage Interface #14

Closed debanjanbhucs closed 2 years ago

debanjanbhucs commented 2 years ago

It will be nice to have the usage interface as follows

from dlkp.models import KeyphraseTagger from dlkp.models import KeyphraseGenerator

load the keyphrase tagger tagger = KeyphraseTagger.load(<path to tagger/model name in huggingface hub>

Run keyphrase extraction over input_text tagger.predict(input_text)

load the keyphrase generator generator = KeyphraseGenerator.load(<path to tagger/model name in huggingface hub>

Run keyphrase generation over input_text generator.predict(input_text)

ad6398 commented 2 years ago

@debanjanbhucs this is fixed with PR #15 . pls look at inference_tagger.py and 'train_tagger...py` for usage details.