How to use the intent inform in Rasa? - rasa-nlu

I am trying to create a chatbot for banking. Flow is,
User: hi
Bot: Welcome to ABC bank services. Let me know your name?
User: Kabeer
Bot: Hi kabeer, how can i help you?
Buttons:
1: Loan (/inform{“service_type”:“Loan”})
2: Deposit (/inform{“service_type”:“Deposit”})
3: Account Types (/inform{“service_type”:“Account Types”})
4: Customer Support No (/inform{“service_type”:“Customer Support No”})
5: Service Request (/inform{“service_type”:“Service Request”})
6: Careers (/inform{“service_type”:“Careers”})
Type out your own message…
User: 1: Loan (/inform{“service_type”:“Loan”})
Bot:Please select the required Loan type from the list
Buttons:
1: Personal Loan (/inform{“loan_type”:“Personal Loan”})
2: Home Loan (/inform{“loan_type”:“Home Loan”})
3: Two-wheeler Loan (/inform{“loan_type”:“Two-wheeler Loan”})
4: Car Loan (/inform{“loan_type”:“Car Loan”})
5: Gold Loan (/inform{“loan_type”:“Gold Loan”})
Type out your own message…
User:Car Loan (/inform{“loan_type”:“Car Loan”})
Bot: Uttering home loan here.
Issue is the bot always utter home loan only. The bot is not recognise the stories for other loans using entity. How can i make this work? I used inform intent because of i thought it will cause similar intnent problem
Here is my code.
## say goodbye
* goodbye
- utter_goodbye
## bot challenge
* bot_challenge
- utter_iamabot
## happy_path_personal_loan_01
* greet
- utter_greet
* PERSON{"PERSON": "kabeer"}
- slot{"PERSON": "kabeer"}
- utter_ask_help
* inform{"service_type": "Loan"}
- slot{"service_type": "Loan"}
- utter_ask_loan_type
* inform{"loan_type": "Personal Loan"}
- slot{"loan_type": "Personal Loan"}
- utter_personal_loan
* goodbye
- utter_goodbye
## happy_path_home_loan_01
* greet
- utter_greet
* PERSON{"PERSON": "kabeer"}
- slot{"PERSON": "kabeer"}
- utter_ask_help
* inform{"service_type": "Loan"}
- slot{"service_type": "Loan"}
- utter_ask_loan_type
* inform{"loan_type": "Home Loan"}
- slot{"loan_type": "Home Loan"}
- utter_home_loan
* goodbye
- utter_goodbye
## happy_path_car_loan_01
* greet
- utter_greet
* PERSON{"PERSON": "kabeer"}
- slot{"PERSON": "kabeer"}
- utter_ask_help
* inform{"service_type": "Loan"}
- slot{"service_type": "Loan"}
- utter_ask_loan_type
* inform{"loan_type": "Car Loan"}
- slot{"loan_type": "Car Loan"}
- utter_car_loan
## interactive_story_1
* greet
- utter_greet
* PERSON{"PERSON": "kiran"}
- slot{"PERSON": "kiran"}
- utter_ask_help
* inform{"service_type": "Loan"}
- slot{"service_type": "Loan"}
- utter_ask_loan_type
* inform{"loan_type": "Home Loan"}
- slot{"loan_type": "Home Loan"}
- utter_home_loan
## interactive_story_2
* greet
- utter_greet
* PERSON{"PERSON": "kumar"}
- slot{"PERSON": "kumar"}
- utter_ask_help
* inform{"service_type": "Loan"}
- slot{"service_type": "Loan"}
- utter_ask_loan_type
* inform{"loan_type": "Personal Loan"}
- slot{"loan_type": "Personal Loan"}
- utter_personal_loan
- action_restart
## interactive_story_3
* greet
- utter_greet
* PERSON{"PERSON": "kiran"}
- slot{"PERSON": "kiran"}
- utter_ask_help
* inform{"service_type": "Loan"}
- slot{"service_type": "Loan"}
- utter_ask_loan_type
* inform{"loan_type": "Car Loan"}
- slot{"loan_type": "Car Loan"}
- utter_car_loan
- action_restart
## interactive_story_4
* greet
- utter_greet
* PERSON{"PERSON": "kiran"}
- slot{"PERSON": "kiran"}
- utter_ask_help
* inform{"service_type": "Loan"}
- slot{"service_type": "Loan"}
- utter_ask_loan_type
* inform{"loan_type": "Personal Loan"}
- slot{"loan_type": "Personal Loan"}
- utter_personal_loan
- action_restart
domain.yml
actions:
- utter_ask_help
- utter_ask_loan_type
- utter_car_loan
- utter_cheer_up
- utter_did_that_help
- utter_goodbye
- utter_greet
- utter_happy
- utter_home_loan
- utter_iamabot
- utter_personal_loan
entities:
- PERSON
- loan_type
- service_type
intents:
- greet
- inform
- PERSON
- goodbye
- affirm
- deny
- bot_challenge
slots:
PERSON:
type: text
loan_type:
type: text
service_type:
type: text
templates:
utter_ask_help:
- buttons:
- payload: /inform{"service_type":"Loan"}
title: Loan
- payload: /inform{"service_type":"Deposit"}
title: Deposit
- payload: /inform{"service_type":"Account Types"}
title: Account Types
- payload: /inform{"service_type":"Customer Support No"}
title: Customer Support No
- payload: /inform{"service_type":"Service Request"}
title: Service Request
- payload: /inform{"service_type":"Careers"}
title: Careers
text: Hi {PERSON}, how can i help you?
utter_ask_loan_type:
- buttons:
- payload: /inform{"loan_type":"Personal Loan"}
title: Personal Loan
- payload: /inform{"loan_type":"Home Loan"}
title: Home Loan
- payload: /inform{"loan_type":"Two-wheeler Loan"}
title: Two-wheeler Loan
- payload: /inform{"loan_type":"Car Loan"}
title: Car Loan
- payload: /inform{"loan_type":"Gold Loan"}
title: Gold Loan
text: Please select the required Loan type from the list
utter_car_loan:
- text: LTV up to 100% on select models, faster processing of loans, easy documentation.
utter_cheer_up:
- image: https://i.imgur.com/nGF1K8f.jpg
text: 'Here is something to cheer you up:'
utter_did_that_help:
- text: Did that help you?
utter_goodbye:
- text: Bye
utter_greet:
- text: Welcome to Voxtron bank services. Let me know your name?
utter_happy:
- text: Great, carry on!
utter_home_loan:
- text: Loans from 25,000 to 50 lakhs. Attractive interest rates, zero prepayment
charges, affordable EMIs.
utter_iamabot:
- text: I am a bot, powered by Rasa.
utter_personal_loan:
- text: Loans up to 20 lakhs at attractive interest, no collateral & flexible repayment.
Documents Required to apply, KYC and Income Documents are mandatory for applying
a Personal Loan. Additional documents may be requested on a case to case basis.
nlu.md
## intent:inform
- How can i apply for a [loan](service_type)
- i want to get a [car loan](loan_type)
- i want to apply for [personal loan](loan_type)
- please let me know how can i apply for a [loan](service_type)
- [gold loan](loan_type) details please
- how to get a [home loan](loan_type)
- I would like to know about the [gold loan](loan_type)
- what are the conditions to get a [home loan](loan_type)
- please send me the details about [vehicle loans](loan_type)
- I would like to take a [housing loan](loan_type)
- How am I supposed to apply for a [two wheeler loans](loan_type)
- [car loan](loan_type)
- [personal loan](loan_type)
- [gold loan](loan_type)
- [home loan](loan_type)
- [vehicle loan](loan_type)
- [housing loan](loan_type)
- [loan](service_type)
- [loans](service_type)

