问题
I'm trying to tag my training data using vocab files to reduce the number of training phrases I need to add e.g. use a Bill vocab which allows the use of 'bill' or 'invoice' interchangeably. I have added a Bill enum type and an Bill vocab file. However when I try to tag the word 'bill' in my training phrase with value Bill:Bill I get an 'Illegal Plan' message in my training entry.
My goal is an action. Note that 'bill' is not an expected input to my action. I'm just trying to minimise the number of training phrases I need to add.
Also, could you explain the function of 'Role' in training data? I don't see an explanation in the documentation.
num (Bill) {
symbol (Bill)
}
vocab (Bill) {
"Bill" {"Bill", "bill", "invoice", "account balance"}
}
[g:FaqBill] check my (bill)[v:Bill:Bill]
I would expect the NL model to compile successfully but I get an 'Illegal Plan' message in my training entry.
回答1:
I attempted to do the same thing and was able to get the expected plan.
Here are the parts of my attempt at reproducing the behavior you described. Please check each file to see if it matches the code below:
Enum:
enum (Bill) {
symbol (Bill)
}
Vocabulary:
vocab (Bill) {
"Bill" {"Bill", "bill", "invoice", "account balance"}
}
Action:
action (GetBill) {
description (Gets the bill)
type (Search)
collect {
input (bill) {
type (Bill)
min (Required) max (One)
}
}
output (Bill)
}
Action JS:
module.exports = {
function: GetBill
}
function GetBill (bill) {
return bill
}
With these 4 elements, I was able to get the utterance training plan shown in the screenshot provided above.
来源:https://stackoverflow.com/questions/55726751/illegal-plan-message-when-tagging-training-data-with-vocab-types