Multiple entity extractors in pipline

I have 3 different extractors in the pipeline:

  • SpacyEntityExtractor
  • CRFEntityExtractor
  • DucklingHTTPExtractor

I am wondering, when all of them extract the same entity, the value of which one will be taken to set slots and how?

1 Like

Hey @rahimakhavan welcome to the forum :smiley: and sorry for the late response… So SpacyEntityExtractor and DucklingHTTPExtractor by default don’t have any entity names that are the same. And ideally you shouldn’t name any of your entities in CRFEntityExtractor the same way they’re named in the other two. If you do do this, I believe Rasa will just take the value of the extractor that’s last in your pipeline to fill the slot. If you want to do any custom logic to slot filling, you’d do that in a custom action – you can access all entities extracted there

1 Like

Hey @akelad, Thanks for your response!

Yes, this is what we concluded after a couple of tests, but it would be nice if Rasa adds a feature to prioritize the extractors and let the user pick the entity he wants, even if the entities are named the same.

That just seems unnecessarily complicated. I’d personally go with naming entities differently.
But if you really do have a use case where the entity names collide, you can write a custom component and add the selection logic yourself. You should have all the extracted entities available in your component if you put it as the last component of your pipeline.

1 Like

Thanks @akshay2000!

For now we fixed the issue by naming differently the entities which I think is the easier approach.

But, good, your approach is gonna work for the entities which are the named the same.