How do i get totally random name from user input? (not name in sample data)

How do i get totally random name from user input? i tried to follow examples but those samples only executed with name inside nlu.yml, not totally unknown name not listed in yml? or do i have to list all human name in this planet like this?? with sample intent below i try to catch unknown name like “AKARAPACI” , but the bots cannot recognized it as “give_name” intent

- intent: give_name
  examples: |
    - [ojan](krs_student_name)
    - [agus](krs_student_name)
    - bapak [budi](krs_student_name)
    - mas [acong](krs_student_name)
    - [sitorus](krs_student_name)
    - Bpk [Joko](krs_student_name)
    - Bu [susan](krs_student_name)
    - nama saya [Ucok](krs_student_name)
    - nama saya [ojan](krs_student_name)
    - nama saya [agus](krs_student_name)
    - nama saya [budi](krs_student_name)
    - nama saya [acong](krs_student_name)
    - nama saya [sitorus](krs_student_name)
    - nama saya [situpea](krs_student_name)
    - nama gw [Bangun](krs_student_name)
    - nama gw [ojan](krs_student_name)
    - nama gw [agus](krs_student_name)
    - nama gw [budi](krs_student_name)
    - nama gw [acong](krs_student_name)
    - nama gw [sitorus](krs_student_name)
    - nama gw [situpea](krs_student_name)
    - saya adalah [Situpea](krs_student_name)
    - nama: [Ucok](krs_student_name)
    - nama: [ojan](krs_student_name)
    - nama: [agus](krs_student_name)
    - nama: [budi](krs_student_name)
    - nama: [acong](krs_student_name)
    - nama: [sitorus](krs_student_name)
    - nama: [situpea](krs_student_name)
    - saya [Ucok](krs_student_name)
    - saya [ojan](krs_student_name)
    - saya [agus](krs_student_name)
    - saya [budi](krs_student_name)
    - saya [acong](krs_student_name)
    - saya [sitorus](krs_student_name)
    - saya [situpea](krs_student_name)
    - [Kayleigh Lebsack Jr.] (krs_student_name)
    - [Dr. Trenton Mayert] (krs_student_name)
    - [Amya Gerhold] (krs_student_name)
    - [Eudora Torp] (krs_student_name)
    - [Dr. Ned Jaskolski PhD] (krs_student_name)
    - [Dessie Schinner] (krs_student_name)
    - [Cary Turcotte] (krs_student_name)
    - [Bertram Cassin] (krs_student_name)
    - [Prof. Jayden Pollich] (krs_student_name)
    - [Nayeli Swift PhD] (krs_student_name)
    - [Anna Reinger] (krs_student_name)
    - [Therese Kutch] (krs_student_name)
    - [Aileen Koss MD] (krs_student_name)
    - [Aiyana Herzog] (krs_student_name)
    - [Pansy Ratke Jr.] (krs_student_name)
    - [Tremayne Will MD] (krs_student_name)
    - [Jamil Kub] (krs_student_name)
    - [Ruby Kuhn] (krs_student_name)
    - [Laurine Jast] (krs_student_name)
    - [Susie Pfannerstill] (krs_student_name)
    - [Gabriella Gaylord DVM] (krs_student_name)
    - [Billy Kerluke MD] (krs_student_name)
    - [Gaston Bruen] (krs_student_name)
    - [Ramiro Zemlak II] (krs_student_name)
    - [Montana Jacobs] (krs_student_name)
    - [Colt Hayes] (krs_student_name)
    - [Esther Gusikowski MD] (krs_student_name)
    - [Nora Wehner] (krs_student_name)
    - [Brendan Mertz] (krs_student_name)
    - [Mr. Mackenzie Altenwerth II] (krs_student_name)
    - [Ms. Rhoda Kreiger Sr.] (krs_student_name)
    - [Mr. Damian Schumm] (krs_student_name)
    - [Rosalyn Swaniawski Sr.] (krs_student_name)
    - [Mikayla Heaney] (krs_student_name)
    - [Alvis Leffler] (krs_student_name)
    - [Lenna Turner] (krs_student_name)
    - [Itzel Berge] (krs_student_name)
    - [Wilson Rolfson] (krs_student_name)
    - [Tracey Weber] (krs_student_name)
    - [Dr. Jordyn Pacocha PhD] (krs_student_name)
    - [Tiffany Rowe DDS] (krs_student_name)
    - [Joshuah Hansen] (krs_student_name)
    - [Donato Effertz] (krs_student_name)
    - [Prof. Daphne Schaefer] (krs_student_name)
    - [Lourdes Wolf IV] (krs_student_name)
    - [Rhea Klein III] (krs_student_name)
    - [Dr. Juanita Ledner I] (krs_student_name)
    - [Regan Ondricka Sr.] (krs_student_name)
    - [Aron Weber] (krs_student_name)
    - [Gwendolyn Grant] (krs_student_name)
    - [Julia Dickinson] (krs_student_name)
    - [Dr. Kathlyn Jenkins III] (krs_student_name)
    - [Mr. Hayley Crooks] (krs_student_name)
    - [Dr. Orval Kautzer] (krs_student_name)
    - [Lolita Zieme] (krs_student_name)
    - [Demetris Lakin] (krs_student_name)
    - [Prof. Vallie Kuhic] (krs_student_name)
    - [Mr. Dayton Bergnaum DVM] (krs_student_name)
    - [Braulio Romaguera] (krs_student_name)
    - [Meghan Heller] (krs_student_name)
    - [Mr. Russell Wunsch III] (krs_student_name)
    - [Mauricio Rippin] (krs_student_name)
    - [Bertrand Barrows] (krs_student_name)
    - [Dr. Trevor Daniel] (krs_student_name)
    - [Orval Wisoky] (krs_student_name)
    - [Danny Pagac MD] (krs_student_name)
    - [Gladyce Spinka] (krs_student_name)
    - [Dr. Noel Weber] (krs_student_name)
    - [Jackson Kub] (krs_student_name)
    - [Simone Hilpert] (krs_student_name)
    - [Ryan Jacobi] (krs_student_name)
    - [Miss Bert Toy] (krs_student_name)
    - [Dr. Giovanny Farrell] (krs_student_name)
    - [Daija Ferry] (krs_student_name)
    - [Ms. Haven Halvorson] (krs_student_name)
    - [Domenico Johns] (krs_student_name)
    - [Jamel Satterfield Jr.] (krs_student_name)
    - [Heidi Gerhold] (krs_student_name)
    - [Larry Balistreri] (krs_student_name)
    - [Mr. Brice Mraz Sr.] (krs_student_name)
    - [Thalia Legros] (krs_student_name)
    - [Rhea Erdman] (krs_student_name)
    - [Laurel Treutel] (krs_student_name)
    - [Prof. Jarod Adams] (krs_student_name)
    - [Micheal Ernser] (krs_student_name)
    - [Mr. Leland Pacocha] (krs_student_name)
    - [Rene Quitzon] (krs_student_name)
    - [Macy Medhurst] (krs_student_name)
    - [Isaac Wehner] (krs_student_name)
    - [Miss Margaretta Koelpin Sr.] (krs_student_name)
    - [Miss Cassidy Nader V] (krs_student_name)
    - [Alfonzo Lindgren PhD] (krs_student_name)
    - [Cory Anderson] (krs_student_name)
    - [Terence Welch DDS] (krs_student_name)
    - [Emmet Luettgen] (krs_student_name)
    - [Payton Marvin V] (krs_student_name)
    - [Prof. Adrian Johnston IV] (krs_student_name)
    - [Miss Ocie Murazik V] (krs_student_name)
    - [Erick Mertz] (krs_student_name)
    - [Ms. Loyce Wisozk I] (krs_student_name)

