CN116050427B - Information generation method, training device, electronic equipment and storage medium - Google Patents
Information generation method, training device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116050427B CN116050427B CN202211742317.3A CN202211742317A CN116050427B CN 116050427 B CN116050427 B CN 116050427B CN 202211742317 A CN202211742317 A CN 202211742317A CN 116050427 B CN116050427 B CN 116050427B
- Authority
- CN
- China
- Prior art keywords
- information
- sample
- understanding
- dialogue
- query
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本公开提供了一种信息生成方法、训练方法、装置、电子设备以及存储介质,涉及人工智能技术领域,尤其涉及自然语言处理和深度学习技术领域。具体实现方案为:对查询信息进行语义理解,得到理解信息,其中,查询信息包括历史对话信息,理解信息包括对象动作和对话状态;响应于检测到辅助请求指令,根据查询信息和理解信息,得到辅助请求信息;根据查询信息、理解信息和辅助请求信息,生成对话应答信息。
The present disclosure provides an information generation method, a training method, a device, an electronic device and a storage medium, and relates to the field of artificial intelligence technology, especially to the technical fields of natural language processing and deep learning. The specific implementation plan is: perform semantic understanding of the query information to obtain understanding information, where the query information includes historical dialogue information, and the understanding information includes object actions and dialogue status; in response to detecting the auxiliary request instruction, based on the query information and understanding information, obtain Auxiliary request information; generate dialogue response information based on query information, understanding information and auxiliary request information.
Description
技术领域Technical field
本公开涉及人工智能技术领域,尤其涉及自然语言处理和深度学习技术领域。具体地,涉及一种信息生成方法、训练方法、装置、电子设备以及存储介质。The present disclosure relates to the technical field of artificial intelligence, and in particular to the technical fields of natural language processing and deep learning. Specifically, it relates to an information generation method, training method, device, electronic device and storage medium.
背景技术Background technique
随着人工智能技术的发展,可以利用人工智能技术实现任务型对话(TaskOriented Dialogue,TOD)。With the development of artificial intelligence technology, artificial intelligence technology can be used to realize task-oriented dialogue (TaskOriented Dialogue, TOD).
任务型对话可以指系统需要通过有限的对话回合并访问外部数据库,以引导用户完成对话任务和实现对话目的。例如,对话任务可以包括以下至少之一:查询任务、推荐任务和预约任务。对话目的可以包括以下至少之一:查询天气、推荐景点和预约酒店等。Task-based dialogue can mean that the system needs to go through limited dialogue rounds and access external databases to guide the user to complete the dialogue task and achieve the purpose of the dialogue. For example, the conversation task may include at least one of the following: a query task, a recommendation task, and a reservation task. The purpose of the conversation may include at least one of the following: checking the weather, recommending attractions, making hotel reservations, etc.
发明内容Contents of the invention
本公开提供了一种信息生成方法、训练方法、装置、电子设备以及存储介质。The present disclosure provides an information generation method, training method, device, electronic device and storage medium.
根据本公开的一方面,提供了一种信息生成方法,包括:对查询信息进行语义理解,得到理解信息,其中,上述查询信息包括历史对话信息,上述理解信息包括对象动作和对话状态;响应于检测到辅助请求指令,根据上述查询信息和上述理解信息,得到辅助请求信息;以及,根据上述查询信息、上述理解信息和上述辅助请求信息,生成对话应答信息。According to one aspect of the present disclosure, an information generation method is provided, including: performing semantic understanding on query information to obtain understanding information, wherein the above query information includes historical dialogue information, and the above understanding information includes object actions and dialogue states; in response to The auxiliary request instruction is detected, and the auxiliary request information is obtained based on the above query information and the above understanding information; and the dialogue response information is generated based on the above query information, the above understanding information, and the above auxiliary request information.
根据本公开的另一方面,提供了一种预训练模型的训练方法,包括:对第一样本查询信息进行语义理解,得到第一样本理解信息,其中,上述第一样本查询信息包括第一样本历史对话信息,上述第一样本理解信息包括第一样本对象动作和第一样本对话状态;根据上述第一样本查询信息和上述第一样本理解信息,得到第一样本辅助请求信息;根据上述第一样本查询信息、上述第一样本理解信息和上述第一样本辅助请求信息,生成第一样本对话应答信息;以及,利用上述第一样本查询信息、上述第一样本理解信息和上述第一样本对话应答信息训练预训练对话生成模型,得到信息生成模型。According to another aspect of the present disclosure, a training method for a pre-training model is provided, including: performing semantic understanding on the first sample query information to obtain the first sample understanding information, wherein the above-mentioned first sample query information includes The first sample historical dialogue information, the above-mentioned first sample understanding information includes the first sample object action and the first sample dialogue state; according to the above-mentioned first sample query information and the above-mentioned first sample understanding information, the first sample is obtained Sample auxiliary request information; generating first sample dialogue response information based on the above-mentioned first sample query information, the above-mentioned first sample understanding information and the above-mentioned first sample auxiliary request information; and, using the above-mentioned first sample query information, the above-mentioned first sample understanding information and the above-mentioned first sample dialogue response information to train a pre-trained dialogue generation model to obtain an information generation model.
根据本公开的另一方面,提供了一种信息生成装置,包括:第一语义理解模块,用于对查询信息进行语义理解,得到理解信息,其中,上述查询信息包括历史对话信息,上述理解信息包括对象动作和对话状态;第一获得模块,用于响应于检测到辅助请求指令,根据上述查询信息和上述理解信息,得到辅助请求信息;以及,第一生成模块,用于根据上述查询信息、上述理解信息和上述辅助请求信息,生成对话应答信息。According to another aspect of the present disclosure, an information generation device is provided, including: a first semantic understanding module for performing semantic understanding on query information to obtain understanding information, wherein the above query information includes historical conversation information, and the above understanding information Including object actions and dialogue states; a first obtaining module, in response to detecting the auxiliary request instruction, obtaining auxiliary request information based on the above query information and the above understanding information; and a first generation module, used according to the above query information, The above understanding information and the above auxiliary request information generate dialogue response information.
根据本公开的另一方面,提供了一种预训练模型的训练装置,包括:第二语义理解模块,用于对第一样本查询信息进行语义理解,得到第一样本理解信息,其中,上述第一样本查询信息包括第一样本历史对话信息,上述第一样本理解信息包括第一样本对象动作和第一样本对话状态;第二获得模块,用于根据上述第一样本查询信息和上述第一样本理解信息,得到第一样本辅助请求信息;第二生成模块,用于根据上述第一样本查询信息、上述第一样本理解信息和上述第一样本辅助请求信息,生成第一样本对话应答信息;以及,训练模块,用于利用上述第一样本查询信息、上述第一样本理解信息和上述第一样本对话应答信息训练预训练对话生成模型,得到信息生成模型。According to another aspect of the present disclosure, a training device for a pre-training model is provided, including: a second semantic understanding module for performing semantic understanding on the first sample query information to obtain the first sample understanding information, wherein, The above-mentioned first sample query information includes the first sample historical dialogue information, the above-mentioned first sample understanding information includes the first sample object action and the first sample dialogue state; the second acquisition module is used to obtain the first sample according to the above-mentioned first sample. This query information and the above-mentioned first sample understanding information are used to obtain the first sample auxiliary request information; the second generation module is used to obtain the above-mentioned first sample query information, the above-mentioned first sample understanding information and the above-mentioned first sample. Auxiliary request information to generate first sample dialogue response information; and, a training module for training pre-training dialogue generation using the above-mentioned first sample query information, the above-mentioned first sample understanding information and the above-mentioned first sample dialogue response information. Model, get the information to generate the model.
根据本公开的另一方面,提供了一种电子设备,包括:至少一个处理器;以及与上述至少一个处理器通信连接的存储器;其中,上述存储器存储有可被上述至少一个处理器执行的指令,上述指令被上述至少一个处理器执行,以使上述至少一个处理器能够执行如本公开所述的方法。According to another aspect of the present disclosure, an electronic device is provided, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor. , the above-mentioned instructions are executed by the above-mentioned at least one processor, so that the above-mentioned at least one processor can execute the method according to the present disclosure.
根据本公开的另一方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,上述计算机指令用于使上述计算机执行如本公开所述的方法。According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to the present disclosure.
根据本公开的另一方面,提供了一种计算机程序产品,包括计算机程序,上述计算机程序在被处理器执行时实现如本公开所述的方法。According to another aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements a method according to the present disclosure.
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or important features of the embodiments of the disclosure, nor is it intended to limit the scope of the disclosure. Other features of the present disclosure will become readily understood from the following description.
附图说明Description of the drawings
附图用于更好地理解本方案,不构成对本公开的限定。其中:The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. in:
图1示意性示出了根据本公开实施例的可以应用信息生成方法、预训练模型的训练方法及装置的示例性系统架构;Figure 1 schematically illustrates an exemplary system architecture in which an information generation method, a pre-training model training method and a device can be applied according to an embodiment of the present disclosure;
图2示意性示出了根据本公开实施例的信息生成方法的流程图;Figure 2 schematically shows a flow chart of an information generation method according to an embodiment of the present disclosure;
图3A示意性示出了根据本公开实施例的信息生成过程的示例示意图;3A schematically illustrates an example schematic diagram of an information generation process according to an embodiment of the present disclosure;
图3B示意性示出了根据本公开另一实施例的信息生成过程的示例示意图;3B schematically illustrates an example schematic diagram of an information generation process according to another embodiment of the present disclosure;
图4A示意性示出了根据本公开实施例的根据第一融合信息,生成对话应答信息的示例示意图;FIG. 4A schematically shows an example diagram of generating dialogue response information based on first fusion information according to an embodiment of the present disclosure;
图4B示意性示出了根据本公开另一实施例的根据第一融合信息,生成对话应答信息的示例示意图;FIG. 4B schematically shows an example diagram of generating dialogue response information based on first fusion information according to another embodiment of the present disclosure;
图4C示意性示出了根据本公开另一实施例的根据第一融合信息,生成对话应答信息的示例示意图;4C schematically illustrates an example diagram of generating dialogue response information based on first fusion information according to another embodiment of the present disclosure;
图4D示意性示出了根据本公开另一实施例的根据第一融合信息,生成对话应答信息的示例示意图;4D schematically illustrates an example diagram of generating dialogue response information based on first fusion information according to another embodiment of the present disclosure;
图5A示意性示出了根据本公开实施例的对查询信息进行语义理解,得到理解信息的示例示意图;FIG. 5A schematically shows an example diagram of semantic understanding of query information and obtaining understanding information according to an embodiment of the present disclosure;
图5B示意性示出了根据本公开另一实施例的对查询信息进行语义理解,得到理解信息的示例示意图;Figure 5B schematically shows an example diagram of performing semantic understanding on query information and obtaining understanding information according to another embodiment of the present disclosure;
图6示意性示出了根据本公开实施例的预训练模型的训练方法的流程图;Figure 6 schematically shows a flow chart of a training method for a pre-trained model according to an embodiment of the present disclosure;
图7A示意性示出了根据本公开实施例的真实语料集的生成方法的示例示意图;FIG. 7A schematically shows an example schematic diagram of a method for generating a real corpus according to an embodiment of the present disclosure;
图7B示意性示出了根据本公开实施例的模拟语料集的生成方法的示例示意图;FIG. 7B schematically shows an example schematic diagram of a method for generating a simulation corpus according to an embodiment of the present disclosure;
图8示意性示出了根据本公开实施例的信息生成装置的框图;Figure 8 schematically shows a block diagram of an information generation device according to an embodiment of the present disclosure;
图9示意性示出了根据本公开实施例的预训练模型的训练装置的框图;以及Figure 9 schematically shows a block diagram of a training device for a pre-trained model according to an embodiment of the present disclosure; and
图10示意性示出了根据本公开实施例的适于实现信息生成方法和预训练模型的训练方法的电子设备的框图。FIG. 10 schematically shows a block diagram of an electronic device suitable for implementing the information generation method and the training method of the pre-training model according to an embodiment of the present disclosure.
具体实施方式Detailed ways
以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the present disclosure are included to facilitate understanding and should be considered to be exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the disclosure. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.
为此,本公开实施例提出了一种信息生成方案。例如,对查询信息进行语义理解,得到理解信息。查询信息包括历史对话信息,理解信息包括对象动作和对话状态。响应于检测到辅助请求指令,根据查询信息和理解信息,得到辅助请求信息。根据查询信息、理解信息和辅助请求信息,生成对话应答信息。To this end, embodiments of the present disclosure propose an information generation solution. For example, semantic understanding of query information is performed to obtain understanding information. Query information includes historical dialogue information, and understanding information includes object actions and dialogue status. In response to detecting the assistance request instruction, the assistance request information is obtained based on the query information and the understanding information. Conversation response information is generated based on query information, understanding information and auxiliary request information.
根据本公开的实施例,由于理解信息是通过对查询信息进行语义理解得到的,由此,能够获得对话理解的理解信息。由于辅助请求信息是响应于检测到辅助请求指令,根据查询信息和理解信息得到的,因此能够有效利用外部的知识。在此基础上,通过根据查询信息、理解信息和辅助请求信息,生成对话应答信息,提高了对话应答信息的准确性。According to embodiments of the present disclosure, since the understanding information is obtained by semantic understanding of the query information, the understanding information for dialogue understanding can be obtained. Since the auxiliary request information is obtained based on the query information and understanding information in response to detecting the auxiliary request instruction, external knowledge can be effectively utilized. On this basis, the accuracy of the dialogue response information is improved by generating dialogue response information based on the query information, understanding information and auxiliary request information.
本公开的技术方案中,所涉及的用户个人信息的收集、存储、使用、加工、传输、提供和公开等处理,均符合相关法律法规的规定,且不违背公序良俗。In the technical solution of this disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information are in compliance with relevant laws and regulations and do not violate public order and good customs.
在本公开的技术方案中,在获取或采集用户个人信息之前,均获取了用户的授权或同意。In the technical solution of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
图1示意性示出了根据本公开实施例的可以应用信息生成方法、预训练模型的训练方法及装置的示例性系统架构。FIG. 1 schematically illustrates an exemplary system architecture in which an information generation method, a pre-training model training method and a device can be applied according to an embodiment of the present disclosure.
需要注意的是,图1所示仅为可以应用本公开实施例的系统架构的示例,以帮助本领域技术人员理解本公开的技术内容,但并不意味着本公开实施例不可以用于其他设备、系统、环境或场景。例如,在另一实施例中,可以应用信息生成方法、预训练模型的训练方法及装置的示例性系统架构可以包括终端设备,但终端设备可以无需与服务器进行交互,即可实现本公开实施例提供的信息生成方法、预训练模型的训练方法及装置。It should be noted that Figure 1 is only an example of a system architecture to which embodiments of the present disclosure can be applied, to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure cannot be used in other applications. Device, system, environment or scenario. For example, in another embodiment, the exemplary system architecture in which the information generation method, the pre-training model training method and the device can be applied may include a terminal device, but the terminal device may implement the embodiments of the present disclosure without interacting with the server. Provided information generation methods, pre-training model training methods and devices.
如图1所示,根据该实施例的系统架构100可以包括第一终端设备101、第二终端设备102、第三终端设备103、网络104和服务器105。网络104用以在第一终端设备101、第二终端设备102、第三终端设备103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型。例如,有线和无线通信链路等中的至少之一。终端设备可以包括第一终端设备101、第二终端设备102和第三终端设备103中的至少之一。As shown in FIG. 1 , the system architecture 100 according to this embodiment may include a first terminal device 101 , a second terminal device 102 , a third terminal device 103 , a network 104 and a server 105 . The network 104 is used as a medium for providing communication links between the first terminal device 101 , the second terminal device 102 , the third terminal device 103 and the server 105 . Network 104 may include various connection types. For example, at least one of wired and wireless communication links, and the like. The terminal device may include at least one of the first terminal device 101, the second terminal device 102, and the third terminal device 103.
用户可以使用第一终端设备101、第二终端设备102和第三终端设备103中的至少之一通过网络104与服务器105交互,以接收或发送消息等。第一终端设备101、第二终端设备102和第三终端设备103中的至少之一可以安装有各种通讯客户端应用。例如,知识阅读类应用、网页浏览器应用、搜索类应用、即时通信工具、邮箱客户端和社交平台软件等中的至少之一。The user may use at least one of the first terminal device 101, the second terminal device 102 and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages and the like. At least one of the first terminal device 101, the second terminal device 102 and the third terminal device 103 may be installed with various communication client applications. For example, at least one of a knowledge reading application, a web browser application, a search application, an instant messaging tool, an email client, and a social platform software.
第一终端设备101、第二终端设备102、第三终端设备103可以是具有显示屏并且支持网页浏览的各种电子设备。例如,电子设备可以包括智能手机、平板电脑、膝上型便携计算机和台式计算机等中的至少之一。The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having a display screen and supporting web browsing. For example, the electronic device may include at least one of a smartphone, a tablet computer, a laptop computer, a desktop computer, and the like.
服务器105可以是提供各种服务的服务器。例如,服务器105可以是云服务器,又称为云计算服务器或云主机,是云计算服务体系中的一项主机产品,以解决了传统物理主机与VPS服务(Virtual Private Server,虚拟专用服务器)中,存在的管理难度大,业务扩展性弱的缺陷。The server 105 may be a server that provides various services. For example, the server 105 can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the problem between traditional physical hosts and VPS services (Virtual Private Server). , which has the disadvantages of difficult management and weak business scalability.
需要说明的是,本公开实施例所提供的信息生成方法一般可以由第一终端设备101、第二终端设备102和第三终端设备103中的之一执行。相应地,本公开实施例所提供的信息生成装置也可以设置于第一终端设备101、第二终端设备102和第三终端设备103中的之一。It should be noted that the information generation method provided by the embodiment of the present disclosure can generally be executed by one of the first terminal device 101, the second terminal device 102, and the third terminal device 103. Correspondingly, the information generation apparatus provided by the embodiment of the present disclosure may also be provided in one of the first terminal device 101, the second terminal device 102, and the third terminal device 103.
备选地,本公开实施例所提供的信息生成方法一般也可以由服务器105执行。相应地,本公开实施例所提供的信息生成装置一般可以设置于服务器105中。本公开实施例所提供的信息生成方法也可以由不同于服务器105且能够与第一终端设备101、第二终端设备102、第三终端设备103和服务器105中的至少之一通信的服务器或服务器集群执行。相应地,本公开实施例所提供的信息生成装置也可以设置于不同于服务器105且能够与第一终端设备101、第二终端设备102、第三终端设备103和服务器105中的至少之一通信的服务器或服务器集群中。Alternatively, the information generation method provided by the embodiment of the present disclosure can generally also be executed by the server 105. Correspondingly, the information generation device provided by the embodiment of the present disclosure can generally be provided in the server 105. The information generation method provided by the embodiment of the present disclosure may also be performed by a server or servers that are different from the server 105 and can communicate with at least one of the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. Cluster execution. Correspondingly, the information generation device provided by the embodiment of the present disclosure may also be provided in a location different from the server 105 and capable of communicating with at least one of the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. of servers or server clusters.
需要说明的是,本公开实施例所提供的预训练模型的训练方法一般也可以由服务器105执行。相应地,本公开实施例所提供的预训练模型的训练装置一般可以设置于服务器105中。本公开实施例所提供的预训练模型的训练方法也可以由不同于服务器105且能够与第一终端设备101、第二终端设备102、第三终端设备103和服务器105中的至少之一通信的服务器或服务器集群执行。相应地,本公开实施例所提供的预训练模型的训练装置也可以设置于不同于服务器105且能够与第一终端设备101、第二终端设备102、第三终端设备103和服务器105中的至少之一通信的服务器或服务器集群中。It should be noted that the training method of the pre-trained model provided by the embodiment of the present disclosure can generally also be executed by the server 105. Accordingly, the training device for the pre-training model provided by the embodiment of the present disclosure may generally be installed in the server 105 . The training method of the pre-training model provided by the embodiment of the present disclosure can also be performed by a server different from the server 105 and capable of communicating with at least one of the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. Server or server cluster execution. Correspondingly, the training device of the pre-training model provided by the embodiment of the present disclosure can also be provided in a location different from the server 105 and can communicate with at least one of the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. One of the communicating servers or server clusters.
备选地,本公开实施例所提供的预训练模型的训练方法一般可以由第一终端设备101、第二终端设备102和第三终端设备103中的之一执行。相应地,本公开实施例所提供的预训练模型的训练装置也可以设置于第一终端设备101、第二终端设备102和第三终端设备103中的之一。Alternatively, the training method of the pre-training model provided by the embodiment of the present disclosure may generally be executed by one of the first terminal device 101, the second terminal device 102, and the third terminal device 103. Correspondingly, the training device for the pre-training model provided by the embodiment of the present disclosure may also be provided in one of the first terminal device 101, the second terminal device 102, and the third terminal device 103.
应该理解,图1中的第一终端设备、第二终端设备、第三终端设备网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的第一终端设备、第二终端设备、第三终端设备、网络和服务器。It should be understood that the numbers of the first terminal device, the second terminal device, the third terminal device network and the servers in Figure 1 are only illustrative. According to implementation requirements, there may be any number of first terminal devices, second terminal devices, third terminal devices, networks and servers.
应注意,以下方法中各个操作的序号仅作为该操作的表示以便描述,而不应被看作表示该各个操作的执行顺序。除非明确指出,否则该方法不需要完全按照所示顺序来执行。It should be noted that the sequence number of each operation in the following method is only used as a representation of the operation for the purpose of description, and should not be regarded as indicating the execution order of the respective operations. Unless explicitly stated, the methods need not be performed in exactly the order shown.
图2示意性示出了根据本公开实施例的信息生成方法的流程图。FIG. 2 schematically shows a flow chart of an information generation method according to an embodiment of the present disclosure.
如图2所示,该方法200包括操作S210~S230。As shown in Figure 2, the method 200 includes operations S210 to S230.
在操作S210,对查询信息进行语义理解,得到理解信息,其中,查询信息包括历史对话信息,理解信息包括对象动作和对话状态。In operation S210, the query information is semantically understood to obtain understanding information, where the query information includes historical dialogue information, and the understanding information includes object actions and dialogue states.
在操作S220,响应于检测到辅助请求指令,根据查询信息和理解信息,得到辅助请求信息。In operation S220, in response to detecting the assistance request instruction, assistance request information is obtained based on the query information and the understanding information.
在操作S230,根据查询信息、理解信息和辅助请求信息,生成对话应答信息。In operation S230, dialogue response information is generated based on the query information, understanding information, and assistance request information.
根据本公开的实施例,响应于接收到对象的对话指令,可以生成对话应答信息。在生成对话应答信息的过程中,可以根据对话指令获取查询信息。查询信息可以是通过实时采集获取的。例如,可以通过采集对象的语音信息等方式来获取。备选地,查询信息也可以是从数据源中获取的。数据源可以包括以下至少之一:本地数据库、云数据库和网络资源。例如,可以调用数据接口,利用数据接口从数据源中获取查询信息。备选地,查询信息可以是接收自其它终端设备发送的。本公开实施例对查询信息的获取方式不作限定。According to embodiments of the present disclosure, in response to receiving a dialogue instruction from an object, dialogue response information may be generated. In the process of generating dialogue response information, query information can be obtained according to dialogue instructions. Query information can be obtained through real-time collection. For example, it can be obtained by collecting the voice information of the object. Alternatively, query information can be obtained from a data source. Data sources may include at least one of the following: local databases, cloud databases, and network resources. For example, you can call the data interface and use the data interface to obtain query information from the data source. Alternatively, the query information may be received and sent from other terminal devices. The embodiment of the present disclosure does not limit the method of obtaining query information.
根据本公开的实施例,查询信息可以包括历史对话信息。历史对话信息可以来源于系统和对象的交互过程。历史对话信息可以包括以下至少之一:截至当前系统时刻的对象历史对话信息和系统历史对话信息。对象历史对话信息可以指用户历史对话信息。系统历史对话信息可以指系统历史回复信息。According to embodiments of the present disclosure, the query information may include historical conversation information. Historical conversation information can come from the interaction process between the system and the object. The historical dialogue information may include at least one of the following: object historical dialogue information as of the current system moment and system historical dialogue information. The object historical dialogue information may refer to user historical dialogue information. System history dialogue information may refer to system history reply information.
根据本公开的实施例,在获得查询信息之后,通过对查询信息进行语义理解,可以将查询信息解析为结构化的、机器可读的理解信息。语义理解的方式可以包括以下至少之一:自然语言理解(Natural LanguageUnderstanding,NLU)、对话状态跟踪(Dialog StateTracking,DST)、对话策略学习(Dialogue Policy learning,DPL)和自然语言生成(NeuralLanguage Generation,NLG)。According to embodiments of the present disclosure, after obtaining the query information, the query information can be parsed into structured, machine-readable understanding information by performing semantic understanding on the query information. Semantic understanding methods may include at least one of the following: Natural Language Understanding (NLU), Dialog State Tracking (DST), Dialogue Policy Learning (DPL), and Natural Language Generation (NLG). ).
根据本公开的实施例,理解信息可以包括以下至少之一:查询领域(即domain)、查询意图(即intent)和查询词槽(即slot)。查询领域可以指语义理解场景。语义理解场景可以具有对应的查询意图和查询词槽。语义理解场景可以包括以下至少之一:聊天、天气、地图、电台、翻译、故事、闹钟、人物、新闻、音乐和影视。查询意图可以指对象通过交互输入所要表达的目的。查询词槽可以指查询意图下对象所附带的限制条件。According to embodiments of the present disclosure, the understanding information may include at least one of the following: query domain (ie, domain), query intent (ie, intent), and query word slot (ie, slot). The query domain can refer to a semantic understanding scenario. Semantic understanding scenarios can have corresponding query intentions and query word slots. Semantic understanding scenarios may include at least one of the following: chat, weather, map, radio, translation, story, alarm clock, people, news, music, and movies. Query intent can refer to the purpose that an object expresses through interactive input. Query word slots can refer to restrictions attached to objects under query intent.
根据本公开的实施例,自然语言理解可以用于理解对象的查询意图和查询行为。自然语言理解可以包括以下至少之一:分词处理、词性标注(Part-Of-Speech tagging,POStagging)处理、命名实体识别(Named Entity Recognition,NER)处理、句法解析处理、情感分析处理、关键词和摘要提取处理和文本分析处理。According to embodiments of the present disclosure, natural language understanding can be used to understand the query intention and query behavior of the object. Natural language understanding may include at least one of the following: word segmentation processing, part-of-speech tagging (POStagging) processing, named entity recognition (Named Entity Recognition, NER) processing, syntactic parsing processing, sentiment analysis processing, keywords and Summary extraction processing and text analysis processing.
根据本公开的实施例,对话状态跟踪可以用于从理解的对象语义信息中抽取实体和属性,以跟踪当前任务的完成情况,以便于根据完成情况确定对话状态。对话状态可以指包括零时刻至当前时刻的历史对话信息、查询领域、查询意图和查询词槽的数据结构。对话状态跟踪的方式可以包括以下至少之一:基于规则的对话状态跟踪、基于生成式模型的对话状态跟踪和基于判别式模型的对话状态跟踪。According to embodiments of the present disclosure, dialogue state tracking can be used to extract entities and attributes from understood object semantic information to track the completion of the current task, so as to determine the dialogue state according to the completion. The conversation state may refer to a data structure including historical conversation information from time zero to the current time, query field, query intention and query word slot. The method of dialogue state tracking may include at least one of the following: rule-based dialogue state tracking, generative model-based dialogue state tracking, and discriminative model-based dialogue state tracking.
根据本公开的实施例,对话策略学习可以用于根据对话状态,在知识库中确定与对话状态对应的对象动作。对象动作可以指与查询意图对应的对象通过交互输入所要表达的目的。自然语言生成可以用于生成自然语言形式的系统回复。According to embodiments of the present disclosure, dialogue policy learning may be used to determine an object action corresponding to the dialogue state in the knowledge base according to the dialogue state. The object action may refer to the purpose that the object corresponding to the query intention expresses through interactive input. Natural language generation can be used to generate system responses in natural language.
根据本公开的实施例,在获得理解信息之后,可以确定请求指令的类型。例如,可以根据对话指令中的对象标注信息确定请求指令的类型。请求指令的类型可以包括以下之一:非辅助请求指令和辅助请求指令。非辅助请求指令可以指在生成对话应答信息的过程中,不需要调用外部资源的请求指令。响应于检测到非辅助请求指令,可以直接根据查询信息和理解信息,生成对话应答信息。According to embodiments of the present disclosure, after obtaining understanding information, the type of requested instruction may be determined. For example, the type of the requested instruction can be determined based on the object label information in the dialog instruction. The type of request instructions may include one of the following: non-assisted request instructions and assisted request instructions. Non-auxiliary request instructions may refer to request instructions that do not require calling external resources in the process of generating dialogue response information. In response to detecting the non-assisted request instruction, dialogue response information can be generated directly based on the query information and understanding information.
根据本公开的实施例,辅助请求指令可以指在生成对话应答信息的过程中,需要调用外部资源的请求指令。响应于检测到辅助请求指令,可以根据查询信息和理解信息,得到辅助请求信息。辅助请求信息可以包括与外部资源对应的接口请求参数。在此基础上,可以根据查询信息、理解信息和辅助请求信息,生成对话应答信息。According to an embodiment of the present disclosure, the auxiliary request instruction may refer to a request instruction that requires calling external resources in the process of generating dialogue response information. In response to detecting the auxiliary request instruction, the auxiliary request information may be obtained based on the query information and the understanding information. The auxiliary request information may include interface request parameters corresponding to the external resource. On this basis, dialogue response information can be generated based on query information, understanding information and auxiliary request information.
根据本公开的实施例,由于理解信息是通过对查询信息进行语义理解得到的,由此,通过保留理解阶段的过程,能够获得对话理解的理解信息。由于辅助请求信息是响应于检测到辅助请求指令,根据查询信息和理解信息得到的,因此能够有效利用外部的知识。在此基础上,通过根据查询信息、理解信息和辅助请求信息,生成对话应答信息,提高了对话应答信息的准确性。According to embodiments of the present disclosure, since the understanding information is obtained by semantic understanding of the query information, the understanding information for dialogue understanding can be obtained by retaining the process of the understanding stage. Since the auxiliary request information is obtained based on the query information and understanding information in response to detecting the auxiliary request instruction, external knowledge can be effectively utilized. On this basis, the accuracy of the dialogue response information is improved by generating dialogue response information based on the query information, understanding information and auxiliary request information.
下面参考图3A、图3B、图4A、图4B、图4C、图4D、图5A和图5B,对根据本公开实施例的信息生成方法200做进一步说明。The information generation method 200 according to the embodiment of the present disclosure will be further described below with reference to FIGS. 3A, 3B, 4A, 4B, 4C, 4D, 5A and 5B.
根据本公开的实施例,查询信息还包括查询词槽。According to an embodiment of the present disclosure, the query information further includes a query word slot.
根据本公开的实施例,槽可以指多轮对话过程中将初始对象意图转化为明确对象指令所需要补全的信息。槽可以包括至少一个槽位。至少一个槽位各自具有对应的填槽方式。槽位的属性可以包括以下之一:词槽和接口槽。词槽可以指通过用户对话的关键词获取信息的填槽方式。接口槽可以指通过其他方式获取信息的填槽方式。例如,查询词槽可以属于词槽。According to embodiments of the present disclosure, a slot may refer to information that needs to be completed to convert the initial object intention into a clear object instruction during multiple rounds of dialogue. A slot may include at least one slot. At least one slot each has a corresponding slot filling method. The attributes of a slot can include one of the following: word slot and interface slot. Word slots can refer to slot filling methods that obtain information through keywords in user conversations. Interface slots can refer to slot filling methods that obtain information through other means. For example, a query slot can belong to a slot.
根据本公开的实施例,填槽可以理解为序列标注(Sequence Tagging)问题。序列标注可以指给定一个输入序列,利用第一预定模型对该输入序列的每一个位置标注一个相应的标签,即把连续序列中每个词赋予相应的语义类别标签的过程。第一预定模型可以根据实际业务需求进行配置,能够实现序列标注的功能即可,在此不作限定。According to embodiments of the present disclosure, slot filling can be understood as a sequence tagging (Sequence Tagging) problem. Sequence labeling can refer to the process of given an input sequence and using a first predetermined model to label each position of the input sequence with a corresponding label, that is, assigning each word in the continuous sequence a corresponding semantic category label. The first predetermined model can be configured according to actual business requirements, and it only needs to be able to realize the function of sequence labeling, which is not limited here.
例如,第一预定模型可以包括以下至少之一:基于生成式模型的第一预定模型和基于判别式模型的第一预定模型。基于生成式模型的第一预定模型可以包括以下至少之一:隐含马尔柯夫模型(Hidden Markov Model,HMM)和隐藏向量状态(Hidden VectorState,HVS)模型。基于判别式模型的第一预定模型可以包括以下至少之一:条件随机场(Conditional Random Field,CRF)模型、最大熵马尔可夫模型(Maximum Entropy MarkovModel,MEMM)和支持向量机(Support Vector Machine,SVM)模型。For example, the first predetermined model may include at least one of the following: a first predetermined model based on a generative model and a first predetermined model based on a discriminative model. The first predetermined model based on the generative model may include at least one of the following: a Hidden Markov Model (HMM) and a Hidden Vector State (HVS) model. The first predetermined model based on the discriminant model may include at least one of the following: a conditional random field (Conditional Random Field, CRF) model, a maximum entropy Markov model (Maximum Entropy Markov Model, MEMM), and a support vector machine (Support Vector Machine, SVM) model.
根据本公开的实施例,操作S230可以包括如下操作。According to an embodiment of the present disclosure, operation S230 may include the following operations.
从数据源中确定与辅助请求信息对应的辅助应答信息。根据查询信息、理解信息和辅助应答信息,生成对话应答信息。Determine auxiliary response information corresponding to the auxiliary request information from the data source. Conversation response information is generated based on query information, understanding information and auxiliary response information.
根据本公开的实施例,数据源可以包括以下至少之一:数据库和知识库。知识库(即Knowledge Base)可以指知识工程中结构化、易操作、易利用、全面有组织的知识集群。知识库是针对某一或某些领域问题求解的需要。知识库可以包括采用某种或若干种知识表示方式在计算机存储器中存储、组织、管理和使用的互相联系的知识片集合。知识片集合中的知识片可以包括与领域相关的理论知识和事实数据。备选地,知识片集合中的知识片还可以包括由专家经验得到的启发式知识,例如,某领域内有关的定义、定理和运算法则以及常识性知识等。According to embodiments of the present disclosure, the data source may include at least one of the following: a database and a knowledge base. Knowledge base (Knowledge Base) can refer to a structured, easy-to-operate, easy-to-use, comprehensive and organized knowledge cluster in knowledge engineering. Knowledge base is the need to solve problems in a certain or certain fields. A knowledge base may include a collection of interconnected knowledge pieces that are stored, organized, managed, and used in computer memory using one or several knowledge representation methods. The knowledge pieces in the knowledge piece collection can include theoretical knowledge and factual data related to the domain. Alternatively, the knowledge pieces in the knowledge piece collection may also include heuristic knowledge obtained from expert experience, such as relevant definitions, theorems, algorithms and common sense knowledge in a certain field.
根据本公开的实施例,在获得辅助请求信息之后,可以根据辅助请求信息,从数据源中确定与辅助请求信息对应的辅助应答信息。例如,在数据源为知识库的情况下,辅助应答信息可以用于表征与辅助请求信息对应的知识库结果。在此情况下,可以根据知识库结果、查询信息、对象动作和对话状态,生成对话应答信息。According to an embodiment of the present disclosure, after obtaining the assistance request information, the assistance response information corresponding to the assistance request information can be determined from the data source according to the assistance request information. For example, when the data source is a knowledge base, the auxiliary response information can be used to characterize the knowledge base results corresponding to the auxiliary request information. In this case, the dialogue response information can be generated based on the knowledge base results, query information, object actions and dialogue status.
根据本公开的实施例,用于辅助应答信息是根据辅助请求信息从数据源中确定的,数据源包括数据库和知识库中的至少之一,因而可以有效利用外部知识。在此基础上,由于对话应答信息是根据查询信息、理解信息和辅助应答信息生成的,因此可以在避免重新训练模型的情况下,完成知识的更新。According to an embodiment of the present disclosure, the assistance response information is determined from a data source according to the assistance request information, and the data source includes at least one of a database and a knowledge base, so that external knowledge can be effectively utilized. On this basis, since the dialogue response information is generated based on the query information, understanding information and auxiliary response information, the knowledge update can be completed without retraining the model.
图3A示意性示出了根据本公开实施例的信息生成过程的示例示意图。FIG. 3A schematically illustrates an example schematic diagram of an information generation process according to an embodiment of the present disclosure.
如图3A所示,在300A中,可以对查询信息301进行语义理解,得到理解信息302。响应于检测到辅助请求指令,可以根据查询信息301和理解信息302,得到辅助请求信息303。As shown in Figure 3A, in 300A, semantic understanding can be performed on the query information 301 to obtain understanding information 302. In response to detecting the assistance request instruction, assistance request information 303 may be obtained based on the query information 301 and the understanding information 302 .
在获得辅助请求信息303之后,可以从数据源中确定与辅助请求信息303对应的辅助应答信息304。在获得辅助应答信息304之后,可以根据查询信息301、理解信息302和辅助应答信息304,生成对话应答信息305。After obtaining the assistance request information 303, the assistance response information 304 corresponding to the assistance request information 303 may be determined from the data source. After obtaining the auxiliary response information 304, the dialogue response information 305 can be generated based on the query information 301, the understanding information 302 and the auxiliary response information 304.
根据本公开的实施例,根据查询信息、理解信息和辅助应答信息,生成对话应答信息,可以包括如下操作。According to embodiments of the present disclosure, generating dialogue response information based on query information, understanding information, and auxiliary response information may include the following operations.
将查询信息、理解信息和辅助应答信息进行融合,得到第一融合信息。根据第一融合信息,生成对话应答信息。The query information, understanding information and auxiliary response information are fused to obtain first fused information. Conversation response information is generated according to the first fusion information.
根据本公开的实施例,在获得辅助应答信息之后,可以将查询信息、理解信息和辅助应答信息进行融合,得到第一融合信息。融合可以包括以下至少之一:拼接和相加。例如,可以对查询信息、理解信息和辅助应答信息进行拼接处理,得到第一融合信息。备选地,可以对查询信息、理解信息和辅助应答信息进行相加处理,得到第一融合信息。备选地,可以对查询信息、理解信息和辅助应答信息进行拼接处理和相加处理,得到第一融合信息。According to embodiments of the present disclosure, after obtaining the auxiliary response information, the query information, the understanding information and the auxiliary response information can be fused to obtain the first fused information. Fusion may include at least one of the following: splicing and addition. For example, the query information, understanding information and auxiliary response information can be spliced to obtain the first fusion information. Alternatively, the query information, understanding information and auxiliary response information can be added together to obtain the first fusion information. Alternatively, the query information, understanding information and auxiliary response information can be spliced and added to obtain the first fusion information.
根据本公开的实施例,在获得第一融合信息之后,可以将第一融合信息输入第二预定模型,得到对话应答信息。第二预定模型可以包括以下至少之一:循环神经网络(Recurrent Neural Networks,RNN)模型、长短期记忆网络(Long Short-Term Memory,LSTM)模型和Transformer模型。第二预定模型可以根据实际业务需求进行配置,能够实现对话应答信息生成的功能即可,在此不作限定。According to embodiments of the present disclosure, after obtaining the first fusion information, the first fusion information can be input into the second predetermined model to obtain the dialogue response information. The second predetermined model may include at least one of the following: a recurrent neural network (Recurrent Neural Networks, RNN) model, a long short-term memory network (Long Short-Term Memory, LSTM) model, and a Transformer model. The second reservation model can be configured according to actual business requirements, and it only needs to be able to realize the function of generating dialogue response information, which is not limited here.
图3B示意性示出了根据本公开另一实施例的信息生成过程的示例示意图。FIG. 3B schematically illustrates an example schematic diagram of an information generation process according to another embodiment of the present disclosure.
如图3B所示,如图3B所示,在300B中,可以对查询信息306进行语义理解,得到理解信息307。响应于检测到辅助请求指令,可以根据查询信息306和理解信息307,得到辅助请求信息308。As shown in Figure 3B, in step 300B, the query information 306 can be semantically understood to obtain understanding information 307. In response to detecting the assistance request instruction, assistance request information 308 may be obtained based on the query information 306 and the understanding information 307 .
在获得辅助请求信息308之后,可以从数据源中确定与辅助请求信息308对应的辅助应答信息309。在获得辅助应答信息309之后,可以将查询信息306、理解信息307和辅助应答信息309进行融合,得到第一融合信息310。在获得第一融合信息310之后,可以根据第一融合信息310,生成对话应答信息311。After obtaining the assistance request information 308, the assistance response information 309 corresponding to the assistance request information 308 may be determined from the data source. After obtaining the auxiliary response information 309, the query information 306, the understanding information 307 and the auxiliary response information 309 can be fused to obtain the first fusion information 310. After obtaining the first fusion information 310, the dialogue response information 311 can be generated according to the first fusion information 310.
根据本公开的实施例,根据第一融合信息,生成对话应答信息,可以包括如下操作。According to an embodiment of the present disclosure, generating dialogue response information according to the first fusion information may include the following operations.
对第一融合信息进行编码,得到第一编码信息。对第一编码信息进行自解码,得到中间解码信息。根据第一编码信息和中间解码信息,生成对话应答信息。Encode the first fusion information to obtain first encoded information. Self-decode the first encoded information to obtain intermediate decoded information. Conversation response information is generated based on the first encoded information and the intermediate decoded information.
根据本公开的实施例,在获得第一融合信息之后,可以将第一融合信息输入第三预定模型,得到对话应答信息。第三预定模型可以根据实际业务需求进行配置,能够实现对话应答信息生成的功能即可,在此不作限定。例如,第三预定模型可以包括BoB(BERT overBERT)模型。第三预定模型可以包括第一编码器、第一解码器和第二解码器。可以对第一编码器、第一解码器和第二解码器执行多轮次训练,直至满足预定条件。将经训练的第一编码器、第一解码器和第二解码器确定为第三预定模型。According to embodiments of the present disclosure, after obtaining the first fusion information, the first fusion information can be input into the third predetermined model to obtain the dialogue response information. The third reservation model can be configured according to actual business requirements, and it only needs to be able to realize the function of generating dialogue response information, which is not limited here. For example, the third predetermined model may include a BoB (BERT over BERT) model. The third predetermined model may include a first encoder, a first decoder and a second decoder. Multiple rounds of training may be performed on the first encoder, the first decoder and the second decoder until a predetermined condition is met. The trained first encoder, first decoder and second decoder are determined as a third predetermined model.
根据本公开的实施例,第一编码器可以包括以下至少之一:第一双向长短期记忆网络(Bidirectional Long Short Term Memory,BiLSTM)、第一门控循环单元(GatedRecurrent Unit,GRU)、第一卷积神经网络(Convolutional Neural Networks,CNN)、第一长短期记忆网络和第一循环神经网络。第一编码器可以包括第一输入层和第一隐藏层。第一编码器可以采用线性变换函数。第一编码器可以用于将第一融合信息进行编码,得到第一编码信息。例如,可以利用第一编码器的第一输入层对第一融合信息进行编码,得到第一中间向量。利用第一编码器的第一隐藏层对第一中间向量进行处理,得到第一编码信息。According to an embodiment of the present disclosure, the first encoder may include at least one of the following: a first bidirectional long short term memory network (Bidirectional Long Short Term Memory, BiLSTM), a first gated recurrent unit (GatedRecurrent Unit, GRU), a first Convolutional Neural Networks (CNN), the first long short-term memory network and the first recurrent neural network. The first encoder may include a first input layer and a first hidden layer. The first encoder may employ a linear transformation function. The first encoder may be used to encode the first fusion information to obtain the first encoded information. For example, the first input layer of the first encoder may be used to encode the first fusion information to obtain the first intermediate vector. The first intermediate vector is processed using the first hidden layer of the first encoder to obtain the first encoded information.
根据本公开的实施例,第一解码器可以包括以下至少之一:第二双向长短期记忆网络、第二门控循环单元、第二卷积神经网络、第二长短期记忆网络和第二循环神经网络。第一解码器可以包括自回归解码器。第一解码器可以包括第二隐藏层和第一输出层。第一解码器可以采用线性变换函数。第一解码器可以用于对第一编码信息进行重构,得到中间解码信息,以实现响应对话回复。例如,可以利用第一解码器的第二隐藏层对第一编码信息进行自解码,得到第一辅助解码信息。利用第一解码器的第一输出层对第一辅助解码信息进行处理,得到中间解码信息。According to an embodiment of the present disclosure, the first decoder may include at least one of the following: a second bidirectional long short-term memory network, a second gated recurrent unit, a second convolutional neural network, a second long short-term memory network, and a second loop Neural Networks. The first decoder may include an autoregressive decoder. The first decoder may include a second hidden layer and a first output layer. The first decoder may employ a linear transformation function. The first decoder may be used to reconstruct the first encoded information to obtain intermediate decoded information to implement a response dialogue reply. For example, the second hidden layer of the first decoder can be used to self-decode the first encoded information to obtain the first auxiliary decoding information. The first auxiliary decoding information is processed using the first output layer of the first decoder to obtain intermediate decoding information.
根据本公开的实施例,第二解码器可以包括以下至少之一:第三双向长短期记忆网络、第三门控循环单元、第三卷积神经网络、第三长短期记忆网络和第三循环神经网络。第二解码器可以包括第三隐藏层和第二输出层。第二解码器可以采用Unlikelihood函数。第二解码器可以用于对第一编码信息和中间解码信息进行重构,得到生成对话应答信息,以实现一致性理解。例如,可以利用第二解码器的第三隐藏层对第一编码信息和中间解码信息进行处理,得到第一辅助对话应答信息。利用第二解码器的第二输出层对第一辅助对话应答信息进行处理,生成对话应答信息。According to an embodiment of the present disclosure, the second decoder may include at least one of the following: a third bidirectional long short-term memory network, a third gated recurrent unit, a third convolutional neural network, a third long short-term memory network, and a third loop Neural Networks. The second decoder may include a third hidden layer and a second output layer. The second decoder can use the Unlikelihood function. The second decoder can be used to reconstruct the first encoded information and the intermediate decoded information to generate dialogue response information to achieve consistent understanding. For example, the third hidden layer of the second decoder can be used to process the first encoded information and the intermediate decoded information to obtain the first auxiliary dialogue response information. The first auxiliary dialogue response information is processed using the second output layer of the second decoder to generate dialogue response information.
图4A示意性示出了根据本公开实施例的根据第一融合信息,生成对话应答信息的示例示意图。FIG. 4A schematically shows an example diagram of generating dialogue response information according to the first fusion information according to an embodiment of the present disclosure.
如图4A所示,在400A中,在获得第一融合信息401之后,可以对第一融合信息401进行编码,得到第一编码信息402。在获得第一编码信息402之后,可以对第一编码信息402进行自解码,得到中间解码信息403。在获得中间解码信息403之后,可以根据第一编码信息402和中间解码信息403,生成对话应答信息404。As shown in FIG. 4A, in step 400A, after obtaining the first fusion information 401, the first fusion information 401 may be encoded to obtain the first encoded information 402. After obtaining the first encoded information 402, the first encoded information 402 can be self-decoded to obtain intermediate decoded information 403. After obtaining the intermediate decoding information 403, the conversation response information 404 can be generated according to the first encoding information 402 and the intermediate decoding information 403.
根据本公开的实施例,根据第一融合信息,生成对话应答信息,可以包括如下操作。According to an embodiment of the present disclosure, generating dialogue response information according to the first fusion information may include the following operations.
对第一融合信息进行编码,得到第二编码信息。对第二编码信息进行解码,得到对话应答信息。The first fusion information is encoded to obtain the second encoded information. Decode the second encoded information to obtain dialogue response information.
根据本公开的实施例,在获得第一融合信息之后,可以将第一融合信息输入第四预定模型,得到对话应答信息。第四预定模型可以根据实际业务需求进行配置,能够实现对话应答信息生成的功能即可,在此不作限定。例如,第四预定模型可以包括基于TransfOrmer-ED(即Transformer的Encoder和Decoder)结构的模型。第四预定模型可以包括第二编码器和第三解码器。可以对第二编码器和第三解码器执行多轮次训练,直至满足预定条件。将经训练的第二编码器和第三解码器确定为第四预定模型。According to embodiments of the present disclosure, after obtaining the first fusion information, the first fusion information can be input into the fourth predetermined model to obtain the dialogue response information. The fourth predetermined model can be configured according to actual business requirements, and it only needs to be able to realize the function of generating dialogue response information, which is not limited here. For example, the fourth predetermined model may include a model based on the TransfOrmer-ED (ie, Transformer's Encoder and Decoder) structure. The fourth predetermined model may include a second encoder and a third decoder. Multiple rounds of training may be performed on the second encoder and the third decoder until predetermined conditions are met. The trained second encoder and third decoder are determined as a fourth predetermined model.
根据本公开的实施例,第二编码器可以包括以下至少之一:第四双向长短期记忆网络、第四门控循环单元、第四卷积神经网络、第四长短期记忆网络和第四循环神经网络。第二编码器可以包括第二输入层和第四隐藏层。第二编码器可以采用线性变换函数。第二编码器可以用于将第一融合信息进行编码,得到第二编码信息。例如,可以利用第二编码器的第二输入层对第一融合信息进行编码,得到第二中间向量。利用第二编码器的第四隐藏层对第二中间向量进行处理,得到第二编码信息。According to an embodiment of the present disclosure, the second encoder may include at least one of the following: a fourth bidirectional long short-term memory network, a fourth gated recurrent unit, a fourth convolutional neural network, a fourth long short-term memory network, and a fourth loop Neural Networks. The second encoder may include a second input layer and a fourth hidden layer. The second encoder may employ a linear transformation function. The second encoder may be used to encode the first fusion information to obtain the second encoded information. For example, the second input layer of the second encoder can be used to encode the first fusion information to obtain the second intermediate vector. The second intermediate vector is processed using the fourth hidden layer of the second encoder to obtain the second encoded information.
根据本公开的实施例,第三解码器可以包括以下至少之一:第五双向长短期记忆网络、第五门控循环单元、第五卷积神经网络、第五长短期记忆网络和第五循环神经网络。第三解码器可以包括第五隐藏层和第三输出层。第三解码器可以采用线性变换函数。第三解码器可以用于对第一编码信息进行重构,得到对话应答信息,以实现响应对话回复。例如,可以利用三解码器的第五隐藏层对第二编码信息进行解码,得到第二辅助解码信息。利用第三解码器的第三输出层对第二辅助解码信息进行处理,得到对话应答信息。According to an embodiment of the present disclosure, the third decoder may include at least one of the following: a fifth bidirectional long short-term memory network, a fifth gated recurrent unit, a fifth convolutional neural network, a fifth long short-term memory network, and a fifth loop Neural Networks. The third decoder may include a fifth hidden layer and a third output layer. The third decoder may employ a linear transformation function. The third decoder can be used to reconstruct the first encoded information to obtain the dialogue response information, so as to realize the response dialogue reply. For example, the fifth hidden layer of the three-decoder can be used to decode the second encoded information to obtain the second auxiliary decoding information. The second auxiliary decoding information is processed using the third output layer of the third decoder to obtain the dialogue response information.
图4B示意性示出了根据本公开另一实施例的根据第一融合信息,生成对话应答信息的示例示意图。FIG. 4B schematically illustrates an example of generating dialogue response information according to first fusion information according to another embodiment of the present disclosure.
如图4B所示,在400B中,在获得第一融合信息405之后,可以对第一融合信息405进行编码,得到第二编码信息406。在获得第二编码信息406之后,可以对第二编码信息406进行解码,得到对话应答信息407。As shown in Figure 4B, in 400B, after obtaining the first fusion information 405, the first fusion information 405 can be encoded to obtain the second encoded information 406. After obtaining the second encoded information 406, the second encoded information 406 can be decoded to obtain the conversation response information 407.
根据本公开的实施例,根据第一融合信息,生成对话应答信息,可以包括如下操作。According to an embodiment of the present disclosure, generating dialogue response information according to the first fusion information may include the following operations.
根据第一融合信息,生成至少一个第一候选对话应答信息。分别将至少一个第一候选对话应答信息和第一融合信息进行融合,得到至少一个第二融合信息。根据至少一个第二融合信息,从至少一个第一候选对话应答信息中确定对话应答信息。According to the first fusion information, at least one first candidate dialogue response information is generated. The at least one first candidate dialogue response information and the first fusion information are respectively fused to obtain at least one second fusion information. Conversation response information is determined from at least one first candidate conversation response information based on at least one second fusion information.
根据本公开的实施例,在获得第一融合信息之后,可以将第一融合信息输入第五预定模型,得到对话应答信息。第五预定模型可以根据实际业务需求进行配置,能够实现对话应答信息生成的功能即可,在此不作限定。例如,第五预定模型可以包括基于Transformer-Dec(即Transformer的Decoder)结构的模型。第五预定模型可以包括第一语言子模型(Dialogue Model)和第一最大互信息评分函数子模型(Maximum MutualInformationscoring fuunction,MMI Model)。第一语言子模型可以包括第三编码器和第四解码器。可以对第一语言子模型和第一最大互信息评分函数子模型执行多轮次训练,直至满足预定条件。将经训练的第一语言子模型和第一最大互信息评分函数子模型确定为第五预定模型。According to embodiments of the present disclosure, after obtaining the first fusion information, the first fusion information can be input into the fifth predetermined model to obtain the dialogue response information. The fifth reservation model can be configured according to actual business requirements, and it only needs to be able to realize the function of generating dialogue response information, which is not limited here. For example, the fifth predetermined model may include a model based on the Transformer-Dec (ie, Transformer's Decoder) structure. The fifth predetermined model may include a first language sub-model (Dialogue Model) and a first maximum mutual information scoring function sub-model (Maximum MutualInformationscoring fuunction, MMI Model). The first language sub-model may include a third encoder and a fourth decoder. Multiple rounds of training may be performed on the first language sub-model and the first maximum mutual information scoring function sub-model until predetermined conditions are met. The trained first language sub-model and the first maximum mutual information scoring function sub-model are determined as the fifth predetermined model.
根据本公开的实施例,第三编码器可以包括以下至少之一:第六双向长短期记忆网络、第六门控循环单元、第六卷积神经网络、第六长短期记忆网络和第六循环神经网络。第三编码器可以包括第三输入层和第六隐藏层。第三编码器可以用于将第一融合信息进行编码,得到第三编码信息。例如,可以利用第三编码器的第三输入层对第一融合信息进行编码,得到第三中间向量。利用第三编码器的第六隐藏层对第三中间向量进行处理,得到第三编码信息。According to an embodiment of the present disclosure, the third encoder may include at least one of the following: a sixth bidirectional long short-term memory network, a sixth gated recurrent unit, a sixth convolutional neural network, a sixth long short-term memory network, and a sixth loop Neural Networks. The third encoder may include a third input layer and a sixth hidden layer. The third encoder may be used to encode the first fusion information to obtain third encoded information. For example, the third input layer of the third encoder may be used to encode the first fusion information to obtain the third intermediate vector. The third intermediate vector is processed using the sixth hidden layer of the third encoder to obtain third encoded information.
根据本公开的实施例,第四解码器可以包括以下至少之一:第七双向长短期记忆网络、第七门控循环单元、第七卷积神经网络、第七长短期记忆网络和第七循环神经网络。第四解码器可以包括第七隐藏层和第四输出层。第四解码器可以用于对第三编码信息进行重构,生成至少一个第一候选对话应答信息。例如,可以利用四解码器的第七隐藏层对第三编码信息进行解码,得到第三辅助解码信息。利用第四解码器的第四输出层对第三辅助解码信息进行处理,生成至少一个第一候选对话应答信息。According to an embodiment of the present disclosure, the fourth decoder may include at least one of the following: a seventh bidirectional long short-term memory network, a seventh gated recurrent unit, a seventh convolutional neural network, a seventh long short-term memory network, and a seventh loop Neural Networks. The fourth decoder may include a seventh hidden layer and a fourth output layer. The fourth decoder may be used to reconstruct the third encoded information and generate at least one first candidate dialogue response information. For example, the third encoded information can be decoded using the seventh hidden layer of the quad decoder to obtain the third auxiliary decoding information. The third auxiliary decoding information is processed using a fourth output layer of the fourth decoder to generate at least one first candidate dialogue response information.
根据本公开的实施例,在获得至少一个第一候选对话应答信息之后,可以分别将至少一个第一候选对话应答信息和第一融合信息进行融合,得到至少一个第二融合信息。融合可以包括以下至少之一:拼接和相加。在获得至少一个第二融合信息之后,可以利用第一最大互信息评分函数子模型,根据至少一个第二融合信息,从至少一个第一候选对话应答信息中确定对话应答信息。例如,可以利用第一最大互信息评分函数子模型对至少一个第二融合信息分别进行处理,得到与至少一个第一候选对话应答信息各自对应的第一最大互信息评分。根据与至少一个第一候选对话应答信息各自对应的第一最大互信息评分,从至少一个第一候选对话应答信息中确定对话应答信息。According to embodiments of the present disclosure, after obtaining at least one first candidate dialogue response information, the at least one first candidate dialogue response information and the first fusion information may be respectively fused to obtain at least one second fusion information. Fusion may include at least one of the following: splicing and addition. After obtaining the at least one second fusion information, the first maximum mutual information scoring function sub-model may be used to determine the dialogue response information from the at least one first candidate dialogue response information based on the at least one second fusion information. For example, the first maximum mutual information scoring function sub-model can be used to separately process at least one second fusion information to obtain the first maximum mutual information score corresponding to each of the at least one first candidate dialogue response information. The dialogue response information is determined from the at least one first candidate dialogue response information according to the first maximum mutual information score respectively corresponding to the at least one first candidate dialogue response information.
图4C示意性示出了根据本公开另一实施例的根据第一融合信息,生成对话应答信息的示例示意图。FIG. 4C schematically illustrates an example of generating dialogue response information according to first fusion information according to another embodiment of the present disclosure.
如图4C所示,在400C中,在获得第一融合信息408之后,可以根据第一融合信息408,生成至少一个第一候选对话应答信息409。至少一个第一候选对话应答信息409可以包括第一候选对话应答信息4091、第一候选对话应答信息409_2、...、第一候选对话应答信息409_m、...、第一候选对话应答信息409_M。M可以是大于或等于1的整数,m∈{1,2,...,(M-1),M}。As shown in Figure 4C, in 400C, after obtaining the first fusion information 408, at least one first candidate dialogue response information 409 can be generated according to the first fusion information 408. At least one first candidate dialogue response information 409 may include first candidate dialogue response information 4091, first candidate dialogue response information 409_2, ..., first candidate dialogue response information 409_m, ..., first candidate dialogue response information 409_M . M can be an integer greater than or equal to 1, m∈{1, 2,..., (M-1), M}.
在获得至少一个第一候选对话应答信息409之后,可以分别将第一候选对话应答信息409_1、第一候选对话应答信息409_2、...、第一候选对话应答信息409_m、...、第一候选对话应答信息409_M和第一融合信息408进行融合,得到至少一个第二融合信息。至少一个第二融合信息可以包括第二融合信息410_1、第二融合信息410_2、...、第二融合信息410_m、...、第二融合信息410_M。After obtaining at least one first candidate dialogue response information 409, the first candidate dialogue response information 409_1, the first candidate dialogue response information 409_2, ..., the first candidate dialogue response information 409_m, ..., the first candidate dialogue response information 409_1, ..., the first candidate dialogue response information 409_m, ..., the first candidate dialogue response information 409_1, . The candidate dialogue response information 409_M and the first fusion information 408 are fused to obtain at least one second fusion information. The at least one second fusion information may include second fusion information 410_1, second fusion information 410_2, ..., second fusion information 410_m, ..., second fusion information 410_M.
在获得至少一个第二融合信息之后,可以根据第二融合信息4101、第二融合信息410_2、...、第二融合信息410_m、...、第二融合信息410_M,从第一候选对话应答信息409_1、第一候选对话应答信息409_2、...、第一候选对话应答信息409_m、...、第一候选对话应答信息409_M中确定对话应答信息411。After obtaining at least one second fusion information, the first candidate dialogue response may be obtained according to the second fusion information 4101, the second fusion information 410_2, ..., the second fusion information 410_m, ..., the second fusion information 410_M. The dialogue response information 411 is determined among the information 409_1, the first candidate dialogue response information 409_2,..., the first candidate dialogue response information 409_m,..., the first candidate dialogue response information 409_M.
根据本公开的实施例,根据第一融合信息,生成对话应答信息,可以包括如下操作。According to an embodiment of the present disclosure, generating dialogue response information according to the first fusion information may include the following operations.
分别将至少一个第一隐变量信息和第一融合信息进行融合,得到至少一个第三融合信息。根据至少一个第三融合信息,生成至少一个第二候选对话应答信息。根据与至少一个第二候选对话应答信息对应的评估值,从至少一个第二候选对话应答信息中确定对话应答信息。The at least one first latent variable information and the first fusion information are respectively fused to obtain at least one third fusion information. Generate at least one second candidate dialogue response information based on at least one third fusion information. The dialogue response information is determined from the at least one second candidate dialogue response information based on an evaluation value corresponding to the at least one second candidate dialogue response information.
根据本公开的实施例,在获得第一融合信息之后,可以将第一融合信息输入第六预定模型,得到对话应答信息。第六预定模型可以根据实际业务需求进行配置,能够实现对话应答信息生成的功能即可,在此不作限定。例如,第六预定模型可以包括基于UniLM-based(即Unified Language Model Pre-training for Natural LanguageUnderstanding and Generation)结构的模型。第六预定模型可以包括第四编码器、第五解码器和第一评估器。可以对第四编码器和第五解码器执行多轮次训练,直至满足预定条件。将经训练的第四编码器和第五解码器确定为第六预定模型。According to embodiments of the present disclosure, after obtaining the first fusion information, the first fusion information can be input into the sixth predetermined model to obtain the dialogue response information. The sixth predetermined model can be configured according to actual business requirements, and it only needs to be able to realize the function of generating dialogue response information, which is not limited here. For example, the sixth predetermined model may include a model based on a UniLM-based (ie, Unified Language Model Pre-training for Natural Language Understanding and Generation) structure. The sixth predetermined model may include a fourth encoder, a fifth decoder and a first evaluator. Multiple rounds of training may be performed on the fourth encoder and the fifth decoder until predetermined conditions are met. The trained fourth encoder and fifth decoder are determined as a sixth predetermined model.
根据本公开的实施例,可以根据与至少一个对话轮数各自对应的对话内容(即Djalogue Context)和对话回应(即Response),生成与至少一个对话轮数各自对应的第一隐变量信息。与至少一个对话轮数各自对应的对话内容和对话回应能够反映与该对话轮数对应的第一隐变量信息。在获得至少一个第一隐变量信息之后,可以分别将至少一个第一隐变量信息和所述第一融合信息进行融合,得到至少一个第三融合信息。融合可以包括以下至少之一:拼接和相加。According to embodiments of the present disclosure, the first latent variable information corresponding to at least one dialogue round may be generated based on the dialogue content (ie, Djalogue Context) and dialogue response (ie, Response) corresponding to at least one dialogue round. The dialogue content and dialogue response respectively corresponding to at least one dialogue round can reflect the first latent variable information corresponding to the dialogue round. After obtaining at least one first latent variable information, at least one first latent variable information and the first fusion information may be respectively fused to obtain at least one third fusion information. Fusion may include at least one of the following: splicing and addition.
根据本公开的实施例,第四编码器可以包括以下至少之一:第八双向长短期记忆网络、第八门控循环单元、第八卷积神经网络、第八长短期记忆网络和第八循环神经网络。第四编码器可以包括第四输入层和第八隐藏层。第四编码器可以用于将至少一个第三融合信息分别进行编码,得到与至少一个第三融合信息各自对应的第四编码信息。例如,可以利用第四编码器的第四输入层对第三融合信息进行编码,得到第四中间向量。利用第四编码器的第八隐藏层对第四中间向量进行处理,得到与至少一个第三融合信息各自对应的第四编码信息。According to an embodiment of the present disclosure, the fourth encoder may include at least one of the following: an eighth bidirectional long short-term memory network, an eighth gated recurrent unit, an eighth convolutional neural network, an eighth long short-term memory network, and an eighth loop Neural Networks. The fourth encoder may include a fourth input layer and an eighth hidden layer. The fourth encoder may be used to separately encode at least one third piece of fusion information to obtain fourth coded information respectively corresponding to the at least one third piece of fusion information. For example, the fourth input layer of the fourth encoder may be used to encode the third fusion information to obtain the fourth intermediate vector. The fourth intermediate vector is processed using an eighth hidden layer of the fourth encoder to obtain fourth coding information respectively corresponding to at least one third fusion information.
根据本公开的实施例,第五解码器可以包括以下至少之一:第九双向长短期记忆网络、第九门控循环单元、第九卷积神经网络、第九长短期记忆网络和第九循环神经网络。第五解码器可以包括第九隐藏层和第五输出层。第五解码器可以用于对与至少一个第三融合信息各自对应的第四编码信息分别进行重构,生成至少一个第二候选对话应答信息。例如,可以利用第五解码器的第九隐藏层对与至少一个第三融合信息各自对应的第四编码信息进行解码,得到与至少一个第三融合信息各自对应的第四辅助解码信息。利用第五解码器的第五输出层对与至少一个第三融合信息各自对应的第四辅助解码信息分别进行处理,生成至少一个第二候选对话应答信息。According to an embodiment of the present disclosure, the fifth decoder may include at least one of the following: a ninth bidirectional long short-term memory network, a ninth gated recurrent unit, a ninth convolutional neural network, a ninth long short-term memory network, and a ninth loop Neural Networks. The fifth decoder may include a ninth hidden layer and a fifth output layer. The fifth decoder may be used to respectively reconstruct the fourth encoded information respectively corresponding to the at least one third fusion information, and generate at least one second candidate dialogue response information. For example, the ninth hidden layer of the fifth decoder may be used to decode the fourth encoded information respectively corresponding to the at least one third fusion information, to obtain the fourth auxiliary decoding information respectively corresponding to the at least one third fusion information. The fifth output layer of the fifth decoder is used to separately process the fourth auxiliary decoding information corresponding to the at least one third fusion information to generate at least one second candidate dialogue response information.
根据本公开的实施例,在获得至少一个第二候选对话应答信息之后,可以利用第一评估器处理至少一个第二候选对话应答信息,得到与至少一个第二候选对话应答信息各自对应的评估值。第一评估器可以是基于NSP(即Next Sentence Prediction)任务和MLM(即Mask Language Model)任务训练得到的。在获得与至少一个第二候选对话应答信息各自对应的评估值之后,可以根据与至少一个第二候选对话应答信息对应的评估值,从至少一个第二候选对话应答信息中确定对话应答信息。According to an embodiment of the present disclosure, after obtaining at least one second candidate dialogue response information, the first evaluator may be used to process the at least one second candidate dialogue response information to obtain an evaluation value corresponding to the at least one second candidate dialogue response information. . The first evaluator may be trained based on the NSP (Next Sentence Prediction) task and the MLM (Mask Language Model) task. After obtaining the evaluation values corresponding to the at least one second candidate dialogue response information, the dialogue response information may be determined from the at least one second candidate dialogue response information according to the evaluation values corresponding to the at least one second candidate dialogue response information.
图4D示意性示出了根据本公开另一实施例的根据第一融合信息,生成对话应答信息的示例示意图。FIG. 4D schematically illustrates an example diagram of generating dialogue response information based on first fusion information according to another embodiment of the present disclosure.
如图4D所示,在400D中,在获得第一融合信息之后,可以确定至少一个第一隐变量信息412。至少一个第一隐变量信息412可以包括第一隐变量信息412_1、第一隐变量信息412_2、...、第一隐变量信息412_n、...、第一隐变量信息412_N。N可以是大于或等于1的整数,n∈{1,2,...,(N-1),N}。As shown in FIG. 4D, in 400D, after obtaining the first fusion information, at least one first latent variable information 412 may be determined. At least one first latent variable information 412 may include first latent variable information 412_1, first latent variable information 412_2, ..., first latent variable information 412_n, ..., first latent variable information 412_N. N can be an integer greater than or equal to 1, n∈{1, 2,..., (N-1), N}.
在获得至少一个第一隐变量信息412之后,可以分别将第一隐变量信息412_1、第一隐变量信息412_2、...、第一隐变量信息412_n、...、第一隐变量信息412_N和第一融合信息进行融合,得到至少一个第三融合信息。至少一个第三融合信息可以包括第三融合信息413_1、第三融合信息413_2、...、第三融合信息413_n、...、第三融合信息413_N。After obtaining at least one first latent variable information 412, the first latent variable information 412_1, the first latent variable information 412_2, ..., the first latent variable information 412_n, ..., the first latent variable information 412_N can be respectively Fusion with the first fusion information to obtain at least one third fusion information. The at least one third fusion information may include third fusion information 413_1, third fusion information 413_2, ..., third fusion information 413_n, ..., third fusion information 413_N.
在获得至少一个第三融合信息之后,可以根据第三融合信息4131、第三融合信息413_2、...、第三融合信息413_n、...、第三融合信息413_N,生成至少一个第二候选对话应答信息。至少一个第二候选对话应答信息可以包括第二候选对话应答信息414_1、第二候选对话应答信息414_2、...、第二候选对话应答信息414_n、...、第二候选对话应答信息414_N。After at least one third fusion information is obtained, at least one second candidate can be generated based on the third fusion information 4131, the third fusion information 413_2, ..., the third fusion information 413_n, ..., the third fusion information 413_N Conversation response message. The at least one second candidate dialogue response information may include second candidate dialogue response information 414_1, second candidate dialogue response information 414_2, . . . , second candidate dialogue response information 414_n, . . . , second candidate dialogue response information 414_N.
在获得至少一个第二候选对话应答信息之后,可以确定与第二候选对话应答信息414_1、第二候选对话应答信息414_2、...、第二候选对话应答信息414_n、...、第二候选对话应答信息414_N各自对应的评估值。至少一个评估值可以包括评估值415_1、评估值415_2、...、评估值415_n、...、评估值415_N。After obtaining at least one second candidate dialogue response information, the second candidate dialogue response information 414_1, the second candidate dialogue response information 414_2, ..., the second candidate dialogue response information 414_n, ..., the second candidate dialogue response information 414_1, the second candidate dialogue response information 414_n, ..., the second candidate dialogue response information 414_n, ... The respective evaluation values corresponding to the dialogue response information 414_N. At least one evaluation value may include evaluation value 415_1, evaluation value 415_2, ..., evaluation value 415_n, ..., evaluation value 415_N.
在获得与至少一个第二候选对话应答信息各自对应的评估值之后,可以根据评估值415_1、评估值415_2、...、评估值415_n、...、评估值415_N,从第二候选对话应答信息414_1、第二候选对话应答信息414_2、...、第二候选对话应答信息414_n、...、第二候选对话应答信息414_N中确定对话应答信息416。After obtaining evaluation values corresponding to at least one second candidate dialogue response information, the second candidate dialogue response may be obtained according to the evaluation value 415_1, the evaluation value 415_2, ..., the evaluation value 415_n, ..., the evaluation value 415_N. The dialogue response information 416 is determined among the information 414_1, the second candidate dialogue response information 414_2, . . . , the second candidate dialogue response information 414_n, . . . , the second candidate dialogue response information 414_N.
根据本公开的实施例,操作S210可以包括如下操作。According to an embodiment of the present disclosure, operation S210 may include the following operations.
分别将至少一个第二隐变量信息和查询信息进行融合,得到至少一个第四融合信息。根据至少一个第四融合信息,生成至少一个第一候选理解信息。根据与至少一个第一候选理解信息对应的评估值,从至少一个第一候选理解信息中确定理解信息。The at least one second latent variable information and the query information are respectively fused to obtain at least one fourth fusion information. Generate at least one first candidate understanding information based on at least one fourth fusion information. Understanding information is determined from the at least one first candidate understanding information based on an evaluation value corresponding to the at least one first candidate understanding information.
根据本公开的实施例,在获得查询信息之后,可以将查询信息输入第七预定模型,得到理解信息。第七预定模型可以根据实际业务需求进行配置,能够实现确定理解信息的功能即可,在此不作限定。例如,第七预定模型可以包括第五编码器、第六解码器和第二评估器。可以对第五编码器和第六解码器执行多轮次训练,直至满足预定条件。将经训练的第五编码器和第六解码器确定为第七预定模型。According to embodiments of the present disclosure, after obtaining the query information, the query information can be input into the seventh predetermined model to obtain understanding information. The seventh predetermined model can be configured according to actual business needs, as long as it can realize the function of determining and understanding information, and is not limited here. For example, the seventh predetermined model may include a fifth encoder, a sixth decoder, and a second evaluator. Multiple rounds of training may be performed on the fifth encoder and the sixth decoder until predetermined conditions are met. The trained fifth encoder and sixth decoder are determined as a seventh predetermined model.
根据本公开的实施例,可以根据与至少一个对话轮数各自对应的对话内容和对话回应,生成与至少一个对话轮数各自对应的第二隐变量信息。与至少一个对话轮数各自对应的对话内容和对话回应能够反映与该对话轮数对应的第二隐变量信息。在获得至少一个第二隐变量信息之后,可以分别将至少一个第二隐变量信息和查询信息进行融合,得到至少一个第四融合信息。融合可以包括以下至少之一:拼接和相加。According to embodiments of the present disclosure, second latent variable information corresponding to at least one dialogue round may be generated based on dialogue content and dialogue responses corresponding to at least one dialogue round. The dialogue content and dialogue response respectively corresponding to at least one dialogue round can reflect the second latent variable information corresponding to the dialogue round. After obtaining at least one second latent variable information, the at least one second latent variable information and the query information can be respectively fused to obtain at least one fourth fusion information. Fusion may include at least one of the following: splicing and addition.
根据本公开的实施例,第五编码器可以包括以下至少之一:第五编码器可以包括第五输入层和第十隐藏层。第五编码器可以用于将至少一个第四融合信息分别进行编码,得到与至少一个第四融合信息各自对应的第五编码信息。例如,可以利用第五编码器的第五输入层对第四融合信息进行编码,得到第五中间向量。利用第五编码器的第十隐藏层对第五中间向量进行处理,得到与至少一个第四融合信息各自对应的第五编码信息。According to an embodiment of the present disclosure, the fifth encoder may include at least one of the following: the fifth encoder may include a fifth input layer and a tenth hidden layer. The fifth encoder may be used to separately encode at least one piece of fourth fusion information to obtain fifth coded information respectively corresponding to at least one piece of fourth fusion information. For example, the fifth input layer of the fifth encoder may be used to encode the fourth fusion information to obtain the fifth intermediate vector. The fifth intermediate vector is processed using the tenth hidden layer of the fifth encoder to obtain fifth coding information respectively corresponding to at least one fourth fusion information.
根据本公开的实施例,第六解码器可以包括第十一隐藏层和第六输出层。第六解码器可以用于对与至少一个第四融合信息各自对应的第五编码信息分别进行重构,生成至少一个第一候选理解信息。例如,可以利用第六解码器的第十一隐藏层对与至少一个第四融合信息各自对应的第五编码信息进行解码,得到与至少一个第四融合信息各自对应的第五辅助解码信息。利用第六解码器的第六输出层对与至少一个第四融合信息各自对应的第五辅助解码信息分别进行处理,生成至少一个第一候选理解信息。According to embodiments of the present disclosure, the sixth decoder may include an eleventh hidden layer and a sixth output layer. The sixth decoder may be used to reconstruct the fifth encoded information respectively corresponding to the at least one fourth fusion information, and generate at least one first candidate understanding information. For example, the eleventh hidden layer of the sixth decoder can be used to decode the fifth coded information corresponding to the at least one fourth fusion information, and obtain the fifth auxiliary decoding information corresponding to the at least one fourth fusion information. The sixth output layer of the sixth decoder is used to separately process the fifth auxiliary decoding information corresponding to the at least one fourth fusion information to generate at least one first candidate understanding information.
根据本公开的实施例,在获得至少一个第一候选理解信息之后,可以利用第二评估器处理至少一个第一候选理解信息,得到与至少一个第一候选理解信息各自对应的评估值。第二评估器可以是基于NSP任务和MLM任务训练得到的。在获得与至少一个第一候选理解信息各自对应的评估值之后,可以根据与至少一个第一候选理解信息对应的评估值,从至少一个第一候选理解信息中确定理解信息。According to embodiments of the present disclosure, after obtaining at least one first candidate understanding information, the second evaluator may be used to process the at least one first candidate understanding information to obtain evaluation values corresponding to the at least one first candidate understanding information. The second evaluator may be trained based on the NSP task and the MLM task. After obtaining the evaluation values respectively corresponding to the at least one first candidate understanding information, the understanding information may be determined from the at least one first candidate understanding information based on the evaluation values corresponding to the at least one first candidate understanding information.
图5A示意性示出了根据本公开实施例的对查询信息进行语义理解,得到理解信息的示例示意图。FIG. 5A schematically shows an example of performing semantic understanding on query information and obtaining understanding information according to an embodiment of the present disclosure.
如图5A所示,在500A中,在获得查询信息之后,可以确定至少一个第二隐变量信息501。至少一个第二隐变量信息501可以包括第二隐变量信息501_1、第二隐变量信息501_2、...、第二隐变量信息501_p、...、第二隐变量信息501_P。P可以是大于或等于1的整数,p∈{1,2,...,(P-1),P}。As shown in FIG. 5A, in 500A, after obtaining the query information, at least one second latent variable information 501 may be determined. The at least one second latent variable information 501 may include second latent variable information 501_1, second latent variable information 501_2, ..., second latent variable information 501_p, ..., second latent variable information 501_P. P can be an integer greater than or equal to 1, p∈{1, 2,..., (P-1), P}.
在获得至少一个第二隐变量信息501之后,可以分别将第二隐变量信息501_1、第二隐变量信息501_2、...、第二隐变量信息501_p、...、第二隐变量信息501_P和查询信息进行融合,得到至少一个第四融合信息。至少一个第四融合信息可以包括第四融合信息502_1、第四融合信息502_2、...、第四融合信息502_p、...、第四融合信息502_P。After obtaining at least one second latent variable information 501, the second latent variable information 501_1, the second latent variable information 501_2, ..., the second latent variable information 501_p, ..., the second latent variable information 501_P can be respectively Fusion with the query information to obtain at least one fourth fusion information. The at least one fourth fusion information may include fourth fusion information 502_1, fourth fusion information 502_2, ..., fourth fusion information 502_p, ..., fourth fusion information 502_P.
在获得至少一个第四融合信息之后,可以根据第四融合信息502_1、第四融合信息502_2、...、第四融合信息502_p、...、第四融合信息502_P,生成至少一个第一候选理解信息。至少一个第一候选理解信息可以包括第一候选理解信息503_1、第一候选理解信息503_2、...、第一候选理解信息503_p、...、第一候选理解信息503_P。After obtaining at least one fourth fusion information, at least one first candidate can be generated based on the fourth fusion information 502_1, the fourth fusion information 502_2, ..., the fourth fusion information 502_p, ..., the fourth fusion information 502_P Understand the message. The at least one first candidate understanding information may include first candidate understanding information 503_1, first candidate understanding information 503_2, ..., first candidate understanding information 503_p, ..., first candidate understanding information 503_P.
在获得至少一个第一候选理解信息之后,可以确定与第一候选理解信息503_1、第一候选理解信息503_2、...、第一候选理解信息503_p、...、第一候选理解信息503_P各自对应的评估值。至少一个评估值可以包括评估值504_1、评估值504_2、...、评估值504_p、...、评估值504_P。After at least one first candidate understanding information is obtained, each of the first candidate understanding information 503_1, the first candidate understanding information 503_2, ..., the first candidate understanding information 503_p, ..., the first candidate understanding information 503_P may be determined. the corresponding evaluation value. At least one evaluation value may include evaluation value 504_1, evaluation value 504_2, ..., evaluation value 504_p, ..., evaluation value 504_P.
在获得与至少一个第一候选理解信息对应的评估值之后,可以根据评估值504_1、评估值504_2、...、评估值504_p、...、评估值504_P,从第一候选理解信息503_1、第一候选理解信息503_2、...、第一候选理解信息503_p、...、第一候选理解信息503_P中确定理解信息505。After obtaining an evaluation value corresponding to at least one first candidate understanding information, the first candidate understanding information 503_1, 504_2, ..., 504_p, ..., evaluation value 504_P may be obtained. The understanding information 505 is determined among the first candidate understanding information 503_2, ..., the first candidate understanding information 503_p, ..., and the first candidate understanding information 503_P.
根据本公开的实施例,操作S210可以包括如下操作。According to an embodiment of the present disclosure, operation S210 may include the following operations.
根据查询信息,生成至少一个第二候选理解信息。分别将至少一个第二候选理解信息和查询信息进行融合,得到至少一个第五融合信息。根据至少一个第五融合信息,从至少一个第二候选理解信息中确定理解信息。Based on the query information, at least one second candidate understanding information is generated. The at least one second candidate understanding information and the query information are respectively fused to obtain at least one fifth fusion information. Understanding information is determined from at least one second candidate understanding information based on at least one fifth fusion information.
根据本公开的实施例,在获得查询信息之后,可以将查询信息输入第八预定模型,得到理解信息。第八预定模型可以根据实际业务需求进行配置,能够实现确定理解信息的功能即可,在此不作限定。例如,第八预定模型可以包括基于Transformer-Dec结构的模型。第八预定模型可以包括第二语言子模型和第二最大互信息评分函数子模型。第二语言子模型可以包括第六编码器和第七解码器。可以对第二语言子模型和第二最大互信息评分函数子模型执行多轮次训练,直至满足预定条件。将经训练的第二语言子模型和第二最大互信息评分函数子模型确定为第八预定模型。According to embodiments of the present disclosure, after obtaining the query information, the query information can be input into the eighth predetermined model to obtain understanding information. The eighth predetermined model can be configured according to actual business needs, as long as it can realize the function of determining and understanding information, and is not limited here. For example, the eighth predetermined model may include a model based on the Transformer-Dec structure. The eighth predetermined model may include a second language sub-model and a second maximum mutual information scoring function sub-model. The second language sub-model may include a sixth encoder and a seventh decoder. Multiple rounds of training may be performed on the second language sub-model and the second maximum mutual information scoring function sub-model until predetermined conditions are met. The trained second language sub-model and the second maximum mutual information scoring function sub-model are determined as the eighth predetermined model.
根据本公开的实施例,第六编码器可以包括第六输入层和第十二隐藏层。第六编码器可以用于将查询信息进行编码,得到第六编码信息。例如,可以利用第六编码器的第六输入层对查询信息进行编码,得到第六中间向量。利用第六编码器的第十二隐藏层对第六中间向量进行处理,得到第六编码信息。According to embodiments of the present disclosure, the sixth encoder may include a sixth input layer and a twelfth hidden layer. The sixth encoder may be used to encode the query information to obtain sixth encoded information. For example, the sixth input layer of the sixth encoder can be used to encode the query information to obtain a sixth intermediate vector. The sixth intermediate vector is processed using the twelfth hidden layer of the sixth encoder to obtain the sixth encoded information.
根据本公开的实施例,第七解码器可以包括第十三隐藏层和第七输出层。第七解码器可以用于对第六编码信息进行重构,生成至少一个第二候选理解信息。例如,可以利用七解码器的第十三隐藏层对第六编码信息进行解码,得到第六辅助解码信息。利用第七解码器的第七输出层对第六辅助解码信息进行处理,生成至少一个第二候选理解信息。According to embodiments of the present disclosure, the seventh decoder may include a thirteenth hidden layer and a seventh output layer. The seventh decoder may be used to reconstruct the sixth encoded information and generate at least one second candidate understanding information. For example, the sixth encoded information can be decoded using the thirteenth hidden layer of the seven-decoder to obtain the sixth auxiliary decoding information. The sixth auxiliary decoding information is processed using a seventh output layer of the seventh decoder to generate at least one second candidate understanding information.
根据本公开的实施例,在获得至少一个第二候选理解信息之后,可以分别将至少一个第二候选理解信息和查询信息进行融合,得到至少一个第五融合信息。融合可以包括以下至少之一:拼接和相加。在获得至少一个第五融合信息之后,可以利用第二最大互信息评分函数子模型,根据至少一个第五融合信息,从至少一个第二候选理解信息中确定理解信息。例如,可以利用第二最大互信息评分函数子模型对至少一个第五融合信息分别进行处理,得到与至少一个第二候选理解信息各自对应的第二最大互信息评分。根据与至少一个第二候选理解信息各自对应的第二最大互信息评分,从至少一个第二候选理解信息中确定理解信息。According to embodiments of the present disclosure, after obtaining at least one second candidate understanding information, the at least one second candidate understanding information and the query information may be respectively fused to obtain at least one fifth fusion information. Fusion may include at least one of the following: splicing and addition. After obtaining the at least one fifth fusion information, the second maximum mutual information scoring function sub-model may be used to determine the understanding information from the at least one second candidate understanding information based on the at least one fifth fusion information. For example, the second maximum mutual information scoring function sub-model can be used to separately process at least one fifth fusion information to obtain a second maximum mutual information score corresponding to each of at least one second candidate understanding information. The understanding information is determined from the at least one second candidate understanding information according to the second maximum mutual information score respectively corresponding to the at least one second candidate understanding information.
根据本公开的实施例,历史对话信息可以包括系统历史对话信息和对象历史对话信息。系统历史对话信息可以包括系统标识和与系统标识对应的历史对话信息。对象历史对话信息可以包括对象标识和与对象标识对应的历史对话信息。理解信息还可以包括与对象动作对应的动作标识和与对话状态对应的状态标识。According to embodiments of the present disclosure, the historical dialogue information may include system historical dialogue information and object historical dialogue information. The system historical dialogue information may include a system identification and historical dialogue information corresponding to the system identification. The object historical dialogue information may include an object identification and historical dialogue information corresponding to the object identification. The understanding information may also include an action identifier corresponding to the object's action and a state identifier corresponding to the conversation state.
根据本公开的实施例,如下表1所示,可以使用“system”表征系统标识。使用“user”表征对象标识。使用“user_action”表征动作标识。使用“belief”表征状态标识。According to an embodiment of the present disclosure, as shown in Table 1 below, "system" may be used to characterize the system identifier. Use "user" to characterize the object identity. Use "user_action" to characterize the action identifier. Use "belief" to characterize status identification.
表1Table 1
根据本公开的实施例,由于系统标识可以用于表征系统历史对话信息,对象标识可以用于表征对象历史对话信息,由此实现了对多轮对话中的系统和对象进行清晰的角色区分,因而提高了信息生成方法的连贯性,进而提高了对话应答信息的准确性。According to the embodiments of the present disclosure, since the system identifier can be used to represent the system historical dialogue information, and the object identifier can be used to represent the object historical dialogue information, a clear role distinction between the system and the object in the multi-round dialogue is achieved. Therefore, The coherence of the information generation method is improved, thereby improving the accuracy of the dialogue response information.
图5B示意性示出了根据本公开另一实施例的对查询信息进行语义理解,得到理解信息的示例示意图。FIG. 5B schematically shows an example diagram of performing semantic understanding on query information to obtain understanding information according to another embodiment of the present disclosure.
如图5B所示,在500B中,在获得查询信息506之后,可以根据查询信息506,生成至少一个第二候选理解信息。至少一个第二候选理解信息可以包括第二候选理解信息507_1、第二候选理解信息507_2、…、第二候选理解信息507_q、...、第二候选理解信息507_Q。Q可以是大于或等于1的整数,q∈{1,2,…,(Q-1),Q}。As shown in FIG. 5B, in step 500B, after obtaining the query information 506, at least one second candidate understanding information may be generated based on the query information 506. The at least one second candidate understanding information may include second candidate understanding information 507_1, second candidate understanding information 507_2, ..., second candidate understanding information 507_q, ..., second candidate understanding information 507_Q. Q can be an integer greater than or equal to 1, q∈{1, 2,…, (Q-1), Q}.
在获得至少一个第二候选理解信息之后,可以分别将第二候选理解信息507_1、第二候选理解信息507_2、...、第二候选理解信息507_q、...、第二候选理解信息507_Q和查询信息506进行融合,得到至少一个第五融合信息。至少一个第五融合信息可以包括第五融合信息508_1、第五融合信息508_2、...、第五融合信息508_q、...、第五融合信息508_Q。After obtaining at least one second candidate understanding information, the second candidate understanding information 507_1, the second candidate understanding information 507_2, ..., the second candidate understanding information 507_q, ..., the second candidate understanding information 507_Q and The query information 506 is fused to obtain at least one fifth fusion information. At least one fifth fusion information may include fifth fusion information 508_1, fifth fusion information 508_2, ..., fifth fusion information 508_q, ..., fifth fusion information 508_Q.
在获得至少一个第五融合信息之后,可以根据第五融合信息508_1、第五融合信息508_2、...、第五融合信息508_q、...、第五融合信息508_Q,从第二候选理解信息507_1、第二候选理解信息507_2、...、第二候选理解信息507_q、...、第二候选理解信息507_Q中确定理解信息509。After obtaining at least one fifth fusion information, information may be understood from the second candidate according to the fifth fusion information 508_1, the fifth fusion information 508_2, ..., the fifth fusion information 508_q, ..., the fifth fusion information 508_Q. The understanding information 509 is determined among 507_1, second candidate understanding information 507_2, ..., second candidate understanding information 507_q, ..., and second candidate understanding information 507_Q.
根据本公开的实施例,信息生成方法200还可以包括如下操作。According to an embodiment of the present disclosure, the information generation method 200 may further include the following operations.
响应于检测到非辅助请求指令,直接根据查询信息和理解信息,生成对话应答信息。In response to detecting the non-assisted request instruction, dialogue response information is generated directly based on the query information and understanding information.
根据本公开的实施例,非辅助请求指令可以指在生成对话应答信息的过程中,不需要调用外部资源的请求指令。在检测到非辅助请求指令情况下,由于不需要调用外部资源,因此可以不需要确定辅助请求信息,辅助请求信息标识可以为NULL。在此情况下,可以直接根据查询信息和理解信息,生成对话应答信息。According to an embodiment of the present disclosure, a non-assisted request instruction may refer to a request instruction that does not require calling external resources in the process of generating dialogue response information. When a non-auxiliary request instruction is detected, since there is no need to call external resources, there is no need to determine the auxiliary request information, and the auxiliary request information identifier may be NULL. In this case, dialogue response information can be generated directly based on the query information and understanding information.
根据本公开的实施例,表2可以用于表征响应于检测到非辅助请求指令,生成对话应答信息的示例示意过程。如表2所示,辅助请求信息可以包括与辅助请求信息对应的辅助请求信息标识,可以使用“callapi”表征辅助请求信息标识。辅助应答信息可以包括与辅助应答信息的辅助应答信息标识,可以使用“kb”表征辅助应答信息标识。对话应答信息可以包括系统动作、与系统动作对应的系统动作标识、系统答复、与系统答复对应的系统答复标识,可以使用“system action”表征系统动作标识。使用“response”表征系统答复标识。According to embodiments of the present disclosure, Table 2 may be used to characterize an example schematic process for generating conversation response information in response to detecting a non-assisted request instruction. As shown in Table 2, the assistance request information may include an assistance request information identifier corresponding to the assistance request information, and "callapi" may be used to represent the assistance request information identifier. The auxiliary response information may include an auxiliary response information identifier related to the auxiliary response information, and "kb" may be used to represent the auxiliary response information identifier. The dialogue response information may include a system action, a system action identifier corresponding to the system action, a system reply, and a system reply identifier corresponding to the system reply. "system action" may be used to represent the system action identifier. Use "response" to represent the system reply identifier.
表2Table 2
根据本公开的实施例,表3可以用于表征响应于检测到辅助请求指令,生成对话应答信息的示例示意过程。According to embodiments of the present disclosure, Table 3 may be used to characterize an example schematic process for generating conversation response information in response to detecting an assistance request instruction.
表3table 3
以上仅是示例性实施例,但不限于此,还可以包括本领域已知的其他信息生成方法,只要能够提高对话应答信息的准确性即可。The above are only exemplary embodiments, but are not limited thereto. Other information generation methods known in the art may also be included, as long as the accuracy of the dialogue response information can be improved.
图6示意性示出了根据本公开实施例的预训练模型的训练方法的流程图。Figure 6 schematically shows a flow chart of a training method of a pre-trained model according to an embodiment of the present disclosure.
如图6所示,该方法600包括操作S610~S640。As shown in Figure 6, the method 600 includes operations S610 to S640.
在操作S610,对第一样本查询信息进行语义理解,得到第一样本理解信息,其中,第一样本查询信息包括第一样本历史对话信息,第一样本理解信息包括第一样本对象动作和第一样本对话状态。In operation S610, semantic understanding is performed on the first sample query information to obtain the first sample understanding information, where the first sample query information includes the first sample historical dialogue information, and the first sample understanding information includes the first sample This object's actions and first sample dialogue state.
在操作S620,根据第一样本查询信息和第一样本理解信息,得到第一样本辅助请求信息。In operation S620, first sample assistance request information is obtained according to the first sample query information and the first sample understanding information.
在操作S630,根据第一样本查询信息、第一样本理解信息和第一样本辅助请求信息,生成第一样本对话应答信息。In operation S630, first sample dialogue response information is generated according to the first sample query information, the first sample understanding information, and the first sample assistance request information.
在操作S640,利用第一样本查询信息、第一样本理解信息和第一样本对话应答信息训练预训练对话生成模型,得到信息生成模型。In operation S640, the pre-trained dialogue generation model is trained using the first sample query information, the first sample understanding information and the first sample dialogue response information to obtain an information generation model.
根据本公开的实施例,在获得信息生成模型之后,可以利用信息生成模型执行信息生成方法200。According to an embodiment of the present disclosure, after obtaining the information generation model, the information generation method 200 may be performed using the information generation model.
根据本公开的实施例,针对第一样本查询信息、第一样本理解信息、第一样本历史对话信息、第一样本对象动作、第一样本对话状态、第一样本辅助请求信息和第一样本对话应答信息的说明,可以参见上文针对查询信息、理解信息、历史对话信息、对象动作、对话状态、辅助请求信息和对话应答信息的相关内容,在此不再赘述。According to an embodiment of the present disclosure, for the first sample query information, the first sample understanding information, the first sample historical dialogue information, the first sample object action, the first sample dialogue status, and the first sample assistance request For descriptions of the information and the first sample dialogue response information, please refer to the relevant contents above regarding query information, understanding information, historical dialogue information, object actions, dialogue status, auxiliary request information, and dialogue response information, which will not be described again here.
根据本公开的实施例,可以根据第一样本历史对话信息、第一样本对象动作和第一样本对话状态,构造第一训练样本。例如,第一训练样本可以为“第一样本历史对话信息->第一样本对象动作+第一样本对话状态”。可以根据第一样本历史对话信息、第一样本对象动作、第一样本对话状态、第一样本辅助请求信息和第一样本对话应答信息,构造第二训练样本。例如,第一训练样本可以为“第一样本历史对话信息+第一样本对象动作+第一样本对话状态+第一样本辅助请求信息->第一样本对话应答信息”。According to embodiments of the present disclosure, the first training sample may be constructed based on the first sample historical dialogue information, the first sample object action, and the first sample dialogue state. For example, the first training sample may be "first sample historical dialogue information -> first sample object action + first sample dialogue state". The second training sample may be constructed based on the first sample historical dialogue information, the first sample object action, the first sample dialogue state, the first sample auxiliary request information, and the first sample dialogue response information. For example, the first training sample may be "first sample historical dialogue information + first sample object action + first sample dialogue state + first sample auxiliary request information -> first sample dialogue response information".
根据本公开的实施例,由于第一样本理解信息是通过对第一样本查询信息进行语义理解得到的,由此,能够获得对话理解的第一样本理解信息。由于第一样本辅助请求信息是根据第一样本查询信息和第一样本理解信息得到的,因此能够有效利用外部的知识。此外,用于第一样本对话应答信息是根据第一样本查询信息、第一样本理解信息和第一样本辅助请求信息生成的,因此,提高了第一样本对话应答信息的准确性。在此基础上,通过利用第一样本查询信息、第一样本理解信息和第一样本对话应答信息训练预训练对话生成模型,得到一体化的信息生成模型,由于信息生成模型集成了语义理解和信息生成,能够实现不同任务参数之间的共享,因而提高了信息生成模型的表征学习能力,进而提高了信息生成模型的信息生成能力。According to embodiments of the present disclosure, since the first sample understanding information is obtained by performing semantic understanding on the first sample query information, the first sample understanding information for dialogue understanding can be obtained. Since the first sample auxiliary request information is obtained based on the first sample query information and the first sample understanding information, external knowledge can be effectively utilized. In addition, the first sample dialogue response information is generated based on the first sample query information, the first sample understanding information and the first sample auxiliary request information. Therefore, the accuracy of the first sample dialogue response information is improved. sex. On this basis, by using the first sample query information, the first sample understanding information and the first sample dialogue response information to train the pre-trained dialogue generation model, an integrated information generation model is obtained. Since the information generation model integrates semantics Understanding and information generation can achieve sharing between different task parameters, thus improving the representation learning ability of the information generation model, thereby improving the information generation ability of the information generation model.
下面参考图7A和图7B,对根据本公开实施例的预训练模型的训练方法600做进一步说明。The training method 600 of the pre-trained model according to the embodiment of the present disclosure will be further described below with reference to FIG. 7A and FIG. 7B .
根据本公开的实施例,预训练模型的训练方法600还可以包括如下操作。According to an embodiment of the present disclosure, the training method 600 of the pre-trained model may further include the following operations.
从语料集中获取样本历史对话信息,其中,语料集包括以下至少之一:真实语料集和模拟语料集。Obtain sample historical dialogue information from a corpus, where the corpus includes at least one of the following: a real corpus and a simulated corpus.
根据本公开的实施例,真实语料集可以用于表征来自于公开数据集的数据集。模拟语料集可以用于表征人工生成的语料集。可以从语料集中获取原始样本历史对话信息。在获得原始样本历史对话信息之后,可以对原始样本历史对话信息进行处理,得到样本历史对话信息。According to embodiments of the present disclosure, real corpora may be used to characterize data sets from publicly available data sets. Simulated corpora can be used to characterize artificially generated corpora. The original sample historical dialogue information can be obtained from the corpus. After obtaining the original sample historical dialogue information, the original sample historical dialogue information can be processed to obtain the sample historical dialogue information.
根据本公开的实施例,真实语料集可以包括第一真实语料集和第二真实语料集,其中,第二真实语料集是将第三真实语料集进行译文翻译得到的,第一真实语料集和第二真实语料集的语种相同。According to embodiments of the present disclosure, the real corpus may include a first real corpus and a second real corpus, where the second real corpus is obtained by translating the third real corpus, and the first real corpus and The languages of the second real corpus are the same.
根据本公开的实施例,模拟语料集可以是基于以下方式至少之一生成的:基于预定文本参数生成的和基于生成对抗网络模型处理预定随机噪声数据生成的。According to embodiments of the present disclosure, the simulation corpus may be generated based on at least one of the following ways: generated based on predetermined text parameters and generated based on a generative adversarial network model processing predetermined random noise data.
根据本公开的实施例,可以从公开数据集获取第一真实语料集和第三真实语料集。第一真实语料集和第三真实语料集的语种不同。在获得第三真实语料集之后,可以对第三真实语料集进行译文翻译得到与第一真实语料集的语种相同的第二真实语料集。According to embodiments of the present disclosure, the first real corpus and the third real corpus may be obtained from public data sets. The languages of the first real corpus and the third real corpus are different. After obtaining the third real corpus, translation can be performed on the third real corpus to obtain a second real corpus in the same language as the first real corpus.
根据本公开的实施例,可以基于预定文本参数使用程序人工生成模拟语料集,以扩大模拟语料集的覆盖范围。备选地,可以通过将预定随机噪声数据输入生成对抗网络模型,得到模拟语料集。生成对抗网络模型可以包括深度卷积生成对抗网络模型、基于推土机距离的生成对抗网络模型或条件性生成对抗网络模型等。生成对抗网络模型可以包括生成器和判别器。生成器和判别器可以包括神经网络模型。生成器可以用于生成模拟语料集,并通过不断训练生成器学习到模拟语料集的数据分布,从而能够从无到有生成与模拟语料集的数据分布相符合的样本,并尽可能的去混淆判别器。判别器可以用于对模拟语料集和真实语料集进行区分。According to embodiments of the present disclosure, a simulation corpus can be artificially generated using a program based on predetermined text parameters to expand the coverage of the simulation corpus. Alternatively, a simulation corpus can be obtained by inputting predetermined random noise data into a generative adversarial network model. Generative adversarial network models can include deep convolutional generative adversarial network models, bulldozer distance-based generative adversarial network models, or conditional generative adversarial network models, etc. A generative adversarial network model can include a generator and a discriminator. The generator and discriminator can include neural network models. The generator can be used to generate a simulated corpus, and by continuously training the generator, it can learn the data distribution of the simulated corpus, so that it can generate samples from scratch that are consistent with the data distribution of the simulated corpus and eliminate confusion as much as possible. discriminator. The discriminator can be used to distinguish between simulated corpus and real corpus.
根据本公开的实施例,生成对抗网络模型的收敛条件可以包括生成器收敛、生成器和判别器均收敛或迭代达到终止条件,迭代达到终止条件可以包括迭代次数等于预定迭代次数。According to embodiments of the present disclosure, the convergence condition of the generative adversarial network model may include generator convergence, both generator and discriminator convergence, or an iteration reaching a termination condition, and the iteration reaching the termination condition may include the number of iterations being equal to a predetermined number of iterations.
根据本公开的实施例,由于样本历史对话信息是从语料集中获取的,语料集包括真实语料集和模拟语料集中的至少之一,能够增加训练预料,由此提高了信息生成模型的跨类型对话能力,进而提高了信息生成模型的通用性。According to embodiments of the present disclosure, since the sample historical dialogue information is obtained from a corpus, which includes at least one of a real corpus and a simulated corpus, training expectations can be increased, thereby improving the cross-type dialogue of the information generation model. capabilities, thus improving the versatility of the information generation model.
图7A示意性示出了根据本公开实施例的真实语料集的生成方法的示例示意图。FIG. 7A schematically shows an example schematic diagram of a method for generating a real corpus according to an embodiment of the present disclosure.
如图7A所示,在700A中,可以获取第三真实语料集701。在获得第三真实语料集701之后,可以对第三真实语料集701进行译文翻译得到第二真实语料集702。As shown in Figure 7A, in 700A, a third real corpus 701 can be obtained. After obtaining the third real corpus 701, the third real corpus 701 can be translated to obtain the second real corpus 702.
在获得第二真实语料集702之后,可以根据第二真实语料集702,确定与第二真实语料集702语种相同的第一真实语料集703。在获得第一真实语料集703之后,可以根据第一真实语料集703和第二真实语料集702确定真实语料集704。After obtaining the second real corpus 702, the first real corpus 703 that has the same language as the second real corpus 702 can be determined based on the second real corpus 702. After obtaining the first real corpus 703, the real corpus 704 may be determined based on the first real corpus 703 and the second real corpus 702.
图7B示意性示出了根据本公开实施例的模拟语料集的生成方法的示例示意图。FIG. 7B schematically shows an example schematic diagram of a method for generating a simulation corpus according to an embodiment of the present disclosure.
如图7B所示,在700B中,可以预先设置预定文本参数705和预定随机噪声数据706。可以基于预定文本参数705生成第一模拟语料集707。可以基于预定随机噪声数据706生成第二模拟语料集708。As shown in FIG. 7B, in 700B, a predetermined text parameter 705 and a predetermined random noise data 706 may be set in advance. A first simulation corpus 707 may be generated based on predetermined text parameters 705 . A second simulated corpus 708 may be generated based on the predetermined random noise data 706 .
在获得第一模拟语料集707和第二模拟语料集708之后,可以根据第一模拟语料集707和第二模拟语料集708确定模拟语料集709。After obtaining the first simulation corpus 707 and the second simulation corpus 708 , the simulation corpus 709 may be determined based on the first simulation corpus 707 and the second simulation corpus 708 .
根据本公开的实施例,操作S640可以包括如下操作。According to an embodiment of the present disclosure, operation S640 may include the following operations.
利用正样本和负样本训练对话生成模型,得到信息生成模型。Use positive samples and negative samples to train the dialogue generation model and obtain the information generation model.
根据本公开的实施例,正样本可以包括第一样本查询信息、第一样本理解信息、第一样本理解标签信息、第一样本对话应答信息和第一样本对话应答标签信息。According to an embodiment of the present disclosure, the positive sample may include first sample query information, first sample understanding information, first sample understanding label information, first sample dialogue response information, and first sample dialogue response label information.
根据本公开的实施例,负样本可以包括第一样本查询信息、第一样本理解信息、第二样本理解标签信息、第一样本对话应答信息和第二样本对话应答标签信息。According to an embodiment of the present disclosure, the negative sample may include first sample query information, first sample understanding information, second sample understanding label information, first sample dialogue response information, and second sample dialogue response label information.
根据本公开的实施例,第一样本理解标签信息可以用于表征正常标签信息。第一样本对话应答标签信息可以用于表征正常标签信息。第二样本理解标签信息和第二样本对话应答标签信息中的至少之一可以是异常标签信息。According to embodiments of the present disclosure, the first sample understanding label information may be used to characterize normal label information. The first sample dialogue response tag information can be used to characterize normal tag information. At least one of the second sample understanding label information and the second sample dialogue response label information may be abnormal label information.
根据本公开的实施例,在对比学习中,对父样本进行数据增强得到的子样本被认为是针对父样本的正样本,这是由于子样本与父样本的类别相同,彼此保持相同的语义信息。父样本可以指作为进行数据增强处理对象的样本。针对同一父样本,可以对该父样本进行多次数据增强,从而得到多个子样本。虽然是针对同一父样本的多个子样本,但是多个子样本也存在细微区别,即,多个子样本也并不是完全一致的。负样本可以指与父样本的类别不同的其他样本。在本公开实施例中正样本可以包括父样本和对父样本进行数据增强得到的正样本。According to embodiments of the present disclosure, in contrastive learning, the sub-sample obtained by performing data enhancement on the parent sample is considered to be a positive sample for the parent sample. This is because the sub-sample and the parent sample have the same category and maintain the same semantic information with each other. . The parent sample may refer to the sample that is the target of data enhancement processing. For the same parent sample, multiple data enhancements can be performed on the parent sample to obtain multiple subsamples. Although it is for multiple subsamples of the same parent sample, there are subtle differences between the multiple subsamples, that is, the multiple subsamples are not completely consistent. Negative samples can refer to other samples that are of a different category than the parent sample. In this embodiment of the present disclosure, positive samples may include parent samples and positive samples obtained by performing data enhancement on the parent samples.
根据本公开的实施例,通过利用正样本和负样本训练对话生成模型,得到信息生成模型,由此提高了信息生成模型的学习能力。According to embodiments of the present disclosure, the information generation model is obtained by training the dialogue generation model using positive samples and negative samples, thereby improving the learning ability of the information generation model.
以上仅是示例性实施例,但不限于此,还可以包括本领域已知的其他预训练模型的训练方法,只要能够提高信息生成模型的信息生成能力即可。The above are only exemplary embodiments, but are not limited thereto. Other pre-training model training methods known in the art may also be included, as long as the information generation capability of the information generation model can be improved.
图8示意性示出了根据本公开实施例的信息生成装置的框图。FIG. 8 schematically shows a block diagram of an information generating device according to an embodiment of the present disclosure.
如图8所示,信息生成装置800可以包括第一语义理解模块810、第一获得模块820和第一生成模块830。As shown in FIG. 8 , the information generating device 800 may include a first semantic understanding module 810 , a first obtaining module 820 and a first generating module 830 .
第一语义理解模块810,用于对查询信息进行语义理解,得到理解信息,其中,查询信息包括历史对话信息,理解信息包括对象动作和对话状态。The first semantic understanding module 810 is used to perform semantic understanding on the query information to obtain understanding information, where the query information includes historical dialogue information, and the understanding information includes object actions and dialogue states.
第一获得模块820,用于响应于检测到辅助请求指令,根据查询信息和理解信息,得到辅助请求信息。The first obtaining module 820 is configured to obtain the assistance request information based on the query information and understanding information in response to detecting the assistance request instruction.
第一生成模块830,用于根据查询信息、理解信息和辅助请求信息,生成对话应答信息。The first generation module 830 is used to generate dialogue response information based on query information, understanding information and auxiliary request information.
根据本公开的实施例,第一生成模块830可以包括第一确定子模块和第一生成子模块。According to an embodiment of the present disclosure, the first generating module 830 may include a first determining sub-module and a first generating sub-module.
第一确定子模块,用于从数据源中确定与辅助请求信息对应的辅助应答信息。The first determination sub-module is used to determine the assistance response information corresponding to the assistance request information from the data source.
第一生成子模块,用于根据查询信息、理解信息和辅助应答信息,生成对话应答信息。The first generation sub-module is used to generate dialogue response information based on query information, understanding information and auxiliary response information.
根据本公开的实施例,第一生成子模块可以包括融合单元和生成单元。According to embodiments of the present disclosure, the first generation sub-module may include a fusion unit and a generation unit.
融合单元,用于将查询信息、理解信息和辅助应答信息进行融合,得到第一融合信息。The fusion unit is used to fuse the query information, understanding information and auxiliary response information to obtain the first fusion information.
生成单元,用于根据第一融合信息,生成对话应答信息。A generating unit configured to generate dialogue response information based on the first fusion information.
根据本公开的实施例,生成单元可以包括第一编码子单元、第一解码子单元和第一生成子单元。According to embodiments of the present disclosure, the generation unit may include a first encoding sub-unit, a first decoding sub-unit, and a first generation sub-unit.
第一编码子单元,用于对第一融合信息进行编码,得到第一编码信息。The first encoding subunit is used to encode the first fusion information to obtain the first encoded information.
第一解码子单元,用于对第一编码信息进行自解码,得到中间解码信息。The first decoding subunit is used to self-decode the first encoded information to obtain intermediate decoded information.
第一生成子单元,用于根据第一编码信息和中间解码信息,生成对话应答信息。The first generating subunit is used to generate dialogue response information based on the first encoded information and the intermediate decoded information.
根据本公开的实施例,生成单元可以包括第二编码子单元和第二解码子单元。According to embodiments of the present disclosure, the generation unit may include a second encoding subunit and a second decoding subunit.
第二编码子单元,用于对第一融合信息进行编码,得到第二编码信息。The second encoding subunit is used to encode the first fusion information to obtain the second encoded information.
第二解码子单元,用于对第二编码信息进行解码,得到对话应答信息。The second decoding subunit is used to decode the second encoded information to obtain dialogue response information.
根据本公开的实施例,生成单元可以包括第二生成子单元、第一融合子单元和第一确定子单元。According to embodiments of the present disclosure, the generation unit may include a second generation subunit, a first fusion subunit, and a first determination subunit.
第二生成子单元,用于根据第一融合信息,生成至少一个第一候选对话应答信息。The second generating subunit is configured to generate at least one first candidate dialogue response information according to the first fusion information.
第一融合子单元,用于分别将至少一个第一候选对话应答信息和第一融合信息进行融合,得到至少一个第二融合信息。The first fusion subunit is used to fuse at least one first candidate dialogue response information and the first fusion information respectively to obtain at least one second fusion information.
第一确定子单元,用于根据至少一个第二融合信息,从至少一个第一候选对话应答信息中确定对话应答信息。The first determining subunit is configured to determine dialogue response information from at least one first candidate dialogue response information based on at least one second fusion information.
根据本公开的实施例,生成单元可以包括第二融合子单元、第三生成子单元和第二确定子单元。According to embodiments of the present disclosure, the generation unit may include a second fusion subunit, a third generation subunit, and a second determination subunit.
第二融合子单元,用于分别将至少一个第一隐变量信息和第一融合信息进行融合,得到至少一个第三融合信息。The second fusion subunit is used to fuse at least one first latent variable information and the first fusion information respectively to obtain at least one third fusion information.
第三生成子单元,用于根据至少一个第三融合信息,生成至少一个第二候选对话应答信息。The third generation subunit is configured to generate at least one second candidate dialogue response information based on at least one third fusion information.
第二确定子单元,用于根据与至少一个第二候选对话应答信息对应的评估值,从至少一个第二候选对话应答信息中确定对话应答信息。The second determination subunit is configured to determine dialogue response information from at least one second candidate dialogue response information based on an evaluation value corresponding to the at least one second candidate dialogue response information.
根据本公开的实施例,第一语义理解模块810可以包括第一融合子模块、第一生成子模块和第二确定子模块。According to an embodiment of the present disclosure, the first semantic understanding module 810 may include a first fusion sub-module, a first generating sub-module and a second determining sub-module.
第一融合子模块,用于分别将至少一个第二隐变量信息和查询信息进行融合,得到至少一个第四融合信息。The first fusion sub-module is used to fuse at least one second latent variable information and the query information respectively to obtain at least one fourth fusion information.
第一生成子模块,用于根据至少一个第四融合信息,生成至少一个第一候选理解信息。The first generation sub-module is used to generate at least one first candidate understanding information based on at least one fourth fusion information.
第二确定子模块,用于根据与至少一个第一候选理解信息对应的评估值,从至少一个第一候选理解信息中确定理解信息。The second determination sub-module is used to determine understanding information from at least one first candidate understanding information according to the evaluation value corresponding to the at least one first candidate understanding information.
根据本公开的实施例,第一语义理解模块810可以包括第二生成子模块、第二融合子模块和第三确定子模块。According to an embodiment of the present disclosure, the first semantic understanding module 810 may include a second generating sub-module, a second fusion sub-module and a third determining sub-module.
第二生成子模块,用于根据查询信息,生成至少一个第二候选理解信息。The second generation sub-module is used to generate at least one second candidate understanding information according to the query information.
第二融合子模块,用于分别将至少一个第二候选理解信息和查询信息进行融合,得到至少一个第五融合信息。The second fusion sub-module is used to fuse at least one second candidate understanding information and the query information respectively to obtain at least one fifth fusion information.
第三确定子模块,用于根据至少一个第五融合信息,从至少一个第二候选理解信息中确定理解信息。The third determination sub-module is used to determine understanding information from at least one second candidate understanding information according to at least one fifth fusion information.
根据本公开的实施例,信息生成装置800还可以包括第三生成模块。According to an embodiment of the present disclosure, the information generation device 800 may further include a third generation module.
第三生成模块,用于响应于检测到非辅助请求指令,直接根据查询信息和理解信息,生成对话应答信息。The third generation module is used to generate dialogue response information directly based on the query information and understanding information in response to detecting the non-auxiliary request instruction.
根据本公开的实施例,查询信息还包括查询词槽。According to an embodiment of the present disclosure, the query information further includes a query word slot.
根据本公开的实施例,历史对话信息包括系统历史对话信息和对象历史对话信息,系统历史对话信息包括系统标识和与系统标识对应的历史对话信息,对象历史对话信息包括对象标识和与对象标识对应的历史对话信息。According to an embodiment of the present disclosure, the historical dialogue information includes system historical dialogue information and object historical dialogue information. The system historical dialogue information includes a system identification and historical dialogue information corresponding to the system identification. The object historical dialogue information includes an object identification and a corresponding object identification. historical conversation information.
根据本公开的实施例,理解信息还包括与对象动作对应的动作标识和与对话状态对应的状态标识。According to an embodiment of the present disclosure, the understanding information further includes an action identifier corresponding to the object action and a state identifier corresponding to the conversation state.
图9示意性示出了根据本公开实施例的预训练模型的训练装置的框图。Figure 9 schematically shows a block diagram of a training device for a pre-trained model according to an embodiment of the present disclosure.
如图9所示,预训练模型的训练装置900可以包括第二语义理解模块910、第二获得模块920、第二生成模块930和训练模块940。As shown in FIG. 9 , the training device 900 of the pre-training model may include a second semantic understanding module 910 , a second acquisition module 920 , a second generation module 930 and a training module 940 .
第二语义理解模块910,用于对第一样本查询信息进行语义理解,得到第一样本理解信息,其中,第一样本查询信息包括第一样本历史对话信息,第一样本理解信息包括第一样本对象动作和第一样本对话状态。The second semantic understanding module 910 is used to perform semantic understanding on the first sample query information to obtain the first sample understanding information, where the first sample query information includes the first sample historical dialogue information, and the first sample understanding information The information includes a first sample object action and a first sample conversation state.
第二获得模块920,用于根据第一样本查询信息和第一样本理解信息,得到第一样本辅助请求信息。The second obtaining module 920 is used to obtain the first sample assistance request information according to the first sample query information and the first sample understanding information.
第二生成模块930,用于根据第一样本查询信息、第一样本理解信息和第一样本辅助请求信息,生成第一样本对话应答信息。The second generation module 930 is configured to generate first sample dialogue response information based on the first sample query information, the first sample understanding information, and the first sample assistance request information.
训练模块940,用于利用第一样本查询信息、第一样本理解信息和第一样本对话应答信息训练预训练对话生成模型,得到信息生成模型。The training module 940 is used to train the pre-trained dialogue generation model using the first sample query information, the first sample understanding information and the first sample dialogue response information to obtain an information generation model.
根据本公开的实施例,预训练模型的训练装置900还可以包括获取模块。According to an embodiment of the present disclosure, the training device 900 of the pre-trained model may further include an acquisition module.
获取模块,用于从语料集中获取样本历史对话信息,其中,语料集包括以下至少之一:真实语料集和模拟语料集。The acquisition module is used to obtain sample historical dialogue information from the corpus, where the corpus includes at least one of the following: a real corpus and a simulated corpus.
根据本公开的实施例,真实语料集包括第一真实语料集和第二真实语料集,其中,第二真实语料集是将第三真实语料集进行译文翻译得到的,第一真实语料集和第二真实语料集的语种相同。According to an embodiment of the present disclosure, the real corpus includes a first real corpus and a second real corpus, where the second real corpus is obtained by translating the third real corpus, and the first real corpus and the third real corpus The languages of the two real corpora are the same.
根据本公开的实施例,模拟语料集是基于以下方式至少之一生成的:基于预定文本参数生成的和基于生成对抗网络模型处理预定随机噪声数据生成的。According to an embodiment of the present disclosure, the simulation corpus is generated based on at least one of the following ways: generated based on predetermined text parameters and generated based on a generative adversarial network model processing predetermined random noise data.
根据本公开的实施例,训练模块940可以包括训练子模块。According to embodiments of the present disclosure, the training module 940 may include a training sub-module.
训练子模块,用于利用正样本和负样本训练对话生成模型,得到信息生成模型。The training submodule is used to train the dialogue generation model using positive samples and negative samples to obtain the information generation model.
根据本公开的实施例,正样本包括第一样本查询信息、第一样本理解信息、第一样本理解标签信息、第一样本对话应答信息和第一样本对话应答标签信息。According to an embodiment of the present disclosure, the positive sample includes first sample query information, first sample understanding information, first sample understanding label information, first sample dialogue response information, and first sample dialogue response label information.
根据本公开的实施例,负样本包括第一样本查询信息、第一样本理解信息、第二样本理解标签信息、第一样本对话应答信息和第二样本对话应答标签信息,第二样本理解标签信息和第二样本对话应答标签信息中的至少之一是异常标签信息。According to an embodiment of the present disclosure, the negative sample includes first sample query information, first sample understanding information, second sample understanding label information, first sample dialogue response information, and second sample dialogue response label information. The second sample At least one of the understanding tag information and the second sample conversation response tag information is anomaly tag information.
根据本公开的实施例,本公开还提供了一种电子设备、一种可读存储介质和一种计算机程序产品。According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
根据本公开的实施例,一种电子设备,包括:至少一个处理器;以及与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行如本公开所述的方法。According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by at least one processor, and the instructions are processed by at least one processor. The processor executes, so that at least one processor can execute the method as described in the present disclosure.
根据本公开的实施例,一种存储有计算机指令的非瞬时计算机可读存储介质,其中,计算机指令用于使计算机执行如本公开所述的方法。According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions are used to cause a computer to perform a method as described in the present disclosure.
根据本公开的实施例,一种计算机程序产品,包括计算机程序,计算机程序在被处理器执行时实现如本公开所述的方法。According to an embodiment of the present disclosure, a computer program product includes a computer program, and when executed by a processor, the computer program implements the method according to the present disclosure.
图10示意性示出了根据本公开实施例的适于实现信息生成方法和预训练模型的训练方法的电子设备的框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。FIG. 10 schematically shows a block diagram of an electronic device suitable for implementing the information generation method and the training method of the pre-training model according to an embodiment of the present disclosure. Electronic devices are intended to refer to various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are examples only and are not intended to limit implementations of the disclosure described and/or claimed herein.
如图10所示,电子设备1000包括计算单元1001,其可以根据存储在只读存储器(ROM)1002中的计算机程序或者从存储单元1008加载到随机访问存储器(RAM)1003中的计算机程序,来执行各种适当的动作和处理。在RAM 1003中,还可存储电子设备1000操作所需的各种程序和数据。计算单元1001、ROM 1002以及RAM 1003通过总线1004彼此相连。输入/输出(I/O)接口1005也连接至总线1004。As shown in FIG. 10 , the electronic device 1000 includes a computing unit 1001 that can perform calculations according to a computer program stored in a read-only memory (ROM) 1002 or loaded from a storage unit 1008 into a random access memory (RAM) 1003 . Perform various appropriate actions and processing. In the RAM 1003, various programs and data required for the operation of the electronic device 1000 can also be stored. Computing unit 1001, ROM 1002 and RAM 1003 are connected to each other via bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
电子设备1000中的多个部件连接至I/O接口1005,包括:输入单元1006,例如键盘、鼠标等;输出单元1007,例如各种类型的显示器、扬声器等;存储单元1008,例如磁盘、光盘等;以及通信单元1009,例如网卡、调制解调器、无线通信收发机等。通信单元1009允许电子设备1000通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Multiple components in the electronic device 1000 are connected to the I/O interface 1005, including: input unit 1006, such as a keyboard, mouse, etc.; output unit 1007, such as various types of displays, speakers, etc.; storage unit 1008, such as a magnetic disk, optical disk etc.; and communication unit 1009, such as network card, modem, wireless communication transceiver, etc. The communication unit 1009 allows the electronic device 1000 to exchange information/data with other devices through a computer network such as the Internet and/or various telecommunications networks.
计算单元1001可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元1001的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元1001执行上文所描述的各个方法和处理,例如信息生成方法和预训练模型的训练方法。例如,在一些实施例中,信息生成方法和预训练模型的训练方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元1008。在一些实施例中,计算机程序的部分或者全部可以经由ROM 1002和/或通信单元1009而被载入和/或安装到电子设备1000上。当计算机程序加载到RAM 1003并由计算单元1001执行时,可以执行上文描述的信息生成方法和预训练模型的训练方法的一个或多个步骤。备选地,在其他实施例中,计算单元1001可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行信息生成方法和预训练模型的训练方法。Computing unit 1001 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processing processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 1001 performs the various methods and processes described above, such as the information generation method and the training method of the pre-trained model. For example, in some embodiments, the information generation method and the training method of the pre-trained model may be implemented as a computer software program, which is tangibly embodied in a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 1000 via the ROM 1002 and/or the communication unit 1009 . When the computer program is loaded into the RAM 1003 and executed by the computing unit 1001, one or more steps of the information generation method and the training method of the pre-trained model described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the information generation method and the training method of the pre-trained model in any other suitable manner (eg, by means of firmware).
本文中以上描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、芯片上系统的系统(SOC)、复杂可编程逻辑设备(CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described above may be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip implemented in a system (SOC), complex programmable logic device (CPLD), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include implementation in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor The processor, which may be a special purpose or general purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device. An output device.
用于实施本公开的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that the program codes, when executed by the processor or controller, cause the functions specified in the flowcharts and/or block diagrams/ The operation is implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of this disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, laptop disks, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer. Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and may be provided in any form, including Acoustic input, voice input or tactile input) to receive input from the user.
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., A user's computer having a graphical user interface or web browser through which the user can interact with implementations of the systems and technologies described herein), or including such backend components, middleware components, or any combination of front-end components in a computing system. The components of the system may be interconnected by any form or medium of digital data communication (eg, a communications network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,也可以是分布式系统的服务器,或者是结合了区块链的服务器。Computer systems may include clients and servers. Clients and servers are generally remote from each other and typically interact over a communications network. The relationship of client and server is created by computer programs running on corresponding computers and having a client-server relationship with each other. The server can be a cloud server, a distributed system server, or a server combined with a blockchain.
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that various forms of the process shown above may be used, with steps reordered, added or deleted. For example, each step described in the present disclosure can be executed in parallel, sequentially, or in a different order. As long as the desired results of the technical solution disclosed in the present disclosure can be achieved, there is no limitation here.
上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。The above-mentioned specific embodiments do not constitute a limitation on the scope of the present disclosure. It will be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions are possible depending on design requirements and other factors. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this disclosure shall be included in the protection scope of this disclosure.
Claims (20)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211742317.3A CN116050427B (en) | 2022-12-30 | 2022-12-30 | Information generation method, training device, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211742317.3A CN116050427B (en) | 2022-12-30 | 2022-12-30 | Information generation method, training device, electronic equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN116050427A CN116050427A (en) | 2023-05-02 |
| CN116050427B true CN116050427B (en) | 2023-10-27 |
Family
ID=86123256
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211742317.3A Active CN116050427B (en) | 2022-12-30 | 2022-12-30 | Information generation method, training device, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116050427B (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20200092455A (en) * | 2019-01-04 | 2020-08-04 | 주식회사 케이티 | Server, method and computer program for predicting intention of user |
| CN111666385A (en) * | 2019-03-07 | 2020-09-15 | 南京邮电大学 | Customer service question-answering system based on deep learning and implementation method |
| CN112365892A (en) * | 2020-11-10 | 2021-02-12 | 杭州大搜车汽车服务有限公司 | Man-machine interaction method, device, electronic device and storage medium |
| WO2022057712A1 (en) * | 2020-09-15 | 2022-03-24 | 华为技术有限公司 | Electronic device and semantic parsing method therefor, medium, and human-machine dialog system |
| CN114490985A (en) * | 2022-01-25 | 2022-05-13 | 北京百度网讯科技有限公司 | Dialog generation method and device, electronic equipment and storage medium |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8275803B2 (en) * | 2008-05-14 | 2012-09-25 | International Business Machines Corporation | System and method for providing answers to questions |
| CN107612814A (en) * | 2017-09-08 | 2018-01-19 | 北京百度网讯科技有限公司 | Method and apparatus for generating candidate's return information |
-
2022
- 2022-12-30 CN CN202211742317.3A patent/CN116050427B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20200092455A (en) * | 2019-01-04 | 2020-08-04 | 주식회사 케이티 | Server, method and computer program for predicting intention of user |
| CN111666385A (en) * | 2019-03-07 | 2020-09-15 | 南京邮电大学 | Customer service question-answering system based on deep learning and implementation method |
| WO2022057712A1 (en) * | 2020-09-15 | 2022-03-24 | 华为技术有限公司 | Electronic device and semantic parsing method therefor, medium, and human-machine dialog system |
| CN112365892A (en) * | 2020-11-10 | 2021-02-12 | 杭州大搜车汽车服务有限公司 | Man-machine interaction method, device, electronic device and storage medium |
| CN114490985A (en) * | 2022-01-25 | 2022-05-13 | 北京百度网讯科技有限公司 | Dialog generation method and device, electronic equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN116050427A (en) | 2023-05-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20220358292A1 (en) | Method and apparatus for recognizing entity, electronic device and storage medium | |
| CN115309877B (en) | Dialogue generation method, dialogue model training method and device | |
| CN114548110A (en) | Semantic understanding method and device, electronic equipment and storage medium | |
| CN115238045B (en) | Method, system and storage medium for extracting generation type event argument | |
| CN113553411B (en) | Query statement generation method and device, electronic equipment and storage medium | |
| CN117421398A (en) | Man-machine interaction method, device, equipment and storage medium | |
| US20250021610A1 (en) | Human-machine interaction method and apparatus, electronic device and storage medium | |
| CN111104796B (en) | Method and device for translation | |
| CN117236340A (en) | Question and answer methods, devices, equipment and media | |
| CN113204616B (en) | Training of text extraction model and text extraction method and device | |
| CN116187301A (en) | Model generation, entity recognition method, device, electronic device and storage medium | |
| CN112528654A (en) | Natural language processing method and device and electronic equipment | |
| CN117391185A (en) | Student model generation method and device based on large model | |
| CN118673038A (en) | Index acquisition method, apparatus, electronic device and computer readable storage medium | |
| CN114722841B (en) | Translation method, translation device and computer program product | |
| CN114416941B (en) | Method and device for generating dialogue knowledge point determination model fused with knowledge graph | |
| US12106062B2 (en) | Method and apparatus for generating a text, and storage medium | |
| CN113360590B (en) | Method and device for updating interest point information, electronic equipment and storage medium | |
| CN115481229A (en) | Method and device for pushing answer call, electronic equipment and storage medium | |
| CN112559715B (en) | Attitude recognition methods, devices, equipment and storage media | |
| CN112650844B (en) | Method and device for tracking dialogue state, electronic equipment and storage medium | |
| JP2024170588A (en) | Text detection method, training method, device, equipment, medium and program | |
| CN117198289B (en) | Voice interaction method, device, equipment, medium and product | |
| CN116050427B (en) | Information generation method, training device, electronic equipment and storage medium | |
| CN115577106B (en) | Text classification methods, devices, equipment and media based on artificial intelligence |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |