flashtext icon indicating copy to clipboard operation
flashtext copied to clipboard

How to get the new text after keywords are removed?

Open lingvisa opened this issue 2 years ago • 1 comments

>>> keyword_processor.remove_keywords_from_dict({"product management": ["PM"]})
>>> keyword_processor.remove_keywords_from_list(["java programing"])
>>> keyword_processor.extract_keywords('I am a product manager for a java_2e platform')

These all returns extracted words after the removal. But how to get the NEW sentence after the keywords are removed? It seems it doesn't modify the original text. How can I get the new sentence?

lingvisa avatar Jan 22 '22 04:01 lingvisa

Hi, it's on the documentation

>>> keyword_processor.add_keyword('New Delhi', 'NCR region')
>>> new_sentence = keyword_processor.replace_keywords('I love Big Apple and new delhi.')
>>> new_sentence
>>> # 'I love New York and NCR region.'

AbrJA avatar Jun 23 '22 18:06 AbrJA