vivekanon
vivekanon

Reputation: 1823

Adding utterances in the nlu.md file and training a model not working

I've added below utterance in the nlu.md file :

## intent:input_year
- [2019](year)

And have a story like this :

## test
* input_year{"year" : "2019"}
 - utter_year

The intent input_year and action utter_year is added to domain.yml

I trained a new model through command line, started rasa x and talked to the bot, on entering 2019 the intent identified is null0.

This is my pipeline :

pipeline: 
- name: "SpacyNLP"
- name: "SpacyTokenizer"
- name: "RegexFeaturizer"
- name: "SpacyFeaturizer"
- name: "CRFEntityExtractor"
- name: "EntitySynonymMapper"
- name: "SklearnIntentClassifier"
- name: "DucklingHTTPExtractor"
  # url of the running duckling server
  url: "http://localhost:8000"
  # dimensions to extract
  dimensions: ["email", "time", "number", "amount-of-money", "distance"]
  # allows you to configure the locale, by default the language is
  # used
  locale: "NL_Nothing"
  # if not set the default timezone of Duckling is going to be used
  # needed to calculate dates from relative expressions like "tomorrow"
  timezone: "US/Pacific"

Is this a valid way to train new data ? Or is it important to use the UI to train? Please suggest what is wrong here. Thanks

Upvotes: 0

Views: 504

Answers (3)

V. Dhananjaya
V. Dhananjaya

Reputation: 101

Have you specified a entity and slot in domain file if not you have to specify it because if you are defining the intent like this [2019](year). In your case slot will be "year". You can specify those things like below in your domain.yml file.

entities:
- echannel_service

slots:
  year:
    type: text

Note: Insteat of slot type as text you can use categorical and specifiy the list of years. Refer this about slots

If you have already mentioned those things and still it doesnt work, try specifing in the stories like this.

## input_year path
* input_year{"yea":"2019"}
    - slot{"year":"2019"}

If you don't want to use slots just specify the years in nlu.md file like this and try.

## intent:input_year
- 2019 year
- 2020 year

Upvotes: 1

michael
michael

Reputation: 46

Is 2019 the only line you have for that intent? I think Rasa expects several examples for possible inputs per intent. Try adding more examples to that intent.

Upvotes: 0

Dushan
Dushan

Reputation: 1565

Option 1

hi, you can try adding lookup for your year in nlu.md like below.

## lookup:year
 - 2001
 - 2002
 - 2003
 - 2010
 - 2011
 - 2012
 - 2018
 - 2019

Option 2

I'm giving this option since you have already trained your bot using interactive form. Try changing your intent like below and check if thats working.

## intent:input_year
- [2019](year) year

Let me know the result.

Upvotes: 0

Related Questions