slots of type text are featurized in a way that it only affects the story flow if they are set or not (docs for it here)
I think in your case you rather want to use a categorical slot. In this case the stories will go down different paths depending on the slot value (docs for it here)

Related

Why is Go Colly Collector not always finding SVG tag?

I am trying to write a simple web scraper in Go using Colly. The program is supposed to visit an earnings calendar for a particular date range on yahoo finance and then spiral out and visit each Stock Ticker page that shows up in the list. The scraper is then supposed to collect specific information on each individual ticker page.
Three pieces of information I am trying to grab is the style on 3 SVG tags that populate on the individual stock ticker pages. These SVGs each indicate the short, medium, and long term outlook for the stock (I am interpreting what each "outlook" is based on the css style being applied to the SVG).
When I run my program, Colly will spider through and only capture the styling for the SVG tags for about 30% of the stock ticker pages. The rest come back empty. Every time I run the program the list of Stocks where the SVG styles actually populate is different. Why is this happening? See sample output and src code below:
package main
import (
"fmt"
"github.com/gocolly/colly/v2"
"log"
"strings"
"sync"
"time"
)
type Stock struct {
Url string
TickerSymbol string
CompanyName string
PerformanceOutlookShort string
PerformanceOutlookMid string
PerformanceOutlookLong string
}
var mu sync.Mutex
func main() {
var stockData = make(map [string]*Stock)
c := colly.NewCollector(
colly.UserAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36"),
colly.AllowedDomains("finance.yahoo.com"),
colly.MaxBodySize(0),
colly.AllowURLRevisit(),
colly.Async(true),
)
// Set max Parallelism and introduce a Random Delay
c.Limit(&colly.LimitRule{
DomainGlob: "*",
Parallelism: 2,
Delay: 500 * time.Millisecond,
})
log.Println("User Agent: ", c.UserAgent)
// Before making a request print "Visiting ..."
c.OnRequest(func(r *colly.Request) {
log.Println("Visiting", r.URL.String())
})
// Unique Identifier for the Earnings Page
// Collect the list of stocks, initializing each one in a map
c.OnHTML(`.simpTblRow`, func(e *colly.HTMLElement){
temp := Stock{}
temp.CompanyName = e.ChildText(`td[aria-label="Company"]`)
temp.TickerSymbol = e.ChildText(`td[aria-label="Symbol"]`)
temp.Url =e.ChildAttr("td>a", "href")
stockData[temp.TickerSymbol] = &temp
e.Request.Visit("https://finance.yahoo.com" + temp.Url)
})
// On each stock ticker page collect the relevant information and update each map item
c.OnHTML(".finance.US", func(e *colly.HTMLElement) {
// Skip this callback if we are on the earnings calendar page
if !strings.Contains(e.Request.URL.Path, "/quote/"){
return
}
// Get the current stock in the map that matches the one on the ticker page
stockNameTickerString := e.ChildText("#quote-header-info h1")
justTicker :=stockNameTickerString[strings.Index(stockNameTickerString, "(")+1:strings.Index(stockNameTickerString, ")")]
currStock := stockData[justTicker]
log.Println(currStock.TickerSymbol)
// The LAST 3 Stats are not always captured for each stock... why?
// Capture Short Term Outlook
currStock.PerformanceOutlookShort = e.ChildAttr(`#chrt-evts-mod > div:nth-child(3) > ul > li:first-child > a svg`, "style")
// Capture Mid Term Outlook
currStock.PerformanceOutlookMid = e.ChildAttr(`#chrt-evts-mod > div:nth-child(3) > ul > li:nth-child(2)> a svg`, "style")
// Capture Short Term Outlook
currStock.PerformanceOutlookLong = e.ChildAttr(`#chrt-evts-mod > div:nth-child(3) > ul > li:nth-child(3)> a svg`, "style")
})
c.Visit("https://finance.yahoo.com/calendar/earnings?from=2021-02-28&to=2021-03-06&day=2021-03-04")
c.Wait()
for _, v := range stockData {
fmt.Println(v.TickerSymbol, " - ", v.PerformanceOutlookShort)
fmt.Println(v.TickerSymbol, " - ", v.PerformanceOutlookMid)
fmt.Println(v.TickerSymbol, " - ", v.PerformanceOutlookLong)
}
}
Sample Output:
FENC -
FENC -
FENC -
GMRE -
GMRE -
GMRE -
SBOW -
SBOW -
SBOW -
NMM -
NMM -
NMM -
WB - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
WB - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
WB - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
VSEC - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
VSEC - fill:#464e56;stroke:#464e56;stroke-width:0;vertical-align:bottom;
VSEC - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
GEENQ -
GEENQ -
GEENQ -
TZOO -
TZOO -
TZOO -
FCRD - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
FCRD - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
FCRD - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
SYNC -
SYNC -
SYNC -
RNET -
RNET -
RNET -
INFI -
INFI -
INFI -
GCP - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
GCP - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
GCP - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
FRPH -
FRPH -
FRPH -
SIGA -
SIGA -
SIGA -
NWPX - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
NWPX - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
NWPX - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
MICT -
MICT -
MICT -
SLNO -
SLNO -
SLNO -
AAMC - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
AAMC - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
AAMC - fill:#464e56;stroke:#464e56;stroke-width:0;vertical-align:bottom;
PKDC - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
PKDC - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
PKDC - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
NWLI -
NWLI -
NWLI -
MNDO - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
MNDO - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
MNDO - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
FTSI -
FTSI -
FTSI -
AIKI - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
AIKI - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
AIKI - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
CULP - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
CULP - fill:#464e56;stroke:#464e56;stroke-width:0;vertical-align:bottom;
CULP - fill:#464e56;stroke:#464e56;stroke-width:0;vertical-align:bottom;
HURC - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
HURC - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
HURC - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
EQ -
EQ -
EQ -
HRTG -
HRTG -
HRTG -
SALM -
SALM -
SALM -
OXFD -
OXFD -
OXFD -
CMTL - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
CMTL - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
CMTL - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
DXYN - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
DXYN - fill:#464e56;stroke:#464e56;stroke-width:0;vertical-align:bottom;
DXYN - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
SD -
SD -
SD -
BXMX - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
BXMX - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
BXMX - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
BXC - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
BXC - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
BXC - fill:#464e56;stroke:#464e56;stroke-width:0;vertical-align:bottom;
SHIP - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
SHIP - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
SHIP - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
NRP -
NRP -
NRP -
GWRS -
GWRS -
GWRS -
WPG -
WPG -
WPG -
MLR -
MLR -
MLR -
OXSQ - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
OXSQ - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
OXSQ - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
UTF - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
UTF - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
UTF - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
SMHI -
SMHI -
SMHI -
MNKKQ -
MNKKQ -
MNKKQ -
FIZZ - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
FIZZ - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
FIZZ - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
RLH - fill:#464e56;stroke:#464e56;stroke-width:0;vertical-align:bottom;
RLH - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
RLH - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
YY -
YY -
YY -
ANFIF - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
ANFIF - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
ANFIF - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
CIA - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
CIA - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
CIA - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
SFE -
SFE -
SFE -
APT - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
APT - fill:#464e56;stroke:#464e56;stroke-width:0;vertical-align:bottom;
APT - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
AIV - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
AIV - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
AIV - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
FLMN - fill:#ff4d52;stroke:#ff4d52;stroke-width:0;vertical-align:bottom;
FLMN - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;
FLMN - fill:#1ac567;stroke:#1ac567;stroke-width:0;vertical-align:bottom;