You can use custom action to take any name in and then use it later

Actions

yes, actually im already using it, but still its still need to categorized as “give_name” intents, but when i give “Akarapaci” the bot dont even know the intents so the action “action_get_nama_lengkap” not triggered

this is rules.yml :


- rule: user beri namanya
  steps:
  - intent: give_name
  - action: action_get_nama_lengkap

stories.yml

- story: membuat KRS (confirmed)
  steps:
  - intent: greet
  - action: utter_greet
  - intent: ask_create_krs
  - action: utter_confirm_create_krs
  - intent: affirm
  - action: utter_create_krs.ask_nama_lengkap
  - intent: give_name
  - action: action_get_nama_lengkap

ok, use slots that takes any text and then use that in Actions server

https://rasa.com/docs/rasa/domain/

how do i catch random phrase to the slot? how to bring slot value into actions.py? care to give minimum sample?

Here example, bot asks question and user can type anything there and then Action code is evaluating if answer is right or not and replies to user if answer is correct (match given choices) or not (anything else).

Now you can modify this to that you don’t evaluate slot but just store that as name. You can do some basic checkings like it is not number, first letter is capital etc.

in Domain

forms:
  kysymys01_form:
    vastaus01:
      - type: from_text

slots:
  vastaus01:
    type: text
    influence_conversation: false

