WO2021082836A1 - Robot dialogue method, apparatus and device, and computer-readable storage medium - Google Patents

Robot dialogue method, apparatus and device, and computer-readable storage medium Download PDF

Info

Publication number
WO2021082836A1
WO2021082836A1 PCT/CN2020/117925 CN2020117925W WO2021082836A1 WO 2021082836 A1 WO2021082836 A1 WO 2021082836A1 CN 2020117925 W CN2020117925 W CN 2020117925W WO 2021082836 A1 WO2021082836 A1 WO 2021082836A1
Authority
WO
WIPO (PCT)
Prior art keywords
scene
instance
input information
scene instance
information
Prior art date
Application number
PCT/CN2020/117925
Other languages
French (fr)
Chinese (zh)
Inventor
何柯君
夏晓松
覃非
Original Assignee
中国银联股份有限公司
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 中国银联股份有限公司 filed Critical 中国银联股份有限公司
Publication of WO2021082836A1 publication Critical patent/WO2021082836A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/243Natural language query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing

Definitions

  • This application relates to the technical field of robot dialogue, and in particular to a method, device, equipment and computer-readable storage medium for robot dialogue.
  • a robot with a dialogue function is essentially a computer program that communicates with people through voice or text.
  • robots with dialogue functions have been widely used in finance, education, medical care, e-commerce, smart devices and other fields. Excellent robots can significantly improve people's work efficiency, saving enterprises more manpower and time costs.
  • Robots in related technologies rely on a knowledge base to achieve dialogue.
  • the knowledge base is divided into three parts: matching rules, question and answer knowledge base, and response template.
  • the input information is first analyzed through natural language technology to determine the user’s intention, and then the knowledge base’s matching rules are used to match the most similar problem to the input information, and then according to The response template gives the corresponding answer.
  • natural language processing, machine learning, text mining and other technologies are used to optimize the matching method to improve the accuracy of the robot's response.
  • the embodiments of the present application provide a robot dialogue method, device, equipment, and computer-readable storage medium, which can simplify the process of the robot searching for response information and improve the efficiency and accuracy of the robot dialogue.
  • an embodiment of the present application provides a robot dialogue method, which includes:
  • an embodiment of the present application provides a robot dialogue device, which includes:
  • the control module is used to obtain the user's input information; call the scene instance in the scene library to determine the target scene instance matched by the input information; display the response information returned by the execution unit;
  • the scene library is used to store preset scene instances
  • the execution unit is configured to query response information of the input information in the target scene instance in a preset resource warehouse; and return the response information to the control module;
  • the resource warehouse is used to store the input information contained in each scenario instance and the corresponding response information.
  • an embodiment of the present application provides a robot dialogue device, which includes a processor and a memory storing computer program instructions;
  • the processor implements the robot dialogue method described in the first aspect of the embodiments of the present application when the processor executes the computer program instructions.
  • an embodiment of the present application provides a computer-readable storage medium.
  • the computer-readable storage medium stores computer program instructions.
  • the robot described in the first aspect of the embodiments of the present application is implemented. Dialogue method.
  • the embodiment of the application is provided with scene instances corresponding to different dialogue scenes. After the user's input information is successfully matched with the pre-stored scene instance, the query and reply of response information are performed according to the matched target scene instance. It can be seen that this embodiment limits the search range of the response information, thereby reducing the amount of data corresponding to the search range, and also simplifies the process of searching for the response information, thereby improving the efficiency of the robot conversation. Moreover, after the search process is simplified, the possibility of searching errors is reduced, thereby improving the accuracy of the conversation reply.
  • FIG. 1 is a schematic flowchart of an embodiment of the robot dialogue method of the present application
  • FIG. 2 is a schematic flowchart of another embodiment of the robot dialogue method of the present application.
  • FIG. 3 is a schematic flowchart of another embodiment of the robot dialogue method of the present application.
  • FIG. 4 is a schematic structural diagram of an embodiment of the robot dialogue device of the present application.
  • FIG. 5 is a schematic structural diagram of another embodiment of the robot dialogue device of the present application.
  • Fig. 6 is a schematic diagram of the hardware structure of an embodiment of the robot dialogue device of the present application.
  • Robots with conversational functions can significantly improve the efficiency of data center operations.
  • robots with conversational functions have begun to be used in application scenarios such as intelligent customer service and Chatbot-based Operations (ChatOps).
  • the key to the realization of dialogue-enabled robotics technology is to build a knowledge base that meets the needs.
  • Two core functional components need to be designed around the knowledge base, namely, Natural Language Understanding (NLU) and Natural Language Expression (Natural Language Generation, NLG). ).
  • NLU Natural Language Understanding
  • NLG Natural Language Generation
  • the realization algorithm model of robot dialogue in related technologies is mainly divided into two types: retrieval model and generative model:
  • the embodiments of the application are applied to a retrieval model, and the retrieval model requires that the knowledge base be divided into three parts: matching rules, question and answer knowledge base, and response template.
  • the retrieval model requires that the knowledge base be divided into three parts: matching rules, question and answer knowledge base, and response template.
  • After obtaining the user's input information first analyze the user's intentions through natural language technology, and then use the matching rules of the knowledge base to match the closest question to the question library, and then give the corresponding answer according to the response template.
  • natural language processing, machine learning, text mining and other technologies are used to optimize the matching method to improve the accuracy of the robot's response.
  • the retrieval model is more suitable for scenarios where the scope of use is clear and the dialogue intent is clear.
  • the answer of the robot based on the retrieval model is of high quality, and there will be no grammatical errors, unclear semantics, and confusion in the dialogue response. Therefore, the robot dialogue operation oriented to the enterprise scene is mainly realized based on the retrieval model.
  • the embodiment of the present application achieves the purpose of improving the efficiency and accuracy of the dialogue by dividing specific scenes for the dialogue of the robot.
  • Fig. 1 shows a schematic flowchart of an embodiment of the robot dialogue method of the present application.
  • the robot dialogue method may include:
  • the human-computer interaction between the user and the robot may be voice interaction, or realized through a touch screen or keyboard.
  • this application does not limit specific human-computer interaction methods.
  • a similar conversational intention of the user should be summarized, that is, a scenario instance of the robot.
  • the possible input intentions of the user can be divided based on the scene through the scene instance, so that it is convenient to provide a personalized response for each type of scene in the subsequent, and can make the robot have better responsiveness, and can adapt to the needs of complex and changeable application scenarios. .
  • this design ensures that the new scene instance will not cause query interference to the existing scene instance after the addition of the new scene instance, and realizes the rapid expansion of the robot dialogue range.
  • the display method here may be display on the screen, or voice broadcast, or display through a user terminal connected to the robot, etc.
  • the application does not limit the specific display method.
  • the embodiment of the present application is provided with scene instances corresponding to different dialogue scenes. After the user's input information is successfully matched with the pre-stored scene instance, the query and display of response information are performed according to the matched template scene instance. It can be seen that this embodiment limits the search range of the response information, thereby reducing the amount of data corresponding to the search range, and also simplifies the search process of the response information, thereby improving the efficiency of the robot conversation. Moreover, after the search process is simplified, the possibility of searching errors is reduced, thereby improving the accuracy of the conversation reply.
  • the present application also provides other embodiments, as shown in FIG. 2, which shows a schematic flowchart of another embodiment of the robot dialogue method of the present application.
  • the method for determining the target scene instance matched by the input information may include:
  • S102b Determine whether the input information is valid input in the last matched scene instance, if so, use the last matched scene instance as the target scene instance; go to S103;
  • S102c Among the scene instances included in the preset scene library, determine the target scene instance matching the input information, and save the target scene instance as the most recently matched scene instance, and then proceed to S103.
  • the successfully matched scene instance after each successful matching of the scene instance, the successfully matched scene instance will be saved, for example, it can be saved through a cache, so that after the next user input information, if the user's input information matches the most recently matched scene instance , It is no longer necessary to query and match the scene instance, but can directly query the response information under the most recently matched scene instance, that is, the embodiment of the present application can realize the state maintenance of multiple rounds of conversations and reduce the number of conversation query scene instances. The amount of data at the same time improves the efficiency of session processing.
  • the user can switch between scene instances and realize multiple rounds of dialogue between the user and the robot.
  • the above valid input refers to that the input information meets the input requirements of the most recently matched scene instance.
  • the process of judging whether the input information is valid input can be: judging whether the input information meets the preset input rules of the last matched scene instance; or it can also be: matching the input information with the last matched scene instance If it matches, it means it is a valid input.
  • the method of saving the successfully matched scene instance may be: using the successfully matched scene instance to update the previously saved scene instance of the most recent match. In this way, at most, only one matching scene instance, that is, one target scene instance, can be saved at the same time.
  • the update may not be performed, but the scene instance that was successfully matched this time is directly saved separately. In this case, there may be a situation in which multiple matched scene instances are saved at the same time. After each input information is received, it is only necessary to determine whether the input information is valid input in the last saved scene instance.
  • the specific method used above is not limited in this application.
  • S102 may further include:
  • the method of determining the target scene instance matching the input information specifically includes: The preset matching order is sequentially matched with the scene instances contained in the scene library. If the matching is successful, the matching operation is stopped.
  • the preset matching order is: first match the professional scene instance, then match the retrieval scene instance, and finally match the session Scene instance.
  • each professional scene instance contained in the scene library determine whether there is a target scene instance matching the input information
  • retrieval scene instance is a target scene instance, then proceed to S103; if the retrieval scene instance is not a target scene instance, it is determined whether the conversation scene instance contained in the scene library is a target scene instance matching the input information.
  • the matching between the input information and the scene instance in this embodiment refers to the complete match between the key text feature in the input information and the text feature of the scene instance. That is, the matching process is as follows: extract the key text features in the input information; compare the key text features with the text features of the scene instance currently undergoing the matching process, if the two are exactly the same, the matching is successful; otherwise, the matching fails.
  • the conversation can be divided into three types: professional conversation, retrieval conversation, and conversation scenario conversation.
  • the search type dialogue includes some queries for professional knowledge, such as Frequently Asked Questions (FAQ) and so on.
  • Conversational conversations include natural communication conversations, such as daily greetings.
  • the content of professional type conversations includes other conversations besides the above two, mainly some content related to the enterprise, such as the position of the company employee, the employee's business scope, the company's business scope, and the company's product list. Since the professional scene has a wide range of more complex conversational requirements, the professional scene includes multiple professional scene instances, while the retrieval scene and the conversation scene only include one scene instance.
  • all the scene instances in the scene library may be formed into a work sequence in a certain order to facilitate the traversal of the scene instances during the scene process.
  • the priority order of the scene instances is the professional scene instance, the retrieval scene instance, and the conversation scene instance.
  • Multiple professional scene instances can be sorted according to the preset weight and creation time of the scene instance.
  • This method can facilitate the traversal process of scene instances and find matching scene instances as soon as possible.
  • the robot can distinguish different users, and can simultaneously establish multiple conversation flows for different users.
  • the way to distinguish different users may be voiceprint recognition, or may also be distinguished according to the user's login account, which is not limited in this application.
  • the robot can distinguish between different users, there can only be one conversation flow at the same time, and the input information obtained by the robot can come from different users.
  • the user’s input information may not be entered strictly in accordance with the input rules or input fields. Therefore, it cannot be completely matched with the professional scene instance. However, because the user’s input information actually belongs to the scope of the professional scene instance, even If it is matched with the retrieval scene instance or the conversation scene instance, the matching will not succeed, which will lead to the failure of the response and reduce the usability of the robot.
  • the method may also include :
  • the recommended professional scene instance is taken as the target scene instance.
  • the robot recommends the professional scene instance suitable for the user's input information, so that when the user's input information is not rigorous enough, the appropriate professional scene can be selected as much as possible
  • the instance responds to it to improve the accuracy of the robot conversation.
  • the process of judging whether there is a recommended professional scene instance in the scene library may be:
  • the professional scene instance whose matching degree reaches the preset matching degree threshold is taken as the recommended professional scene instance.
  • the professional scene instance where the matching degree of the text feature and the key text feature in the input information exceeds the preset matching degree threshold is recommended, because the meaning of the input information is basically determined by the key text in the input information.
  • the characteristics are determined, therefore, the professional scene instance that can reach a certain degree of matching with the key text characteristics is likely to be the content that the user wants to query.
  • the recommended professional scene instance is determined according to whether the user's input information is similar to the professional scene instance, but because the user's input information is not accurate, there may be multiple recommended professions found at the same time. In the case of the scene instance, and the recommended professional scene instance may also be different from the user's needs, if the recommended professional scene instance is directly used by default, it may cause the wrong response message to be returned to the user.
  • the method further includes:
  • the recommended professional scene instance is taken as the target scene instance.
  • the user can select one of them as the recommended professional scene instance according to their actual needs. In the case that there is only one recommended professional scene instance, the user can also determine whether the recommended professional scene instance meets his own needs. Therefore, in these embodiments, the recommended professional scene instance is not directly used, but the user selects the professional scene instance according to his own needs. The user experience is better and the reliability of the robot dialogue is higher.
  • each pre-stored scenario instance includes a preset execution rule
  • the execution rule includes each state node corresponding to the user's input information and the execution operation corresponding to each state node.
  • state nodes can include any of the following combinations: input information enters the scene instance for the first time, waiting for input information, input information is invalid, input information is valid, the scene instance exits due to unresponsiveness beyond a preset time, and the scene implementation is actively ended.
  • other state nodes can also be included.
  • the execution rules corresponding to different scene instances can be the same or different.
  • the execution rules corresponding to specific scene instances can be determined according to actual conditions, such as personalized design according to user intentions. Not limited.
  • the robot conversation method may also include:
  • the input information is an instance of entering the target scene for the first time, extract the user authority corresponding to the input information;
  • the user's authority determine whether it is allowed to query the response information of the input information in the target scenario instance through the resource warehouse.
  • the input information entering the target scene instance for the first time refers to: the current target scene instance is obtained by matching the current input information, rather than the last matched scene instance, that is, after the target scene instance is successfully matched, The response message has not been queried in this scenario instance. Since each scenario instance corresponds to part of the information in the resource warehouse, this part of information may not be inquired by everyone. Therefore, for the scenario instance corresponding to this part of the information that requires permission to query, enter the target for the first time after entering the information After the scenario instance, you need to first determine the user authority corresponding to the current input information. If the user has the authority, he can find the corresponding response information from the resource warehouse and reply. This method can meet the permission setting requirements of different information in the enterprise scenario, and enrich the scope of the robot's dialogue scenario.
  • the method for extracting the user authority corresponding to the input information may be: obtaining the user identifier carried in the input information, and querying the user authority corresponding to the user identifier in the pre-stored authority list.
  • the user ID can be a user name or account number, etc.
  • the acquisition method can be to receive the user ID input by the user through a touch screen or keyboard, or it can also be a comparison of the voiceprint information input by the voice to obtain the user ID. Not limited.
  • the robot conversation method further includes:
  • the saved scene event status is updated according to the response information, and the scene event status includes the key features of the response information.
  • the control logic for the state of the scene event can be implemented by methods such as a finite state machine or a decision tree.
  • step S103 of some embodiments of the present application the process of querying the input information in the preset resource warehouse for response information in the target scenario instance may include:
  • the response information is determined by the saved scene event state and input information, so that the robot can conduct a continuous dialogue with the user, and meet the purpose of the user's multiple rounds of dialogue.
  • the identification information of the target scene instance and the status of the scene event are saved, in order to achieve the continuous execution of multiple rounds of conversations and reduce the number of repeated matching scene instances.
  • the conversation information of the previous user is always saved, it will not only take up a large storage space, but also affect the conversation processing of subsequent users.
  • the robot conversation method further includes: deleting the target scene instance corresponding to the case that the user’s input information is not received within a preset time from the moment the scene event state is updated. All the saved information of the, the saved information includes the scene event status and the identification information of the target scene instance.
  • the time is started at the time when the state of the scene event is updated each time (that is, the time when a dialogue is completed). If the user's input information is not received within the preset time, it is likely to indicate that the user has stopped the dialogue with the robot Therefore, at this time, the related information about the previous user dialogue (that is, the saved scene event state and the identification information of the target scene instance) can be deleted.
  • This method can reduce the storage space occupied by excessive invalid saved information during the dialogue between the robot and the user, and reduce the influence between the dialogues of different users.
  • the traditional robot knowledge base is constructed based on combed knowledge, and cannot call the Application Programming Interface (API) interface and data source of the external platform.
  • API Application Programming Interface
  • the robot is not flexible enough in the dialogue process, and its ability to adapt to scene changes is poor.
  • the resource warehouse may include at least two of an offline database, a preset knowledge base, a tool script, and an open API.
  • some pre-edited offline data can be stored in the offline database, such as the names of the employees of the enterprise and the names of the businesses that the employees are responsible for.
  • the preset knowledge base can include explanations of some professional terms and knowledge content related to the business of the enterprise.
  • Tool scripts can include some corporate business-related script names, script content, and script download links.
  • API is an application program interface. The robot can call the corresponding application level through the open API, or access the corresponding platform for data acquisition. Therefore, through the above methods, the functional boundaries of traditional task-based robots are broken, the data sources of the resource warehouse are greatly expanded, and the flexibility of the robot in the dialogue process and the expansion ability to adapt to scene changes are improved.
  • Fig. 3 shows a schematic flowchart of another embodiment of the robot dialogue method of the present application.
  • the dialogue flow between the user and the robot can include:
  • S202 Judge whether there is a scene instance of the most recent match saved, if there is, go to S203; if not, go to S204;
  • S203 Judge whether the input information is valid input in the last matched scene instance, if it is valid input, go to S208; if it is invalid input, go to S204;
  • S205 Determine whether there is a recommended professional scene instance that can be used as a target scene instance in the scene library, if it exists, go to S208; if it does not exist, go to S206;
  • S206 Determine whether the retrieval scene instance contained in the scene library is a target scene instance matching the input information, if yes, go to S208; if not, go to S207;
  • S207 Determine whether the conversation scene instance included in the scene library is a target scene instance matching the input information, and if the matching is successful, enter S208;
  • the embodiments of the present application are provided with scene instances corresponding to different dialogue scenes. After the user's input information is successfully matched with the scene instances in the preset scene library, the response information is processed according to the target scene instance obtained by the match. Inquiries and responses. It can be seen that this embodiment limits the search range of the response information, thereby reducing the amount of data corresponding to the search range, and simplifies the process of searching for the response information, thereby improving the efficiency of the robot conversation. Moreover, after the search process is simplified, the possibility of searching errors is reduced, thereby improving the accuracy of the conversation reply.
  • the embodiment of the present application saves the most recently matched scene instance, so that it may no longer be necessary to match the scene instance after receiving the user's input information next time, thereby further improving the efficiency of the robot conversation. And by setting recommended professional scene instances, it is possible to reduce the situation where matching scene instances cannot be found, and to improve the reliability of the robot conversation.
  • Chatbot The systems that Zhang San is responsible for include: small and micro merchant service platforms, and QRC, a two-dimensional code system.
  • Chatbot Checking the permission is passed, it is checking for you...
  • Chatbot INC000107-0113:39 to deal with the transaction wave of ICBC Guangdong Branch.
  • Chatbot Exited the operation and maintenance event query window. I can continue to serve you.
  • the robot After the robot obtains the user input information "Hello", it checks that there is no currently saved scene instance of the most recent match. It traverses the work sequence of matching professional scene instances without success, there is no recommended professional scene instance, and the search scene instance is not matched. Finally, Call the conversation scenario instance to process the input information, the input information matches the natural conversation "Hello” in the conversation scenario instance successfully, and a response message of "Hello” is generated, "Welcome to the operation robot, what can I do for you?" Reply.
  • the robot After the robot obtains the user input information "Zhang San", it checks that there is no currently saved scene instance of the most recent match, the work sequence of traversing the matching professional scene instance is unsuccessful, and there is no recommended professional scene instance, and the scene instance matches the input information. Success, in line with the text characteristics of the address book in the retrieval scenario instance.
  • the retrieval scenario instance obtains the address book information of "Zhang San” by querying the address book, and generates response information to return to the user.
  • the robot After the robot obtains the user input information "Yes", it checks the current recommended professional scene instance, confirms the user's intention to enter the scene instance according to the user input information, updates the saved target scene instance to "query system” and deletes the professional scene recommendation In the state, the scene instance of the "query system” is called to process the user's input information.
  • Responsible systems include: small and micro merchant service platform, QR code system QRC.”
  • response messages are generated and returned to users.
  • the robot After the robot obtains the user's input information "How is the ICBC incident handled by Zhang San", it checks the dialogue status.
  • the currently saved professional scene instance is the "query system”, and calls the professional scene instance to process the user's input information.
  • the "query system” professional scene instance judges the input information to be invalid according to the user's input information, and then checks whether there is a recommended professional scene instance according to the input information "How is the ICBC incident handled by Zhang San” (this embodiment is based on the aforementioned In the case that the input information is invalid in the matched scene instance, directly retrieve the recommended professional scene instance scheme), and find that the text characteristics of the scene instance matching the "query operation and maintenance event" match the recommended conditions, and generate a prompt "May I ask” Do you want to switch to the "Operation and Maintenance Event Query” window?" Return to the user.
  • the robot After the robot obtains the user input information "Yes”, it checks that there are currently recommended professional scene instances, confirms the user's intention to enter the scene instance based on the user input information, updates the saved target scene instance to "query operation and maintenance events" and deletes the profession In the recommended state of the scene, the scene instance of the "query operation and maintenance event" is called to process the user's input information.
  • the "query operation and maintenance event" professional scenario example first analyzes the state node of the user's input information that meets the "first entry” state, and invokes the execution operation of the state node to extract the user authority corresponding to the input information. After the user permission check is passed, a prompt “Check permission passed, querying for you" is generated and returned to the user.
  • the robot After the robot obtains the user input information "1", it checks that there is currently a matching professional scene instance "query operation and maintenance event", and calls the professional scene instance to process the user input.
  • the robot continuously monitors the life cycle of the matched professional scene instance saved by the user.
  • the life cycle of the "query operation and maintenance event" is 1 minute. If the user has no subsequent input within 1 minute, the scene instance will be logged out after 1 minute, that is, delete "Query operation and maintenance event” corresponds to all the saved information, and generate a prompt "Exited the operation and maintenance event query window. I can continue to serve you” to inform the user that the currently matched professional scene instance has been cancelled.
  • FIG. 4 shows a schematic structural diagram of an embodiment of the robot dialogue device of the present application.
  • the robot dialogue device 300 may include:
  • the scene library 320 is used to store preset scene instances
  • the resource warehouse 340 is used to store various input information and corresponding response information under each scene instance; the resource warehouse 340 is a resource collection of knowledge, data, and calling functions that the robot depends on;
  • the control module 310 is used to obtain the user's input information; call the scene instance in the scene library 320 to determine the target scene instance matched by the input information; display the response information returned by the execution unit 330;
  • the execution unit 330 is used to query the response information of the input information in the target scene instance in the preset resource warehouse 340; and return the response information to the control module 310, where the execution unit 330 is a functional adapter for the robot to operate the resource warehouse 340,
  • the resources in each resource warehouse 340 such as knowledge bases, APIs, etc., need to be adapted using a separate execution unit 330.
  • the execution unit 330 provides operation support for the scene instance to process user input.
  • the embodiment of the present application is provided with scene instances corresponding to different dialogue scenes. After the user's input information is successfully matched with the scene instances in the preset scene library, the query and display of response information are performed according to the matched target scene instances. It can be seen that this embodiment limits the search range of the response information, thereby reducing the amount of data corresponding to the search range, and also simplifies the search process of the response information, thereby improving the efficiency of the robot conversation. Moreover, after the search process is simplified, the possibility of searching errors is reduced, thereby improving the accuracy of the conversation reply. Among them, the control module 310 implements matching and invocation of scene instances through the functional interface provided by the scene library 320.
  • the scene library 320 may further include: composing all scene instances into a working sequence in a certain order, so that the control module 310 can traverse the scene instances.
  • the priority order of the scene instances is professional scene instance, retrieval scene instance, and conversation scene instance. Multiple professional scene instances can be sorted according to the preset weight and creation time of the scene instance. Of course, this application does not limit this. This method can facilitate the traversal process of the control module 310, and find a matching scene instance as soon as possible.
  • the scene library 320 may further include: under the control of the control module 310, the cache module 350 saves the identification information of the successfully matched scene instance.
  • control module 310 further includes:
  • the life cycle management unit is used to control the scene library 320 to delete all the saved information corresponding to the target scene instance in the cache module 350 when the user's input information is not received within a preset time from the time the scene event state is updated,
  • the saved information includes the status of the scene event and the identification information of the target scene instance.
  • the time is started every time the scene event status is updated, that is, the time when a dialogue is completed. If the user's input information is not received within the preset time, it is likely that the user has stopped the dialogue with the robot. Therefore, at this time, the related information about the conversation with the previous user can be deleted, and the related information about the conversation with the previous user is the saved scene event state and the identification information of the target scene instance.
  • This method can reduce the storage space occupied by excessive invalid saved information during the dialogue between the robot and the user, and reduce the influence between the dialogues of different users.
  • the scene library 320 can also be used to perform operations such as creation, deletion, and management of scene instances under the control of the control module 310.
  • FIG. 5 shows a schematic structural diagram of another embodiment of the robot dialogue device of the present application.
  • the robot dialogue device 300 may also include a cache module 350: for storing successfully matched scene instances.
  • the control module 310 may include:
  • the input information obtaining unit is used to obtain the input information of the user
  • the scene determination unit is configured to use the most recently matched scene instance as the target when the most recently matched scene instance is stored and the input information is valid input in the most recently matched scene instance Scene instance; in the case that the most recently matched scene instance is not saved, the matching unit is triggered.
  • the matching unit is used to determine the target scene instance matching the input information among the scene instances included in the preset scene library, and save the target scene instance as the most recently matched scene instance.
  • the response unit is used to respond according to the response information returned by the execution unit 330.
  • the scene instance is saved, which can be specifically cached, so that after the user inputs information the next time, if the user's input information matches the saved scene instance of the most recent match, then It is no longer necessary to query and match scene instances, but can directly query response information under the most recently matched scene instance, that is, the embodiment of the present application can realize the state maintenance of multiple rounds of conversations, and reduce the time when the conversation is inquired about the scene instance. The amount of data improves the efficiency of session processing.
  • the scene determination unit may also be used to trigger the matching unit when the input information is an invalid input in the last matched scene instance.
  • the matching unit may be used to: match the input information with the scene instances contained in the preset scene library 320 in a preset matching order, and if the matching is successful Next, the successfully matched scene instance is obtained, and the above matching operation is stopped.
  • the preset matching sequence is: first match the professional scene instance, then match the retrieval scene instance, and finally match the conversation scene instance.
  • the matching unit may be used to: obtain key text features in the input information; compare the key text features with the text features of the scene instance currently undergoing the matching process, if If the two are exactly the same, the match is successful; otherwise, the match fails.
  • control module 310 can perform preliminary processing of the input information, including decomposition, filtering, and extraction of key text features of the input information.
  • the matching unit specifically includes:
  • the professional matching unit is used to determine whether there is a target scene instance matching the input information in each professional scene instance included in the scene library 320, if it exists, trigger the execution unit 330 if it does not exist, trigger the search matching unit;
  • the search matching unit is used to determine whether the search scene instance contained in the scene library 320 is a target scene instance matching the input information; if so, trigger the execution unit 330; if not, trigger the conversation matching unit;
  • the conversation matching unit is used to determine whether the conversation scene instance contained in the scene library is a target scene instance matching the input information, and if so, trigger the execution unit 330.
  • the matching unit may further include a recommended matching unit, and the professional matching unit triggers the recommended matching unit when none of the matching succeeds.
  • the recommendation matching unit may be used to determine whether there is a recommended professional scene instance in the scene library 320; if there is a recommended professional scene instance, use the recommended professional scene instance as the target scene instance.
  • the robot recommends the professional scene instance suitable for the user's input information, so that when the user's input information is not rigorous enough, the appropriate scene can be selected as much as possible
  • the instance responds to it to improve the accuracy of the robot conversation.
  • the recommended matching unit of some embodiments of the present application may specifically include: extracting key text features in the input information; determining the degree of matching between the key text features and the text features of each professional scene instance contained in the scene library 320; The professional scene instance whose matching degree reaches the preset matching degree threshold is taken as the recommended professional scene instance.
  • the professional scene instance where the matching degree of the text feature and the key text feature in the input information exceeds the preset matching degree threshold is recommended, because the meaning of the input information is basically determined by the key text in the input information.
  • the characteristics are determined, therefore, the professional scene instance that can reach a certain degree of matching with the key text characteristics is likely to be the content that the user wants to query.
  • the recommended matching unit may further include:
  • the prompt unit is used to display the prompt information of whether to enter the recommended professional scene instance; in the case of receiving the entry instruction input by the user, the recommended professional scene instance is taken as the target scene instance.
  • the user can select one of them as the recommended professional scene instance according to their actual needs. In the case that there is only one recommended professional scene instance, the user can also determine whether the recommended professional scene instance meets his own needs. Therefore, in these embodiments, the recommended professional scene instance is not directly used, but the user selects the professional scene instance according to his own needs. The user experience is better and the reliability of the robot dialogue is higher.
  • the scene determination unit may also be used to trigger the recommended matching unit when the input information is invalid in the scene instance of the last match. Thereby reducing the matching time of scene instances and improving the efficiency of dialogue.
  • FIG. 5 shows a schematic structural diagram of a robot dialogue device provided by another embodiment of the present application; in some embodiments of the present application, the robot dialogue device 300 further includes:
  • the scene instance module 360 is used to control the execution unit 330 to obtain response information according to the user's input information and the current target scene instance.
  • scenario instance module 360 may further include:
  • the authority determining unit is used to extract the user authority corresponding to the input information when the input information is entering the target scene instance for the first time; according to the user authority, determine whether to allow the execution unit 330 to query the response information of the input information in the target scene instance.
  • the input information entering the target scene instance for the first time refers to: the current target scene instance is obtained by matching according to the current input information, rather than the last matched scene instance, that is, the current target scene instance is matched after the match is successful. ,
  • the response message has not been queried in this scenario instance. Since each scenario instance corresponds to part of the information in the resource warehouse 340, this part of information may not be inquired by everyone with permission. Therefore, for the scenario instance corresponding to this part of the information that requires permission to query, enter the information for the first time.
  • the user authority corresponding to the current input information needs to be determined first. If the user has the authority, the corresponding response information can be searched from the resource warehouse 340 to reply. This method can meet the permission setting requirements of different information in the enterprise scenario, and enrich the scope of the robot's dialogue scenario.
  • the scenario instance module 360 may further include:
  • the state control unit is used to update the state of the scene event stored in the cache module 350 according to the response information.
  • the state of the scene event includes the key features of the response information.
  • the cache module 350 can also be used to save scene state information.
  • the scene instance module 360 can also be used to: determine the information to be queried according to the saved scene event state and input information; and query the information to be queried through the execution unit 330 Response information under the target scenario instance.
  • the resource warehouse 340 may include at least two of an offline database, a preset knowledge base, a tool script, and an open API.
  • some pre-edited offline data can be stored in the offline database, such as the names of the employees of the enterprise and the names of the businesses that the employees are responsible for.
  • the preset knowledge base can include explanations of some professional terms and knowledge content related to the business of the enterprise.
  • Tool scripts can include some corporate business-related script names, script content, and script download links.
  • API is an application program interface. The robot can call the corresponding application level through the open API, or access the corresponding platform for data acquisition. Therefore, through the above method, the functional boundary of the traditional task-based robot is broken, the data source of the resource warehouse 340 is greatly expanded, and the flexibility of the robot in the dialogue process and the expansion ability to adapt to scene changes are improved.
  • the robot dialogue method and device in the embodiments of the present application can be implemented by a robot dialogue device.
  • Fig. 6 shows a schematic diagram of the hardware structure of an embodiment of the robot dialogue device of the present application.
  • the robot dialogue device 400 includes an input device 401, an input interface 402, a central processing unit 403, a memory 404, an output interface 405, and an output device 406.
  • the input interface 402, the central processing unit 403, the memory 404, and the output interface 405 are connected to each other through the bus 410, and the input device 401 and the output device 406 are respectively connected to the bus 410 through the input interface 402 and the output interface 405, and then communicate with the robot device 400 other components are connected.
  • the input device 401 receives input information from the outside, and transmits the input information to the central processing unit 403 through the input interface 402; the central processing unit 403 processes the input information based on the computer executable instructions stored in the memory 404 to generate output Information, the output information is temporarily or permanently stored in the memory 404, and then the output information is transmitted to the output device 406 through the output interface 405; the output device 406 outputs the output information to the outside of the robot dialogue device 400 for the user to use.
  • the robot dialogue device shown in FIG. 6 can also be implemented as including: a memory storing computer-executable instructions; and a processor, which can implement what is described in the embodiments of the present application when executing the computer-executable instructions Robot dialogue method and device.
  • the embodiments of the present application also provide a computer-readable storage medium on which computer program instructions are stored; when the computer program instructions are executed by a processor, the robot dialogue method provided in the embodiments of the present application is implemented.
  • Examples of computer-readable storage media may be non-transitory computer-readable storage media, including ROM, RAM, magnetic disks, or optical disks.
  • the functional blocks shown in the above structural block diagram can be implemented as hardware, software, firmware, or a combination thereof.
  • hardware When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, and so on.
  • ASIC application specific integrated circuit
  • the elements of this application are programs or code segments used to perform required tasks.
  • the program or code segment may be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link through a data signal carried in a carrier wave.
  • Machine-readable medium may include any medium that can store or transmit information.
  • machine-readable media examples include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and so on.
  • the code segment can be downloaded via a computer network such as the Internet, an intranet, and so on.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Manipulator (AREA)

