设计经验
mail@qhduan.com
wx: longinusd
段清华 Dean
Human:User
Machine:Expert & Algorithm
Human cheap
Machine expensive
Human expensive
Machine cheap (NLP cheap)
HUMAN
machine
HUMAN
machine
Dialog System (Task Complete)
Question Answering (Information Retrivel)
Chitchat (comfortable)
Language Processing
Young (2000)
任务完成的定义:
收集所有任务必要的元素
即:
任何东西都是要素
不要预期能设计一个大而全的模型
设计一个可迭代的模型
产品随时进行集成测试,测试End-to-End对话效果
Cons:集成测试需要比传统App多的多的多
Pros:集成测试写起来比传统APP简单的多
人的阅读速度比听音速度快得多,区分场景
限制用户想象,集中在生产环境
MORE HAPPY PATH
as MUCH as POSSIBLE
文字交互时:
说更多细节与引导,用户会学习
给更多当前状态的信息,用户会纠错
EXPLAIN BOTS's WEAKNESS, DON'T HIDE
HOW
{
"DestCity": {
"value": null,
"confirm": false
},
"DepartCity": {
"value": null,
"confirm": false
},
"DepartDate": {
"value": null,
"confirm": false
},
"Cabin": {
"value": null,
"confirm": false
},
"Price": {
"value": null,
"confirm": false
},
"Ticket": {
"confirm": false
}
}国际难题
挂起当前领域
尝试复制当前领域可用SLOT
完成任务
尝试问用户回顾前领域
no anaphora resolution
(飞机) 它几点到? == 几点到?
dialog_state = initialize_dialog()
system_action = HELLO()
system_utterance = NLG(system_action) # 你好
while True:
user_utterance = input('>') # eg. 我要去北京的机票
domain, intent, slots = NLU(user_utterance)
# domain: travel
# intent = inform
# slots = {'DestCity': '北京', 'TravelType': '飞机'}
latest_user_action = domain, intent, slots
dialog_state = DialogStateTracking(
dialog_state, # 输入老的dialog_state
latest_user_action,
latest_system_action)
system_action = DialogPolicy( # eg. REQUEST('DepartCity')
dialog_state,
latest_user_action,
latest_system_action)
system_utterance = NLG(system_action) # 请问从哪里出发INPUT: "我要去北京的飞机"
Domain
Classifier
Intent
Classifier
Slot
Filler
(NER)
Travel
Inform
DestCity: 北京
TravelType: 飞机
User Intent = Domain + Intent + Slots
Domain(travel) + Intent(inform) + Slots(DestCity=北京, TravelType=飞机)
Domain(plane) + Intent(inform) + Slots(DestCity=北京)
Domain(travel) + Intent(inform_plane) + Slots(DestCity=北京)
=
=
=
意图是语言要素的排列组合,没有定式
人工定义 - 瀑布流
newFrame = clone(frame)
if frame.DestCity not filled:
if userAction.slot.DestCity:
newFrame.DestCity.value = userAction.slot.DestCity
if last_system_action == CONFIRM("DestCity"):
if userAction.intent == YES():
newFrame.DestCity.confirm = True
elif userAction.intent == NO():
newFrame.DestCity.confirm = False
return newFrameif frame.DestCity not filled:
# 请告诉目的地
return REQUEST("DestCity")
if frame.DestCity not confirmed:
# 请确认目的地是 $frame.DestCity$
return CONFIRM("DestCity", frame.DestCity)
# ...
if lastest_system_action == CONFIRM("Ticket"):
if lastest_user_action == YES():
return ORDER_TICKET()
elif lastest_user_action == NO():
return CONFIRM("Ticket")
Higher Precision
Lower Recall
Scikit-Learn Wrapper, Grid Search
Chinese Fuzzy Enhancement
Lower Recall: Focus on domain
Position Sensitive
Bounder mistake
Vocabulary-based re-fine
导航到广安门
我要去北京
made by Microsoft
Waterfall design
Complex rules programming
Simple
Not Configurable
// input: system action == hello(name)
// output: natural language
funciton hello (name: string= null) {
if (name) {
return `你好,${name}`
}
return '你好'
}
TEMPLATE + VARIANCE + ENTITIES + ERROR
WHATEVER
mail@qhduan.com
wx: longinusd
段清华 Dean