flashtext
flashtext copied to clipboard
Not working with parallel processing framework like Dask
Can you give an example of your implementation?
import dask.bag as db
from flashtext import KeywordProcessor
processor = KeywordProcessor()
string_list = [“new york is a big city”,”apple is a fruit”]
bags = db.from_sequence(string_list,npartitions=2)
extracted_words = bags.map(processor.extract_keywords)
extracted_words.compute()
Ran with python 3.6
You have to add the keywords first.
Hi @mittalsuraj18 , as mentioned by @giriannamalai , you have to add keywords, eg. by calling
processor.add_keyword("New York")
Rémi