Abstract

Disclosed are a robot dialogue method, apparatus and device, and a computer-readable storage medium. The robot dialogue method comprises: acquiring input information of a user; determining a target scenario instance matching the input information; querying, in a preset resource warehouse, response information for the input information in the target scenario instance; and displaying the response information. According to the embodiments of the present application, the process of a robot searching for response information can be simplified, thereby improving robot dialogue efficiency and accuracy.

Description

机器人对话方法、装置、设备及计算机可读存储介质Robot dialogue method, device, equipment and computer readable storage medium
相关申请的交叉引用Cross-references to related applications
本申请要求享有于2019年10月30日提交的名称为“机器人对话方法、装置、设备及计算机可读存储介质”的中国专利申请201911044588.X的优先权,该申请的全部内容通过引用并入本文中。This application claims the priority of the Chinese patent application 201911044588.X entitled "Robot dialogue method, device, equipment and computer-readable storage medium" filed on October 30, 2019. The entire content of this application is incorporated by reference. In this article.
技术领域Technical field
本申请涉及机器人对话技术领域,特别是涉及一种机器人对话方法、装置、设备及计算机可读存储介质。This application relates to the technical field of robot dialogue, and in particular to a method, device, equipment and computer-readable storage medium for robot dialogue.
背景技术Background technique
具有对话功能的机器人本质上是通过声音或文本与人对话交流的计算机程序。作为人工智能的重要应用之一,具有对话功能的机器人目前已经广泛应用到了金融、教育、医疗、电子商务、智能设备等领域。优秀的机器人可以显著提升人们的工作效率,为企业节省较多的人力及时间成本。A robot with a dialogue function is essentially a computer program that communicates with people through voice or text. As one of the important applications of artificial intelligence, robots with dialogue functions have been widely used in finance, education, medical care, e-commerce, smart devices and other fields. Excellent robots can significantly improve people's work efficiency, saving enterprises more manpower and time costs.
相关技术中的机器人依赖于知识库来实现对话,知识库分为三部分:分别是匹配规则、问答知识库和应答模板。Robots in related technologies rely on a knowledge base to achieve dialogue. The knowledge base is divided into three parts: matching rules, question and answer knowledge base, and response template.
在相关技术中,在每次获得用户的输入信息后,首先通过自然语言技术对输入信息进行分析来确定用户意图,然后通过知识库的匹配规则,匹配到和输入信息最相近的问题,再根据应答模板给出相应的回答。匹配的过程中通过自然语言处理、机器学习、文本挖掘等技术优化匹配方式,从而提高机器人响应的准确性。In related technologies, each time the user’s input information is obtained, the input information is first analyzed through natural language technology to determine the user’s intention, and then the knowledge base’s matching rules are used to match the most similar problem to the input information, and then according to The response template gives the corresponding answer. In the matching process, natural language processing, machine learning, text mining and other technologies are used to optimize the matching method to improve the accuracy of the robot's response.
由此可知,现有的机器人响应准确性取决于所实现的自然语言分析技术、知识领域模型和匹配规则,在企业使用的场景中,由于企业的知识存量大且用户使用场景复杂多变,导致会话回复的准确性和效率较低。It can be seen that the accuracy of the existing robot response depends on the realized natural language analysis technology, knowledge domain model and matching rules. In the scenes used by enterprises, due to the large stock of knowledge of enterprises and the complex and changeable user scenarios, The accuracy and efficiency of conversation reply is low.
发明内容Summary of the invention
本申请实施例提供一种机器人对话方法、装置、设备及计算机可读存储介质,能够简化机器人查找应答信息的过程,提高机器人对话效率和准确性。The embodiments of the present application provide a robot dialogue method, device, equipment, and computer-readable storage medium, which can simplify the process of the robot searching for response information and improve the efficiency and accuracy of the robot dialogue.
第一方面,本申请实施例提供了一种机器人对话方法,该方法包括:In the first aspect, an embodiment of the present application provides a robot dialogue method, which includes:
获取用户的输入信息;Obtain user input information;
确定所述输入信息所匹配的目标场景实例;Determine the target scene instance matched by the input information;
在预设的资源仓库内查询所述输入信息在所述目标场景实例下的应答信息;Query the response information of the input information in the target scene instance in the preset resource warehouse;
展示所述应答信息。Show the response information.
第二方面,本申请实施例提供了一种机器人对话装置,该装置包括:In the second aspect, an embodiment of the present application provides a robot dialogue device, which includes:
控制模块,用于获取用户的输入信息;调用场景库中的场景实例,确定所述输入信息所匹配的目标场景实例;展示执行单元返回的应答信息;The control module is used to obtain the user's input information; call the scene instance in the scene library to determine the target scene instance matched by the input information; display the response information returned by the execution unit;
所述场景库,用于保存预设的场景实例;The scene library is used to store preset scene instances;
所述执行单元,用于在预设的资源仓库内查询所述输入信息在所述目标场景实例下的应答信息;并将所述应答信息返回所述控制模块;The execution unit is configured to query response information of the input information in the target scene instance in a preset resource warehouse; and return the response information to the control module;
所述资源仓库,用于保存每个场景实例下包含的输入信息及其对应的应答信息。The resource warehouse is used to store the input information contained in each scenario instance and the corresponding response information.
第三方面,本申请实施例提供了一种机器人对话设备,该设备包括:处理器以及存储有计算机程序指令的存储器;In a third aspect, an embodiment of the present application provides a robot dialogue device, which includes a processor and a memory storing computer program instructions;
处理器执行计算机程序指令时实现本申请实施例第一方面所述的机器人对话方法。The processor implements the robot dialogue method described in the first aspect of the embodiments of the present application when the processor executes the computer program instructions.
第四方面,本申请实施例提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序指令,计算机程序指令被处理器执行时实现本申请实施例第一方面所述的机器人对话方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium. The computer-readable storage medium stores computer program instructions. When the computer program instructions are executed by a processor, the robot described in the first aspect of the embodiments of the present application is implemented. Dialogue method.
本申请实施例设置有对应于不同对话场景的场景实例,在用户的输入信息与预存的场景实例成功匹配后,依据匹配的目标场景实例进行应答信息的查询和回复。可见,本实施例限定了应答信息的查找范围,从而降低了查找范围对应的数据量,也简化了应答信息的查找过程,进而提高了机 器人会话的效率。并且,查找过程简化后,查找错误的可能会降低,从而提高了会话回复的准确性。The embodiment of the application is provided with scene instances corresponding to different dialogue scenes. After the user's input information is successfully matched with the pre-stored scene instance, the query and reply of response information are performed according to the matched target scene instance. It can be seen that this embodiment limits the search range of the response information, thereby reducing the amount of data corresponding to the search range, and also simplifies the process of searching for the response information, thereby improving the efficiency of the robot conversation. Moreover, after the search process is simplified, the possibility of searching errors is reduced, thereby improving the accuracy of the conversation reply.
附图说明Description of the drawings
下面将通过参考附图来描述本申请示例性实施例的特征、优点和技术效果。The features, advantages, and technical effects of exemplary embodiments of the present application will be described below with reference to the accompanying drawings.
图1是本申请的机器人对话方法的实施例的流程示意图;FIG. 1 is a schematic flowchart of an embodiment of the robot dialogue method of the present application;
图2是本申请的机器人对话方法的另一个实施例的流程示意图;2 is a schematic flowchart of another embodiment of the robot dialogue method of the present application;
图3是本申请的机器人对话方法的又一个实施例的流程示意图;FIG. 3 is a schematic flowchart of another embodiment of the robot dialogue method of the present application;
图4是本申请的机器人对话装置的实施例的结构示意图;FIG. 4 is a schematic structural diagram of an embodiment of the robot dialogue device of the present application;
图5是本申请的机器人对话装置的另一个实施例的结构示意图;FIG. 5 is a schematic structural diagram of another embodiment of the robot dialogue device of the present application;
图6是本申请的机器人对话设备的实施例的硬件结构示意图。Fig. 6 is a schematic diagram of the hardware structure of an embodiment of the robot dialogue device of the present application.
具体实施方式Detailed ways
下面结合附图和实施例对本申请的实施方式作进一步详细描述。以下实施例的详细描述和附图用于示例性地说明本申请的原理,但不能用来限制本申请的范围,即本申请不限于所描述的实施例。The implementation of the present application will be described in further detail below with reference to the accompanying drawings and embodiments. The detailed description and drawings of the following embodiments are used to exemplarily illustrate the principle of the present application, but cannot be used to limit the scope of the present application, that is, the present application is not limited to the described embodiments.
在本申请的描述中,需要说明的是,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。In the description of this application, it should be noted that relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities. Or there is any such actual relationship or sequence between operations. Moreover, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes those that are not explicitly listed Other elements of, or also include elements inherent to this process, method, article or equipment. If there are no more restrictions, the element defined by the sentence "including..." does not exclude the existence of other same elements in the process, method, article, or equipment that includes the element.
具有对话功能的机器人对于数据中心运营工作效能有明显提升作用,近年来具有对话功能的机器人已经开始应用于智能客服、基于对话机器人的运维(Chatbot-based Operations,ChatOps)等应用场景。Robots with conversational functions can significantly improve the efficiency of data center operations. In recent years, robots with conversational functions have begun to be used in application scenarios such as intelligent customer service and Chatbot-based Operations (ChatOps).
具有对话功能的机器人技术实现的关键是构建符合需要的知识库,围绕知识库需设计两个核心功能组件,分别是自然语言理解(Natural Language Understanding,NLU)和自然语言表达(Natural Language Generation,NLG)。相关技术中的机器人对话的实现算法模型主要分为检索模型和生成模型两种:The key to the realization of dialogue-enabled robotics technology is to build a knowledge base that meets the needs. Two core functional components need to be designed around the knowledge base, namely, Natural Language Understanding (NLU) and Natural Language Expression (Natural Language Generation, NLG). ). The realization algorithm model of robot dialogue in related technologies is mainly divided into two types: retrieval model and generative model:
本申请实施例应用于检索模型,检索模型要求将知识库分为三部分:分别是匹配规则、问答知识库和应答模板。在获得用户输入信息后,首先通过自然语言技术对信息分析用户意图,然后通过知识库的匹配规则,匹配到和问题库最相近的问题,再根据应答模板给出相应的回答。匹配的过程中通过自然语言处理、机器学习、文本挖掘等技术优化匹配方式,从而提高机器人响应的准确性。The embodiments of the application are applied to a retrieval model, and the retrieval model requires that the knowledge base be divided into three parts: matching rules, question and answer knowledge base, and response template. After obtaining the user's input information, first analyze the user's intentions through natural language technology, and then use the matching rules of the knowledge base to match the closest question to the question library, and then give the corresponding answer according to the response template. In the matching process, natural language processing, machine learning, text mining and other technologies are used to optimize the matching method to improve the accuracy of the robot's response.
检索模型更适用于使用范围明确、对话意图清晰的场景。基于检索模型的机器人的回答质量高,不会出现对话响应语法错误、语义不明、逻辑混乱的问题。因此,面向企业场景的机器人对话操作主要是基于检索模型实现。The retrieval model is more suitable for scenarios where the scope of use is clear and the dialogue intent is clear. The answer of the robot based on the retrieval model is of high quality, and there will be no grammatical errors, unclear semantics, and confusion in the dialogue response. Therefore, the robot dialogue operation oriented to the enterprise scene is mainly realized based on the retrieval model.
为了提供一种能够应用于企业场景下的、具有对话功能的机器人,本申请实施例通过为机器人的对话进行具体场景划分,来实现提高对话效率和准确性的目的。In order to provide a robot with a dialogue function that can be applied in an enterprise scenario, the embodiment of the present application achieves the purpose of improving the efficiency and accuracy of the dialogue by dividing specific scenes for the dialogue of the robot.
下面首先对本申请实施例所提供的机器人对话方法进行介绍,该方法应用于具有对话功能的机器人。图1示出了本申请的机器人对话方法的实施例的流程示意图。如图1所示,该机器人对话方法可以包括:The following first introduces the robot dialogue method provided by the embodiment of the present application, and the method is applied to a robot with a dialogue function. Fig. 1 shows a schematic flowchart of an embodiment of the robot dialogue method of the present application. As shown in Figure 1, the robot dialogue method may include:
S101、获取用户的输入信息;S101. Obtain user input information;
用户在与机器人进行对话的过程中,用户与机器人之间的人机交互可以是语音交互、或者通过触控屏幕或键盘实现的。当然,本申请不限定具体的人机交互方式。In the process of the user's dialogue with the robot, the human-computer interaction between the user and the robot may be voice interaction, or realized through a touch screen or keyboard. Of course, this application does not limit specific human-computer interaction methods.
S102、确定输入信息所匹配的目标场景实例;S102: Determine a target scene instance matched by the input information;
由于在企业场景下,用户与机器人之间的交互应该有明确的使用意图,对用户一类相似的对话意图进行概括,即总结为机器人的一个场景实例。通过场景实例能够将用户的可能输入意图基于场景进行划分,从而方便后 续分别为每一类场景提供个性化的应答,且能够使机器人具有较好的响应能力,能适应复杂多变的应用场景需要。并且,由于场景实例之间的独立性,这种设计确保了新的场景实例加入后不会对已有的场景实例造成查询干扰,实现了机器人对话范围的快速拓展。Since in the enterprise scenario, the interaction between the user and the robot should have a clear intention to use, a similar conversational intention of the user should be summarized, that is, a scenario instance of the robot. The possible input intentions of the user can be divided based on the scene through the scene instance, so that it is convenient to provide a personalized response for each type of scene in the subsequent, and can make the robot have better responsiveness, and can adapt to the needs of complex and changeable application scenarios. . Moreover, due to the independence between the scene instances, this design ensures that the new scene instance will not cause query interference to the existing scene instance after the addition of the new scene instance, and realizes the rapid expansion of the robot dialogue range.
S103、在预设的资源仓库内查询输入信息在目标场景实例下的应答信息;S103: Query the response information of the input information in the target scene instance in the preset resource warehouse;
S104、展示应答信息。S104. Display response information.
其中,这里的展示方式,可以是在屏幕上进行显示,或者可以是语音播报,或者还可以是通过与机器人相连的用户终端进行显示等,本申请不限定具体的展示方式。Wherein, the display method here may be display on the screen, or voice broadcast, or display through a user terminal connected to the robot, etc. The application does not limit the specific display method.
本申请实施例设置有对应于不同对话场景的场景实例,在用户的输入信息与预存的场景实例成功匹配后,依据匹配的模板场景实例进行应答信息的查询和展示。可见,本实施例限定了应答信息的查找范围,从而降低了查找范围对应的数据量,也简化了应答信息的查找过程,进而提高了机器人会话的效率。并且,查找过程简化后,查找错误的可能会降低,从而提高了会话回复的准确性。The embodiment of the present application is provided with scene instances corresponding to different dialogue scenes. After the user's input information is successfully matched with the pre-stored scene instance, the query and display of response information are performed according to the matched template scene instance. It can be seen that this embodiment limits the search range of the response information, thereby reducing the amount of data corresponding to the search range, and also simplifies the search process of the response information, thereby improving the efficiency of the robot conversation. Moreover, after the search process is simplified, the possibility of searching errors is reduced, thereby improving the accuracy of the conversation reply.
在前述实施例的基础上,本申请还提供了另一些实施例,参见图2所示,图2示出了本申请的机器人对话方法的另一个实施例的流程示意图。在这些实施例的S102中,确定输入信息所匹配的目标场景实例的方法可以包括:On the basis of the foregoing embodiments, the present application also provides other embodiments, as shown in FIG. 2, which shows a schematic flowchart of another embodiment of the robot dialogue method of the present application. In S102 of these embodiments, the method for determining the target scene instance matched by the input information may include:
S102a、判断是否保存有最近一次匹配的场景实例,若有,进入S102b;若没有,进入S102c;S102a. Judge whether there is a scene instance of the most recent match, if so, go to S102b; if not, go to S102c;
S102b、判断输入信息在最近一次匹配的场景实例内是否为有效输入,若是,将最近一次匹配的场景实例作为目标场景实例;进入S103;S102b: Determine whether the input information is valid input in the last matched scene instance, if so, use the last matched scene instance as the target scene instance; go to S103;
S102c、在预设的场景库内包含的场景实例中,确定与输入信息匹配的目标场景实例,并将目标场景实例保存为最近一次匹配的场景实例,进入S103。S102c: Among the scene instances included in the preset scene library, determine the target scene instance matching the input information, and save the target scene instance as the most recently matched scene instance, and then proceed to S103.
在本实施中,在每次成功匹配场景实例之后,会将成功匹配的场景实例进行保存,例如可以通过缓存保存,使得下一次用户输入信息之后,若 用户的输入信息符合最近一次匹配的场景实例,则不再需要进行场景实例的查询和匹配,而是可以直接在最近一次匹配的场景实例下进行应答信息的查询,即本申请实施例能够实现多轮会话的状态保持,降低会话查询场景实例时的数据量,提高会话处理效率。并且,通过本实施例,能够实现用户在场景实例之间的跳转切换,实现用户与机器人的多轮对话。In this implementation, after each successful matching of the scene instance, the successfully matched scene instance will be saved, for example, it can be saved through a cache, so that after the next user input information, if the user's input information matches the most recently matched scene instance , It is no longer necessary to query and match the scene instance, but can directly query the response information under the most recently matched scene instance, that is, the embodiment of the present application can realize the state maintenance of multiple rounds of conversations and reduce the number of conversation query scene instances. The amount of data at the same time improves the efficiency of session processing. In addition, through this embodiment, the user can switch between scene instances and realize multiple rounds of dialogue between the user and the robot.
其中,上述有效输入指的是输入信息符合最近一次匹配的场景实例的输入要求。具体的,判断输入信息是否为有效输入的过程,可以为:判断输入信息是否符合最近一次匹配的场景实例的预设输入规则;或者还可以为:将输入信息与最近一次匹配的场景实例进行匹配,若匹配,则表明为有效输入。Among them, the above valid input refers to that the input information meets the input requirements of the most recently matched scene instance. Specifically, the process of judging whether the input information is valid input can be: judging whether the input information meets the preset input rules of the last matched scene instance; or it can also be: matching the input information with the last matched scene instance If it matches, it means it is a valid input.
进一步的,在一些实施例中,保存成功匹配的场景实例的方法可以为:利用成功匹配的场景实例更新之前保存的最近一次匹配的场景实例。这样使得,同一时间内,最多仅保存有一个匹配的场景实例,即一个目标场景实例。当然,在其他实施例中,也可以不进行更新,而是直接单独保存本次成功匹配的场景实例,这种情况下,则可能出现同时保存有多个匹配的场景实例的情况,此时在每次接收到输入信息后,仅需要判断输入信息在最近一次保存的场景实例内是否为有效输入。具体采用以上哪种方法,本申请不作限定。Further, in some embodiments, the method of saving the successfully matched scene instance may be: using the successfully matched scene instance to update the previously saved scene instance of the most recent match. In this way, at most, only one matching scene instance, that is, one target scene instance, can be saved at the same time. Of course, in other embodiments, the update may not be performed, but the scene instance that was successfully matched this time is directly saved separately. In this case, there may be a situation in which multiple matched scene instances are saved at the same time. After each input information is received, it is only necessary to determine whether the input information is valid input in the last saved scene instance. The specific method used above is not limited in this application.
基于前述实施例,在本申请的另一些实施例中,S102还可以包括:Based on the foregoing embodiments, in other embodiments of the present application, S102 may further include:
在输入信息在最近一次匹配的场景实例内为无效输入的情况下,在预设的场景库内包含的场景实例中,确定与输入信息匹配的目标场景实例,并将目标场景实例保存为最近一次匹配的场景实例In the case that the input information is invalid in the scene instance of the last match, among the scene instances contained in the preset scene library, determine the target scene instance that matches the input information, and save the target scene instance as the most recent Examples of matching scenarios
基于前述实施例,在本申请的另一些实施例的S102c中,在预设的场景库内包含的场景实例中,确定与所述输入信息匹配的目标场景实例的方法具体包括:将输入信息按照预设匹配顺序依次与场景库内包含的场景实例进行匹配,在匹配成功的情况下,停止匹配操作,其中,预设匹配顺序为:首先匹配专业场景实例、之后匹配检索场景实例、最后匹配会话场景实例。Based on the foregoing embodiment, in S102c of some other embodiments of the present application, among the scene instances included in the preset scene library, the method of determining the target scene instance matching the input information specifically includes: The preset matching order is sequentially matched with the scene instances contained in the scene library. If the matching is successful, the matching operation is stopped. The preset matching order is: first match the professional scene instance, then match the retrieval scene instance, and finally match the session Scene instance.
上述匹配过程的具体过程为:The specific process of the above matching process is:
在场景库包含的各个专业场景实例中,确定是否存在与输入信息匹配的目标场景实例;In each professional scene instance contained in the scene library, determine whether there is a target scene instance matching the input information;
若存在与输入信息匹配的目标场景实例,则进入S103,若不存在与输入信息匹配的目标场景实例,则确定场景库包含的检索场景实例是否为与输入信息匹配的目标场景实例;If there is a target scene instance matching the input information, proceed to S103, if there is no target scene instance matching the input information, it is determined whether the retrieval scene instance contained in the scene library is a target scene instance matching the input information;
若检索场景实例是目标场景实例,则进入S103;若检索场景实例不是目标场景实例,则确定场景库包含的会话场景实例是否为与输入信息匹配的目标场景实例。If the retrieval scene instance is a target scene instance, then proceed to S103; if the retrieval scene instance is not a target scene instance, it is determined whether the conversation scene instance contained in the scene library is a target scene instance matching the input information.
其中,本实施例中的输入信息与场景实例的匹配,指的是输入信息中的关键文本特征与场景实例的文本特征的完全匹配。即匹配过程如下:提取输入信息中的关键文本特征;将关键文本特征与当前进行匹配过程的场景实例的文本特征进行比对,若两者完全相同,则匹配成功;否则,匹配失败。Wherein, the matching between the input information and the scene instance in this embodiment refers to the complete match between the key text feature in the input information and the text feature of the scene instance. That is, the matching process is as follows: extract the key text features in the input information; compare the key text features with the text features of the scene instance currently undergoing the matching process, if the two are exactly the same, the matching is successful; otherwise, the matching fails.
在面向企业场景的机器人与用户进行对话的过程中,对话可以分为三类:专业类型对话、检索类型对话和会话场景对话。其中,检索类型对话包括一些对于专业知识的查询,例如常见问题解答(Frequently Asked Questions,FAQ)等。会话类型对话包括自然交流类的会话,例如日常问候等。专业类型对话的内容包括除以上两者之外的其他会话,主要是一些和企业相关的内容,例如企业员工的职位、员工的业务范围、企业的业务范围、企业的产品列表等。由于专业场景具有较宽的范围的较为复杂的会话需求,因此专业场景包括多个专业场景实例,而检索场景和会话场景仅包含一个场景实例。In the process of a conversation between a robot oriented to an enterprise scene and a user, the conversation can be divided into three types: professional conversation, retrieval conversation, and conversation scenario conversation. Among them, the search type dialogue includes some queries for professional knowledge, such as Frequently Asked Questions (FAQ) and so on. Conversational conversations include natural communication conversations, such as daily greetings. The content of professional type conversations includes other conversations besides the above two, mainly some content related to the enterprise, such as the position of the company employee, the employee's business scope, the company's business scope, and the company's product list. Since the professional scene has a wide range of more complex conversational requirements, the professional scene includes multiple professional scene instances, while the retrieval scene and the conversation scene only include one scene instance.
由于专业类型会话的范围最广,因此出于提高效率的目的,首先需要判断用户的输入信息是否符合专业场景实例,若不符合专业场景实例,再判断输入信息是否符合检索场景实例,若不符合检索场景实例,再判断输入信息是否满足会话场景实例。Since the scope of professional conversations is the widest, for the purpose of improving efficiency, it is first necessary to determine whether the user's input information meets the professional scene instance. If it does not meet the professional scene instance, then judge whether the input information meets the retrieval scene instance. Retrieve the scene instance, and then judge whether the input information meets the conversation scene instance.
此外,在本申请的一些实施例中,可以将场景库中的所有场景实例按照一定顺序组成工作序列,以方便在场景过程中进行场景实例的遍历。其中,场景实例的优先顺序依次是专业场景实例、检索场景实例、会话场景 实例,多个专业场景实例可以按照场景实例的预设权重和创建时间进行排序,当然,本申请对此不作限定。这种方式能够方便场景实例的遍历过程,尽快找到相匹配的场景实例。In addition, in some embodiments of the present application, all the scene instances in the scene library may be formed into a work sequence in a certain order to facilitate the traversal of the scene instances during the scene process. Among them, the priority order of the scene instances is the professional scene instance, the retrieval scene instance, and the conversation scene instance. Multiple professional scene instances can be sorted according to the preset weight and creation time of the scene instance. Of course, this application does not limit this. This method can facilitate the traversal process of scene instances and find matching scene instances as soon as possible.
需要注意的是,在本申请的一些实施例中,机器人能够区分不同的用户,可以同时建立多个分别针对不同用户的会话流程。其中,区分不同用户的方式可以为声纹识别,或者还可以是根据用户的登录账号进行区分,本申请对此不作限定。但是,在上述方式下,对于同一个用户的对话,最多保存一个匹配的专业场景实例,即,对于同一个用户,在同一时刻仅能够建立一个会话流程。若机器人无法区分不同用户的话,则同一时刻仅能够有一个会话流程,机器人所获取的输入信息可以来自不同的用户。It should be noted that in some embodiments of the present application, the robot can distinguish different users, and can simultaneously establish multiple conversation flows for different users. Among them, the way to distinguish different users may be voiceprint recognition, or may also be distinguished according to the user's login account, which is not limited in this application. However, in the above manner, for the conversation of the same user, at most one matching professional scene instance is saved, that is, for the same user, only one conversation process can be established at the same time. If the robot cannot distinguish between different users, there can only be one conversation flow at the same time, and the input information obtained by the robot can come from different users.
在部分情况下,用户的输入信息可能并未严格按照输入规则或者输入字段进行输入,因此,无法与专业场景实例进行完全匹配,但由于用户的输入信息实际上属于专业场景实例的范围,因此即使将其与检索场景实例或者会话场景实例进行匹配,也无法匹配成功,这就会导致应答失败的情况,降低了机器人的可用性。In some cases, the user’s input information may not be entered strictly in accordance with the input rules or input fields. Therefore, it cannot be completely matched with the professional scene instance. However, because the user’s input information actually belongs to the scope of the professional scene instance, even If it is matched with the retrieval scene instance or the conversation scene instance, the matching will not succeed, which will lead to the failure of the response and reduce the usability of the robot.
为了解决上述技术问题,在本申请的其他实施例中,在专业场景实例中,不存在与输入信息匹配的目标场景实例的情况下,将输入信息与检索场景实例匹配之前,该方法还可以包括:In order to solve the above technical problems, in other embodiments of the present application, in the case that there is no target scene instance matching the input information in the professional scene instance, before matching the input information with the retrieval scene instance, the method may also include :
确定场景库内是否存在能够作为目标场景实例的推荐的专业场景实例判断场景库内是否存在推荐的专业场景实例;Determine whether there is a recommended professional scene instance that can be used as a target scene instance in the scene library to determine whether there is a recommended professional scene instance in the scene library;
在存在推荐的专业场景实例的情况下,将推荐的专业场景实例作为目标场景实例。In the case where there is a recommended professional scene instance, the recommended professional scene instance is taken as the target scene instance.
在本实施中,在没有匹配的专业场景实例的情况下,由机器人推荐适合于用户的输入信息的专业场景实例,从而在用户的输入信息不够严谨的情况,也能够尽可能选择合适的专业场景实例对其进行应答,提高机器人会话的准确性。In this implementation, when there is no matching professional scene instance, the robot recommends the professional scene instance suitable for the user's input information, so that when the user's input information is not rigorous enough, the appropriate professional scene can be selected as much as possible The instance responds to it to improve the accuracy of the robot conversation.
进一步的,在本申请的一些实施例中,判断场景库内是否存在推荐的专业场景实例的过程可以为:Further, in some embodiments of the present application, the process of judging whether there is a recommended professional scene instance in the scene library may be:
提取输入信息中的关键文本特征;Extract key text features in the input information;
确定所述关键文本特征与所述场景库内包含的各个专业场景实例的文本特征的匹配度;Determining the degree of matching between the key text feature and the text feature of each professional scene instance contained in the scene library;
将匹配度达到预设匹配度阈值的专业场景实例作为推荐的专业场景实例。The professional scene instance whose matching degree reaches the preset matching degree threshold is taken as the recommended professional scene instance.
在本实施例中,将文本特征与输入信息中的关键文本特征的匹配度超出预设匹配度阈值的专业场景实例进行推荐,由于输入信息想要表达的含义基本是由输入信息中的关键文本特征决定的,因此,能够与关键文本特征达到一定匹配度的专业场景实例很可能就是用户想要查询的内容。通过上述方式,能够尽可能找到合适的专业场景实例进行推荐,从而提高机器人应答的准确性。In this embodiment, the professional scene instance where the matching degree of the text feature and the key text feature in the input information exceeds the preset matching degree threshold is recommended, because the meaning of the input information is basically determined by the key text in the input information. The characteristics are determined, therefore, the professional scene instance that can reach a certain degree of matching with the key text characteristics is likely to be the content that the user wants to query. Through the above method, it is possible to find a suitable professional scene instance for recommendation as much as possible, thereby improving the accuracy of the robot's response.
基于前述提到的实施例,由于推荐的专业场景实例是根据用户的输入信息与专业场景实例是否相似来确定的,但是由于用户的输入信息并不准确,因此可能存在同时找到多个推荐的专业场景实例的情况,并且,所推荐的专业场景实例也可能与用户需求存在差异,若直接默认使用推荐的专业场景实例的话,可能会导致回复错误的应答信息给用户。Based on the aforementioned embodiment, since the recommended professional scene instance is determined according to whether the user's input information is similar to the professional scene instance, but because the user's input information is not accurate, there may be multiple recommended professions found at the same time. In the case of the scene instance, and the recommended professional scene instance may also be different from the user's needs, if the recommended professional scene instance is directly used by default, it may cause the wrong response message to be returned to the user.
因此,为了解决上述技术问题,在本申请的一些实施例中,在存在推荐的专业场景实例的情况下,还包括:Therefore, in order to solve the above-mentioned technical problems, in some embodiments of the present application, when there are recommended professional scene examples, the method further includes:
展示是否进入推荐的专业场景实例的提示信息;Show the prompt information about whether to enter the recommended professional scene instance;
在接收到用户输入的进入指令的情况下,将推荐的专业场景实例作为目标场景实例。In the case of receiving the entry instruction input by the user, the recommended professional scene instance is taken as the target scene instance.
在这些实施例中,通过对推荐的专业场景实例进行提示,在存在多个推荐的专业场景实例的情况下,用户能够根据自身的实际需求来选择其中一个作为推荐的专业场景实例。在仅存在一个推荐的专业场景实例的情况下,用户也能够确定该推荐的专业场景实例是否符合自身需求。因此,在这些实施例中,并未直接将推荐的专业场景实例进行使用,而是由用户选择自身需求的专业场景实例,用户体验更好,机器人对话的可靠性更高。In these embodiments, by prompting the recommended professional scene instances, in the case where there are multiple recommended professional scene instances, the user can select one of them as the recommended professional scene instance according to their actual needs. In the case that there is only one recommended professional scene instance, the user can also determine whether the recommended professional scene instance meets his own needs. Therefore, in these embodiments, the recommended professional scene instance is not directly used, but the user selects the professional scene instance according to his own needs. The user experience is better and the reliability of the robot dialogue is higher.
另外,在本申请的一些实施例中,可以在输入信息在最近一次匹配的场景实例内为无效输入的情况下,不用将输入信息与专业场景实例依次进行匹配,而是直接执行上述选择推荐的专业场景实例的操作。这种方式是 由于在连续会话过程中,若当前会话所属的场景实例发生变化,直接通过查找推荐的专业场景实例、检索场景实例以及会话场景实例即能够基本确定符合的场景实例,从而减少场景实例的匹配时间,提高对话效率。In addition, in some embodiments of the present application, when the input information is invalid input in the last matched scene instance, it is not necessary to sequentially match the input information with the professional scene instance, but directly execute the above-mentioned selection recommendation. Operation of professional scene examples. This method is because in the continuous conversation process, if the scene instance to which the current conversation belongs changes, you can basically determine the matching scene instance by directly searching for the recommended professional scene instance, retrieving the scene instance, and the conversation scene instance, thereby reducing the scene instance. Matching time, improve the efficiency of dialogue.
在本申请的一些实施例中,预存的每个场景实例均包含预设的执行规则,执行规则包括用户的输入信息对应的各个状态节点以及每个状态节点对应的执行操作。这些状态节点可以包括以下任意几种的组合:输入信息首次进入场景实例、等待输入信息、输入信息无效、输入信息有效、超出预设时间未响应导致场景实例退出、主动结束场景实施等。当然,还可以包含其他状态节点,不同的场景实例对应的执行规则可以相同也可以不同,具体场景实例对应的执行规则可以根据实际情况而定,例如根据用户意图进行个性化设计,本申请对此不作限定。In some embodiments of the present application, each pre-stored scenario instance includes a preset execution rule, and the execution rule includes each state node corresponding to the user's input information and the execution operation corresponding to each state node. These state nodes can include any of the following combinations: input information enters the scene instance for the first time, waiting for input information, input information is invalid, input information is valid, the scene instance exits due to unresponsiveness beyond a preset time, and the scene implementation is actively ended. Of course, other state nodes can also be included. The execution rules corresponding to different scene instances can be the same or different. The execution rules corresponding to specific scene instances can be determined according to actual conditions, such as personalized design according to user intentions. Not limited.
在企业场景中,许多信息设置有查询权限,有权限的用户才能进行查询,基于此,在本申请的另一些实施例中,该机器人会话方法还可以包括:In the enterprise scenario, many information is set with query permissions, and only authorized users can query. Based on this, in some other embodiments of the present application, the robot conversation method may also include:
在输入信息为首次进入目标场景实例的情况下,提取输入信息对应的用户权限;In the case where the input information is an instance of entering the target scene for the first time, extract the user authority corresponding to the input information;
依据用户权限,确定是否允许通过资源仓库查询输入信息在目标场景实例下的应答信息。According to the user's authority, determine whether it is allowed to query the response information of the input information in the target scenario instance through the resource warehouse.
在这些实施例中,输入信息首次进入目标场景实例指的是:当前目标场景实例是根据当前的输入信息匹配得到的,而不是最近一次匹配的场景实例,即,目标场景实例在匹配成功后,尚未在该场景实例下查询过应答消息。由于每个场景实例会对应资源仓库内的部分信息,但是这部分信息不一定是每个人均有权限查询的,因此对于这部分需要权限才能查询的信息对应的场景实例,在输入信息首次进入目标场景实例后,需要首先确定当前输入信息对应的用户权限,若用户有权限,则才能够从资源仓库内查找对应的应答信息进行回复。这种方式能够满足企业场景下的不同信息的权限设置需求,丰富了机器人的对话情景范围。In these embodiments, the input information entering the target scene instance for the first time refers to: the current target scene instance is obtained by matching the current input information, rather than the last matched scene instance, that is, after the target scene instance is successfully matched, The response message has not been queried in this scenario instance. Since each scenario instance corresponds to part of the information in the resource warehouse, this part of information may not be inquired by everyone. Therefore, for the scenario instance corresponding to this part of the information that requires permission to query, enter the target for the first time after entering the information After the scenario instance, you need to first determine the user authority corresponding to the current input information. If the user has the authority, he can find the corresponding response information from the resource warehouse and reply. This method can meet the permission setting requirements of different information in the enterprise scenario, and enrich the scope of the robot's dialogue scenario.
其中,上述提取输入信息对应的用户权限的方法可以为:获取输入信息携带的用户标识,查询预存的权限列表内该用户标识对应的用户权限。其中,用户标识可以为用户名或者账号等,获取方式可以是接收用户通过 触屏或者键盘输入的用户标识,或者还可以是根据语音输入的声纹信息比对得到用户的标识,本申请对此不作限定。Wherein, the method for extracting the user authority corresponding to the input information may be: obtaining the user identifier carried in the input information, and querying the user authority corresponding to the user identifier in the pre-stored authority list. Among them, the user ID can be a user name or account number, etc., and the acquisition method can be to receive the user ID input by the user through a touch screen or keyboard, or it can also be a comparison of the voiceprint information input by the voice to obtain the user ID. Not limited.
在本申请的一些实施例的S104之后,该机器人会话方法还包括:After S104 in some embodiments of the present application, the robot conversation method further includes:
依据应答信息更新保存的场景事件状态,场景事件状态包括应答信息的关键特征。其中,对于场景事件状态的控制逻辑可以通过有限状态机或者决策树等方法实现。The saved scene event status is updated according to the response information, and the scene event status includes the key features of the response information. Among them, the control logic for the state of the scene event can be implemented by methods such as a finite state machine or a decision tree.
在部分会话过程中,前后会话存在连贯性。例如,用户的输入信息为“查询业务类型”,机器人回复的应答信息为“类型1:业务A;类型2:业务B;请输入查询序号”,则后续用户的输入信息会基于前述机器人的应答消息,回复“1”或者“2”。在这种情况下,为了保证机器人的应答信息能够基于连贯性进行回复,因此,需要对之前回复的应答信息的关键特征进行保存。例如,可以保存“1=业务A,2=业务B”的信息,从而在后续继续接收用户的输入信息后,能够根据输入信息以及之前保存的关键特征来进行应答信息的查询,实现多轮会话连贯进行的目的。In part of the conversation, there is continuity between the previous and subsequent conversations. For example, if the user's input information is "query business type", the robot's response information is "type 1: business A; type 2: business B; please enter the query serial number", the subsequent user input will be based on the aforementioned robot's response Message, reply "1" or "2". In this case, in order to ensure that the robot's response information can respond based on continuity, it is necessary to save the key features of the previous response information. For example, you can save the information of "1=Business A, 2=Business B", so that after continuing to receive user input information, you can query the response information according to the input information and the key features saved before, realizing multiple rounds of conversations The purpose of coherence.
基于前述实施例,在本申请的一些实施例的步骤S103中,在预设的资源仓库内查询输入信息在目标场景实例下的应答信息的过程可以包括:Based on the foregoing embodiment, in step S103 of some embodiments of the present application, the process of querying the input information in the preset resource warehouse for response information in the target scenario instance may include:
依据输入信息以及保存的场景事件状态,确定待查询信息;Determine the information to be queried according to the input information and the saved scene event status;
在资源仓库内查询待查询信息在目标场景实例下的应答信息。Query the response information of the information to be queried in the target scenario instance in the resource warehouse.
其中,待查询信息指的是:根据前一次会话过程中保存的场景事件状态以及本轮会话中的输入信息所确定的需要查询的信息。例如,保存的场景事件状态为“1=业务A,2=业务B”,输入信息为“1”,则待查询信息为业务A的内容。在本实施例中,通过保存的场景事件状态以及输入信息来确定应答信息,使得机器人能够与用户进行连贯性对话,满足用户多轮对话的目的。Among them, the information to be queried refers to the information that needs to be queried determined according to the state of the scene event saved in the previous session and the input information in the current round of the session. For example, if the status of the saved scene event is "1=Business A, 2=Business B", and the input information is "1", the information to be queried is the content of Business A. In this embodiment, the response information is determined by the saved scene event state and input information, so that the robot can conduct a continuous dialogue with the user, and meet the purpose of the user's multiple rounds of dialogue.
根据前述实施例可知,在本申请的一些实施例中,会保存目标场景实例的标识信息以及场景事件状态,目的是为了实现多轮会话的连贯执行并且减少重复匹配场景实例的次数,但是由于机器人会和不同的用户进行对话,若是始终保存有之前的用户的对话信息,则不仅会占用较大的存储空间,并且还会影响后续用户的对话处理。According to the foregoing embodiments, in some embodiments of the present application, the identification information of the target scene instance and the status of the scene event are saved, in order to achieve the continuous execution of multiple rounds of conversations and reduce the number of repeated matching scene instances. However, due to the robot There will be conversations with different users. If the conversation information of the previous user is always saved, it will not only take up a large storage space, but also affect the conversation processing of subsequent users.
基于此,在本申请的另一些实施例中,该机器人会话方法还包括:在自更新场景事件状态的时刻起的预设时间内未接收到用户的输入信息的情况下,删除目标场景实例对应的全部保存信息,保存信息包括场景事件状态以及目标场景实例的标识信息。Based on this, in some other embodiments of the present application, the robot conversation method further includes: deleting the target scene instance corresponding to the case that the user’s input information is not received within a preset time from the moment the scene event state is updated. All the saved information of the, the saved information includes the scene event status and the identification information of the target scene instance.
在本实施例中,在每次更新场景事件状态的时刻(即完成一次对话的时刻)开始计时,若在预设时间内没有接收到用户的输入信息,很可能表明用户已经停止与机器人的对话,因此,此时可以将与之前用户对话的相关信息(即保存的场景事件状态和目标场景实例的标识信息)进行删除。这种方式能够降低机器人与用户对话过程中,过多的无效保存信息对存储空间的占用,并减少不同用户的对话之间的影响。In this embodiment, the time is started at the time when the state of the scene event is updated each time (that is, the time when a dialogue is completed). If the user's input information is not received within the preset time, it is likely to indicate that the user has stopped the dialogue with the robot Therefore, at this time, the related information about the previous user dialogue (that is, the saved scene event state and the identification information of the target scene instance) can be deleted. This method can reduce the storage space occupied by excessive invalid saved information during the dialogue between the robot and the user, and reduce the influence between the dialogues of different users.
此外,由于现有的机器人的对话能力的边界受知识库限制,传统的机器人知识库基于已梳理知识构建,无法调用外部平台的应用程序调用接口(Application Programming Interface,API)接口和数据源,因此,机器人在对话过程中不够灵活,适应场景变化的拓展能力较差。In addition, because the boundaries of the existing robot’s dialogue capabilities are limited by the knowledge base, the traditional robot knowledge base is constructed based on combed knowledge, and cannot call the Application Programming Interface (API) interface and data source of the external platform. , The robot is not flexible enough in the dialogue process, and its ability to adapt to scene changes is poor.
为了解决上述技术问题,在本申请实施例中,资源仓库可以包括离线数据库、预设知识库、工具脚本以及开放API中的至少两者。In order to solve the above technical problems, in the embodiment of the present application, the resource warehouse may include at least two of an offline database, a preset knowledge base, a tool script, and an open API.
其中,离线数据库内可以保存一些预先编辑的离线数据,例如企业员工的名称、员工负责的业务名称等。预设知识库可以包含一些专业名词的解释以及企业业务相关的知识内容等。工具脚本可以包含一些企业业务相关的脚本名称、脚本内容以及脚本下载链接等。API为应用程序接口,机器人能够通过开放的API来调用对应的应用程度,或者接入对应的平台进行数据获取。因此,通过上述方式,打破了传统任务型机器人的功能边界,大大扩展了资源仓库的数据来源,提高了机器人在对话过程中的灵活性以及适应场景变化的拓展能力。Among them, some pre-edited offline data can be stored in the offline database, such as the names of the employees of the enterprise and the names of the businesses that the employees are responsible for. The preset knowledge base can include explanations of some professional terms and knowledge content related to the business of the enterprise. Tool scripts can include some corporate business-related script names, script content, and script download links. API is an application program interface. The robot can call the corresponding application level through the open API, or access the corresponding platform for data acquisition. Therefore, through the above methods, the functional boundaries of traditional task-based robots are broken, the data sources of the resource warehouse are greatly expanded, and the flexibility of the robot in the dialogue process and the expansion ability to adapt to scene changes are improved.
基于前述各个实施例,以下为本申请一个具体实施例中的机器人对话流程。图3示出了本申请的机器人对话方法的又一个实施例的流程示意图。用户与机器人之间的对话流程可以包括:Based on the foregoing embodiments, the following is a robot dialogue flow in a specific embodiment of the application. Fig. 3 shows a schematic flowchart of another embodiment of the robot dialogue method of the present application. The dialogue flow between the user and the robot can include:
S201、获取用户的输入信息;S201. Obtain user input information;
S202、判断是否保存有最近一次匹配的场景实例,若有,则进入S203; 若没有,则进入S204;S202: Judge whether there is a scene instance of the most recent match saved, if there is, go to S203; if not, go to S204;
S203、判断输入信息在最近一次匹配的场景实例内是否为有效输入,若是有效输入,则进入S208;若为无效输入,则进入S204;S203: Judge whether the input information is valid input in the last matched scene instance, if it is valid input, go to S208; if it is invalid input, go to S204;
S204、在场景库包含的各个专业场景实例中,确定是否存在与输入信息匹配的目标场景实例,若存在,进入S208;若不存在,则进入S205;S204. In each professional scene instance contained in the scene library, determine whether there is a target scene instance matching the input information, if it exists, go to S208; if it does not exist, go to S205;
S205、确定场景库内是是否存在能够作为目标场景实例的推荐的专业场景实例,若存在,进入S208;若不存在,则进入S206;S205: Determine whether there is a recommended professional scene instance that can be used as a target scene instance in the scene library, if it exists, go to S208; if it does not exist, go to S206;
S206、确定场景库包含的检索场景实例是否为与输入信息匹配的目标场景实例,若是,进入S208;若不是,则进入S207;S206: Determine whether the retrieval scene instance contained in the scene library is a target scene instance matching the input information, if yes, go to S208; if not, go to S207;
S207、确定场景库包含的会话场景实例是否为与输入信息匹配的目标场景实例,若匹配成功,进入S208;S207: Determine whether the conversation scene instance included in the scene library is a target scene instance matching the input information, and if the matching is successful, enter S208;
S208、将目标场景实例保存为最近一次匹配的场景实例,并在资源仓库内查询输入信息在目标场景实例下的应答信息;S208. Save the target scene instance as the most recently matched scene instance, and query the input information in the resource warehouse for response information under the target scene instance;
S209、展示应答信息,并依据应答信息更新保存的场景事件状态。S209. Display response information, and update the saved scene event state according to the response information.
综上所述,本申请实施例设置有对应于不同对话场景的场景实例,在用户的输入信息与预设的场景库内的场景实例成功匹配后,依据匹配得到的目标场景实例进行应答信息的查询和回复。可见,本实施例限定了应答信息的查找范围,从而降低了查找范围对应的数据量,也简化了应答信息的查找过程,进而提高了机器人会话的效率。并且,查找过程简化后,查找错误的可能会降低,从而提高了会话回复的准确性。此外,本申请实施例通过保存最近一次匹配的场景实例,使得下次接收到用户的输入信息之后可能不再需要进行场景实例的匹配,从而进一步提高机器人会话的效率。且通过设置推荐的专业场景实例,能够减少无法查找到匹配的场景实例的情况,提高机器人会话的可靠性。To sum up, the embodiments of the present application are provided with scene instances corresponding to different dialogue scenes. After the user's input information is successfully matched with the scene instances in the preset scene library, the response information is processed according to the target scene instance obtained by the match. Inquiries and responses. It can be seen that this embodiment limits the search range of the response information, thereby reducing the amount of data corresponding to the search range, and simplifies the process of searching for the response information, thereby improving the efficiency of the robot conversation. Moreover, after the search process is simplified, the possibility of searching errors is reduced, thereby improving the accuracy of the conversation reply. In addition, the embodiment of the present application saves the most recently matched scene instance, so that it may no longer be necessary to match the scene instance after receiving the user's input information next time, thereby further improving the efficiency of the robot conversation. And by setting recommended professional scene instances, it is possible to reduce the situation where matching scene instances cannot be found, and to improve the reliability of the robot conversation.
为方便理解,以下为本申请一个具体实施例提供的用户与机器人之间的对话内容。假设机器人(例如,Chatbot)的知识库中包含了自然会话语料以及与运营相关的专业知识,机器人有2个专业场景实例分别是查询系统和查询运维事件。To facilitate understanding, the following is the content of the dialogue between the user and the robot provided in a specific embodiment of this application. Assuming that the knowledge base of a robot (for example, Chatbot) contains natural conversational materials and professional knowledge related to operations, the robot has two professional scene examples: querying the system and querying operation and maintenance events.
用户:你好User: hello
Chatbot:欢迎使用运营机器人,有什么可以为你服务?Chatbot: Welcome to use the operating robot, what can I do for you?
用户:张三User: Zhang San
Chatbot:张三,信息总中心流程与质量保证室,电话021-38929999-6100,邮箱zhangsan@unionpay.comChatbot: Zhang San, Process and Quality Assurance Room of Information Center, Tel: 021-38929999-6100, Email: zhangsan@unionpay.com
用户:张三的系统User: Zhang San's system
Chatbot:请问是查询张三负责运维的业务系统吗?Chatbot: Excuse me, are you inquiring about the business system that Zhang San is responsible for?
用户:是User: Yes
Chatbot:张三负责的系统包括:小微商户服务平台、二维码系统QRC。Chatbot: The systems that Zhang San is responsible for include: small and micro merchant service platforms, and QRC, a two-dimensional code system.
用户:张三负责处理的工行事件进展如何User: How is the ICBC incident handled by Zhang San?
Chatbot:请问是要切换到“运维事件查询”窗口吗?Chatbot: Do you want to switch to the "Operation and Maintenance Event Query" window?
用户:是User: Yes
Chatbot:检查权限通过,正在为你查询…Chatbot: Checking the permission is passed, it is checking for you...
Chatbot:符合本周内处理人=张三和关联工商银行条件有2个事件,请输入查询序号:Chatbot: There are 2 events that meet the conditions of handler = Zhang San and associated ICBC in this week, please enter the query serial number:
【1】INC000107-0113:39处理中工行广东省分行交易波动,应答返14[1] INC000107-0113:39 dealt with the transaction fluctuation of ICBC Guangdong Branch, the response was 14
【2】INC00207-0108:00已关闭工行借记出现交易异常无交易上送[2] INC00207-0108:00 has been closed ICBC debit transaction abnormalities occur, no transaction sent
用户:1User: 1
Chatbot:INC000107-0113:39处理中工行广东省分行交易波,事件原因:监控规则导致,事件处理人应用一室张三,有完整的应急处理手册,过去三个月类似事件8期,事件风险评估等级:轻微。Chatbot: INC000107-0113:39 to deal with the transaction wave of ICBC Guangdong Branch. The cause of the event: monitoring rules, the incident handler should use Zhang San from one room, with a complete emergency handling manual, 8 similar incidents in the past three months, incident risk Assessment level: slight.
【用户后续未有输入,一分钟后】[The user does not input in the follow-up, one minute later]
Chatbot:已退出运维事件查询窗口。我可以继续为你服务。Chatbot: Exited the operation and maintenance event query window. I can continue to serve you.
其中,上述对话的具体实现过程为:Among them, the specific realization process of the above dialogue is:
【用户输入:你好】[User input: hello]
机器人获得用户输入信息“你好”后,检查当前未保存有最近一次匹配的场景实例,遍历匹配专业场景实例的工作序列均未成功,未存在推荐的专业场景实例,未匹配检索场景实例,最后调用会话场景实例处理该输 入信息,输入信息与会话场景实例下的自然会话语聊“你好”匹配成功,生成“你好”的应答信息“欢迎使用运营机器人,有什么可以为你服务?”进行回复。After the robot obtains the user input information "Hello", it checks that there is no currently saved scene instance of the most recent match. It traverses the work sequence of matching professional scene instances without success, there is no recommended professional scene instance, and the search scene instance is not matched. Finally, Call the conversation scenario instance to process the input information, the input information matches the natural conversation "Hello" in the conversation scenario instance successfully, and a response message of "Hello" is generated, "Welcome to the operation robot, what can I do for you?" Reply.
【用户输入:张三】【User input: Zhang San】
机器人获得用户输入信息“张三”后,检查当前未保存有最近一次匹配的场景实例、遍历匹配专业场景实例的工作序列均未成功、未存在推荐的专业场景实例,检索场景实例匹配该输入信息成功,符合检索场景实例中通讯录的文本特征。检索场景实例通过查询通讯录获取“张三”的通讯录信息,生成应答信息返回用户。After the robot obtains the user input information "Zhang San", it checks that there is no currently saved scene instance of the most recent match, the work sequence of traversing the matching professional scene instance is unsuccessful, and there is no recommended professional scene instance, and the scene instance matches the input information. Success, in line with the text characteristics of the address book in the retrieval scenario instance. The retrieval scenario instance obtains the address book information of "Zhang San" by querying the address book, and generates response information to return to the user.
【用户输入:张三的系统】[User input: Zhang San’s system]
机器人获得用户输入信息“张三的系统”后,检查当前未保存有最近一次匹配的场景实例、遍历匹配专业场景实例的工作序列均未成功,用户输入的“张三的系统”部分匹配“查询系统”的文本特征,将“查询系统”作为推荐的专业场景实例。生成提示“请问是查询张三负责运维的业务系统吗?”返回用户。After the robot obtains the user input information "Zhang San's system", it checks that there is no currently saved scene instance of the most recent match, and the work sequence that traverses the matching professional scene instance is unsuccessful. The "Zhang San's system" input by the user partially matches the "query" The text feature of "System" uses "Inquiry System" as an example of a recommended professional scene. A prompt "Is this to inquire about the business system that Zhang San is responsible for operation and maintenance?" is returned to the user.
【用户输入:是】[User input: yes]
机器人获得用户输入信息“是”后,检查当前存在推荐的专业场景实例,依据用户的输入信息确认用户选择进入该场景实例的意图,更新保存的目标场景实例为“查询系统”并删除专业场景推荐的状态,调用“查询系统”的场景实例处理用户的输入信息。After the robot obtains the user input information "Yes", it checks the current recommended professional scene instance, confirms the user's intention to enter the scene instance according to the user input information, updates the saved target scene instance to "query system" and deletes the professional scene recommendation In the state, the scene instance of the "query system" is called to process the user's input information.
“查询系统”专业场景实例根据场景事件状态中保存的用户输入信息“张三的系统”,提取关键文本特征“运维系统负责人=张三”,并查询知识库,获得查询结果“张三负责的系统包括:小微商户服务平台、二维码系统QRC。”,依据查询结果生成应答信息返回用户。同时,更新“查询系统”专业场景实例的场景事件状态为:“历史查询运维负责人=张三”。The "Query System" professional scene example extracts the key text feature "Operation and Maintenance System Person in Charge = Zhang San" according to the user input information "Zhang San's system" saved in the scene event state, and queries the knowledge base to obtain the query result "Zhang San" Responsible systems include: small and micro merchant service platform, QR code system QRC.” According to the query results, response messages are generated and returned to users. At the same time, the scene event status of the professional scene instance of the "query system" is updated as: "the person in charge of historical query operation and maintenance = Zhang San".
【用户输入:张三负责处理的工行事件进展如何】[User input: How is the ICBC incident handled by Zhang San?]
机器人获得用户输入信息“张三负责处理的工行事件进展如何”后,检查对话状态目前保存的专业场景实例为“查询系统”,调用该专业场景 实例处理用户的输入信息。After the robot obtains the user's input information "How is the ICBC incident handled by Zhang San", it checks the dialogue status. The currently saved professional scene instance is the "query system", and calls the professional scene instance to process the user's input information.
“查询系统”专业场景实例依据用户的输入信息,判断该输入信息为无效输入,之后根据输入信息“张三负责处理的工行事件进展如何”检查是否存在推荐的专业场景实例(本实施例基于前述在输入信息在已匹配的场景实例内为无效输入的情况下,直接检索推荐的专业场景实例的方案),发现匹配“查询运维事件”场景实例的文本特征,符合推荐条件,生成提示“请问是要切换到‘运维事件查询’窗口吗?”返回用户。The "query system" professional scene instance judges the input information to be invalid according to the user's input information, and then checks whether there is a recommended professional scene instance according to the input information "How is the ICBC incident handled by Zhang San" (this embodiment is based on the aforementioned In the case that the input information is invalid in the matched scene instance, directly retrieve the recommended professional scene instance scheme), and find that the text characteristics of the scene instance matching the "query operation and maintenance event" match the recommended conditions, and generate a prompt "May I ask" Do you want to switch to the "Operation and Maintenance Event Query" window?" Return to the user.
【用户输入:是】[User input: yes]
机器人获得用户输入信息“是”后,检查当前存在推荐的专业场景实例,依据用户的输入信息确认用户选择进入该场景实例的意图,更新保存的目标场景实例为“查询运维事件”并删除专业场景推荐的状态,调用“查询运维事件”的场景实例处理用户的输入信息。After the robot obtains the user input information "Yes", it checks that there are currently recommended professional scene instances, confirms the user's intention to enter the scene instance based on the user input information, updates the saved target scene instance to "query operation and maintenance events" and deletes the profession In the recommended state of the scene, the scene instance of the "query operation and maintenance event" is called to process the user's input information.
“查询运维事件”专业场景实例首先分析用户的输入信息的符合“首次进入”的状态节点,调用该状态节点的执行操作提取输入信息对应的用户权限。用户权限检查通过后,生成提示“检查权限通过,正在为你查询…”返回用户。The "query operation and maintenance event" professional scenario example first analyzes the state node of the user's input information that meets the "first entry" state, and invokes the execution operation of the state node to extract the user authority corresponding to the input information. After the user permission check is passed, a prompt "Check permission passed, querying for you..." is generated and returned to the user.
同时,调用后续查询函数进行查询:“查询运维事件”专业场景实例根据输入信息“张三负责处理的工行事件”,提取关键文本特征“事件标签=工行,事件处理人=张三”,并查询外部数据库,获得两个事件的查询结果,根据查询结果生成应答信息返回用户。At the same time, the follow-up query function is called to query: "Query operation and maintenance events" professional scene example according to the input information "ICBC event handled by Zhang San", extract the key text feature "event label = ICBC, event handler = Zhang San", and Query the external database to obtain the query results of the two events, and generate response information based on the query results to return to the user.
同时,更新机器人的场景事件状态“待用户确认事件,1=INC001,2=INC002”。At the same time, update the robot's scene event status "event to be confirmed by the user, 1=INC001, 2=INC002".
【用户输入:1】【User input: 1】
机器人获得用户输入信息“1”后,检查当前存在已匹配的专业场景实例“查询运维事件”,调用该专业场景实例处理用户输入。After the robot obtains the user input information "1", it checks that there is currently a matching professional scene instance "query operation and maintenance event", and calls the professional scene instance to process the user input.
“查询运维事件”专业场景实例调用场景事件状态,发现存在用户的确认状态“待用户确认事件,1=INC001,2=INC002”,根据用户的输入信息“1”,得到待查询信息“INC001”。查询外部数据库,获得INC001事件的概要信息,生成应答信息返回用户。The professional scene instance of "Query Operation and Maintenance Events" calls the scene event status, and it is found that there is a user's confirmation status "Awaiting user confirmation event, 1=INC001, 2=INC002". According to the user's input information "1", the information to be queried "INC001" is obtained ". Query an external database to obtain the summary information of the INC001 event, generate a response message and return it to the user.
同时更新场景事件状态为“查询时间=INC001”。At the same time, the scene event status is updated to "query time = INC001".
【用户后续未有输入,一分钟后】[The user does not input in the follow-up, one minute later]
机器人持续监控用户保存的已匹配的专业场景实例的生命周期,“查询运维事件”的生命周期为1分钟,用户在1分钟内没有后续输入,则在1分钟后注销该场景实例,即删除“查询运维事件”对应的全部保存信息,生成提示“已退出运维事件查询窗口。我可以继续为你服务”,告知用户当前已匹配的专业场景实例已被注销。The robot continuously monitors the life cycle of the matched professional scene instance saved by the user. The life cycle of the "query operation and maintenance event" is 1 minute. If the user has no subsequent input within 1 minute, the scene instance will be logged out after 1 minute, that is, delete "Query operation and maintenance event" corresponds to all the saved information, and generate a prompt "Exited the operation and maintenance event query window. I can continue to serve you" to inform the user that the currently matched professional scene instance has been cancelled.
基于前述实施例给出的机器人对话方法,本申请实施例还提供了一种机器人对话装置,图4示出了本申请的机器人对话装置的实施例的结构示意图。该机器人对话装置300可以包括:Based on the robot dialogue method given in the foregoing embodiment, an embodiment of the present application also provides a robot dialogue device. FIG. 4 shows a schematic structural diagram of an embodiment of the robot dialogue device of the present application. The robot dialogue device 300 may include:
场景库320,用于保存预设的场景实例;The scene library 320 is used to store preset scene instances;
资源仓库340,用于保存每个场景实例下的各个输入信息及其对应的应答信息;资源仓库340是机器人依赖的知识、数据及调用功能的资源集合;The resource warehouse 340 is used to store various input information and corresponding response information under each scene instance; the resource warehouse 340 is a resource collection of knowledge, data, and calling functions that the robot depends on;
控制模块310,用于获取用户的输入信息;调用场景库320中的场景实例,确定输入信息所匹配的目标场景实例;展示执行单元330返回的应答信息;The control module 310 is used to obtain the user's input information; call the scene instance in the scene library 320 to determine the target scene instance matched by the input information; display the response information returned by the execution unit 330;
执行单元330,用于在预设的资源仓库340内查询输入信息在目标场景实例下的应答信息;并将应答信息返回控制模块310,其中,执行单元330为机器人操作资源仓库340的功能适配器,每个资源仓库340中的资源,例如知识库、API等,均需使用单独的执行单元330进行适配。执行单元330为场景实例处理用户输入提供操作支持。The execution unit 330 is used to query the response information of the input information in the target scene instance in the preset resource warehouse 340; and return the response information to the control module 310, where the execution unit 330 is a functional adapter for the robot to operate the resource warehouse 340, The resources in each resource warehouse 340, such as knowledge bases, APIs, etc., need to be adapted using a separate execution unit 330. The execution unit 330 provides operation support for the scene instance to process user input.
本申请实施例设置有对应于不同对话场景的场景实例,在用户的输入信息与预设的场景库中的场景实例成功匹配后,依据匹配的目标场景实例进行应答信息的查询和展示。可见,本实施例限定了应答信息的查找范围,从而降低了查找范围对应的数据量,也简化了应答信息的查找过程,进而提高了机器人会话的效率。并且,查找过程简化后,查找错误的可能会降低,从而提高了会话回复的准确性。其中,控制模块310通过场景库320 提供的功能接口实现对场景实例的匹配和调用。The embodiment of the present application is provided with scene instances corresponding to different dialogue scenes. After the user's input information is successfully matched with the scene instances in the preset scene library, the query and display of response information are performed according to the matched target scene instances. It can be seen that this embodiment limits the search range of the response information, thereby reducing the amount of data corresponding to the search range, and also simplifies the search process of the response information, thereby improving the efficiency of the robot conversation. Moreover, after the search process is simplified, the possibility of searching errors is reduced, thereby improving the accuracy of the conversation reply. Among them, the control module 310 implements matching and invocation of scene instances through the functional interface provided by the scene library 320.
在本申请的一些实施例中,场景库320还可以包括:将所有场景实例按照一定顺序组成工作序列,以使控制模块310进行场景实例的遍历。其中,场景实例的优先顺序依次是专业场景实例、检索场景实例、会话场景实例,多个专业场景实例可以按照场景实例的预设权重和创建时间进行排序,当然,本申请对此不作限定。这种方式能够方便控制模块310的遍历过程,尽快找到相匹配的场景实例。In some embodiments of the present application, the scene library 320 may further include: composing all scene instances into a working sequence in a certain order, so that the control module 310 can traverse the scene instances. Among them, the priority order of the scene instances is professional scene instance, retrieval scene instance, and conversation scene instance. Multiple professional scene instances can be sorted according to the preset weight and creation time of the scene instance. Of course, this application does not limit this. This method can facilitate the traversal process of the control module 310, and find a matching scene instance as soon as possible.
在本申请的一些实施例中,场景库320还可以包括:在控制模块310的控制下,在缓存模块350中保存成功匹配场景实例的标识信息。In some embodiments of the present application, the scene library 320 may further include: under the control of the control module 310, the cache module 350 saves the identification information of the successfully matched scene instance.
在本申请的另一些实施例中,控制模块310还包括:In some other embodiments of the present application, the control module 310 further includes:
生命周期管理单元,用于在自更新场景事件状态的时刻起的预设时间内未接收到用户的输入信息的情况下,控制场景库320删除缓存模块350内目标场景实例对应的全部保存信息,该保存信息包括场景事件状态以及目标场景实例的标识信息。The life cycle management unit is used to control the scene library 320 to delete all the saved information corresponding to the target scene instance in the cache module 350 when the user's input information is not received within a preset time from the time the scene event state is updated, The saved information includes the status of the scene event and the identification information of the target scene instance.
在本实施例中,在每次更新场景事件状态的时刻开始计时,即完成一次对话的时刻,若在预设时间内没有接收到用户的输入信息,很可能表明用户已经停止与机器人的对话,因此,此时可以将与之前用户对话的相关信息进行删除,与之前用户对话的相关信息即保存的场景事件状态和目标场景实例的标识信息。这种方式能够降低机器人与用户对话过程中,过多的无效保存信息对存储空间的占用,并减少不同用户的对话之间的影响。In this embodiment, the time is started every time the scene event status is updated, that is, the time when a dialogue is completed. If the user's input information is not received within the preset time, it is likely that the user has stopped the dialogue with the robot. Therefore, at this time, the related information about the conversation with the previous user can be deleted, and the related information about the conversation with the previous user is the saved scene event state and the identification information of the target scene instance. This method can reduce the storage space occupied by excessive invalid saved information during the dialogue between the robot and the user, and reduce the influence between the dialogues of different users.
此外,场景库320还可以用于在控制模块310的控制下,进行场景实例的新建和删除以及管理等操作。In addition, the scene library 320 can also be used to perform operations such as creation, deletion, and management of scene instances under the control of the control module 310.
在本申请的一些实施例中,图5示出了本申请的机器人对话装置的另一个实施例的结构示意图。该机器人对话装置300还可以包括缓存模块350:用于保存成功匹配的场景实例。并且,在这些实施例中,控制模块310可以包括:In some embodiments of the present application, FIG. 5 shows a schematic structural diagram of another embodiment of the robot dialogue device of the present application. The robot dialogue device 300 may also include a cache module 350: for storing successfully matched scene instances. And, in these embodiments, the control module 310 may include:
输入信息获取单元,用于获取用户的输入信息;The input information obtaining unit is used to obtain the input information of the user;
场景确定单元,用于在保存有最近一次匹配的场景实例且所述输入信息在所述最近一次匹配的场景实例内为有效输入的情况下,将所述最近一 次匹配的场景实例作为所述目标场景实例;在未保存有所述最近一次匹配的场景实例的情况下,触发匹配单元。The scene determination unit is configured to use the most recently matched scene instance as the target when the most recently matched scene instance is stored and the input information is valid input in the most recently matched scene instance Scene instance; in the case that the most recently matched scene instance is not saved, the matching unit is triggered.
匹配单元,用于在预设的场景库内包含的场景实例中,确定与输入信息匹配的目标场景实例,并将目标场景实例保存为最近一次匹配的场景实例。The matching unit is used to determine the target scene instance matching the input information among the scene instances included in the preset scene library, and save the target scene instance as the most recently matched scene instance.
应答单元,用于依据执行单元330返回的应答信息进行回复。The response unit is used to respond according to the response information returned by the execution unit 330.
在本实施中,在每次成功匹配场景实例之后,会将场景实例进行保存,具体可以为缓存,使得下一次用户输入信息之后,若用户的输入信息符合保存的最近一次匹配的场景实例,则不再需要进行场景实例的查询和匹配,而是可以直接在最近一次匹配的场景实例下进行应答信息的查询,即本申请实施例能够实现多轮会话的状态保持,降低会话查询场景实例时的数据量,提高会话处理效率。In this implementation, each time the scene instance is successfully matched, the scene instance is saved, which can be specifically cached, so that after the user inputs information the next time, if the user's input information matches the saved scene instance of the most recent match, then It is no longer necessary to query and match scene instances, but can directly query response information under the most recently matched scene instance, that is, the embodiment of the present application can realize the state maintenance of multiple rounds of conversations, and reduce the time when the conversation is inquired about the scene instance. The amount of data improves the efficiency of session processing.
基于前述实施例,在本申请的另一些实施例中,场景确定单元还可以用于:在输入信息在最近一次匹配的场景实例内为无效输入的情况下,触发匹配单元。Based on the foregoing embodiments, in other embodiments of the present application, the scene determination unit may also be used to trigger the matching unit when the input information is an invalid input in the last matched scene instance.
基于前述实施例,在本申请的另一些实施例中,匹配单元可以用于:将输入信息按照预设匹配顺序依次与预设的场景库320内包含的场景实例进行匹配,在匹配成功的情况下,得到成功匹配的场景实例,并停止上述匹配操作,其中,预设匹配顺序为:首先匹配专业场景实例、之后匹配检索场景实例、最后匹配会话场景实例。Based on the foregoing embodiments, in other embodiments of the present application, the matching unit may be used to: match the input information with the scene instances contained in the preset scene library 320 in a preset matching order, and if the matching is successful Next, the successfully matched scene instance is obtained, and the above matching operation is stopped. The preset matching sequence is: first match the professional scene instance, then match the retrieval scene instance, and finally match the conversation scene instance.
基于前述实施例,在本申请的另一些实施例中,匹配单元可以用于:获取输入信息中的关键文本特征;将关键文本特征与当前进行匹配过程的场景实例的文本特征进行比对,若两者完全相同,则匹配成功;否则,匹配失败。Based on the foregoing embodiments, in other embodiments of the present application, the matching unit may be used to: obtain key text features in the input information; compare the key text features with the text features of the scene instance currently undergoing the matching process, if If the two are exactly the same, the match is successful; otherwise, the match fails.
即,控制模块310能够进行输入信息的初步处理,包括输入信息的分解、过滤和提取关键文本特征等。That is, the control module 310 can perform preliminary processing of the input information, including decomposition, filtering, and extraction of key text features of the input information.
在一种具体实施例中,匹配单元具体包括:In a specific embodiment, the matching unit specifically includes:
专业匹配单元,用于在场景库320包含的各个专业场景实例中,确定是否存在与输入信息匹配的目标场景实例,若存在,触发执行单元330若 不存在,触发检索匹配单元;The professional matching unit is used to determine whether there is a target scene instance matching the input information in each professional scene instance included in the scene library 320, if it exists, trigger the execution unit 330 if it does not exist, trigger the search matching unit;
检索匹配单元,用于确定场景库320包含的检索场景实例是否为与输入信息匹配的目标场景实例;若是,触发执行单元330;若不是,触发会话匹配单元;The search matching unit is used to determine whether the search scene instance contained in the scene library 320 is a target scene instance matching the input information; if so, trigger the execution unit 330; if not, trigger the conversation matching unit;
会话匹配单元,用于确定场景库包含的会话场景实例是否为与输入信息匹配的目标场景实例,若是,触发执行单元330。The conversation matching unit is used to determine whether the conversation scene instance contained in the scene library is a target scene instance matching the input information, and if so, trigger the execution unit 330.
由于专业类型会话的范围最广,因此出于提高效率的目的,首先需要判断用户的输入信息是否符合专业场景实例,若不符合专业场景实例,再判断输入信息是否符合检索场景实例,若不符合检索场景实例,再判断输入信息是否满足会话场景实例。Since the scope of professional conversations is the widest, for the purpose of improving efficiency, it is first necessary to determine whether the user's input information meets the professional scene instance. If it does not meet the professional scene instance, then judge whether the input information meets the retrieval scene instance. Retrieve the scene instance, and then judge whether the input information meets the conversation scene instance.
在本申请的其他实施例中,该匹配单元还可以包括推荐匹配单元,专业匹配单元在均未匹配成功的情况下,触发推荐匹配单元。推荐匹配单元可以用于:判断场景库320内是否存在推荐的专业场景实例;在存在推荐的专业场景实例的情况下,将推荐的专业场景实例作为目标场景实例。In other embodiments of the present application, the matching unit may further include a recommended matching unit, and the professional matching unit triggers the recommended matching unit when none of the matching succeeds. The recommendation matching unit may be used to determine whether there is a recommended professional scene instance in the scene library 320; if there is a recommended professional scene instance, use the recommended professional scene instance as the target scene instance.
在本实施中,在没有匹配的专业场景实例的情况下,由机器人推荐适合于用户的输入信息的专业场景实例,从而使在用户的输入信息不够严谨的情况,也能够尽可能选择合适的场景实例对其进行应答,提高机器人会话的准确性。In this implementation, when there is no matching professional scene instance, the robot recommends the professional scene instance suitable for the user's input information, so that when the user's input information is not rigorous enough, the appropriate scene can be selected as much as possible The instance responds to it to improve the accuracy of the robot conversation.
进一步的,在本申请的一些实施例的推荐匹配单元中可以具体包括:提取输入信息中的关键文本特征;确定关键文本特征与场景库320内包含的各个专业场景实例的文本特征的匹配度;将匹配度达到预设匹配度阈值的专业场景实例作为推荐的专业场景实例。Further, the recommended matching unit of some embodiments of the present application may specifically include: extracting key text features in the input information; determining the degree of matching between the key text features and the text features of each professional scene instance contained in the scene library 320; The professional scene instance whose matching degree reaches the preset matching degree threshold is taken as the recommended professional scene instance.
在本实施例中,将文本特征与输入信息中的关键文本特征的匹配度超出预设匹配度阈值的专业场景实例进行推荐,由于输入信息想要表达的含义基本是由输入信息中的关键文本特征决定的,因此,能够与关键文本特征达到一定匹配度的专业场景实例很可能就是用户想要查询的内容。通过上述方式,能够尽可能找到合适的专业场景实例进行推荐,从而提高机器人应答的准确性。In this embodiment, the professional scene instance where the matching degree of the text feature and the key text feature in the input information exceeds the preset matching degree threshold is recommended, because the meaning of the input information is basically determined by the key text in the input information. The characteristics are determined, therefore, the professional scene instance that can reach a certain degree of matching with the key text characteristics is likely to be the content that the user wants to query. Through the above method, it is possible to find a suitable professional scene instance for recommendation as much as possible, thereby improving the accuracy of the robot's response.
在本申请的一些实施例中,在存在推荐的专业场景实例的情况下,推 荐匹配单元还可以包括:In some embodiments of the present application, when there is a recommended professional scene instance, the recommended matching unit may further include:
提示单元,用于展示是否进入推荐的专业场景实例的提示信息;在接收到用户输入的进入指令的情况下,将推荐的专业场景实例作为目标的场景实例。The prompt unit is used to display the prompt information of whether to enter the recommended professional scene instance; in the case of receiving the entry instruction input by the user, the recommended professional scene instance is taken as the target scene instance.
在这些实施例中,通过对推荐的专业场景实例进行提示,在存在多个推荐的专业场景实例的情况下,用户能够根据自身的实际需求来选择其中一个作为推荐的专业场景实例。在仅存在一个推荐的专业场景实例的情况下,用户也能够确定该推荐的专业场景实例是否符合自身需求。因此,在这些实施例中,并未直接将推荐的专业场景实例进行使用,而是由用户选择自身需求的专业场景实例,用户体验更好,机器人对话的可靠性更高。In these embodiments, by prompting the recommended professional scene instances, in the case where there are multiple recommended professional scene instances, the user can select one of them as the recommended professional scene instance according to their actual needs. In the case that there is only one recommended professional scene instance, the user can also determine whether the recommended professional scene instance meets his own needs. Therefore, in these embodiments, the recommended professional scene instance is not directly used, but the user selects the professional scene instance according to his own needs. The user experience is better and the reliability of the robot dialogue is higher.
另外,在本申请的一些实施例中,场景确定单元还可以用于:在输入信息在最近一次匹配的场景实例内为无效输入的情况下,触发推荐匹配单元。从而减少场景实例的匹配时间,提高对话效率。In addition, in some embodiments of the present application, the scene determination unit may also be used to trigger the recommended matching unit when the input information is invalid in the scene instance of the last match. Thereby reducing the matching time of scene instances and improving the efficiency of dialogue.
为了方便具体管理在场景实例下的信息应答,图5示出了本申请另一个实施例提供的机器人对话装置的结构示意图;在本申请的一些实施例中,该机器人对话装置300还包括:In order to facilitate the specific management of the information response in the scenario instance, FIG. 5 shows a schematic structural diagram of a robot dialogue device provided by another embodiment of the present application; in some embodiments of the present application, the robot dialogue device 300 further includes:
场景实例模块360,用于根据用户的输入信息以及当前目标场景实例,来控制执行单元330获取应答信息。The scene instance module 360 is used to control the execution unit 330 to obtain response information according to the user's input information and the current target scene instance.
进一步的,在本申请的另一些实施例中,场景实例模块360还可以包括:Further, in other embodiments of the present application, the scenario instance module 360 may further include:
权限确定单元,用于在输入信息为首次进入目标场景实例的情况下,提取输入信息对应的用户权限;依据用户权限,确定是否允许通过执行单元330查询输入信息在目标场景实例下的应答信息。The authority determining unit is used to extract the user authority corresponding to the input information when the input information is entering the target scene instance for the first time; according to the user authority, determine whether to allow the execution unit 330 to query the response information of the input information in the target scene instance.
在这些实施例中,输入信息首次进入目标场景实例指的是:当前目标场景实例是根据当前的输入信息匹配得到的,而不是最近一次匹配的场景实例,即,当前目标场景实例在匹配成功后,尚未在该场景实例下查询过应答消息。由于每个场景实例会对应资源仓库340内的部分信息,但是这部分信息不一定是每个人均有权限查询的,因此对于这部分需要权限才能查询的信息对应的场景实例,在输入信息首次进入目标场景实例后,需要 首先确定当前输入信息对应的用户权限,若用户有权限,则才能够从资源仓库340内查找对应的应答信息进行回复。这种方式能够满足企业场景下的不同信息的权限设置需求,丰富了机器人的对话情景范围。In these embodiments, the input information entering the target scene instance for the first time refers to: the current target scene instance is obtained by matching according to the current input information, rather than the last matched scene instance, that is, the current target scene instance is matched after the match is successful. , The response message has not been queried in this scenario instance. Since each scenario instance corresponds to part of the information in the resource warehouse 340, this part of information may not be inquired by everyone with permission. Therefore, for the scenario instance corresponding to this part of the information that requires permission to query, enter the information for the first time. After the target scenario instance, the user authority corresponding to the current input information needs to be determined first. If the user has the authority, the corresponding response information can be searched from the resource warehouse 340 to reply. This method can meet the permission setting requirements of different information in the enterprise scenario, and enrich the scope of the robot's dialogue scenario.
在本申请的一些实施例中,场景实例模块360还可以包括:In some embodiments of the present application, the scenario instance module 360 may further include:
状态控制单元,用于依据应答信息更新缓存模块350内保存的场景事件状态,场景事件状态包括应答信息的关键特征。The state control unit is used to update the state of the scene event stored in the cache module 350 according to the response information. The state of the scene event includes the key features of the response information.
缓存模块350还可以用于保存场景状态信息。The cache module 350 can also be used to save scene state information.
由于在部分会话过程中,前后会话存在连贯性。在这种情况下,为了保证机器人的应答信息能够基于连贯性进行回复,因此,需要对之前回复的应答信息的关键特征进行保存,从而在后续继续接收用户的输入信息后,能够根据输入信息以及之前保存的关键特征来进行应答信息的查询,实现多轮会话连贯进行的目的。Because in part of the conversation, there is continuity before and after the conversation. In this case, in order to ensure that the robot's response information can respond based on consistency, it is necessary to save the key features of the response information previously responded, so that after continuing to receive user input information, it can be based on the input information and The key features saved before are used to query the response information and achieve the goal of continuous conversations in multiple rounds.
基于前述实施例,在本申请的一些实施例的控制模块310中,场景实例模块360还可以用于:依据保存的场景事件状态以及输入信息,确定待查询信息;通过执行单元330查询待查询信息在目标场景实例下的应答信息。Based on the foregoing embodiment, in the control module 310 of some embodiments of the present application, the scene instance module 360 can also be used to: determine the information to be queried according to the saved scene event state and input information; and query the information to be queried through the execution unit 330 Response information under the target scenario instance.
在本申请的一些实施例中,资源仓库340可以包括离线数据库、预设知识库、工具脚本以及开放API中的至少两者。In some embodiments of the present application, the resource warehouse 340 may include at least two of an offline database, a preset knowledge base, a tool script, and an open API.
其中,离线数据库内可以保存一些预先编辑的离线数据,例如企业员工的名称、员工负责的业务名称等。预设知识库可以包含一些专业名词的解释以及企业业务相关的知识内容等。工具脚本可以包含一些企业业务相关的脚本名称、脚本内容以及脚本下载链接等。API为应用程序接口,机器人能够通过开放的API来调用对应的应用程度,或者接入对应的平台进行数据获取。因此,通过上述方式,打破了传统任务型机器人的功能边界,大大扩展了资源仓库340的数据来源,提高了机器人在对话过程中的灵活性以及适应场景变化的拓展能力。Among them, some pre-edited offline data can be stored in the offline database, such as the names of the employees of the enterprise and the names of the businesses that the employees are responsible for. The preset knowledge base can include explanations of some professional terms and knowledge content related to the business of the enterprise. Tool scripts can include some corporate business-related script names, script content, and script download links. API is an application program interface. The robot can call the corresponding application level through the open API, or access the corresponding platform for data acquisition. Therefore, through the above method, the functional boundary of the traditional task-based robot is broken, the data source of the resource warehouse 340 is greatly expanded, and the flexibility of the robot in the dialogue process and the expansion ability to adapt to scene changes are improved.
本申请实施例的机器人对话方法和装置可以由机器人对话设备来实现。图6示出了本申请的机器人对话设备的实施例的硬件结构示意图。The robot dialogue method and device in the embodiments of the present application can be implemented by a robot dialogue device. Fig. 6 shows a schematic diagram of the hardware structure of an embodiment of the robot dialogue device of the present application.
如图6所示,机器人对话设备400包括输入设备401、输入接口402、中央处理器403、存储器404、输出接口405、以及输出设备406。其中,输入接口402、中央处理器403、存储器404、以及输出接口405通过总线410相互连接,输入设备401和输出设备406分别通过输入接口402和输出接口405与总线410连接,进而与机器人对话设备400的其他组件连接。As shown in FIG. 6, the robot dialogue device 400 includes an input device 401, an input interface 402, a central processing unit 403, a memory 404, an output interface 405, and an output device 406. The input interface 402, the central processing unit 403, the memory 404, and the output interface 405 are connected to each other through the bus 410, and the input device 401 and the output device 406 are respectively connected to the bus 410 through the input interface 402 and the output interface 405, and then communicate with the robot device 400 other components are connected.
具体地,输入设备401接收来自外部的输入信息,并通过输入接口402将输入信息传送到中央处理器403;中央处理器403基于存储器404中存储的计算机可执行指令对输入信息进行处理以生成输出信息,将输出信息临时或者永久地存储在存储器404中,然后通过输出接口405将输出信息传送到输出设备406;输出设备406将输出信息输出到机器人对话设备400的外部供用户使用。Specifically, the input device 401 receives input information from the outside, and transmits the input information to the central processing unit 403 through the input interface 402; the central processing unit 403 processes the input information based on the computer executable instructions stored in the memory 404 to generate output Information, the output information is temporarily or permanently stored in the memory 404, and then the output information is transmitted to the output device 406 through the output interface 405; the output device 406 outputs the output information to the outside of the robot dialogue device 400 for the user to use.
也就是说,图6所示的机器人对话设备也可以被实现为包括:存储有计算机可执行指令的存储器;以及处理器,该处理器在执行计算机可执行指令时可以实现本申请实施例描述的机器人对话方法和装置。That is to say, the robot dialogue device shown in FIG. 6 can also be implemented as including: a memory storing computer-executable instructions; and a processor, which can implement what is described in the embodiments of the present application when executing the computer-executable instructions Robot dialogue method and device.
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序指令;该计算机程序指令被处理器执行时实现本申请实施例提供的机器人对话方法。计算机可读存储介质的示例可以是非暂态计算机可读存储介质,包括ROM、RAM、磁碟或者光盘等。The embodiments of the present application also provide a computer-readable storage medium on which computer program instructions are stored; when the computer program instructions are executed by a processor, the robot dialogue method provided in the embodiments of the present application is implemented. Examples of computer-readable storage media may be non-transitory computer-readable storage media, including ROM, RAM, magnetic disks, or optical disks.
以上的结构框图中所示的功能块可以实现为硬件、软件、固件或者它们的组合。当以硬件方式实现时,其可以例如是电子电路、专用集成电路(ASIC)、适当的固件、插件、功能卡等等。当以软件方式实现时,本申请的元素是被用于执行所需任务的程序或者代码段。程序或者代码段可以存储在机器可读介质中,或者通过载波中携带的数据信号在传输介质或者通信链路上传送。“机器可读介质”可以包括能够存储或传输信息的任何介质。机器可读介质的例子包括电子电路、半导体存储器设备、ROM、闪存、可擦除ROM(EROM)、软盘、CD-ROM、光盘、硬盘、光纤介质、射频(RF)链路,等等。代码段可以经由诸如因特网、内联网等的计算机网络被下载。The functional blocks shown in the above structural block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, and so on. When implemented in software, the elements of this application are programs or code segments used to perform required tasks. The program or code segment may be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link through a data signal carried in a carrier wave. "Machine-readable medium" may include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and so on. The code segment can be downloaded via a computer network such as the Internet, an intranet, and so on.
还需要说明的是,本申请中提及的示例性实施例,基于一系列的步骤 或者装置描述一些方法或系统。但是,本申请不局限于上述步骤的顺序,也就是说,可以按照实施例中提及的顺序执行步骤,也可以不同于实施例中的顺序,或者若干步骤同时执行。It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above steps, that is, the steps may be performed in the order mentioned in the embodiments, or may be different from the order in the embodiments, or several steps may be performed at the same time.
以上,仅为本申请的具体实施方式,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的系统、模块和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。应理解,本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。The above are only specific implementations of the present application, and those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working process of the above-described system, module and unit can be referred to in the foregoing method embodiment. The corresponding process will not be repeated here. It should be understood that the scope of protection of this application is not limited to this, and any person skilled in the art can easily think of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should cover Within the scope of protection of this application.

