I'm trying to extract custom entities from a sentence/question and query them against a database, the problem is that I'm having trouble with the extraction of entities.
My table has 10,000s of rows and looks like this:
Car type | Owner
------------------
Sedan | John
Hatchback| Mary
A sample question I would like the program to answer:
"Who purchased the sedan?"
Ideally, the correct answer here would be John
.
Is it possible for me to get the program to understand the context behind the below sentence and answer it properly?
Which means the engine should:
Understand that "sedan" in the sentence "Who purchased the sedan" is an entity (car type) and translate it as
Car Type = Sedan
.Understand that the word "purchased" in the sentence means the same as "owner".
Let's assume that the owner is the same as the person who purchased it, no leasing or anything of that kind.
The end goal is to understand the entities in this sentence and convert it into an SQL query.