[go: up one dir, main page]

CN117076623A - Session processing method, session processing device, electronic equipment and computer readable storage medium - Google Patents

Session processing method, session processing device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN117076623A
CN117076623A CN202310891398.1A CN202310891398A CN117076623A CN 117076623 A CN117076623 A CN 117076623A CN 202310891398 A CN202310891398 A CN 202310891398A CN 117076623 A CN117076623 A CN 117076623A
Authority
CN
China
Prior art keywords
query
session
intention
response
content
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.)
Pending
Application number
CN202310891398.1A
Other languages
Chinese (zh)
Inventor
彭子娇
崔宇星
张伟彬
陈东鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Voiceai Technologies Co ltd
Original Assignee
Voiceai Technologies Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Voiceai Technologies Co ltd filed Critical Voiceai Technologies Co ltd
Priority to CN202310891398.1A priority Critical patent/CN117076623A/en
Publication of CN117076623A publication Critical patent/CN117076623A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computational Linguistics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请提供了一种会话处理方法、装置、电子设备及计算机可读存储介质;方法包括:获取会话对象在会话中输入的询问内容;对询问内容进行意图识别处理,得到询问意图;根据询问意图确定对应的应答内容,并根据应答内容在会话中进行应答处理;根据会话中针对同一询问意图进行应答处理的次数,对会话进行控制处理。通过本申请,能够提升会话效率,避免陷入到无限循环对话的情形中。

This application provides a conversation processing method, device, electronic equipment and computer-readable storage medium; the method includes: obtaining the inquiry content input by the conversation object in the session; performing intent recognition processing on the inquiry content to obtain the inquiry intention; according to the inquiry intention Determine the corresponding response content, and perform response processing in the session based on the response content; control the session based on the number of response processing for the same query intention in the session. Through this application, conversation efficiency can be improved and the situation of endless loop conversations can be avoided.

Description

会话处理方法、装置、电子设备及计算机可读存储介质Session processing method, device, electronic device and computer-readable storage medium

技术领域Technical field

本申请涉及计算机技术领域,具体涉及一种会话处理方法、装置、电子设备及计算机可读存储介质。The present application relates to the field of computer technology, and specifically to a session processing method, device, electronic device and computer-readable storage medium.

背景技术Background technique