Claims (14)

  1. 一种机器人对话方法,包括:A robot dialogue method, including:
    获取用户的输入信息;Obtain user input information;
    确定所述输入信息所匹配的目标场景实例;Determine the target scene instance matched by the input information;
    在预设的资源仓库内查询所述输入信息在所述目标场景实例下的应答信息;Query the response information of the input information in the target scene instance in the preset resource warehouse;
    展示所述应答信息。Show the response information.
  2. 根据权利要求1所述的方法,其中,所述确定所述输入信息所匹配的目标场景实例,包括:The method according to claim 1, wherein the determining the target scene instance matched by the input information comprises:
    在保存有最近一次匹配的场景实例且所述输入信息在所述最近一次匹配的场景实例内为有效输入的情况下,将所述最近一次匹配的场景实例作为所述目标场景实例;In a case where the most recently matched scene instance is stored and the input information is valid input in the most recently matched scene instance, the most recently matched scene instance is used as the target scene instance;
    在未保存有所述最近一次匹配的场景实例的情况下,在预设的场景库内包含的场景实例中,确定与所述输入信息匹配的目标场景实例,并将目标场景实例保存为所述最近一次匹配的场景实例。In the case that the most recently matched scene instance is not saved, among the scene instances contained in the preset scene library, determine the target scene instance that matches the input information, and save the target scene instance as the The most recently matched scene instance.
  3. 根据权利要求2所述的方法,其中,所述在预设的场景库内包含的场景实例中,确定与所述输入信息匹配的目标场景实例,包括:The method according to claim 2, wherein the determining a target scene instance matching the input information among the scene instances included in the preset scene library comprises:
    将所述输入信息按照预设匹配顺序依次与所述场景库内包含的场景实例进行匹配,在匹配成功的情况下,停止匹配操作,其中,所述预设匹配顺序为:首先匹配专业场景实例、之后匹配检索场景实例、最后匹配会话场景实例。The input information is sequentially matched with the scene instances contained in the scene library according to a preset matching order, and if the matching is successful, the matching operation is stopped, wherein the preset matching order is: first match the professional scene instance , After matching to retrieve the scene instance, and finally matching the conversation scene instance.
  4. 根据权利要求3所述的方法,其中,在所述专业场景实例中,不存在与所述输入信息匹配的目标场景实例的情况下,将所述输入信息与所述检索场景实例进行匹配之前,还包括:The method according to claim 3, wherein, in the case where there is no target scene instance matching the input information in the professional scene instance, before matching the input information with the retrieval scene instance, Also includes:
    判断所述场景库内是否存在推荐的专业场景实例;Judging whether there is a recommended professional scene instance in the scene library;
    在存在所述推荐的专业场景实例的情况下,将所述推荐的专业场景实例作为所述目标场景实例。In the case where the recommended professional scene instance exists, the recommended professional scene instance is used as the target scene instance.
  5. 根据权利要求4所述的方法,其中,所述判断所述场景库内是否存 在推荐的专业场景实例,包括:The method according to claim 4, wherein said determining whether there is a recommended professional scene instance in the scene library comprises:
    提取所述输入信息中的关键文本特征;Extract key text features in the input information;
    确定所述关键文本特征与所述场景库内包含的各个专业场景实例的文本特征的匹配度;Determining the degree of matching between the key text feature and the text feature of each professional scene instance contained in the scene library;
    将匹配度达到预设匹配度阈值的专业场景实例作为所述推荐的专业场景实例。The professional scene instance whose matching degree reaches the preset matching degree threshold is taken as the recommended professional scene instance.
  6. 根据权利要求5所述的方法,其中,在存在所述推荐的专业场景实例的情况下,还包括:The method according to claim 5, wherein, when the recommended professional scene instance exists, the method further comprises:
    展示是否进入所述推荐的专业场景实例的提示信息;Show the prompt information of whether to enter the recommended professional scene instance;
    在接收到用户输入的进入指令的情况下,将所述推荐的专业场景实例作为所述目标场景实例。In the case of receiving the entry instruction input by the user, the recommended professional scene instance is used as the target scene instance.
  7. 根据权利要求1-6任一项所述的方法,还包括:The method according to any one of claims 1-6, further comprising:
    在所述输入信息为首次进入所述目标场景实例的情况下,提取所述输入信息对应的用户权限;In a case where the input information is entering the target scene instance for the first time, extract the user authority corresponding to the input information;
    依据所述用户权限,确定是否允许通过所述资源仓库查询所述输入信息在所述目标场景实例下的应答信息。According to the user authority, it is determined whether it is allowed to query the response information of the input information in the target scene instance through the resource warehouse.
  8. 根据权利要求1-6任一项所述的方法,其中,所述展示所述应答信息之后,还包括:The method according to any one of claims 1-6, wherein after the displaying the response information, the method further comprises:
    依据所述应答信息更新保存的场景事件状态,所述场景事件状态包括所述应答信息的关键特征。The saved scene event state is updated according to the response information, and the scene event state includes the key feature of the response information.
  9. 根据权利要求8所述的方法,其中,所述在预设的资源仓库内查询所述输入信息在所述目标场景实例下的应答信息,包括:The method according to claim 8, wherein the querying the input information in the preset resource warehouse for response information in the target scene instance comprises:
    依据所述输入信息以及保存的所述场景事件状态,确定待查询信息;Determine the information to be queried according to the input information and the saved state of the scene event;
    在所述资源仓库内查询所述待查询信息在所述目标场景实例下的应答信息。Query the response information of the information to be queried in the target scene instance in the resource warehouse.
  10. 根据权利要求8所述的方法,还包括:The method according to claim 8, further comprising:
    在自更新所述场景事件状态的时刻起的预设时间内未接收到用户的输入信息的情况下,删除所述目标场景实例对应的全部保存信息,所述保存信息包括所述场景事件状态以及所述目标场景实例的标识信息。In the case that the user's input information is not received within the preset time from the time the scene event state is updated, delete all the saved information corresponding to the target scene instance, and the saved information includes the scene event state and The identification information of the target scene instance.
  11. 根据权利要求1所述的方法,其中,所述资源仓库包括离线数据库、预设知识库、工具脚本以及开放应用程序调用接口API中的至少两者。The method according to claim 1, wherein the resource warehouse includes at least two of an offline database, a preset knowledge base, a tool script, and an open application program calling interface (API).
  12. 一种机器人对话装置,包括:A robot dialogue device includes:
    场景库,用于保存预设的场景实例;Scene library, used to save preset scene instances;
    资源仓库,用于保存每个场景实例下包含的输入信息及其对应的应答信息;Resource warehouse, used to store the input information contained in each scenario instance and its corresponding response information;
    控制模块,用于获取用户的输入信息;调用所述场景库中的场景实例,确定所述输入信息所匹配的目标场景实例;展示执行单元返回的应答信息;The control module is used to obtain the user's input information; call the scene instance in the scene library to determine the target scene instance matched by the input information; display the response information returned by the execution unit;
    所述执行单元,用于在所述资源仓库内查询所述输入信息在所述目标场景实例下的应答信息;并将所述应答信息返回所述控制模块。The execution unit is configured to query response information of the input information in the target scene instance in the resource warehouse; and return the response information to the control module.
  13. 一种机器人对话设备,包括:处理器以及存储有计算机程序指令的存储器,所述处理器执行所述计算机程序指令时实现如权利要求1-11任意一项所述的机器人对话方法。A robot dialogue device, comprising: a processor and a memory storing computer program instructions, the processor implements the robot dialogue method according to any one of claims 1-11 when the processor executes the computer program instructions.
  14. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现如权利要求1-11任意一项所述的机器人对话方法。A computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the robot dialogue method according to any one of claims 1-11 is realized.