elastalert sends multiple email alerts instead of sending an aggregated email

Instead of sending one alert, ElastAlert sends email for each document which mapped. Below is my rule file. It works but I want alerts in one email. Please help any suggestion will be appreciated.
skynet.yaml: |-
---
name: skynet
type: frequency
limit_execution: "0/10 * * * *"
index: wpng-httpd-perf-*
num_events: 1
top_count_keys: ["Host_Id", "Host_Group"]
timeframe:
minutes: 15
filter:
- query:
query_string:
query: "Host_Group.keyword:ZOOKEEPER_ZK1_QA"
alert:
- "email"
email_format: html
aggregation:
minutes: 15
aggregation_key: 'Host_Id'
email:
- "johndoe#skynet.com"
from_addr: "sam#skynet.com"
alert_subject: "PLOT1 at {0}."
alert_subject_args:
- "#timestamp"
alert_text: "Hi Team,<br><br/> {0} ERROR event(s) detected in last 15 minutes <br/><br>Hosts where errors are detected :</br> Host_Id is {1} <br></br><br></br> <br>Here are a few of those :</br><br> messages {2} </br><br> </br><br/><br>bye.</br><br></br><br>Thanks <br></br> "
alert_text_type: alert_text_only
alert_text_args:
- num_matches
- Host_Id
- message
- top_count_keys
Below code worked for me.
PLOTTHREE.yaml: |-
---
name: PLOTTHREE
type: frequency
limit_execution: "0/15 * * * *"
index: home-*
num_events: 1
aggregation:
minutes: 10
include:
- Host_Group
- Host_Id
timeframe:
minutes: 15
filter:
- query:
query_string:
query: "Host_Group.keyword:fatal"
alert:
- "email"
email:
- "john#doe.com"
from_addr: "yyy#doe.com"
alert_subject: "PLOTTHREE - ERROR detected in Kafka Zookeeper logs of host group fatal at {0}."
alert_subject_args:
- "#timestamp"
alert_text: "Hello Team, ERROR event(s) detected in last 15 minutes. Hosts where errors are detected in {0}. Here is the num events {1} . "
alert_text_type: alert_text_only
alert_text_args:
- Host_Id
- num_matches

Lookup table not working after training the model in rasa

I am new to rasa. I am training a model to recognize certain entities using lookup tables. I have multiple entities in the single sentence and I am trying to extract them.
nlu.yml
version: "2.0"
nlu:
- intent: intent_1
examples : |
- how many deaths were there last year in [Ohio](Filter-State)?
- death count of [Florida](Filter-State) this year
- death count of [Texas](Filter-State) this year
- what's the death count for this quarter in [CA](Filter-State)?
- lookup: Filter-State
examples: |
- Alabama
- AL
- Alaska
- AK
- Arizona
- AZ
- Arkansas
- AR
- California
- CA
- Colorado
- CO
- Connecticut
- CT
- Delaware
- DE
- District of Columbia
- DC
- Florida
- FL
- Georgia
- GA
config.yml
language: en
pipeline:
- name: WhitespaceTokenizer
- name: RegexFeaturizer
- name: LexicalSyntacticFeaturizer
- name: CountVectorsFeaturizer
- name: CountVectorsFeaturizer
analyzer: "char_wb"
min_ngram: 1
max_ngram: 4
- name: DIETClassifier
epochs: 150
random_seed: 1
- name: FallbackClassifier
threshold: 0.7
- name: DucklingEntityExtractor
url: http://duckling.rasa.com:8000
dimensions:
- email
- time
- name: EntitySynonymMapper
policies:
- name: AugmentedMemoizationPolicy
max_history: 4
- name: TEDPolicy
max_history: 4
epochs: 100
- name: RulePolicy
core_fallback_threshold: 0.4
core_fallback_action_name: "action_default_fallback"
enable_fallback_prediction: True
When I train the model and try using the api, It doesn't recognize cases from the states in the lookup table and as a result can't assign it to slot filter_state.
Can anyone advise me as to what am I doing wrong here for making the lookup table work!
I'm new to Rasa and searching for another issue, but I just ran into and solved this issue last night.
For lookup tables to work, you need to add "RegexEntityExtractor" to your pipeline and possibly remove RegexFeaturizer. You also need to enable lookup tables in the RegexEntityExtractor config.
config.yml
pipeline:
- name: WhitespaceTokenizer
- name: LexicalSyntacticFeaturizer
- name: CountVectorsFeaturizer
- name: RegexEntityExtractor
case_sensitive: False
use_lookup_tables: True
use_regexes: True
...
Could you, please, post on the Rasa forum and include more details of your setup? In particular, what version of Rasa Open Source are you using? Is the above your complete NLU data? (I think that you need at least 2 intents for an intent classifier to train.) I also recommend that you test the system using rasa interactive --debug and share e.g. a screenshot, this will help everyone see the exact input message and how it gets processed by Rasa. I'm sure we'll trace the issue down to its roots :-)