人工智能(Artificial Intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。人机对话(Human-Machine Conversation)是人工智能的一个重要分支,是指让机器理解和运用自然语言实现人机通信的技术,现今已广泛应用到客服、导航、购物指引等多种场景中。Artificial Intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. Human-Machine Conversation is an important branch of artificial intelligence. It refers to the technology that allows machines to understand and use natural language to achieve human-machine communication. It has now been widely used in customer service, navigation, shopping guidance and other scenarios.

然而,在相关技术中,通常是按照固定流程对用户的询问内容进行反馈,如果用户反复重复类似的话术,则会出现重复反馈相同内容的情况,整个流程会陷入到无限循环中,导致会话效率低。However, in related technologies, feedback to the user's inquiry content is usually based on a fixed process. If the user repeatedly repeats similar words, the same content will be repeatedly fed back, and the entire process will fall into an infinite loop, resulting in conversational inefficiency. Low.

发明内容Contents of the invention

本申请实施例提供一种会话处理方法、装置、电子设备及计算机可读存储介质,能够准确识别出用户是否在重复询问,进而提升会话效率。Embodiments of the present application provide a conversation processing method, device, electronic device and computer-readable storage medium, which can accurately identify whether the user is repeatedly asking, thereby improving conversation efficiency.

本申请实施例的技术方案是这样实现的:The technical solution of the embodiment of this application is implemented as follows:

本申请实施例提供一种会话处理方法,包括:The embodiment of this application provides a session processing method, including:

获取会话对象在会话中输入的询问内容;Get the query content entered by the session object in the session;

对所述询问内容进行意图识别处理,得到询问意图;Perform intention recognition processing on the inquiry content to obtain the inquiry intention;

根据所述询问意图确定对应的应答内容,并根据所述应答内容在所述会话中进行应答处理;Determine the corresponding response content according to the inquiry intention, and perform response processing in the session according to the response content;

根据所述会话中针对同一询问意图进行应答处理的次数,对所述会话进行控制处理。The session is controlled based on the number of times the response processing is performed for the same inquiry intention in the session.

本申请实施例提供一种会话处理装置,包括:An embodiment of the present application provides a session processing device, including:

获取模块,用于获取会话对象在会话中输入的询问内容;The acquisition module is used to obtain the query content entered by the session object in the session;

意图识别模块,用于对所述询问内容进行意图识别处理,得到询问意图;An intent recognition module, used to perform intent recognition processing on the query content to obtain the query intent;

应答模块,用于根据所述询问意图确定对应的应答内容,并根据所述应答内容在所述会话中进行应答处理;A response module, configured to determine the corresponding response content according to the inquiry intention, and to perform response processing in the session according to the response content;

控制模块,用于根据所述会话中针对同一询问意图进行应答处理的次数,对所述会话进行控制处理。A control module, configured to control the session according to the number of times of response processing for the same inquiry intention in the session.

本申请实施例提供一种电子设备,包括:An embodiment of the present application provides an electronic device, including:

存储器,用于存储可执行指令;Memory, used to store executable instructions;

处理器,用于执行所述存储器中存储的可执行指令时,实现本申请实施例提供的会话处理方法。The processor is configured to implement the session processing method provided by the embodiment of the present application when executing executable instructions stored in the memory.

本申请实施例提供一种计算机可读存储介质,存储有可执行指令,用于引起处理器执行时,实现本申请实施例提供的会话处理方法。Embodiments of the present application provide a computer-readable storage medium that stores executable instructions for causing a processor to implement the session processing method provided by embodiments of the present application when executed.

本申请实施例提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括可执行指令,该可执行指令存储在计算机可读存储介质中。电子设备的处理器从计算机可读存储介质读取该可执行指令,处理器执行该可执行指令,使得该电子设备执行本申请实施例上述的会话处理方法。Embodiments of the present application provide a computer program product or computer program. The computer program product or computer program includes executable instructions, and the executable instructions are stored in a computer-readable storage medium. The processor of the electronic device reads the executable instruction from the computer-readable storage medium, and the processor executes the executable instruction, so that the electronic device executes the session processing method described above in the embodiment of the present application.

本申请实施例具有以下有益效果:The embodiments of this application have the following beneficial effects:

本申请实施例应用于对话过程,首先获取会话对象在会话中输入的询问内容,对询问内容进行意图识别处理得到询问意图,根据询问意图确定对应的应答内容,并根据应答内容在会话中进行应答处理,从而实现对询问内容的反馈。根据会话中针对同一询问意图进行应答处理的次数,对会话进行控制处理,通过进行控制而非放任其陷入无限循环对话的情形,能够有效提升会话效率。The embodiment of the present application is applied to the conversation process. First, the query content input by the conversation object in the conversation is obtained, the query content is subjected to intent recognition processing to obtain the query intent, the corresponding response content is determined based on the query intent, and the response is made in the conversation based on the response content. processing to provide feedback on the inquiry content. The conversation is controlled based on the number of responses to the same query intention during the conversation. By controlling the conversation instead of letting it fall into an infinite loop of dialogue, conversation efficiency can be effectively improved.

附图说明Description of the drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without exerting creative efforts.

图1是本申请实施例提供的会话处理系统的一个结构示意图;Figure 1 is a schematic structural diagram of a session processing system provided by an embodiment of the present application;

图2是本申请实施例提供的终端设备的一个结构示意图;Figure 2 is a schematic structural diagram of a terminal device provided by an embodiment of the present application;

图3是本申请实施例提供的会话处理方法的一个流程示意图;Figure 3 is a schematic flowchart of the session processing method provided by the embodiment of the present application;

图4是本申请实施例提供的会话处理方法的一个流程示意图;Figure 4 is a schematic flow chart of the session processing method provided by the embodiment of the present application;

图5是本申请实施例提供的异常控制的一个流程示意图;Figure 5 is a schematic flow chart of exception control provided by the embodiment of the present application;

图6是本申请实施例提供的异常控制的一个流程示意图。Figure 6 is a schematic flow chart of exception control provided by the embodiment of the present application.

具体实施方式Detailed ways

为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请作进一步地详细描述,所描述的实施例不应视为对本申请的限制,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be described in further detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. Those of ordinary skill in the art will not make any All other embodiments obtained under the premise of creative work belong to the scope of protection of this application.

在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。在以下的描述中,所涉及的术语“多个”是指至少两个。In the following description, references to "some embodiments" describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or a different subset of all possible embodiments, and Can be combined with each other without conflict. In the following description, the term "plurality" refers to at least two.

除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

在相关技术中,通常是按照固定流程对用户的询问内容进行反馈,如果用户反复重复类似的话术,则会出现重复反馈相同内容的情况,整个流程会陷入到无限循环中。In related technologies, feedback to the user's inquiry content is usually based on a fixed process. If the user repeats similar words repeatedly, the same content will be fed back repeatedly, and the entire process will fall into an infinite loop.

举例来说,在智能语音培训场景中,培训系统的管理员会预设好话术流程,学员需要根据系统提示进行语音培训。若当学员发现说某一句话时,系统一定会做出相同反应,此时,学员有可能会不停重复该话术,让流程不停重复。这样在浪费时间的同时,也会让流程进入一种无限循环中。For example, in an intelligent voice training scenario, the administrator of the training system will preset the speaking process, and students need to follow the system prompts for voice training. If the student discovers that a certain sentence is said, the system will definitely react in the same way. At this time, the student may repeat the sentence repeatedly, causing the process to repeat. This wastes time and also puts the process into an infinite loop.

综上,相关技术提供的方案会导致会话效率低,无法起到有效引导用户的作用。In summary, the solutions provided by related technologies will lead to low conversation efficiency and fail to effectively guide users.

本申请实施例提供一种会话处理方法、装置、电子设备及计算机可读存储介质,能够提升会话效率,对会话对象进行有效引导,减少资源浪费。下面说明本申请实施例提供的电子设备的示例性应用,本申请实施例提供的电子设备可以实施为笔记本电脑,平板电脑,台式计算机,机顶盒,移动设备(例如,移动电话,便携式音乐播放器,个人数字助理,专用消息设备,便携式游戏设备)等各种类型的终端设备,也可以实施为服务器。Embodiments of the present application provide a session processing method, device, electronic device, and computer-readable storage medium, which can improve session efficiency, effectively guide session objects, and reduce resource waste. The following describes exemplary applications of the electronic devices provided by the embodiments of the present application. The electronic devices provided by the embodiments of the present application can be implemented as notebook computers, tablet computers, desktop computers, set-top boxes, mobile devices (for example, mobile phones, portable music players, Various types of terminal devices such as personal digital assistants, dedicated messaging devices, portable gaming devices) can also be implemented as servers.

参见图1,图1是本申请实施例提供的会话处理系统100的一个架构示意图,终端设备400通过网络300连接服务器200,服务器200连接数据库500,其中,网络300可以是广域网或者局域网,又或者是二者的组合。Referring to Figure 1, Figure 1 is an architectural schematic diagram of the session processing system 100 provided by the embodiment of the present application. The terminal device 400 is connected to the server 200 through the network 300, and the server 200 is connected to the database 500. The network 300 can be a wide area network or a local area network, or It's a combination of the two.

在一些实施例中,以电子设备是终端设备为例,本申请实施例提供的会话处理方法可以由终端设备实现。以会话对象为用户举例,用户可以在终端设备400的客户端410中开启人机对话。终端设备400获取用户在会话中输入的询问内容;对询问内容进行意图识别处理得到询问意图;根据询问意图确定对应的应答内容,并根据应答内容在会话中进行应答处理;根据会话中针对同一询问意图进行应答处理的次数,对会话进行控制处理。该场景可以支持离线的人机对话,适用于无网络环境、网络状态差或无需网络的情况。In some embodiments, taking the electronic device as a terminal device as an example, the session processing method provided in the embodiments of this application can be implemented by the terminal device. Taking the conversation object as a user, for example, the user can start a human-machine conversation in the client 410 of the terminal device 400 . The terminal device 400 obtains the inquiry content entered by the user in the session; performs intent recognition processing on the inquiry content to obtain the inquiry intention; determines the corresponding response content according to the inquiry intention, and performs response processing in the session according to the response content; and responds to the same inquiry in the session. The number of times the intention is to perform response processing and control the session. This scenario can support offline human-computer dialogue and is suitable for situations where there is no network environment, poor network status, or no network required.

在一些实施例中,本申请实施例提供的会话处理方法也可以由终端设备和服务器结合实现。例如,用户可以在终端设备400的客户端410中开启人机对话。终端设备400获取用户在会话中输入的询问内容,并将询问内容发送至服务器200。服务器200对询问内容进行意图识别处理,得到询问意图;根据询问意图确定对应的应答内容,并将应答内容发送至终端设备400,由终端设备400根据应答内容在会话中进行应答处理。服务器200根据会话中针对同一询问意图进行应答处理的次数,对所述会话进行控制处理,服务器200可以将控制信息发送至终端设备400,并由终端设备400执行相应操作,例如,服务器200将提示信息发送至终端设备400,由终端设备400在会话中显示。该场景可以借助服务器的计算能力,提升应答及进行异常处理的效率。In some embodiments, the session processing method provided by the embodiments of this application can also be implemented by a combination of a terminal device and a server. For example, the user can start a human-computer conversation in the client 410 of the terminal device 400. The terminal device 400 obtains the query content input by the user in the session, and sends the query content to the server 200 . The server 200 performs intent recognition processing on the query content to obtain the query intent; determines the corresponding response content based on the query intent, and sends the response content to the terminal device 400, and the terminal device 400 performs response processing in the session based on the response content. The server 200 performs control processing on the session according to the number of times of response processing for the same query intention in the session. The server 200 can send the control information to the terminal device 400, and the terminal device 400 performs corresponding operations. For example, the server 200 will prompt The information is sent to the terminal device 400 and displayed by the terminal device 400 in the session. This scenario can use the computing power of the server to improve the efficiency of response and exception handling.

在一些实施例中,终端设备400和/或服务器200可以通过运行计算机程序来实现本申请实施例提供的会话处理方法,例如,计算机程序可以是操作系统中的原生程序或软件模块;可以是本地(Native)应用程序(APP,Application),即需要在操作系统中安装才能运行的程序,如专用于人机对话的应用程序(对应上文的客户端410);也可以是小程序,即只需要下载到浏览器环境中就可以运行的程序;还可以是能够嵌入至任意APP中的小程序或插件,其中,该小程序或插件可以由用户控制运行或关闭。总而言之,上述计算机程序可以是任意形式的应用程序、模块或插件。In some embodiments, the terminal device 400 and/or the server 200 can implement the session processing method provided by the embodiments of the present application by running a computer program. For example, the computer program can be a native program or software module in the operating system; it can be a local program. (Native) application (APP, Application), that is, a program that needs to be installed in the operating system to run, such as an application dedicated to human-machine dialogue (corresponding to the client 410 above); it can also be a small program, which only It can be a program that needs to be downloaded to the browser environment and then run; it can also be a small program or plug-in that can be embedded in any APP, where the small program or plug-in can be run or closed under the user's control. In summary, the computer program described above can be any form of application, module or plug-in.

在一些实施例中,服务器200可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、网络加速服务(Content DeliveryNetwork,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器,其中,云服务可以是会话处理服务,供终端设备400进行调用。终端设备400可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能电视、智能手表等,但并不局限于此。终端设备以及服务器可以通过有线或无线通信方式进行直接或间接地连接,本申请实施例中不做限制。In some embodiments, the server 200 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or may provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, Cloud servers for basic cloud computing services such as network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and big data and artificial intelligence platforms, among which the cloud service can be session processing Service for the terminal device 400 to call. The terminal device 400 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart TV, a smart watch, etc., but is not limited thereto. The terminal device and the server can be connected directly or indirectly through wired or wireless communication methods, which are not limited in the embodiments of this application.

以本申请实施例提供的电子设备是终端设备为例说明,可以理解的,对于电子设备是服务器的情况,图2中示出的结构中的部分(例如用户接口、呈现模块和输入处理模块)可以缺省。参见图2,图2是本申请实施例提供的终端设备400的结构示意图,图2所示的终端设备400包括:至少一个处理器410、存储器450、至少一个网络接口420和用户接口430。终端设备400中的各个组件通过总线系统440耦合在一起。可理解,总线系统440用于实现这些组件之间的连接通信。总线系统440除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图2中将各种总线都标为总线系统440。Taking the electronic device provided by the embodiment of the present application as a terminal device as an example, it can be understood that for the case where the electronic device is a server, parts of the structure shown in Figure 2 (such as user interface, presentation module and input processing module) Can be defaulted. Referring to Figure 2, Figure 2 is a schematic structural diagram of a terminal device 400 provided by an embodiment of the present application. The terminal device 400 shown in Figure 2 includes: at least one processor 410, a memory 450, at least one network interface 420 and a user interface 430. The various components in the terminal device 400 are coupled together via a bus system 440 . It can be understood that the bus system 440 is used to implement connection communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the various buses are labeled bus system 440 in FIG. 2 .

处理器410可以是一种集成电路芯片,具有信号的处理能力,例如通用处理器、数字信号处理器(DSP,Digital Signal Processor),或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等,其中,通用处理器可以是微处理器或者任何常规的处理器等。The processor 410 may be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware. Components, etc., wherein the general processor can be a microprocessor or any conventional processor, etc.

用户接口430包括使得能够呈现媒体内容的一个或多个输出装置431,包括一个或多个扬声器和/或一个或多个视觉显示屏。用户接口430还包括一个或多个输入装置432,包括有助于用户输入的用户接口部件,比如键盘、鼠标、麦克风、触屏显示屏、摄像头、其他输入按钮和控件。User interface 430 includes one or more output devices 431 that enable the presentation of media content, including one or more speakers and/or one or more visual displays. User interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, and other input buttons and controls.

存储器450可以是可移除的,不可移除的或其组合。示例性的硬件设备包括固态存储器,硬盘驱动器,光盘驱动器等。存储器450可选地包括在物理位置上远离处理器410的一个或多个存储设备。Memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, etc. Memory 450 optionally includes one or more storage devices physically located remotely from processor 410 .

存储器450包括易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。非易失性存储器可以是只读存储器(ROM,Read Only Memory),易失性存储器可以是随机存取存储器(RAM,Random Access Memory)。本申请实施例描述的存储器450旨在包括任意适合类型的存储器。Memory 450 includes volatile memory or non-volatile memory, and may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM, Read Only Memory), and the volatile memory may be a random-access memory (RAM, Random Access Memory). The memory 450 described in the embodiments of this application is intended to include any suitable type of memory.

在一些实施例中,存储器450能够存储数据以支持各种操作,这些数据的示例包括程序、模块和数据结构或者其子集或超集,下面示例性说明。In some embodiments, the memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as exemplarily described below.

操作系统451,包括用于处理各种基本系统服务和执行硬件相关任务的系统程序,例如框架层、核心库层、驱动层等,用于实现各种基础业务以及处理基于硬件的任务;The operating system 451 includes system programs used to process various basic system services and perform hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., which are used to implement various basic services and process hardware-based tasks;

网络通信模块452,用于经由一个或多个(有线或无线)网络接口420到达其他计算设备,示例性的网络接口420包括:蓝牙、无线相容性认证(WiFi)、和通用串行总线(USB,Universal Serial Bus)等;Network communications module 452 for reaching other computing devices via one or more (wired or wireless) network interfaces 420, example network interfaces 420 include: Bluetooth, Wireless Compliance Certified (WiFi), and Universal Serial Bus ( USB, Universal Serial Bus), etc.;

呈现模块453,用于经由一个或多个与用户接口430相关联的输出装置431(例如,显示屏、扬声器等)使得能够呈现信息(例如,用于操作外围设备和显示内容和信息的用户接口);Presentation module 453 for enabling the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 (e.g., display screens, speakers, etc.) associated with user interface 430 );