PCT/CN2020/117925 2019-10-30 2020-09-25 Robot dialogue method, apparatus and device, and computer-readable storage medium WO2021082836A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911044588.X 2019-10-30
CN201911044588.XA CN110955675B (en) 2019-10-30 2019-10-30 Robot dialogue method, apparatus, device and computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2021082836A1 true WO2021082836A1 (en) 2021-05-06

Family

ID=69976506

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/117925 WO2021082836A1 (en) 2019-10-30 2020-09-25 Robot dialogue method, apparatus and device, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN110955675B (en)
WO (1) WO2021082836A1 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110955675B (en) * 2019-10-30 2023-12-19 中国银联股份有限公司 Robot dialogue method, apparatus, device and computer readable storage medium
CN111639218A (en) * 2020-05-12 2020-09-08 广东小天才科技有限公司 Interactive method for spoken language training and terminal equipment
CN113488036A (en) * 2020-06-10 2021-10-08 海信集团有限公司 Multi-round voice interaction method, terminal and server
CN112035650A (en) * 2020-09-07 2020-12-04 贝壳技术有限公司 Information processing method and device, computer readable storage medium and electronic equipment
CN112860862B (en) * 2021-02-01 2022-11-11 北京邮电大学 Method and device for generating intelligent agent dialogue sentences in man-machine dialogue
CN112948555B (en) * 2021-03-03 2023-09-01 北京奇艺世纪科技有限公司 Man-machine interaction method and device, electronic equipment and storage medium
CN113806503A (en) * 2021-08-25 2021-12-17 北京库睿科技有限公司 Dialog fusion method, device and equipment
CN114510557B (en) * 2022-01-21 2024-05-28 民商数字科技(深圳)有限公司 Automatic reply robot and control method thereof
CN117076649B (en) * 2023-10-13 2024-01-26 卓世科技(海南)有限公司 Emergency information query method and device based on large model thinking chain

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105094315A (en) * 2015-06-25 2015-11-25 百度在线网络技术(北京)有限公司 Method and apparatus for smart man-machine chat based on artificial intelligence
CN105487663A (en) * 2015-11-30 2016-04-13 北京光年无限科技有限公司 Intelligent robot oriented intention identification method and system
CN106056207A (en) * 2016-05-09 2016-10-26 武汉科技大学 Natural language-based robot deep interacting and reasoning method and device
CN106095834A (en) * 2016-06-01 2016-11-09 竹间智能科技(上海)有限公司 Intelligent dialogue method and system based on topic
JP2017037588A (en) * 2015-08-14 2017-02-16 富士ゼロックス株式会社 Information processor and information processing program
CN107103005A (en) * 2016-02-23 2017-08-29 阿里巴巴集团控股有限公司 The collection method and device of question and answer language material
CN107741976A (en) * 2017-10-16 2018-02-27 泰康保险集团股份有限公司 Intelligent response method, apparatus, medium and electronic equipment
CN110019848A (en) * 2017-12-22 2019-07-16 深圳市优必选科技有限公司 Talk with exchange method, device and robot
CN110955675A (en) * 2019-10-30 2020-04-03 中国银联股份有限公司 Robot dialogue method, device, equipment and computer readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5729471A (en) * 1995-03-31 1998-03-17 The Regents Of The University Of California Machine dynamic selection of one video camera/image of a scene from multiple video cameras/images of the scene in accordance with a particular perspective on the scene, an object in the scene, or an event in the scene
GB0718259D0 (en) * 2007-09-19 2007-10-31 Olton Ltd Apparatus and method for information processing
CN105975511A (en) * 2016-04-27 2016-09-28 乐视控股(北京)有限公司 Intelligent dialogue method and apparatus
CN109299320B (en) * 2018-10-30 2020-09-25 上海智臻智能网络科技股份有限公司 Information interaction method and device, computer equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105094315A (en) * 2015-06-25 2015-11-25 百度在线网络技术(北京)有限公司 Method and apparatus for smart man-machine chat based on artificial intelligence
JP2017037588A (en) * 2015-08-14 2017-02-16 富士ゼロックス株式会社 Information processor and information processing program
CN105487663A (en) * 2015-11-30 2016-04-13 北京光年无限科技有限公司 Intelligent robot oriented intention identification method and system
CN107103005A (en) * 2016-02-23 2017-08-29 阿里巴巴集团控股有限公司 The collection method and device of question and answer language material
CN106056207A (en) * 2016-05-09 2016-10-26 武汉科技大学 Natural language-based robot deep interacting and reasoning method and device
CN106095834A (en) * 2016-06-01 2016-11-09 竹间智能科技(上海)有限公司 Intelligent dialogue method and system based on topic
CN107741976A (en) * 2017-10-16 2018-02-27 泰康保险集团股份有限公司 Intelligent response method, apparatus, medium and electronic equipment
CN110019848A (en) * 2017-12-22 2019-07-16 深圳市优必选科技有限公司 Talk with exchange method, device and robot
CN110955675A (en) * 2019-10-30 2020-04-03 中国银联股份有限公司 Robot dialogue method, device, equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN110955675B (en) 2023-12-19
CN110955675A (en) 2020-04-03

