lakshmi
(lakshmi)
September 28, 2018, 11:22am
1
Hi
I’m trying custom actions in my Bot application using Python script
def run(self, dispatcher, tracker, domain):
print(tracker.get_slot(‘PERSON’))
Following is my trained data
Looking for Muthu
When I type “Looking for Muthu” in Bot UI the tracker returns “Muthu” as entity/slot
But I type “Looking for Venu” the tracker returns none
It cann’t able to identify the other than Muthu as Person entity.
I’m using following configuration
pipeline:
name: “nlp_spacy”
name: “tokenizer_spacy”
name: “intent_entity_featurizer_regex”
name: “intent_featurizer_spacy”
name: “ner_crf”
name: “ner_spacy”
name:
“ner_synonyms”
name: “intent_classifier_sklearn”
souvikg10
(Souvik Ghosh)
September 28, 2018, 11:39am
2
lakshmi:
PERSON
Are you training this entity extraction using CRF?
This article might help
Entity extraction is one of the most important tasks of any NLU system, where the goal is to extract meaningful information from text. For…
Reading time: 13 min read
lakshmi
(lakshmi)
October 3, 2018, 10:44am
3
Thanks for the reply souvikg , As per the link I upgraded my RASA - NLU version to 0.13
And added the
## lookup: PERSON
data/Person/Person.txt
Then train my data by using the following command
python trainer.py train-all
But the lookup element doesn’t add in training_data.json
Do I miss anything?
souvikg10
(Souvik Ghosh)
October 3, 2018, 11:34am
4
Not sure what is the issue, you just need to add the lookup object in your training data and train a CRF with some of the examples from your lookup to create a patter of identification
"lookup_tables": [
{
"name": "company",
"elements": "data/company/startups.csv"
}
],
syedrizvi
(Syed Rizvi)
October 4, 2018, 6:36am
5
Hi Lakshmi,
If i am trying to print tracker.get_slot(’’) i am getting the below error
TabError: inconsistent use of tabs and spaces in indentation
My exact statement looks like - print(tracker.get_slot(‘cuisine’))
Just wanted to see the values present in the slots in my customized action.
Do you have any inputs ?
Thanks.
syedrizvi
(Syed Rizvi)
October 4, 2018, 6:42am
6
It got resolved…Some issue with the tab fields in that line…Deleted and wrote again.Thanks!
lakshmi
(lakshmi)
October 4, 2018, 9:43am
7
Hi
Yes I did , Following are the steps done
1, Upgraded rasa_nlu : 0.13.5
2, Added Lookup_tables in MD file instead of json
lookup:Person
data/Person/Person.txt
3, Then updated config file as follows
pipeline:
name: “nlp_spacy”
name: “tokenizer_spacy”
name: “intent_entity_featurizer_regex”
name: “intent_featurizer_spacy”
name: “ner_spacy”
name: “ner_synonyms”
name: “intent_classifier_sklearn”
name: “ner_crf”
features: [
[“low”, “title”, “upper”],
[“bias”, “low”, “prefix5”, “prefix2”, “suffix5”,
“suffix3”, “suffix2”, “upper”, “title”, “digit”,
“pattern”],
[“low”, “title”, “upper”]
]
Then i executed train command . My training_data.json has the following update
“lookup_tables”: [
{
“name”: “Person”,
“elements”: “data/Person/Person.txt”
}
],
Now I’m running rasa_nlu server
Still I’m getting None response for Tracker
souvikg10
(Souvik Ghosh)
October 4, 2018, 3:23pm
8
is your slot_name the same as the entity name?
PERSON?
can you simply call the NLU to see if the Person entity is detected or not
lakshmi
(lakshmi)
October 5, 2018, 5:15am
9
Yes it is PERSON
print(tracker.get_slot(‘PERSON’))
It detects the PERSON entity, thus why i mentioned sometimes getting None value.
In my training data, added some examples like
Looking for Muthu
Would like to about Lakshmi
So “print(tracker.get_slot(‘PERSON’))” can able to returns Muthu or Lakshmi . If i try some other names its prints nothing
souvikg10
(Souvik Ghosh)
October 6, 2018, 11:54am
10
I will have to test the pipeline to see why this isn’t working. Will let you know
lakshmi
(lakshmi)
October 9, 2018, 4:45am
11
Hi
Can anybody have solution for this issue