这就是我的做法,但我无法将从 A 到 Z 的句子作为一个完整的实体,只有少数部分知道为“数字”、“位置”、....
merge(request) {
return new Promise(function(resolve, reject) {
var entities = request.entities;
var context = request.context;
var message = request.message;
var sessionId = request.sessionId;
var intent = firstEntityValue(entities, 'intent');
if (intent == "write_free_text") {
context.free_text = request["text"];
}
if (intent == "choose_city") {
var city = firstEntityValue(entities, 'location');
context.city = city;
}
return resolve(context);
});
}
我怎样才能做到这一点并使用合并功能存储整个句子?谢谢