输入处理模块454,用于对一个或多个来自一个或多个输入装置432之一的一个或多个用户输入或互动进行检测以及翻译所检测的输入或互动。An input processing module 454 for detecting one or more user inputs or interactions from one or more input devices 432 and translating the detected inputs or interactions.

在一些实施例中,本申请实施例提供的会话处理装置可以采用软件方式实现,图2示出了存储在存储器450中的会话处理装置455,其可以是程序和插件等形式的软件,包括以下软件模块:获取模块4551、意图识别模块4552、应答模块4553以及控制模块4554,这些模块是逻辑上的,因此根据所实现的功能可以进行任意的组合或进一步拆分。将在下文中说明各个模块的功能。In some embodiments, the session processing device provided by the embodiment of the present application can be implemented in software. Figure 2 shows the session processing device 455 stored in the memory 450, which can be software in the form of programs, plug-ins, etc., including the following Software modules: acquisition module 4551, intention recognition module 4552, response module 4553 and control module 4554. These modules are logical, so they can be combined or further split in any way according to the functions implemented. The functions of each module are explained below.

将结合本申请实施例提供的电子设备的示例性应用和实施,说明本申请实施例提供的会话处理方法。The session processing method provided by the embodiment of the present application will be described with reference to the exemplary application and implementation of the electronic device provided by the embodiment of the present application.

参见图3,图3是本申请实施例提供的会话处理方法的一个流程示意图,将结合图3示出的步骤进行说明。Referring to Figure 3, Figure 3 is a schematic flowchart of a session processing method provided by an embodiment of the present application, which will be described in conjunction with the steps shown in Figure 3.

在步骤101中,获取会话对象在会话中输入的询问内容。In step 101, the query content entered by the conversation object in the conversation is obtained.

这里,建立与会话对象之间的会话,并获取会话对象在会话中输入的询问内容。Here, a session is established with the session object, and the query content entered by the session object in the session is obtained.

本申请实施例对会话对象的类型不做限定,可以是真实用户,也可以是非用户,如脚本程序等。The embodiment of this application does not limit the type of session object. It can be a real user or a non-user, such as a script program.

本申请实施例对询问内容的形式不做限定,可以是多媒体形式,即包含文本、图像以及语音中的至少之一,后文的应答内容同理。在一些实施例中,询问内容可以是用户输入的纯文本消息。The embodiment of the present application does not limit the form of the inquiry content, which may be in a multimedia form, that is, including at least one of text, image, and voice. The same applies to the response content below. In some embodiments, the query content may be a plain text message entered by the user.

在步骤102中,对询问内容进行意图识别处理,得到询问意图。In step 102, intent recognition processing is performed on the inquiry content to obtain the inquiry intention.

在获取到询问内容后,对询问内容进行意图识别处理,得到询问意图。本申请实施例对意图识别处理的方式不做限定,例如可以建立每种询问意图对应的关键词库(如询问意图“打招呼”对应的关键词可以包括“你好”、“hello”等),并对询问内容进行关键词识别处理,若识别出的关键词落入某一关键词库,则将该关键词库对应的询问意图作为该询问内容对应的询问意图;又例如,可以预先训练意图识别模型,并通过训练后的意图识别模型对询问内容进行意图识别处理,得到询问意图,其中,对意图识别模型的类型不做限定,例如可以是卷积神经网络(Convolutional Neural Network,CNN)模型等。After obtaining the inquiry content, perform intention recognition processing on the inquiry content to obtain the inquiry intention. The embodiment of the present application does not limit the method of intention recognition processing. For example, a keyword library corresponding to each inquiry intention can be established (for example, the keywords corresponding to the inquiry intention "say hello" can include "hello", "hello", etc.). And perform keyword recognition processing on the query content. If the identified keywords fall into a certain keyword library, the query intention corresponding to the keyword library will be used as the query intention corresponding to the query content; for another example, the intention can be pre-trained Recognition model, and perform intent recognition processing on the query content through the trained intent recognition model to obtain the query intent. The type of the intent recognition model is not limited, for example, it can be a convolutional neural network (CNN) model. wait.

在步骤103中,根据询问意图确定对应的应答内容,并根据应答内容在会话中进行应答处理。In step 103, the corresponding response content is determined based on the query intention, and response processing is performed in the session based on the response content.

在确定询问内容对应的询问意图后,根据询问意图确定对应的应答内容,并根据应答内容在会话中进行应答处理,例如将应答内容显示于会话界面中,以实现人机对话。After determining the inquiry intention corresponding to the inquiry content, the corresponding response content is determined according to the inquiry intention, and response processing is performed in the session according to the response content, for example, the response content is displayed in the session interface to realize human-computer dialogue.

在一些实施例中,可以通过这样的方式来实现上述的根据询问意图确定对应的应答内容:执行以下任意一种处理:通过应答模型生成与询问意图对应的应答内容;根据询问意图在话术库中进行查询处理,得到应答内容;其中,话术库包括至少一种询问意图以及与每种询问意图对应的至少一个应答内容。In some embodiments, the above-mentioned determination of the corresponding response content based on the query intention can be implemented in this way: performing any of the following processes: generating response content corresponding to the query intention through a response model; Query processing is performed in the query to obtain the response content; wherein the utterance library includes at least one query intention and at least one response content corresponding to each query intention.