Similar Documents

Publication Publication Date Title
WO2021082836A1 (en) Robot dialogue method, apparatus and device, and computer-readable storage medium
KR101872863B1 (en) Business support method using a chatting bot
US11315560B2 (en) Method for conducting dialog between human and computer
US11252117B2 (en) Electronic communication message coaching service
US20190057157A1 (en) Method and system for providing context based adaptive response to user interactions
US20180075335A1 (en) System and method for managing artificial conversational entities enhanced by social knowledge
US9373322B2 (en) System and method for determining query intent
US11922094B2 (en) Database systems and methods for conversation-driven dynamic updates
CN111611368B (en) Method and device for backtracking public scene dialogue in multiple rounds of dialogue
US11461398B2 (en) Information platform for a virtual assistant
CN107786430A (en) Robot chat method and system
KR102307380B1 (en) Natural language processing based call center support system and method
US11615790B1 (en) Disambiguating contacts using relationship data
US10964321B2 (en) Voice-enabled human tasks in process modeling
US8051026B2 (en) Rules collector system and method with user interaction
CN114238745A (en) Method and device for providing search result, electronic equipment and medium
US10606621B2 (en) Assisting users to execute content copied from electronic document in user's computing environment
KR102518901B1 (en) Method and apparatus for providing chatbot service using block component
US20240073161A1 (en) Message processing method, information processing apparatus, and program
CN114221920B (en) Automatic contact method, device, computer equipment and medium based on artificial intelligence
US11997145B1 (en) Account registration session management operations using concurrent preliminary risk scoring
JP7093844B2 (en) Dialogue system
US20210357472A1 (en) Automated hyperlinks for draft emails
US20240169361A1 (en) Systems and methods for capturing sentiments and delivering elevated proactive user experience
US9930428B2 (en) Individualization of migration between telephony systems

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20881031

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20881031

Country of ref document: EP

Kind code of ref document: A1