Rasa Form Action - Слот заполняется одними и теми же данными дважды - PullRequest
0 голосов
/ 11 июля 2019

Я пытаюсь использовать FormAction of Rasa.Ниже приведены мои данные:

MyForm

class MyForm(FormAction):
    """My form action"""
    def name(self):
        return "my_form"

    @staticmethod
    def required_slots(tracker: Tracker) -> List[Text]:
        """A list of required slots that the form has to fill"""
        return ["slot_a", "slot_b", "slot_c",  "slot_d"]

    def slot_mappings(self):
        # type: () -> 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 {"slot_a":[self.from_entity(entity="slot_a", intent=["inform"])],
                "slot_b": [self.from_entity(entity="slot_b", intent=["inform"])],
                "slot_c": [self.from_entity(entity="slot_c", intent=["inform"])],
                "slot_d": [self.from_entity(entity="slot_d", intent=["inform"])]}


    def submit(self, dispatcher: CollectingDispatcher,
               tracker: Tracker,
               domain: Dict[Text, Any]) -> List[Dict]:
        """Define what the form has to do
                after all required slots are filled"""
        dispatcher.utter_template('utter_submit', tracker)
        return []

Ниже приведен мой файл domain.yml, в котором показаны только значения слотов и форм по причинам NDA. MyDomain

# actions, entities, intents, templates 
slots:
  slot_c:
    type: unfeaturized
    auto_fill: false
  slot_b:
    type: unfeaturized
    auto_fill: false
  slot_d:
    type: unfeaturized
    auto_fill: false
  slot_a:
    type: unfeaturized
    auto_fill: false
  slot_e:
    type: text
    auto_fill: false
  slot_f:
    type: categorical
    values:
    - val_1
    - val_2
    - val_3

forms:
    - my_form

Ниже мой stories.yml:

## Story 1
* greet
  - utter_greet
* create_slot_vals
  - my_form
  - form{"name": "my_form"}
  - form{"name": null}
  - utter_saving_slots_values
* thank_you
  - utter_thanks

После заполнения формы у меня есть полное действие, которое показывает все значения слотов, заполненныеформа.

Действие Rasa Utter

 The form details are:
 - Slot A: Software
 - Slot B: Anderson
 - Slot C: 12
 - Slot D: ['permanent', 'permanent']

Проблема в том, что даже если пользователь вводит значение slot_d как постоянное только один раз, тот же слот получаетзапрашивается снова, и одно и то же значение автоматически заполняется в списке дважды и сохраняется.

Кто-нибудь когда-нибудь сталкивался с такой проблемой в Расе?

...