这里,提供两种方式来确定应答内容。Here, two methods are provided to determine the response content.

第一种方式是,通过预先训练好的应答模型生成与询问意图对应的应答内容,该方式能够加强应答内容的随机性,提升用户体验。The first method is to use a pre-trained response model to generate response content corresponding to the query intention. This method can enhance the randomness of the response content and improve the user experience.

第二种方式是,提前建立好话术库,该话术库包括至少一种询问意图以及与每种询问意图对应的至少一个应答内容。例如,对于询问意图“打招呼”来说,其在话术库中对应的应答内容包括“您好,有什么需要我的?”、以及“您好,需要我做什么?”。该方式能够提升应答速度,实现快速响应。The second method is to establish a vocabulary library in advance. The vocabulary library includes at least one inquiry intention and at least one response content corresponding to each inquiry intention. For example, for the inquiry intention "Greetings", the corresponding response content in the vocabulary library includes "Hello, what can I do for you?" and "Hello, what do you need from me?". This method can improve the response speed and achieve rapid response.

在步骤104中,根据所述会话中针对同一询问意图进行应答处理的次数,对所述会话进行控制处理。In step 104, the session is controlled according to the number of times of response processing for the same inquiry intention in the session.

上述步骤101~步骤103可能会执行多次,即电子设备与会话对象在会话中进行交互式对话,会话对象每输入一次询问内容,电子设备则进行一次应答处理。The above-mentioned steps 101 to 103 may be executed multiple times, that is, the electronic device and the conversation partner have an interactive dialogue in the conversation. Each time the conversation partner inputs query content, the electronic device performs a response process.

然而,在一些情况下,可能会在会话中进行重复性对话,例如会话对象重复输入类似的询问内容。因此,在本申请实施例中,确定所述会话中针对同一询问意图进行应答处理的次数,根据该次数可以确定会话对象是否存在基于同一询问意图重复询问的嫌疑,进而对所述会话进行相应的控制处理,该控制处理可以包括关闭会话、进行提示、以及继续执行步骤101中的至少之一。However, in some cases, repetitive conversations may occur within a conversation, such as conversation subjects repeatedly typing similar queries. Therefore, in the embodiment of the present application, the number of times of response processing for the same inquiry intention in the conversation is determined. Based on this number, it can be determined whether the conversation object is suspected of repeated inquiry based on the same inquiry intention, and then the conversation is processed accordingly. Control processing, which may include at least one of closing the session, prompting, and continuing to perform step 101.

值得说明的是,对于“所述会话中针对同一询问意图进行应答处理的次数”的统计时机,本申请实施例不做限定,例如,电子设备可以在每进行一次应答处理时进行统计,也可以每隔预设周期(如一分钟)进行统计。It is worth noting that the embodiment of the present application does not limit the timing of counting "the number of times a response is processed for the same query intention in the session". For example, the electronic device can count every time a response is processed, or it can Statistics are performed every preset period (such as one minute).

在一些实施例中,会话中针对同一询问意图进行应答处理的次数包括以下任意一种:针对同一询问意图进行连续应答处理的次数;针对同一询问意图进行累计应答处理的次数。In some embodiments, the number of times of response processing for the same inquiry intention in a session includes any of the following: the number of consecutive response processes for the same inquiry intention; the cumulative number of response processes for the same inquiry intention.

这里,针对同一询问意图进行应答处理的次数可以是连续应答处理的次数,也可以是累计应答处理的次数,以下将进行分别说明。Here, the number of times of response processing for the same inquiry intention may be the number of consecutive response processes or the number of cumulative response processes, which will be described separately below.

第一种是连续应答处理的次数,这要求针对同一询问意图的应答处理必须连续出现。例如,会话对象连续输入3条均对应询问意图A的询问内容,则电子设备在对最后1条询问内容进行应答处理后,确定针对询问意图A进行连续应答处理的次数为3。又例如,会话对象连续输入2条均对应询问意图A的询问内容后,又输入1条对应询问意图B的询问内容,则电子设备在对最后1条询问内容进行应答处理后,对针对询问意图A进行连续应答处理的次数进行清零,其后,若会话对象又输入1条对应询问意图B的询问内容,则电子设备在进行相应应答处理后,确定针对询问意图B进行连续应答处理的次数为2。连续应答处理对于连续性要求较高,适用于对重复对话监管要求较高的场景。The first is the number of consecutive response processes, which requires that response processes for the same inquiry intention must appear continuously. For example, if the conversation partner continuously inputs three pieces of inquiry content, all of which correspond to inquiry intention A, then the electronic device determines that the number of consecutive response processes for inquiry intention A is 3 after responding to the last inquiry content. For another example, after the conversation partner continuously inputs two query contents corresponding to query intention A, and then inputs one query content corresponding to query intention B, the electronic device responds to the query content for the query intention after processing the response to the last query content. The number of consecutive response processes performed by A is cleared. After that, if the conversation partner inputs another inquiry content corresponding to inquiry intention B, the electronic device determines the number of continuous response processes for inquiry intention B after performing the corresponding response processing. is 2. Continuous response processing has high requirements for continuity and is suitable for scenarios with high requirements for supervision of repeated conversations.

第二种是累计应答处理的次数,并不要求针对同一询问意图的应答处理连续出现,即可以是连续或不连续的。例如,会话对象连续输入2条均对应询问意图A的询问内容后,输入1条对应询问意图B的询问内容,然后再输入1条对应询问意图A的询问内容,则电子设备在对最后1条询问内容进行应答处理后,确定针对询问意图A进行累计应答处理的次数为3次,针对询问意图B进行累计应答处理的次数为1次。又例如,会话对象连续输入2条均对应询问意图A的询问内容后,连续输入2条对应询问意图B的询问内容,则电子设备在对最后1条询问内容进行应答处理后,确定针对询问意图A进行累计应答处理的次数为2次,针对询问意图B进行累计应答处理的次数为2次。这适用于对重复对话监管要求更宽泛的场景。The second type is the cumulative number of response processes, which does not require that response processes for the same inquiry intention occur continuously, that is, they can be continuous or discontinuous. For example, after the conversation partner continuously inputs two query contents corresponding to query intention A, then inputs one query content corresponding to query intention B, and then inputs another query content corresponding to query intention A, the electronic device will process the last query content. After the inquiry content is responded to, it is determined that the cumulative number of response processes for inquiry intention A is 3 times, and the cumulative number of response processes for inquiry intention B is 1 time. For another example, after the conversation partner continuously inputs two query contents corresponding to query intention A, and then continuously inputs two query contents corresponding to query intention B, the electronic device determines the query intention after responding to the last query content. The number of cumulative response processes performed by A is 2 times, and the cumulative number of response processes performed by B for the inquiry intention is 2 times. This applies to scenarios with broader requirements for monitoring repeated conversations.

在一些实施例中,当根据应答内容在会话中进行应答处理时,还包括:对所述询问意图对应的意图标签进行计数处理;其中,不同询问意图对应不同意图标签;根据所述意图标签所记载的数值,确定所述会话中针对所述意图标签对应的询问意图进行应答处理的次数。In some embodiments, when performing response processing in the session according to the response content, it also includes: counting intention tags corresponding to the inquiry intention; wherein different inquiry intentions correspond to different intention tags; The recorded value determines the number of times in the session that the query intention corresponding to the intention tag is responded to.

为了便于统计应答处理的次数,对于每一种询问意图,可以预先建立对应的意图标签,意图标签为数值形式,相当于计数器,初始可以为零,不同的询问意图对应不同的意图标签。In order to facilitate the counting of the number of response processing, for each query intention, a corresponding intention tag can be established in advance. The intention tag is in the form of a numerical value, equivalent to a counter, and can be initially zero. Different query intentions correspond to different intention tags.

电子设备在识别出询问内容属于某一询问意图(以询问意图A举例)并进行应答处理时,对询问意图A对应的意图标签进行计数处理,如执行加一操作。如此,对于询问意图A而言,便可通过对应的意图标签所记载的数值,来确定会话中针对询问意图A进行应答处理的次数。当然,在一些情况下,可能也会涉及到意图标签的清零,如限定统计连续应答处理的次数的情况。通过上述方式,能够提升统计应答处理次数的便利性和实时性。When the electronic device recognizes that the inquiry content belongs to a certain inquiry intention (taking inquiry intention A as an example) and performs response processing, it counts the intention tags corresponding to inquiry intention A, such as performing an increment operation. In this way, for inquiry intention A, the number of times of response processing for inquiry intention A in the session can be determined by the value recorded in the corresponding intention tag. Of course, in some cases, the clearing of intent tags may also be involved, such as limiting the number of consecutive response processing times. Through the above method, the convenience and real-time performance of counting the number of response processing can be improved.

