Wira Admaja
Wira Admaja

Reputation: 13

Rasa 2.8 - Entities not retrieved

Halo, im using rasa 2.8.3 im trying to do conversation like this :

user: Halo
rasa: Halo! ada yang bisa saya bantu?
user: saya ingin bikin krs
rasa: Apa anda ingin membuat KRS? (ya/tidak)
user: y 
rasa: Baik kami akan membuatkannya. Apa nama lengkap anda?
user: nama saya Mario *Mario saved in slots name*
rasa: Terima kasih, akan kami proses segera!

the problem is when i trying to retrieve "Mario" from "nama saya Mario" into entity name, but debugging log only shows [], so no any value retrieved. what i'm missing here?

here's the configuration :

DEBUG : you can see lines 2021-11-01 06:50:36 DEBUG rasa.core.processor - Received user message 'nama saya Mario' with intent '{'id': 4639353148627232315, 'name': 'give_name', 'confidence': 0.9999607801437378}' and entities '[]'

Your input ->  nama saya Mario                                                                                                                                        
2021-11-01 06:50:36 DEBUG    rasa.core.lock_store  - Issuing ticket for conversation 'ddf81f6b34ce4fa3b6d892f52407c40c'.
2021-11-01 06:50:36 DEBUG    rasa.core.lock_store  - Acquiring lock for conversation 'ddf81f6b34ce4fa3b6d892f52407c40c'.
2021-11-01 06:50:36 DEBUG    rasa.core.lock_store  - Acquired lock for conversation 'ddf81f6b34ce4fa3b6d892f52407c40c'.
2021-11-01 06:50:36 DEBUG    rasa.core.tracker_store  - Recreating tracker for id 'ddf81f6b34ce4fa3b6d892f52407c40c'
2021-11-01 06:50:36 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-01 06:50:36 DEBUG    rasa.nlu.selectors.response_selector  - Adding following selector key to message property: default
2021-11-01 06:50:36 DEBUG    rasa.core.processor  - Received user message 'nama saya Mario' with intent '{'id': 4639353148627232315, 'name': 'give_name', 'confidence': 0.9999607801437378}' and entities '[]'
2021-11-01 06:50:36 DEBUG    rasa.core.processor  - Logged UserUtterance - tracker now has 19 events.
2021-11-01 06:50:36 DEBUG    rasa.core.policies.memoization  - Current tracker state:
[state 0] user intent: ask_create_krs | previous action name: action_listen
[state 1] user intent: ask_create_krs | previous action name: utter_confirm_create_krs
[state 2] user intent: affirm | previous action name: action_listen
[state 3] user intent: affirm | previous action name: utter_create_krs.ask_nama_lengkap
[state 4] user intent: give_name | previous action name: action_listen
2021-11-01 06:50:36 DEBUG    rasa.core.policies.memoization  - There is no memorised next action
2021-11-01 06:50:36 DEBUG    rasa.core.policies.rule_policy  - Current tracker state:
[state 1] user intent: greet | previous action name: action_listen
[state 2] user intent: greet | previous action name: utter_greet
[state 3] user intent: ask_create_krs | previous action name: action_listen
[state 4] user intent: ask_create_krs | previous action name: utter_confirm_create_krs
[state 5] user intent: affirm | previous action name: action_listen
[state 6] user intent: affirm | previous action name: utter_create_krs.ask_nama_lengkap
[state 7] user text: nama saya Mario | previous action name: action_listen
2021-11-01 06:50:36 DEBUG    rasa.core.policies.rule_policy  - There is no applicable rule.
2021-11-01 06:50:36 DEBUG    rasa.core.policies.rule_policy  - Current tracker state:
[state 1] user intent: greet | previous action name: action_listen
[state 2] user intent: greet | previous action name: utter_greet
[state 3] user intent: ask_create_krs | previous action name: action_listen
[state 4] user intent: ask_create_krs | previous action name: utter_confirm_create_krs
[state 5] user intent: affirm | previous action name: action_listen
[state 6] user intent: affirm | previous action name: utter_create_krs.ask_nama_lengkap
[state 7] user intent: give_name | previous action name: action_listen
2021-11-01 06:50:36 DEBUG    rasa.core.policies.rule_policy  - There is no applicable rule.
2021-11-01 06:50:36 DEBUG    rasa.core.policies.unexpected_intent_policy  - Querying for intent `give_name`.
2021-11-01 06:50:36 DEBUG    rasa.core.policies.unexpected_intent_policy  - Score for intent `give_name` is `0.5495160818099976`, while threshold is `-1.300525426864624`.
2021-11-01 06:50:36 DEBUG    rasa.core.policies.unexpected_intent_policy  - Top 5 intents (in ascending order) that are likely here are: `[('deny', -0.5744732), ('ask_create_krs', -0.3595225), ('goodbye', -0.35779795), ('greet', -0.20859009), ('give_name', 0.5495161)]`.
2021-11-01 06:50:36 DEBUG    rasa.core.policies.ted_policy  - TED predicted 'utter_thanks' based on user intent.
2021-11-01 06:50:36 DEBUG    rasa.core.policies.ensemble  - Made prediction using user intent.
2021-11-01 06:50:36 DEBUG    rasa.core.policies.ensemble  - Added `DefinePrevUserUtteredFeaturization(False)` event.
2021-11-01 06:50:36 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_3_TEDPolicy.
2021-11-01 06:50:36 DEBUG    rasa.core.processor  - Predicted next action 'utter_thanks' with confidence 0.38.
2021-11-01 06:50:36 DEBUG    rasa.core.processor  - Policy prediction ended with events '[<rasa.shared.core.events.DefinePrevUserUtteredFeaturization object at 0x7fc3799cd970>]'.
2021-11-01 06:50:36 DEBUG    rasa.core.processor  - Action 'utter_thanks' ended with events '[BotUttered('Terima kasih, akan kami proses segera!', {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, {"utter_action": "utter_thanks"}, 1635749436.3559961)]'.
2021-11-01 06:50:36 DEBUG    rasa.core.policies.memoization  - Current tracker state:
[state 0] user intent: ask_create_krs | previous action name: utter_confirm_create_krs
[state 1] user intent: affirm | previous action name: action_listen
[state 2] user intent: affirm | previous action name: utter_create_krs.ask_nama_lengkap
[state 3] user intent: give_name | previous action name: action_listen
[state 4] user intent: give_name | previous action name: utter_thanks
2021-11-01 06:50:36 DEBUG    rasa.core.policies.memoization  - There is no memorised next action
2021-11-01 06:50:36 DEBUG    rasa.core.policies.rule_policy  - Current tracker state:
[state 1] user intent: greet | previous action name: action_listen
[state 2] user intent: greet | previous action name: utter_greet
[state 3] user intent: ask_create_krs | previous action name: action_listen
[state 4] user intent: ask_create_krs | previous action name: utter_confirm_create_krs
[state 5] user intent: affirm | previous action name: action_listen
[state 6] user intent: affirm | previous action name: utter_create_krs.ask_nama_lengkap
[state 7] user intent: give_name | previous action name: action_listen
[state 8] user intent: give_name | previous action name: utter_thanks
2021-11-01 06:50:36 DEBUG    rasa.core.policies.rule_policy  - There is no applicable rule.
2021-11-01 06:50:36 DEBUG    rasa.core.policies.unexpected_intent_policy  - Skipping predictions for UnexpecTEDIntentPolicy as either there is no event of type `UserUttered` or there is an event of type `ActionExecuted` after the last `UserUttered`.
2021-11-01 06:50:36 DEBUG    rasa.core.policies.ted_policy  - TED predicted 'action_listen' based on user intent.
2021-11-01 06:50:36 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_3_TEDPolicy.
2021-11-01 06:50:36 DEBUG    rasa.core.processor  - Predicted next action 'action_listen' with confidence 1.00.
2021-11-01 06:50:36 DEBUG    rasa.core.processor  - Policy prediction ended with events '[]'.
2021-11-01 06:50:36 DEBUG    rasa.core.processor  - Action 'action_listen' ended with events '[]'.
2021-11-01 06:50:36 DEBUG    rasa.core.lock_store  - Deleted lock for conversation 'ddf81f6b34ce4fa3b6d892f52407c40c'.
Terima kasih, akan kami proses segera!
Your input ->                          