Rasa how to get a value (slot) from a user

I want rasa to respond to a user when they ask for a forecast for a part number.
From what I have read, I understand I need to use a slot, but I can't find a clear example that I can understand on how to get the part number from the user.
It would give me a head start if I could see an example nlu, story and domain where
the user is asked for a part number
The user enters the part number
Rasa responds with the part number.
here is what I have so far.
domain.yml
intents:
- greet
- goodbye
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge
- get_supplier_forecast
entities:
- partnumber
slots:
partnumber:
type: text
templates:
utter_greet:
- text: Hey! How are you?
utter_cheer_up:
- text: 'Here is something to cheer you up:'
image: https://i.imgur.com/nGF1K8f.jpg
utter_did_that_help:
- text: Did that help you?
utter_happy:
- text: Great, carry on!
utter_goodbye:
- text: Bye
utter_iamabot:
- text: I am a bot, powered by Rasa.
utter_get_part_number:
- text: can you give me the part number please
utter_give_me_a_minute_while_i_check:
- text: Give me a minute while I see if I can find a forecast for {partnumber}
utter_confirm_part_number:
- text: Thanks you asked for forecast for {partnumber} did this help?
actions:
- utter_greet
- utter_cheer_up
- utter_did_that_help
- utter_happy
- utter_goodbye
- utter_iamabot
- utter_get_part_number
- utter_give_me_a_minute_while_i_check
- utter_confirm_part_number
nlu.md
## intent:greet
- hey
- hello
- hi
- good morning
- good evening
- hey there
## intent:goodbye
- bye
- goodbye
- see you around
- see you later
## intent:affirm
- yes
- indeed
- of course
- that sounds good
- correct
## intent:deny
- no
- never
- I don't think so
- don't like that
- no way
- not really
## intent:mood_great
- perfect
- very good
- great
- amazing
- wonderful
- I am feeling very good
- I am great
- I'm good
## intent:mood_unhappy
- sad
- very sad
- unhappy
- bad
- very bad
- awful
- terrible
- not very good
- extremely sad
- so sad
## intent:bot_challenge
- are you a bot?
- are you a human?
- am I talking to a bot?
- am I talking to a human?
## intent:get_supplier_forecast
- Give me a forecast
- Give me a part number forecast
- I want a forecast
- I want a part number forecast
- I want a forecast for a part
- I want a supplier forecast
- Forecast delivery date
- I need a part number delivery date
- I need an item delivery date
- When will i get a part delivered
stories.md
## happy path
* greet
- utter_greet
* mood_great
- utter_happy
## sad path 1
* greet
- utter_greet
* mood_unhappy
- utter_cheer_up
- utter_did_that_help
* affirm
- utter_happy
## sad path 2
* greet
- utter_greet
* mood_unhappy
- utter_cheer_up
- utter_did_that_help
* deny
- utter_goodbye
## say goodbye
* goodbye
- utter_goodbye
## bot challenge
* bot_challenge
- utter_iamabot
## give me a forecast
* get_supplier_forecast{"partnumber":"J12345-001"}
- slot {"partnumber":"J12345-001"}
- utter_get_part_number
- utter_confirm_part_number
Domain file remain as the same. Try below things.
Story file:
## give me a forecast path1
* get_supplier_forecast{"partnumber":null}
- slot {"partnumber":null}
- utter_get_part_number
## give me a forecast path2
* get_supplier_forecast{"partnumber":"J12345-001"}
- slot {"partnumber":"J12345-001"}
- utter_confirm_part_number
Include this NLU file:
## intent:get_supplier_forecast
#this is how to mention slots in nlu file
- ['J12345-001'](partnumber)
Note: I don't know what is "partnumber" in your case. If there is so many of them you might wanna use "lookup tables".
From above changes first if the slot is null utter_get_part_number will trigger and if the slot is filled with a value utter_confirm_part_number will trigger
If this doesn't fulfill your need or doesn't work as expected, you can try rasa interactive training. Just run rasa interactive on CMD or try rasa x interactive talk. From this you can choose what you expect from the bot