在一些实施例中,可以对步骤104进行进一步约束,例如,可以约束在特定时间段(如最近一分钟)或者最近L次应答处理内,统计会话中针对同一询问意图进行应答处理的次数,其中,L为大于1的整数。In some embodiments, step 104 can be further restricted. For example, the number of response processes for the same inquiry intention in the session can be restricted to a specific time period (such as the last minute) or the last L response processes, where , L is an integer greater than 1.

通过图3所示实施例,统计会话中针对同一询问意图进行应答处理的次数,并进行相应控制处理,能够有效避免对话陷入无限循环的情况,提升会话效率,同时提升电子设备在会话过程中所耗费的计算资源的实际利用率。Through the embodiment shown in Figure 3, counting the number of response processing for the same inquiry intention in the conversation and performing corresponding control processing can effectively avoid the situation of the conversation falling into an infinite loop, improve the conversation efficiency, and at the same time improve the efficiency of the electronic device during the conversation. The actual utilization of the computing resources consumed.

在一些实施例中,参见图4,图4是本申请实施例提供的会话处理方法的一个流程示意图,图3所示的步骤104可以通过步骤201及步骤202实现。In some embodiments, see Figure 4, which is a schematic flowchart of the session processing method provided by the embodiment of the present application. Step 104 shown in Figure 3 can be implemented through step 201 and step 202.

在步骤201中,当所述会话中针对同一询问意图进行应答处理的次数大于次数阈值时,对所述会话进行异常控制。In step 201, when the number of response processes for the same query intention in the session is greater than the number threshold, exception control is performed on the session.

这里,当所述会话中针对同一询问意图进行应答处理的次数大于次数阈值时,确定会话对象存在重复询问的嫌疑,此时对会话进行异常控制。异常控制可以包括进行提示(异常提示或引导提示)、关闭会话中的至少之一,其中,进行提示后可以关闭会话,也可以继续获取会话对象的询问内容。Here, when the number of response processing for the same inquiry intention in the conversation is greater than the number threshold, it is determined that the conversation object is suspected of repeated inquiry, and at this time, the conversation is abnormally controlled. The exception control may include at least one of prompting (an exception prompt or a guidance prompt) and closing the session. After the prompting, the session can be closed, or the inquiry content of the session object can be continued to be obtained.

在步骤202中,当所述会话中针对每种询问意图进行应答处理的次数均小于或等于所述次数阈值时,继续执行获取所述会话对象在所述会话中输入的询问内容的步骤。In step 202, when the number of response processing for each inquiry intention in the session is less than or equal to the number threshold, continue to perform the step of obtaining the inquiry content input by the session object in the session.

这里,当所述会话中针对每种询问意图进行应答处理的次数均小于或等于所述次数阈值时,确定会话对象不存在重复询问的嫌疑,此时继续正常对话即可,即继续执行步骤101。Here, when the number of response processing for each inquiry intention in the conversation is less than or equal to the number threshold, it is determined that the conversation object is not suspected of repeated inquiry, and then the normal conversation can be continued, that is, step 101 is continued. .

通过图4所示实施例,根据应答处理的次数与次数阈值之间的大小关系进行差异化处理,能够提升会话处理的针对性。Through the embodiment shown in FIG. 4 , differentiated processing is performed based on the relationship between the number of response processing times and the number threshold, which can improve the pertinence of session processing.

在一些实施例中,参见图5,图5是本申请实施例提供的异常控制的一个流程示意图,图4所示的步骤201可以通过步骤301至步骤303实现。In some embodiments, see FIG. 5 , which is a schematic flow chart of exception control provided by an embodiment of the present application. Step 201 shown in FIG. 4 can be implemented through steps 301 to 303 .

在步骤301中,当所述会话中针对同一询问意图进行应答处理的次数大于次数阈值时,确定多个目标询问内容之间的询问相似度;其中,所述目标询问内容表征针对所述同一询问意图进行应答处理所应答的询问内容。In step 301, when the number of response processing for the same inquiry intention in the session is greater than the number threshold, the inquiry similarity between multiple target inquiry contents is determined; wherein the target inquiry content represents the response to the same inquiry. Intention to respond to the query content answered.

当会话中针对同一询问意图进行应答处理的次数大于次数阈值,证明会话对象可能存在重复询问的嫌疑,在本申请实施例,还可以从会话对象的角度进行进一步确认。首先,计算多个目标询问内容之间的询问相似度,该询问相似度表征该多个目标询问内容之间的相似程度,其中,所述目标询问内容表征针对上述同一询问意图进行应答处理所应答的询问内容。When the number of response processing for the same inquiry intention in a conversation is greater than the number threshold, it proves that the conversation object may be suspected of repeated inquiries. In the embodiment of the present application, further confirmation can be made from the perspective of the conversation object. First, the query similarity between multiple target query contents is calculated. The query similarity represents the degree of similarity between the multiple target query contents, wherein the target query content represents the response to the same query intention. content of the inquiry.

在步骤302中,当询问相似度大于第一相似度阈值时,对会话对象进行异常提示,以提示停止输入对应同一询问意图的询问内容。In step 302, when the query similarity is greater than the first similarity threshold, an exception prompt is provided to the conversation object to prompt to stop inputting query content corresponding to the same query intention.

这里,当询问相似度大于第一相似度阈值时,确认构成重复询问的情形,此时,对会话对象进行异常提示,以提示停止输入对应上述同一询问意图的询问内容。Here, when the query similarity is greater than the first similarity threshold, it is confirmed that a repeated query is constituted. At this time, an exception prompt is given to the conversation partner to prompt to stop inputting the query content corresponding to the above-mentioned same query intention.

值得说明的是,本申请实施例对提示的方式不做限定,例如可以在会话界面中显示相关提示,可以通过其他方式(如邮件等)来对会话对象进行提示。It is worth noting that the embodiment of the present application does not limit the method of prompting. For example, relevant prompts can be displayed in the conversation interface, and conversation objects can be prompted through other methods (such as emails, etc.).

在步骤303中,当询问相似度小于或等于第二相似度阈值时,对会话对象进行引导提示,以提示输入对应其他询问意图的询问内容;其中,其他询问意图区别于同一询问意图;第一相似度阈值大于或等于第二相似度阈值。In step 303, when the query similarity is less than or equal to the second similarity threshold, a guidance prompt is provided to the conversation object to prompt the input of query content corresponding to other query intentions; wherein the other query intentions are different from the same query intention; first The similarity threshold is greater than or equal to the second similarity threshold.

当询问相似度小于或等于第二相似度阈值时,确认不构成重复询问的情形,可能是因为意图识别错误或者其他原因导致应答处理次数过多,此时,对会话对象进行引导提示,以提示输入对应其他询问意图的询问内容;其中,其他询问意图区别于上述同一询问意图。When the query similarity is less than or equal to the second similarity threshold, it is confirmed that it does not constitute a repeated query. It may be that the response processing times are too many due to an error in intent recognition or other reasons. At this time, a guidance prompt is provided to the conversation object to prompt Enter the query content corresponding to other query intentions; where the other query intentions are different from the same query intention mentioned above.

其中,第一相似度阈值大于或等于第二相似度阈值,可以根据实际情况进行设定,例如可以设定为第一相似度阈值等于第二相似度阈值。The first similarity threshold is greater than or equal to the second similarity threshold, and can be set according to the actual situation. For example, the first similarity threshold can be set to be equal to the second similarity threshold.

在一些实施例中,可以通过这样的方式来实现上述的确定多个目标询问内容之间的询问相似度:执行以下任意一种处理:确定相邻的目标询问内容之间的相似度,以作为询问相似度;确定相邻的目标询问内容之间的相似度,并对多个相似度进行融合处理,得到询问相似度。In some embodiments, the above-mentioned determination of query similarity between multiple target query contents can be implemented in this way: performing any one of the following processes: determining the similarity between adjacent target query contents as Query similarity; determine the similarity between adjacent target query contents, and fuse multiple similarities to obtain query similarity.

这里,当目标询问内容的数量只有两个时,可以直接将这两个目标询问内容之间的相似度作为询问相似度。Here, when there are only two target query contents, the similarity between the two target query contents can be directly used as the query similarity.