domain.yml

version: '2.0'
session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: true

intents:
- out_of_context
- greet
- goodbye
- affirm
- deny
- ask_create_krs
- give_name

entity:
  - name

slots:
  name:
    type: text

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_goodbye
- utter_greet
- utter_not_understand

nlu.yml

version: "2.0"
nlu:
- intent: greet
  examples: |
    - haloo
    - hi
    - apa kabar?
    - oi
    - permisi
    - selamat siang
    - Selamat pagi
    - Selamat siang
    - Selamat sore
    - mo tanya
- intent: goodbye
  examples: |
    - ok
    - sip
    - thnx
    - ok gan
    - dah
    - dadah
    - sudah cukup
    - cukup
    - ckp

- intent: affirm
  examples: |
    - iya
    - yes
    - ya
    - ok
    - betul
    - benar
    - setuju
    - iye
    - y
    - mau
- intent: deny
  examples: |
    - ga
    - ngga
    - ogah
    - tidak
    - tdk
    - tidak setuju
    - ga setuju
    - ga jadi
    - ga deh
    - tidak mau
    - tak mau
    - kok gitu

- intent: ask_create_krs
  examples: |
    - saya ingin membuat KRS
    - saya ingin bikin krs
    - pingin bikin krs
    - mo buat krs
    - bisa bikin krs?
    - tolong bantu saya untuk membuat krs

