Requesting Help with Rasa Forms

Hi,

I’m just trying out few basic things in Rasa forms and slot fillings. I gave the intent in nlu file like below

If user inputs only the disease name, then the bot should ask for ‘crop’ and vice versa. So I defined forms and slots in domain file.

I also added a validate_pp_form in actions file

class ValidatePPForm(FormValidationAction): def name(self) → Text: return “validate_pp_form”

async def required_slots(
    self,
    slots_mapped_in_domain: List[Text],
    dispatcher: "CollectingDispatcher",
    tracker: "Tracker",
    domain: "DomainDict",
) -> Optional[List[Text]]:
    crop_name = tracker.slots.get("crop_name")
    if crop_name is None:
        return ["Could you please give the crop name"]
    disease_name = tracker.slots.get("disease_name")
    if disease_name is None:
        return ["Could you please give the disease name"]

I gave this action name in action section of domain file. While running the bot, I get an error like below.

The user message which I gave in return - validate action is getting displayed in my action server window and not as a reply by bot to user. Kindly help me with this.

@rsklearner Please share stories.yml file or rule ?

Hi Nik,

Thank you!!

I used below rules

along with this action

But it didn’t work. So commented the rules and added Story rasa_story_form

This time it asked for the crop name, when I gave only disease. But tried to find the intent with only the new crop name that it received. I would like to club the crop name entity with previously received disease name and then find the intent and corresponding response. Please advise.

@rsklearner Can you please share the version too rasa --version and nlu.yml file for training example.

Hi Nic,

Please find the details below

Rasa Version : 2.8.7 Minimum Compatible Version: 2.8.0 Rasa SDK Version : 2.8.2 Rasa X Version : None Python Version : 3.7.6 Operating System : Windows-10-10.0.19041-SP0

Have also uploaded the nlu filenlu.yml (8.5 KB)

@rsklearner Hi, you training examples should be increased generally recommended one is 2 and in some your intent examples mentioned is only 1, so I’d recommend to increased up to 5 or 10. Further, your training examples are like sentences, it that your use case demands?

@nik202 Sure, We have many additional data for each intent. We will add them as well. The data is more like Question and Response and so they are like sentences. Is this something I need to worry about?

@rsklearner How many instances you have? it will be a mess for you while doing manually and even responses for the same. I hope you understand?

@nik202 Yes, We have few 1000s of records for a sample academic project. We are working on bringing them to required format using some script.

@rsklearner is this issue still open?

@nik202 Instead of forms, I used only slot and used a db to pull response and now it is working fine. I also working on reducing the number of intents and increasing the sample records for each intent.

Now not facing the error mentioned in screenshot.

Thank you for the help!!