当目标询问内容的数量在三个以上时,可以先确定相邻的两个目标询问内容之间的相似度,如此会得到多个相似度,然后将每个相似度均作为询问相似度。由于询问相似度的数量包括多个,因此,步骤302中的“询问相似度大于第一相似度阈值”可以是指所有询问相似度均大于第一相似度阈值,也可以是指预设数量/预设比例的询问相似度大于第一相似度阈值,预设数量/预设比例可以根据实际应用场景进行设定,同理,也适用于步骤303以及图6中的步骤304。When the number of target query contents is more than three, you can first determine the similarity between two adjacent target query contents. In this way, multiple similarities will be obtained, and then each similarity will be regarded as the query similarity. Since the number of query similarities includes multiple, "the query similarity is greater than the first similarity threshold" in step 302 may mean that all query similarities are greater than the first similarity threshold, or it may refer to a preset number/ The query similarity of the preset ratio is greater than the first similarity threshold, and the preset number/preset ratio can be set according to the actual application scenario. The same applies to step 303 and step 304 in FIG. 6 .

当目标询问内容的数量在三个以上时,也可以先确定相邻的两个目标询问内容之间的相似度,如此会得到多个相似度,然后对多个相似度进行融合处理,将得到的结果作为询问相似度。其中,融合处理可以是算术平均或加权平均等,对此不做限定。如此,仅需将得到的一个询问相似度与第一相似度阈值及第二相似度阈值进行比对即可。When the number of target query contents is more than three, you can also first determine the similarity between two adjacent target query contents. In this way, multiple similarities will be obtained, and then the multiple similarities will be fused to obtain The result is used as query similarity. The fusion process may be an arithmetic average or a weighted average, etc., and is not limited to this. In this way, it is only necessary to compare the obtained query similarity with the first similarity threshold and the second similarity threshold.

通过上述方式,提升了阈值比对的灵活性,可以根据实际场景中的需求,选择询问相似度的计算方式。Through the above method, the flexibility of threshold comparison is improved, and the calculation method of query similarity can be selected according to the needs in actual scenarios.

通过图5所示实施例,能够进一步确认是否构成重复询问的情形,明确导致重复对话的根源,进而进行针对化处理,提升处理的准确性和灵活性。Through the embodiment shown in Figure 5, it is possible to further confirm whether a repeated inquiry is constituted, identify the root cause of repeated conversations, and then carry out targeted processing to improve the accuracy and flexibility of processing.

在一些实施例中,参见图6,图6是本申请实施例提供的异常控制的一个流程示意图,图5所示的步骤301之后,还可以在步骤304中,当所述询问相似度小于或等于所述第一相似度阈值、且大于所述第二相似度阈值时,继续执行获取所述会话对象在所述会话中输入的询问内容的步骤。In some embodiments, see Figure 6, which is a schematic flow chart of exception control provided by an embodiment of the present application. After step 301 shown in Figure 5, in step 304, when the query similarity is less than or When equal to the first similarity threshold and greater than the second similarity threshold, continue to perform the step of obtaining the query content input by the conversation object in the conversation.

这里,当第一相似度阈值大于第二相似度阈值时,还可以扩展出第三种情形,即询问相似度小于或等于第一相似度阈值、且大于第二相似度阈值,在该情形下,确定会话对象可能因各种原因(如听不清或无法理解应答内容)导致需要通过多次询问来确认,因此,不对会话对象进行干扰(不进行提示),而是继续正常对话,即继续获取会话对象在会话中新输入的询问内容。Here, when the first similarity threshold is greater than the second similarity threshold, a third situation can also be extended, that is, the query similarity is less than or equal to the first similarity threshold and greater than the second similarity threshold. In this case , determining that the conversation object may need to be confirmed through multiple inquiries due to various reasons (such as being unable to hear or understand the response content), therefore, the conversation object will not be disturbed (no prompts will be given), but the normal conversation will continue, that is, continue Get the query content newly entered by the session object in the session.

通过图6所示实施例,进一步扩展了对话的新情形,提升了会话处理的灵活性。Through the embodiment shown in Figure 6, new situations of dialogue are further expanded and the flexibility of conversation processing is improved.

下面,将说明本申请实施例在一个实际的应用场景中的示例性应用,即电子设备通过人机对话系统来实现人机交互,从而起到解答用户问题、引导用户的作用。为便于理解,将通过步骤形式进行说明。Below, an exemplary application of the embodiments of the present application in a practical application scenario will be described, that is, the electronic device implements human-computer interaction through a human-computer dialogue system, thereby answering user questions and guiding the user. For ease of understanding, instructions will be given in step-by-step format.

1)对系统相应话术进行统一映射。1) Unified mapping of corresponding speech skills of the system.

在会话中,人机对话系统回应的话术内容(对应上文的应答内容)是与用户的意图(询问意图)相对应的,虽然回应的话术不一定完全一致,但是一定是根据用户意图进行智能生成或者调用话术库得到的。During the conversation, the utterance content of the human-computer dialogue system's response (corresponding to the response content above) corresponds to the user's intention (inquiry intention). Although the response utterance is not necessarily exactly the same, it must be intelligent based on the user's intention. Obtained by generating or calling the vocabulary library.

在本申请实施例中,无论人机对话系统是以哪一种方式得到的回应话术,均可以将对同一种意图所返回的话术进行标记。例如:当用户在会话中说“你好”(对应上文的询问内容),人机对话系统此时会回复“您好,有什么需要我的?”或者“您好,需要我做什么?”,这两种回复实际表达含义都是相同的,都是针对“你好”这个打招呼的意图进行回复。因此,针对同一种意图的回复都可以打上共同的标签(对应上文的意图标签),这个共同标签即为话术映射。在上面示例中,用户输入的“你好”的意图为打招呼,那么系统针对该意图给出的回复都会拥有一个共同的标签“打招呼”。In the embodiment of the present application, no matter which way the human-machine dialogue system obtains the response utterances, it can mark the utterances returned with the same intention. For example: when the user says "Hello" in the conversation (corresponding to the query content above), the human-computer dialogue system will reply "Hello, what can I do for you?" or "Hello, what do you need from me?" ", the actual meaning of these two replies is the same, they are both responses to the intention of greeting "Hello". Therefore, replies with the same intention can be labeled with a common label (corresponding to the intention label above), and this common label is the discourse mapping. In the above example, the user inputs "Hello" with the intention of saying hello, then the system's responses to this intention will all have a common label of "hello".

2)系统回复内容顺序以及频率检测。2) System reply content sequence and frequency detection.

在人机对话过程中,可以按照顺序记录系统每一次的回复。从第二次系统回复开始统计,若当前系统回复的标签与上一次回复的标签一致,则该标签的出现次数加一;若当前系统回复的标签与上一次回复的标签不一致,则清空该标签的出现次数。During the human-machine dialogue, each response of the system can be recorded in sequence. Counting starts from the second system reply. If the label of the current system reply is consistent with the label of the previous reply, the number of occurrences of the label will be increased by one; if the label of the current system reply is inconsistent with the label of the previous reply, the label will be cleared. number of occurrences.

每当标签的出现次数加一时,人机对话系统判断标签的出现次数(对应上文的针对同一询问意图进行连续应答处理的次数)是否达到阈值N(对应上文的次数阈值),如果达到阈值N,则认为用户疑似存在重复询问的情形,触发异常流程(对应上文的异常控制);如果未达到阈值N,则不触发异常流程。其中,N为大于1的整数。Whenever the number of occurrences of a tag is increased by one, the human-machine dialogue system determines whether the number of occurrences of the tag (corresponding to the number of consecutive response processing for the same query intention above) reaches the threshold N (corresponding to the number of times threshold above). If it reaches the threshold N, it is considered that the user is suspected of repeated inquiries, and the abnormal process is triggered (corresponding to the exception control above); if the threshold N is not reached, the abnormal process is not triggered. Among them, N is an integer greater than 1.

3)异常流程。3) Abnormal process.