- intent: give_name
  examples: |
    - [wira](name)
    - [agus](name)
    - bapak [budi](name)
    - mas [acong](name)
    - [sitorus](name)
    - Bpk [Joko](name)
    - Bu [susan](name)
    - nama saya [Ucok](name)
    - nama saya [wira](name)
    - nama saya [agus](name)
    - nama saya [budi](name)
    - nama saya [acong](name)
    - nama saya [sitorus](name)
    - nama saya [situpea](name)
    - nama gw [Bangun](name)
    - nama gw [wira](name)
    - nama gw [agus](name)
    - nama gw [budi](name)
    - nama gw [acong](name)
    - nama gw [sitorus](name)
    - nama gw [situpea](name)
    - saya adalah [Situpea](name)
    - nama: [Ucok](name)
    - nama: [wira](name)
    - nama: [agus](name)
    - nama: [budi](name)
    - nama: [acong](name)
    - nama: [sitorus](name)
    - nama: [situpea](name)
    - saya [Ucok](name)
    - saya [wira](name)
    - saya [agus](name)
    - saya [budi](name)
    - saya [acong](name)
    - saya [sitorus](name)
    - saya [situpea](name)
    
- intent: out_of_context
  examples: |
    - assalamualaikum
    - okaerinasai

stories.yml

version: "2.0"

stories:

- story: basic greetings
  steps:
  - intent: greet
  - action: utter_greet

- story: selamat tinggal
  steps:
  - intent: goodbye
  - action: utter_goodbye

- story: conversation_kagak_ngerti
  steps:
  - intent: out_of_context
  - action: utter_not_understand

- 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
    entities: 
    - name: name
  - slot_was_set: 
      - name: name
  - action: utter_thanks
  

- story: membuat KRS (batal)
  steps:
  - intent: greet
  - action: utter_greet
  - intent: ask_create_krs
  - action: utter_confirm_create_krs
  - intent: deny
  - action: utter_goodbye

rules.yml

version: "2.0"

rules:

- rule: balas ucapan greetings user
  steps:
  - intent: greet
  - action: utter_greet

- rule: balas ucapan randomnya user
  steps:
  - intent: nlu_fallback
  - action: utter_not_understand

Upvotes: 1

Views: 512

Answers (1)

Juste
Juste

Reputation: 246

The reason for the name not being extracted is because the entity extraction methods you chose don't capture the names. What are you currently using for entity extraction? Could you share your nlu pipeline configuration in your config.yml file?

Upvotes: 1

Related Questions