Closed KrishnaSindhur closed 4 years ago
Hey Krishna, If I understood correctly your problem, flashtext already solves it.
Just mention, the keyword, and metadata expected before to the keyword Processor. In your case keyword "xyz"
you can mention the metadata which you want to retrieve: {"java":
{ "meta": { "count": 10, "score": 0.24 } } }`.
Code Snippet:
from flashtext import KeywordProcessor
kp = KeywordProcessor()
kp.add_keyword('xyz', {"java": { "meta": { "count": 10, "score": 0.24 } } })
kp.extract_keywords('i know xyz.')
Returns:
[{'java': {'meta': {'count': 10, 'score': 0.24}}}]
hi i am from belong we have one use case that is we need to store additional meta data along with sibling. {"java": [{ "name": "xyz", "meta": { "count":10, "score":0.24 } }, { "name : "abc", "meta": { "count :12, "score": 0.5 } }]
so now if sentence is like this "i know xyz" it should return - ["java": { "meta": { "count: 10, "score":0.24 } }]
so if this look like generic one can we implement to the flash text library.
Thanks
Regards Krishna