CRF and DIET parse same entity problem

Hi all, I have a problem as below:

My config file as default as below:

image

Following the documentation, DIET and CRF can work together.

Doc : Components

How can I resolve this problem?

Thanks

Hi, you shouldn’t need both DIETClassifier with entity extraction enabled and CRFEntityExtractor. I’d recommend you remove CRFEntityExtractor from your pipeline.

1 Like

Hi @fkoerner I’m using ducklingExtractor and DIETClassifier to parse entities. But it’s parsing wrong somehow. It’s return as below:

I got the wrong timedate(2021-04-14) in this case.

Pls let me know how can i get right date

This looks like an edge case: usually the warning refers to overlapping entities extracted by different extractors, but it seems Duckling interprets the above message two ways. Are you using these values in a form? In this case, I’d suggest you write a slot validation method to select the correct value. Otherwise, you could write this selection code in a custom slot mapping.

Hi @fkoerner I did not use form in this case.

I knew that DucklingExtractor is working 2 times. I think because time and number of Duckling are parsing same format regex like dd/mm and \d+\/\d+.

But i wonder why the resuilt got wrong time at second time ? And why did rasa get resuilt at 2 times ??

Because Duckling and Rasa don’t know which of the two are right. As you noted, Duckling simply extracts any time value it finds. You will need to write code to select the correct value if there are multiple results. I’m not sure where the 14 comes from, but this may be the interpretation of the “2m” part of the message. Since you’re not using a form, you could write a custom slot mapping action to pick the right one, based on your criteria. Or, you could have the user select the right one using buttons like so:

 - bot: did you mean 12/7 or 14/7?
   {button: 12/7} {button: 14/7}