responses:
  utter_ask_vastaus01:
  - text: "- Potilaalle on määrätty tyroksiinia 50 mikrogrammaa. Thyroxin tablettien vahvuus on 0,1 mg. Kuinka monta tablettia annat potilaalle?  \n- Montak$

actions:
- action_tarkista_kysymys_01

In Stories

stories:

- story: aloitus ja kysymys 01
  steps:
  - intent: aloita
# formi kysyy kysymyksen
  - action: kysymys01_form
  - active_loop: kysymys01_form
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
# formi sulkeutuu
  - action: action_tarkista_kysymys_01
  - action: action_restart

and then in Action.py

from typing import Any, Text, Dict, List
from rasa_sdk.events import SlotSet
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.types import DomainDict

class kysymyksienTarkistus1(Action):
    def name(self) -> Text:
        return "action_tarkista_kysymys_01"

    def run(
        self,
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:


        vastaus = tracker.latest_message["text"]
        # tarkistetaan onko vastaus oikein
        if vastaus == "puolikas":
            dispatcher.utter_message(text = "vastaus oikein")
            dispatcher.utter_message(template  = "utter_kysymys01_oikein")
            dispatcher.utter_message(template =  "utter_lopetus")
            return []
        else:
            #dispatcher.utter_message(text = "vastaus väärin")
            dispatcher.utter_message(buttons = [
                {"payload": "/kysymys01_vaarin", "title": "jatka"},
            ])
            #dispatcher.utter_message(template = "utter_kysymys01_vaarin")
            #dispatcher.utter_message(intent = "/kysymys01_vaarin")
            #return ["/kysymys01_vaarin"]
            #return [UserUttered("/kysymys01_vaarin",intent={'name': 'kysymys01_vaarin', 'confidence': 1.0})]
            return []

Hope this helps

Still have same problem , here’s the debug and yml. you can see the process after “utter_create_krs.ask_nama_lengkap” → action_listen → i type ARZUROS (which is i expect it as give_name intents), but the bot not consider it as that. can i see your nlu.yml about aloita intent?

When i use name listed in nlu.yml , it works well, but i cannot define all those human name in nlu.yml in real life situation

debug result

Your input ->  ARZUROS                                                                                                         
2021-11-10 07:55:39 DEBUG    rasa.core.lock_store  - Issuing ticket for conversation 'a1304dc35e4c4c3082b25ea1697d2b28'.
2021-11-10 07:55:39 DEBUG    rasa.core.lock_store  - Acquiring lock for conversation 'a1304dc35e4c4c3082b25ea1697d2b28'.
2021-11-10 07:55:39 DEBUG    rasa.core.lock_store  - Acquired lock for conversation 'a1304dc35e4c4c3082b25ea1697d2b28'.
2021-11-10 07:55:39 DEBUG    rasa.core.tracker_store  - Recreating tracker for id 'a1304dc35e4c4c3082b25ea1697d2b28'
2021-11-10 07:55:39 DEBUG    rasa.nlu.classifiers.diet_classifier  - There is no trained model for 'ResponseSelector': The component is either not trained or didn't receive enough training data.
2021-11-10 07:55:39 DEBUG    rasa.nlu.selectors.response_selector  - Adding following selector key to message property: default
2021-11-10 07:55:39 DEBUG    rasa.nlu.classifiers.fallback_classifier  - NLU confidence 0.35082995891571045 for intent 'ask_create_krs' is lower than NLU threshold 0.85.
2021-11-10 07:55:39 DEBUG    rasa.core.processor  - Received user message 'ARZUROS' with intent '{'name': 'nlu_fallback', 'confidence': 0.85}' and entities '[]'

domain.yml

version: '2.0'
session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: true
intents:
- ask_create_krs
- greet
- affirm
- out_of_context
- goodbye
- deny
- give_name
entities:
- krs_student_name

forms:
  krs_form:
    krs_student_name:
      - type: from_text

slots:
  krs_student_name:
    type: text
    influence_conversation: false

responses:
  utter_greet:
  - text: Halo! ada yang bisa saya bantu?
  utter_goodbye:
  - text: Sampai jumpa!
  utter_thanks:
  - text: Terima kasih, akan kami proses segera!
  utter_not_understand:
  - text: Maaf saya kurang mengerti, bisa diperjelas?
  utter_confirm_create_krs:
  - text: Apa anda ingin membuat KRS? (ya/tidak)
  utter_create_krs.ask_nama_lengkap:
  - text: Baik kami akan membuatkannya. Apa nama lengkap anda?

actions:
- utter_confirm_create_krs
- utter_create_krs.ask_nama_lengkap
- utter_greet
- utter_thanks
- action_out_of_context
- action_get_nama_lengkap

rules.yml

- rule: greet user
  steps:
  - intent: greet
  - action: utter_greet

- rule: user want to ask create krs
  steps:
  - intent: ask_create_krs
  - action: utter_confirm_create_krs

- rule: user beri namanya
  steps:
  - intent: give_name
  - action: krs_form
  - active_loop: krs_form
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  - action: action_get_nama_lengkap

- rule: tanya user ingin isi krs atau tidak
  steps:
  - intent: affirm
  - action: utter_create_krs.ask_nama_lengkap

stories.yml

- story: membuat KRS (confirmed)
  steps:
  - intent: greet
  - action: utter_greet
  - intent: ask_create_krs
  - action: utter_confirm_create_krs
  - intent: affirm
  - action: utter_create_krs.ask_nama_lengkap
  - intent: give_name
  - action: krs_form
  - active_loop: krs_form
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  - action: action_get_nama_lengkap

actions.py

class ActionGetNamaLengkap(Action):
    def name(self) -> Text:
        return "action_get_nama_lengkap"

    def run(self, dispatcher: CollectingDispatcher,
            tracker: Tracker,
            domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

        nama_lengkap = tracker.latest_message['text']
        dispatcher.utter_message(text = f"Terima kasih! {nama_lengkap} KRS anda sudah jadi!")
        return []

I don’t see this as intent? so that why you get

There is no trained model for ‘ResponseSelector’: The component is either not trained or didn’t receive enough training data.

My intent “aloita” is finnish language and it just means “start”. I give this in automatically when chatbot frontend (chatbot window) is opened and bot starts to ask questions, automatically.

In my language is about asking the name of people , so its more like “What is your name?” → person can reply with his/her name. so the point is i want Arzuros as “give_name” intent then custom code will retrieve it and set into slot.

im in trouble to detect random phrase as “give_name” intent such as "SALAH or even elon musk child name without entering the name itself in nlu.yml

Can you share your config file?

Hi @wiraadmaja you can use [X]{“entity”:“PERSON”} in your nlu file and your add SpacyEntityExtractor in your config file of the pipeline