Fuzzy NER using python?

Viewed 11

I have hundreds of different functions, each has its own set of variables. Each variable can have a closed set of options or free text.

I have build a mapping that looks like this:

[{"func_name_1.kuku": [var_possible_value_1, var_possible_value_2, ........]},
{"func_name_1.lulu": [var_possible_value_1, var_possible_value_2, ........]},
{"func_name_2.bubu": [var_value_1]},
{"func_name_2.bubu": [var_value_2]},
{"func_name_2.tutu": [var_possible_value_1, var_possible_value_2, ........]}]

Some of the user inputs has typos.

For example I have the following user text inputs: I want to add one plus 2 mult 54 by twelve div thirteen by eight ....

I have a model, it's given, that understands the function my user wants to run given a sentence. For example, div thirteen by eight ----> Divide function.

Now, I would like to understand the slots or the variables my user passed to me. Here it's thirteen and eight.

I have built a spacy spancat model using the mappings above, but it struggles to extract part of text and fuzzy fit it to the relevant entity. What I want at the end is:

{"function": "divide", "var_1": 13, "var_2": 8}

What should be the best practice to attack this issue? Is there any entity fuzzy matcher model?

0 Answers
Related