一种对话机器人开发技术综述与系统架构实现
2021-04-06孙小鱼



摘 要:对话机器人是使用自然语言处理与生成技术,模拟人类对话逻辑并与人进行交流的计算机程序。作为新一代人工智能产品的人机交互主要入口,逻辑实现方式与交互是对话机器人设计的关键。本文结合对话机器人的技术特点,在实现过程中采用基于Python语言的Django微服务Web应用开发框架,将对话算法模型与逻辑处理过程进行微服务化API封装,使其他应用能够请求对话服务的接口进行功能的二次开发。为了提高对话响应速度,本文采用了关系型数据库MySQL与基于内存的非关系型数据库Redis结合的方式,减少算法模型对硬盘的读取次数,优化了用户体验。
关键词:微服务;Django;MySQL;Redis
Abstract: A chatbot is a computer program that simulates human conversation and communicates with human through natural language processing and generation technology. As main access to human-computer interaction for a new generation of artificial intelligence products, logical implementation and interaction are critical to the design of chatbots. Based on technical characteristics of chatbots, this paper adopts Python-based Django micro-service web application development framework in the implementation and encapsulates dialogue algorithm model and logic processing process into a micro-service API (Application Programming Interface). Thus, other applications can request the interface of dialogue service for a secondary development of functions. In order to improve the efficiency of query processing, a memory-based non-relational database Redis (Remote Dictionary Server) is used with relational database MySQL (Structured Query Language) to reduce the number of reads from hard disk and so to optimize system performance.
Keywords: micro-services; Django; MySQL; Redis
1 引言(Introduction)
對话机器人是当前人工智能领域的研究热点,它应用自然语言处理与生成技术,以聊天界面或API为基础,能够与人进行语音或文本对话,以聊天的方式解决用户的需求[1]。对话算法主要包括以下几个过程:自然语言理解、对话状态追踪[2]、对话内容管理[3]、自然语言生成[4]。但是上述过程的核心算法都是基于Python编程语言开发的,与网站软件开发或终端硬件开发的技术架构并不兼容。为了适应越发复杂的大型网站系统单体架构,微服务技术应运而生,其核心思想是各种自治的子系统协同工作,共同完成大型网站的功能和业务需求[5]。
对话机器人与其他微服务程序不同的地方在于:处理对话逻辑需要大量高频重复且复杂的计算过程和频繁的存取硬盘数据的过程。……
