Using dependency parsing for role assignments

tommetcalfe
rasa-nlu
(Yan Virin) #1

Is the dependency parse from spacy used somehow currently in Rasa to get better do entity extraction?

0 Likes

(Tom Metcalfe) #2

HI @yanvirin,

At the moment no, we don’t implement it. How do you know it would increase the accuracy of entity extraction?

0 Likes

(Yan Virin) #3

I don’t obviously. What I meant is that in general the idea of interpretation in a conversation setting is to perform some sort of semantic parsing of the sentence, to extract all the relations and their related entities into a machine friendly logical form, like lambda calculus or something of that sort.

Rasa’s interpreter is short of that and simplifies the problem into predicting intent and extracting entities. However even in the data camp course lectured by Alan Nichol, there is a discussion and an exercise on using dependency parse from spacy to inform better about how to fill the correct slots with the entities. A good example of that I guess would be “I want to fly from NY to SF”. In order to get right the from and to entities in rasa right now you need to train a custom NER for “from_city” and “to_city”, or to apply some heuristics on top of regular entity extraction, in order to correctly extract the entities and put them in the right slots. Instead, you could imagine extracting the dependency between “NY” and “SF” from the dependency parse of the sentence and using that to fill the slots.

So basically I am wondering if there are plans to move towards real parsing of sentences in addition to just intent classification+entity extraction strategy to be able to better capture the information.

Thanks

0 Likes

(Tom Metcalfe) #4

I agree with you in this case - could make for a decent component - however we have no plans to build this kind of parser at the moment because we could also handle this conversation by asking the information in two stages (“Where are you flying from?”, “And where to?”)

Entity extraction is always a big focus for us though - we recently reviewed the idea of including composite entities (which would also help in the example you gave) and the superstar team at CarLabs built a custom component for this called Innatis. There are some good libraries on Github for dependency parsing so I would definitely recommend taking a stab at building a custom component if you’d like to try it out with our code, @Juste just wrote a great article on how to do that here.

0 Likes