Ruby's YAML only loads first Records from a large File, why?

Okay, I have the following YAML file that was generated by using yaml_db for Rails. So this is basically an autogenerated export of my Rails database:
---
admins:
columns:
- id
- username
- email
- encrypted_password
- password_salt
- sign_in_count
- current_sign_in_at
- last_sign_in_at
- current_sign_in_ip
- last_sign_in_ip
- failed_attempts
- unlock_token
- locked_at
- created_at
- updated_at
records:
- - 1
-
- lalala#lalala.at
- $2a$10$dZU50HD6paWS7EjKuWAruOFdwt9eqxiNTRh/D4sj8cqSzy5gjYd2i
- $2a$10$dZU50HD6paWS7EjKuWAruO
- 86
- 2011-01-27 07:37:45 Z
- 2011-01-26 13:27:13 Z
- 12.34.56.78
- 12.34.56.78
- 0
-
-
- 2010-12-23 09:20:46 Z
- 2011-01-27 07:37:45 Z
- - 2
- admin
- lalalalala#lalalala.com
- $2a$10$3DML64hdCCvG90bnhIpN/unEEm6C.a9FqGrAFlFHU0.2D54DSQ1Ni
- $2a$10$3DML64hdCCvG90bnhIpN/u
- 1
- 2011-01-21 09:52:14 Z
- 2011-01-21 09:52:14 Z
- 12.34.56.78
- 12.34.56.78
- 0
-
-
- 2011-01-05 14:29:49 Z
- 2011-01-21 09:52:14 Z
---
experiments:
columns:
- id
- description
- startdate
- enddate
- maps_base_URI
- maps_count
- queries_count
- proposals_count
- created_at
- updated_at
.......
Now when I try to load this YAML file in Ruby with:
file = YAML.load(File.open("data-2011-01-27.yml"))
It doesn't load more than the first admin, not even the experiments:
ruby-1.9.2-p0 > file.keys
=> ["admins"]
ruby-1.9.2-p0 > file["admins"]["records"].count
=> 1
Why is that? I would assume that the autogenerated .yml file is syntactically correct? When I run rake:db:dump and rake:db:load it works just fine.
Three hyphens (---) separate multiple documents. See YAML.load_stream to load them all:
documents = YAML.load_stream(open("data-2011-01-27.yml")).documents
documents.map(&:keys)
#=> [["admins"], ["experiments"]]

Resources