NLU entity detection for jira chatbot

@Juste Hi, I’m trying to create a Jira chat bot in Rasa. So, the possible questions the user can ask are to create a story,project, sub task. The parameters that the bot needs to create a sub task is name of the sub task to be created, name of the parent story under which the sub task is to created and the name of the project. So, I’ve tried training the NLU but the problem is since there is no restriction here and the user is free to type any name as the story, sub task or as project names, the NLU is finding hard to detect these entites.

For example, in the training data set.

  • the sub-task name fetching conversation id for the story Main order flow broken in the project chatbot.

So, if I try a different sentence

  • the sub-task name exploring chatbot for the story Main order flow broken in the project AI Chatbots…

the word “chatbot” in sub task name "exploring chatbot "is considered as project name and not sub task name.

All the three parameters need to be sent to one action which then performs an API call.

Can you help me with how to try the nlu or is there a better way for writing stories. If yes, can you please provide me with a link or code to train nlu to better differentiate between the entities project name, sub task name and story name.

Hi @Anna, I think there’s two things you could do here, probably both:

  1. Use a Form to collect project name, sub task, etc. You can use slot mappings both from_entity and from_text to fill the slots, so if the entity isn’t extracted it can also use the text directly. You can see more options for how to fill a slot on the forms page.
  2. You need a variety of examples in your NLU data for each entity. What does your NLU data look like right now?

Hi @mloubser …how do I use from text to fill the slot…I’m not sure how to do it even after going through the forms page.

I think you might find this tutorial helpful: Tutorial: Building Assistants

That’ll help you start to build a form.

Once you have a basic form set up, you can set the slot_mappings e.g.

class JiraForm(FormAction):

    def name(self) -> Text:
        """Unique identifier of the form"""

        return "jira_form"

# other methods 

    def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
        """A dictionary to map required slots to
            - an extracted entity
            - intent: value pairs
            - a whole message
            or a list of them, where a first match will be picked"""

        return {
            "subtask": [
                self.from_entity(entity="subtask"),
                self.from_text()
             ]
        }