Plan for nested entities support

Hi! Is there a plan to support nested entities in Rasa? Or are they already supported?

Example for clarity:

Text: Pad Thai

Entities:

  • cuisine: Thai
  • dish: Pad Thai

Here are ways I’d imagine I might label this in the training data:

Nested:

  • [Pad [Thai](cuisine)](dish)

Separated:

  • [Pad Thai](dish)
  • Pad [Thai](cuisine)

Are either of these currently supported? If not, do you know roughly when they might be? For example, Microsoft LUIS seems to potentially support this with their entity decomposition.

Related threads:

2 Likes

@bradyneal Hello, Brady. Did you tried this use case example with rasa? :slight_smile:

Yessir. The “Nested” syntax above yields a “UserWarning: Misaligned entity annotation” message (doesn’t work).

Here’s what rasa interactive says if I use the “Separated” training data above and give a default-configured Rasa chatbot “Pad Thai” as input:

Is the intent ‘food’ correct for ‘[Pad](dish) [Thai](cuisine)’ and are all entities labeled correctly? (Y/n)

(It labels “Pad” as the “dish” entity and “Thai” as the “cuisine” entity.)

1 Like

Rasa doesn’t natively support this (and neither does spaCy if I recall correctly).

You could however use a custom action to parse the entity into sub entities as you see fit.

Gotta ask though, are there more examples of your phenomenon or is Pad Thai the main example? I’m curious to learn how common this use-case might be.

2 Likes