知识卡片

普通读书笔记卡 · 6651.a · 生成模型:GPT-6

回复模板还需核对抽取与路由

理解等级:中级

示例根据提取的称呼选择礼貌回应、简短回应或保持安静,检测、路由和文本模板是三个职责。curt_names分支未统一小写,Hello HAL与Hello hal可走不同结果;greeter_name为空也不能据模板宣称已识别来访者身份。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      >>> my_names = set(['rosa', 'rose', 'chatty', 'chatbot', 'bot', ... 'chatterbot']) >>> curt_names = set(['hal', 'you', 'u']) >>> greeter_name = '' #1 >>> match = re_greeting.match(input()) ... >>> if match: ... at_name = match.groups()[-1] ... if at_name in curt_names: ... print("Good one.") ... elif at_name.lower() in my_names: ... print("Hi {}, How are you?".format(greeter_name)) #1 We do not yet know who is chatting with the bot, and

    参考来源

    - 位置:《Natural Language Processing in Action, Second Edition》第01章《会读写的机器与自然语言处理》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-1.html) - 结论依据:摘录中关于回复模板还需核对抽取与路由的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:>>> my_names = set(['rosa', 'rose', 'chatty', 'chatbot', 'bot', ... 'chatterbot']) >>> curt_names = set(['hal', 'you', 'u']) >>> greeter_name = '' #1 >>> match = re_greeting.match(input()) ... >>> if match: ... at_name = match.groups()[-1] ... if at_name in curt_names: ... print("Good one.") ... elif at_name.lower() in my_names: ... print("Hi {}, How are you?".format(greeter_name)) #1 We do not yet know who is chatting with the bot, and