Added data sent to the handlers (+fix utterance list/str)
This commit is contained in:
parent
d7163ac7de
commit
568f6a3fce
@ -77,6 +77,13 @@ def recognise(sentence):
|
|||||||
# print(result) # DEBUG
|
# print(result) # DEBUG
|
||||||
|
|
||||||
if result.conf >= 0.2:
|
if result.conf >= 0.2:
|
||||||
handle(result.name, [result.matches, result.sent])
|
data = dict()
|
||||||
|
if isinstance(result.sent, list):
|
||||||
|
data['utterance'] = " ".join(
|
||||||
|
result.sent) # add the sentence (utterance) to the data given to the intent handler
|
||||||
|
else:
|
||||||
|
data['utterance'] = result.sent
|
||||||
|
data.update(result.matches) # adding the matches from padatious to the data
|
||||||
|
handle(result.name, data)
|
||||||
else:
|
else:
|
||||||
print("No match... (Padatious")
|
print("No match... (Padatious")
|
||||||
|
Reference in New Issue
Block a user