由于用户疑似存在重复询问的情形,因此在本步骤中从用户输入角度进行进一步确认。人机对话系统对用户最近输入的N个内容进行相似度检测,例如计算用户最近输入的N个内容中每相邻的两个内容之间的相似度,如果所有相似度都大于阈值K(对应上文的第一相似度阈值,为防止用户重复几乎完全一样的话术,所以这里的K值需要设置得较高),则认定是用户故意重复,此时人机对话系统会对用户进行异常提示,例如“请勿连续重复相似话术”;如果所有相似度都小于或等于阈值M(对应上文的第二相似度阈值,为防止人机对话系统由于识别错误用户意图,导致人机对话系统不断返回相同内容,M值需要设置得较低),则认定是对用户的意图识别有误,此时人机对话系统会对用户进行引导提示,以提示用户输入其他意图的内容,即开启新的流程对话,例如“哎呀,系统回复累了,我们不如聊一些别的吧”;如果是其他情况,则考虑到在真实场景下,用户可能会由于听不清、不理解等情况导致反复询问,此时,人机对话系统便不进行提示。Since the user seems to have made repeated inquiries, further confirmation is made from the perspective of user input in this step. The human-computer dialogue system performs similarity detection on the N pieces of content recently input by the user. For example, it calculates the similarity between two adjacent pieces of content among the N pieces of content recently input by the user. If all similarities are greater than the threshold K (corresponding to The first similarity threshold above (in order to prevent the user from repeating almost the same words, so the K value here needs to be set higher), then it is deemed that the user has repeated it intentionally. At this time, the human-computer dialogue system will give an abnormal prompt to the user. , such as "Do not repeat similar words continuously"; if all similarities are less than or equal to the threshold M (corresponding to the second similarity threshold above, in order to prevent the human-machine dialogue system from identifying the wrong user intention, causing the human-machine dialogue system to Continuously returning the same content, the M value needs to be set lower), it is determined that the user's intention has been recognized incorrectly. At this time, the human-computer dialogue system will provide guidance prompts to the user to prompt the user to enter the content of other intentions, that is, to open a new Process dialogue, such as "Oh, the system is tired of replying, let's talk about something else"; if it is other situations, consider that in real scenarios, users may ask repeatedly due to unclear hearing, incomprehension, etc. , at this time, the human-machine dialogue system will not prompt.

通过上述示例,大大降低了对话流程可能重复的概率,提升了人机对话的用户体验,并对错误流程进行有效引导。Through the above examples, the probability of possible repetition of the dialogue process is greatly reduced, the user experience of human-computer dialogue is improved, and the error process is effectively guided.

下面继续说明本申请实施例提供的会话处理装置455实施为软件模块的示例性结构,在一些实施例中,如图2所示,存储在存储器450的会话处理装置455中的软件模块可以包括:获取模块4551,用于获取会话对象在会话中输入的询问内容;意图识别模块4552,用于对询问内容进行意图识别处理,得到询问意图;应答模块4553,用于根据询问意图确定对应的应答内容,并根据应答内容在会话中进行应答处理;控制模块4554,用于根据所述会话中针对同一询问意图进行应答处理的次数,对所述会话进行控制处理。The following continues to describe an exemplary structure in which the session processing device 455 provided by the embodiment of the present application is implemented as a software module. In some embodiments, as shown in Figure 2, the software module stored in the session processing device 455 of the memory 450 may include: The acquisition module 4551 is used to obtain the inquiry content input by the conversation object in the session; the intention identification module 4552 is used to perform intention identification processing on the inquiry content and obtain the inquiry intention; the response module 4553 is used to determine the corresponding response content according to the inquiry intention. , and perform response processing in the session according to the response content; the control module 4554 is used to perform control processing on the session according to the number of response processing for the same inquiry intention in the session.

在一些实施例中,控制模块4554,还用于:当所述会话中针对同一询问意图进行应答处理的次数大于次数阈值时,对所述会话进行异常控制;当所述会话中针对每种询问意图进行应答处理的次数均小于或等于所述次数阈值时,继续执行获取所述会话对象在所述会话中输入的询问内容的步骤。In some embodiments, the control module 4554 is also configured to: perform abnormal control on the session when the number of response processing for the same query intention in the session is greater than the number threshold; when the number of response processing for each query in the session When the number of times that the response processing is intended is less than or equal to the number of times threshold, continue to perform the step of obtaining the query content input by the conversation object in the conversation.

在一些实施例中,控制模块4554,还用于:确定多个目标询问内容之间的询问相似度;其中,所述目标询问内容表征针对所述同一询问意图进行应答处理所应答的询问内容;当所述询问相似度大于第一相似度阈值时,对所述会话对象进行异常提示,以提示停止输入对应所述同一询问意图的询问内容;当所述询问相似度小于或等于第二相似度阈值时,对所述会话对象进行引导提示,以提示输入对应其他询问意图的询问内容;其中,所述其他询问意图区别于所述同一询问意图;其中,所述第一相似度阈值大于或等于所述第二相似度阈值。In some embodiments, the control module 4554 is also used to: determine the query similarity between multiple target query contents; wherein the target query content represents the query content responded to by responding to the same query intention; When the query similarity is greater than the first similarity threshold, an exception prompt is given to the conversation object to prompt to stop inputting query content corresponding to the same query intention; when the query similarity is less than or equal to the second similarity When the threshold is reached, a guidance prompt is provided to the conversation object to prompt the input of inquiry content corresponding to other inquiry intentions; wherein the other inquiry intentions are different from the same inquiry intention; wherein the first similarity threshold is greater than or equal to The second similarity threshold.

在一些实施例中,第一相似度阈值大于所述第二相似度阈值;控制模块4554,还用于:当所述询问相似度小于或等于所述第一相似度阈值、且大于所述第二相似度阈值时,继续执行获取所述会话对象在所述会话中输入的询问内容的步骤。In some embodiments, the first similarity threshold is greater than the second similarity threshold; the control module 4554 is also configured to: when the query similarity is less than or equal to the first similarity threshold and greater than the third similarity threshold, When the similarity threshold is 2, continue to perform the step of obtaining the query content input by the conversation object in the conversation.

在一些实施例中,控制模块4554,还用于:执行以下任意一种处理:确定相邻的目标询问内容之间的相似度,以作为询问相似度;确定相邻的目标询问内容之间的相似度,并对多个相似度进行融合处理,得到询问相似度。In some embodiments, the control module 4554 is also configured to: perform any of the following processes: determine the similarity between adjacent target query contents as the query similarity; determine the similarity between adjacent target query contents. similarity, and perform fusion processing on multiple similarities to obtain the query similarity.

在一些实施例中,会话处理装置455还包括标签计数模块,用于:当根据所述应答内容在所述会话中进行应答处理时,对所述询问意图对应的意图标签进行计数处理;其中,不同询问意图对应不同意图标签;根据所述意图标签所记载的数值,确定所述会话中针对所述意图标签对应的询问意图进行应答处理的次数。In some embodiments, the session processing device 455 also includes a tag counting module, configured to: when performing response processing in the session according to the response content, count the intention tags corresponding to the query intention; wherein, Different inquiry intentions correspond to different intention tags; according to the value recorded in the intention tag, the number of times of response processing for the inquiry intention corresponding to the intention tag is determined in the session.

在一些实施例中,会话中针对同一询问意图进行应答处理的次数包括以下任意一种:针对同一询问意图进行连续应答处理的次数;针对同一询问意图进行累计应答处理的次数。In some embodiments, the number of times of response processing for the same inquiry intention in a session includes any of the following: the number of consecutive response processes for the same inquiry intention; the cumulative number of response processes for the same inquiry intention.

本申请实施例提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括可执行指令,该可执行指令存储在计算机可读存储介质中。电子设备的处理器从计算机可读存储介质读取该可执行指令,处理器执行该可执行指令,使得该电子设备执行本申请实施例上述的会话处理方法。Embodiments of the present application provide a computer program product or computer program. The computer program product or computer program includes executable instructions, and the executable instructions are stored in a computer-readable storage medium. The processor of the electronic device reads the executable instruction from the computer-readable storage medium, and the processor executes the executable instruction, so that the electronic device executes the session processing method described above in the embodiment of the present application.

本申请实施例提供一种存储有可执行指令的计算机可读存储介质,其中存储有可执行指令,当可执行指令被处理器执行时,将引起处理器执行本申请实施例提供的方法,例如,如图3示出的会话处理方法。Embodiments of the present application provide a computer-readable storage medium storing executable instructions. The executable instructions are stored therein. When the executable instructions are executed by a processor, they will cause the processor to execute the method provided by the embodiments of the present application, such as , the session processing method shown in Figure 3.

在一些实施例中,计算机可读存储介质可以是FRAM、ROM、PROM、EPROM、EEPROM、闪存、磁表面存储器、光盘、或CD-ROM等存储器;也可以是包括上述存储器之一或任意组合的各种设备。In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; it may also include one or any combination of the above memories. Various equipment.

在一些实施例中,可执行指令可以采用程序、软件、软件模块、脚本或代码的形式,按任意形式的编程语言(包括编译或解释语言,或者声明性或过程性语言)来编写,并且其可按任意形式部署,包括被部署为独立的程序或者被部署为模块、组件、子例程或者适合在计算环境中使用的其它单元。In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, and their May be deployed in any form, including deployed as a stand-alone program or deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.

作为示例,可执行指令可以但不一定对应于文件系统中的文件,可以可被存储在保存其它程序或数据的文件的一部分,例如,存储在超文本标记语言(HTML,Hyper TextMarkup Language)文档中的一个或多个脚本中,存储在专用于所讨论的程序的单个文件中,或者,存储在多个协同文件(例如,存储一个或多个模块、子程序或代码部分的文件)中。As an example, executable instructions may, but do not necessarily correspond to, files in a file system and may be stored as part of a file holding other programs or data, for example, in a Hyper Text Markup Language (HTML) document. in one or more scripts, stored in a single file specific to the program in question, or in multiple collaborative files (e.g., files storing one or more modules, subroutines, or portions of code).

作为示例,可执行指令可被部署为在一个计算设备上执行,或者在位于一个地点的多个计算设备上执行,又或者,在分布在多个地点且通过通信网络互连的多个计算设备上执行。As examples, executable instructions may be deployed to execute on one computing device, or on multiple computing devices located at one location, or alternatively, on multiple computing devices distributed across multiple locations and interconnected by a communications network execute on.

以上,仅为本申请的实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和范围之内所作的任何修改、等同替换和改进等,均包含在本申请的保护范围之内。The above are only examples of the present application and are not used to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of this application are included in the protection scope of this application.

Claims (10)

1. A session processing method, comprising:
acquiring inquiry content input by a session object in a session;
performing intention recognition processing on the query content to obtain a query intention;
determining corresponding response content according to the query intention, and performing response processing in the session according to the response content;
and according to the times of response processing aiming at the same query intention in the session, controlling the session.
2. The method according to claim 1, wherein the controlling the session according to the number of times of response processing for the same query intention in the session includes:
When the number of times of response processing aiming at the same query intention in the session is larger than a threshold value of times, abnormal control is carried out on the session;
and when the number of times of response processing for each query intention in the session is smaller than or equal to the number threshold, continuing to execute the step of acquiring the query content input by the session object in the session.
3. The method of claim 2, wherein the performing anomaly control on the session comprises:
determining query similarity between a plurality of target query contents; wherein the target query content characterizes the query content responded by the response processing for the same query intention;
when the query similarity is greater than a first similarity threshold, carrying out abnormal prompt on the session object to prompt to stop inputting query content corresponding to the same query intention;
when the query similarity is smaller than or equal to a second similarity threshold, guiding prompt is carried out on the session object so as to prompt the input of query contents corresponding to other query intentions; wherein the other query intent is distinct from the same query intent;
wherein the first similarity threshold is greater than or equal to the second similarity threshold.
4. A method according to claim 3, wherein the first similarity threshold is greater than the second similarity threshold; after the query similarity between the plurality of target query contents is determined, the method further comprises:
and when the query similarity is smaller than or equal to the first similarity threshold and larger than the second similarity threshold, continuing to execute the step of acquiring the query content input by the session object in the session.
5. The method of claim 3, wherein determining query similarity between a plurality of target query contents comprises:
any one of the following processes is performed:
determining the similarity between adjacent target query contents to be used as query similarity;
and determining the similarity between adjacent target query contents, and carrying out fusion processing on a plurality of similarities to obtain the query similarity.
6. The method according to any one of claims 1 to 5, characterized in that when a response process is performed in the session according to the response content, the method further comprises:
counting the intention labels corresponding to the query intention; wherein different query intents correspond to different intent tags;
And determining the number of times of response processing for the query intention corresponding to the intention label in the session according to the numerical value recorded by the intention label.
7. The method according to any one of claims 1 to 5, wherein the number of times of reply processing for the same query intention in the session includes any one of:
the number of consecutive reply processes for the same interrogation intention;
the number of times of response processing is accumulated for the same query intention.
8. A session processing apparatus, comprising:
the acquisition module is used for acquiring inquiry content input by the session object in the session;
the intention recognition module is used for carrying out intention recognition processing on the inquiry content to obtain inquiry intention;
the response module is used for determining corresponding response content according to the query intention and carrying out response processing in the session according to the response content;
and the control module is used for controlling the session according to the times of response processing aiming at the same query intention in the session.
9. An electronic device, comprising:
a memory for storing executable instructions;
A processor configured to implement the session processing method according to any one of claims 1 to 7 when executing the executable instructions stored in the memory.
10. A computer readable storage medium storing executable instructions for implementing the session handling method according to any one of claims 1 to 7 when executed by a processor.
CN202310891398.1A 2023-07-19 2023-07-19 Session processing method, session processing device, electronic equipment and computer readable storage medium Pending CN117076623A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310891398.1A CN117076623A (en) 2023-07-19 2023-07-19 Session processing method, session processing device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310891398.1A CN117076623A (en) 2023-07-19 2023-07-19 Session processing method, session processing device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN117076623A true CN117076623A (en) 2023-11-17

Family

ID=88710564

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310891398.1A Pending CN117076623A (en) 2023-07-19 2023-07-19 Session processing method, session processing device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN117076623A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120067257A (en) * 2025-02-07 2025-05-30 广州虎牙信息科技有限公司 Dialogue optimization method and device, electronic equipment and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108197191A (en) * 2017-12-27 2018-06-22 神思电子技术股份有限公司 A kind of scene of more wheel dialogues is intended to interrupt method
CN113079263A (en) * 2021-03-16 2021-07-06 京东数字科技控股股份有限公司 Method, device, system and medium for intelligent customer service switching
CN113660380A (en) * 2021-08-16 2021-11-16 西安京迅递供应链科技有限公司 Information processing method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108197191A (en) * 2017-12-27 2018-06-22 神思电子技术股份有限公司 A kind of scene of more wheel dialogues is intended to interrupt method
CN113079263A (en) * 2021-03-16 2021-07-06 京东数字科技控股股份有限公司 Method, device, system and medium for intelligent customer service switching
CN113660380A (en) * 2021-08-16 2021-11-16 西安京迅递供应链科技有限公司 Information processing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120067257A (en) * 2025-02-07 2025-05-30 广州虎牙信息科技有限公司 Dialogue optimization method and device, electronic equipment and readable storage medium
CN120067257B (en) * 2025-02-07 2025-10-03 广州虎牙信息科技有限公司 Dialogue optimization method, device, electronic device and readable storage medium

Similar Documents

Publication Publication Date Title
US12375432B2 (en) Chat management system
CN116521841B (en) Method, device, equipment and medium for generating reply information
US20190019112A1 (en) Automated assistant invocation of appropriate agent
CN107609092B (en) Intelligent response method and device
KR20210039997A (en) A method and a device for backtracking public scene dialogue in multi-turn dialogues
CN117520497A (en) Large model interaction processing method, system, terminal, equipment and medium
CN112286485B (en) Method and device for controlling application through voice, electronic equipment and storage medium
CN117520498A (en) Virtual digital human interaction processing method, system, terminal, equipment and medium
CN112115244B (en) Dialogue interaction method, device, storage medium and electronic device
CN113901837A (en) An intent understanding method, apparatus, device and storage medium
US20240096312A1 (en) SYSTEM AND METHOD FOR ADAPTIVELY TRAVERSING CONVERSATION STATES USING CONVERSATIONAL Al TO EXTRACT CONTEXTUAL INFORMATION
CN110740212B (en) Call answering method and device based on intelligent voice technology and electronic equipment
CN118838998A (en) Man-machine interaction method and device and computer readable storage medium
CN117076623A (en) Session processing method, session processing device, electronic equipment and computer readable storage medium
US20220245489A1 (en) Automatic intent generation within a virtual agent platform
CN114118937A (en) Task-based information recommendation method, device, electronic device and storage medium
CN117059082B (en) Outbound call conversation method, device, medium and computer equipment based on large model
CN112560508A (en) Conversation processing method, device and equipment
CN112417123A (en) Customer response identification method based on artificial intelligence and related equipment thereof
CN117610539A (en) Intention execution method, device, electronic equipment and storage medium
CN109788128A (en) Incoming call prompting method, incoming call prompting device and terminal equipment
CN113111643B (en) Information processing method, device and apparatus
US20250323882A1 (en) Chat management system
US12394410B2 (en) Action topic ontology
CN110543556A (en) Dialogue configuration method, storage medium and electronic equipment

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