Esempio n. 1
0
def test_label_fingerprints(message: Message):
    training_data1 = TrainingData(
        [
            Message({INTENT: "intent1"}),
            Message({ENTITIES: [{"entity": "entity1"}]}),
            Message({ACTION_NAME: "action_name1"}),
        ]
    )
    training_data2 = training_data1.merge(TrainingData([message]))
    assert training_data1.label_fingerprint() != training_data2.label_fingerprint()
Esempio n. 2
0
def test_preprocess_selector_multiple_retrieval_intents(
    response_selector_training_data: TrainingData,
    create_response_selector: Callable[[Dict[Text, Any]], ResponseSelector],
):

    training_data_extra_intent = TrainingData([
        Message.build(text="Is it possible to detect the version?",
                      intent="faq/q1"),
        Message.build(text="How can I get a new virtual env", intent="faq/q2"),
    ])
    training_data = response_selector_training_data.merge(
        training_data_extra_intent)

    response_selector = create_response_selector({})

    response_selector.preprocess_train_data(training_data)

    assert sorted(
        response_selector.all_retrieval_intents) == ["chitchat", "faq"]