Extracting User Generated Text Entity (Music Playlist Names)

I am working on extracting the names of playlists from a search query. However, I am running into trouble because the only limitations of a music playlist name is that is between 1 and 100 characters. “asdf123” could be a playlist or “lofi night vibes”.

The intent is structured like:

  • search for my […] (playlist) playlist
  • my […] (playlist) playlist
  • show my […] (playlist) playlist
  • etc.

I tried using regex [*]{1,100} but it still requires example data for the playlist which results in it extracting “vibes” from “search for my lofi night vibes playlist”. I am using the default pipeline configuration from rasa init. Any ideas? Thanks!

@jordanisaacs the issue here is that the regex is too general - it will capture virtually anything. Since playlist names can be pretty much anything, I’d recommend using a different approach rather than trying to use a custom entity.

What you could do is have a single-slot form that fills the slot for playlist using from_text; that way you could instruct the user to type their playlist name in the utter_ask_playlist response. You could also have a validation function that checks if the playlist is valid (or maybe soft-searches for closely related playlist names?) to confirm which one the user meant.