Session response method, medium, device and computing device
By obtaining problems in the intelligent customer service system, determining the target seats and using the historical interactive database to generate reply content consistent with the agent's language style, the matching error and language style inconsistency in the intelligent customer service system when dealing with complex problems is solved, and the user experience and service quality are improved.
Patent Information
- Application Number
- CN202210617493.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-01
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-06-01
AI Technical Summary
When dealing with complex problems, the intelligent customer service system has problems such as large matching errors and low response accuracy, which leads to the need to transfer to manual seats. The language styles are often inconsistent when referring to the responses generated by the customer service system, which affects the user experience.
By obtaining the questions, determining the identity of the target agent, using the historical interactive database to generate reply content consistent with the agent language style, including the processing of the subject vector and context data, to ensure that the reply content is consistent with the agent style.
It improves the service quality and user experience of manual seats, reduces the time for manual seats to modify the reply content, and improves service efficiency and reply accuracy.
Smart Images

Figure CN115017285B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technology. More specifically, embodiments of the present disclosure relate to a session response method, a medium, a device, and a computing device. Background Art
[0002] This section aims to provide background or context for the embodiments of the present disclosure stated in the claims. The descriptions herein are not admitted to be prior art merely because they are included in this section.
[0003] With the continuous development of technology, the traditional way of relying on increasing the number of people to maintain business development has encountered bottlenecks. The intelligent customer service interaction technology has emerged and gradually replaced the traditional manual service. The importance of the efficient interaction between users and intelligent customer service for enterprises is self-evident.
[0004] In the related art, intelligent customer service can only be used to answer a few simple and repetitive questions. When dealing with more complex questions, there are large matching errors and low reply accuracy, and it is necessary to transfer to a human operator for corresponding answers. However, the number of human operators is relatively scarce and needs to be combined with the customer service system. For example, the customer service system generates a response based on the user's question, and the human operator refers to this response to answer the question raised by the user.
[0005] However, when the human operator refers to the response generated by the customer service system to answer the question raised by the user, the language style often changes, resulting in a poor user experience and affecting the service quality. Summary of the Invention
[0006] The present disclosure provides a session response method, a medium, a device, and a computing device, which enable the response generated by the customer service system to be consistent with the language style of the operator, thereby improving the user experience.
[0007] In a first aspect of the embodiments of the present disclosure, a session response method is provided, including: obtaining a first question, determining a target operator according to the first question, obtaining the reply style of the target operator based on the first question and the identity identifier of the target operator, and generating a reply content according to the reply style and the first question.
[0008] In an embodiment of the present disclosure, before generating the reply content according to the reply style and the first question, it further includes: determining a topic vector corresponding to the first question according to the first question, and / or determining context data corresponding to the first question according to the first question; the generating the reply content according to the reply style and the first question includes: generating the reply content according to the topic vector and / or the context data, and the reply style and the first question.
[0009] In one embodiment of the present disclosure, determining a topic vector corresponding to the first problem includes: in a historical interaction database, determining a topic vector corresponding to the first problem according to the first problem, where the historical interaction database is constructed based on historical questions, historical replies corresponding to the historical questions, and identity identifiers of human agents who processed the historical questions.
[0010] In one embodiment of the present disclosure, obtaining the reply style of the target agent based on the first problem and the identity identifier of the target agent includes: in the historical interaction database, obtaining a first historical reply based on the first problem and the identity identifier of the target agent, where the first historical reply corresponds to the first problem and the identity identifier of the target agent, and / or corresponds to a second problem and the identity identifier of the target agent, and the second problem is a similar question corresponding to the first problem, and the semantic similarity between the similar question and the first problem is higher than a preset semantic similarity threshold; determining the reply style of the target agent according to the first historical reply.
[0011] In one embodiment of the present disclosure, determining the reply style of the target agent based on the first historical reply includes: performing word segmentation on the first historical reply to obtain a plurality of word segmentation results; determining a part-of-speech sequence of the first historical reply according to the part-of-speech of the plurality of word segmentation results; obtaining the reply style of the target agent based on the part-of-speech sequence.
[0012] In one embodiment of the present disclosure, determining a topic vector corresponding to the first problem in the historical interaction database according to the first problem includes: in the historical interaction database, obtaining a second historical reply according to the first problem, where the second historical reply corresponds to the first problem, and / or corresponds to the second problem.
[0013] In one embodiment of the present disclosure, before determining a topic vector corresponding to the first problem based on the second historical reply, it further includes: obtaining the length of the second historical reply; filtering the second historical reply according to a preset reply length range and the length of the second historical reply, where the preset reply length range is determined according to the average value and variance of the length of the second historical reply; determining a topic vector corresponding to the first problem based on the second historical reply includes: determining a topic vector corresponding to the first problem based on the filtered second historical reply.
[0014] In one embodiment of the present disclosure, determining a topic vector corresponding to the first question based on the second historical response includes: performing topic extraction on the second historical response to obtain a topic vector corresponding to the first question.
[0015] In one embodiment of the present disclosure, performing topic extraction on the second historical response to obtain a topic vector corresponding to the first question includes: obtaining a first preset number of topics from the second historical response, where each topic carries a corresponding weight, and each topic includes a second preset number of phrases; according to the weight corresponding to each topic, obtaining the topic with the largest weight from the first preset number of topics; based on the second preset number of phrases included in the topic with the largest weight, determining a topic vector corresponding to the first question.
[0016] In one embodiment of the present disclosure, based on the second preset number of phrases included in the topic with the largest weight, determining a topic vector corresponding to the first question includes: performing vectorization processing on the second preset number of phrases included in the topic with the largest weight to obtain the second preset number of phrase vectors; calculating the average value after accumulating the second preset number of phrase vectors; using the average value as the topic vector corresponding to the first question.
[0017] In one embodiment of the present disclosure, after determining the context data corresponding to the first question according to the first question, it further includes: splicing the context data according to the order of the context data; if the number of words in the spliced context data is greater than the third preset number, then deleting the spliced context data to make the number of words in the deleted context data less than or equal to the third preset number; generating a response content according to the response style and the first question includes: generating a response content according to the topic vector and / or the deleted context data, as well as the response style and the first question.
[0018] In one embodiment of the present disclosure, generating a response content according to the topic vector and / or the context data, as well as the response style and the first question includes: respectively performing vectorization processing on the context data, the response style, and the first question to obtain a context data vector, a response style vector, and a first question vector; fusing the topic vector and / or the context data vector, as well as the response style vector and the first question vector, and generating the response content based on the fused vector.
[0019] In one embodiment of the present disclosure, the fusion of the subject vector and / or the context data vector, the response style vector, and the first question vector includes: concatenating the subject vector and / or the context data vector, the response style vector, and the first question vector together to obtain the fused vector.
[0020] In one embodiment of the present disclosure, before generating a response content according to the subject vector and / or the context data, the response style, and the first question, it further includes: obtaining the previously replied content of the target agent to the first question; and the generating of the response content according to the subject vector and / or the context data, the response style, and the first question includes: generating the response content according to the previously replied content, the subject vector and / or the context data, the response style, and the first question.
[0021] In a second aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the session response method provided in the first aspect.
[0022] In a fourth aspect of the embodiments of the present disclosure, there is provided a model training device, including: an acquisition module for acquiring a first question; a first determination module for determining a target agent according to the first question; an obtaining module for obtaining the response style of the target agent based on the first question and the identity identifier of the target agent; and a generation module for generating a response content according to the response style and the first question.
[0023] In one embodiment of the present disclosure, it further includes a second determination module for determining a subject vector corresponding to the first question according to the first question before the generation module generates a response content according to the response style and the first question; and the generation module is specifically configured to: generate a response content according to the subject vector and / or the context data, the response style, and the first question.
[0024] In one embodiment of the present disclosure, the second determination module is specifically configured to: determine a subject vector corresponding to the first question according to the first question in a historical interaction database, and / or determine context data corresponding to the first question according to the first question in the historical interaction database, where the historical interaction database is constructed based on historical questions, historical responses corresponding to the historical questions, and the identity identifiers of the human agents who processed the historical questions.
[0025] In one embodiment of the present disclosure, the obtaining module is specifically configured to: in the historical interaction database, based on the first question and the identity identifier of the target agent, obtain a first historical reply, where the first historical reply corresponds to the first question and the identity identifier of the target agent, and / or corresponds to a second question and the identity identifier of the target agent, and the second question is a similar question corresponding to the first question, and the semantic similarity between the similar question and the first question is higher than a preset semantic similarity threshold; determine the reply style of the target agent according to the first historical reply.
[0026] In one embodiment of the present disclosure, the obtaining module is specifically configured to: perform word segmentation processing on the first historical reply to obtain a plurality of word segmentation results; determine the part-of-speech sequence of the first historical reply according to the part-of-speech of the plurality of word segmentation results; obtain the reply style of the target agent based on the part-of-speech sequence.
[0027] In one embodiment of the present disclosure, the second determining module is specifically configured to: in the historical interaction database, obtain a second historical reply according to the first question, where the second historical reply corresponds to the first question, and / or corresponds to the second question; determine a topic vector corresponding to the first question based on the second historical reply.
[0028] In one embodiment of the present disclosure, the second determining module is specifically configured to: obtain the length of the second historical reply; filter the second historical reply according to a preset reply length range and the length of the second historical reply, where the preset reply length range is determined according to the average value and variance of the length of the second historical reply; determine a topic vector corresponding to the first question based on the filtered second historical reply.
[0029] In one embodiment of the present disclosure, the second determining module is specifically configured to: perform topic extraction on the second historical reply to obtain a topic vector corresponding to the first question.
[0030] In one embodiment of the present disclosure, the second determining module is specifically configured to: obtain a first preset number of topics from the second historical reply, where each topic carries a corresponding weight, and each topic includes a second preset number of phrases; obtain the topic with the largest weight from the first preset number of topics according to the weight corresponding to each topic; determine a topic vector corresponding to the first question based on the second preset number of phrases included in the topic with the largest weight.
[0031] In one embodiment of the present disclosure, the second determination module is specifically configured to: perform vectorization processing on a second preset number of phrases included in the topic with the largest weight to obtain the second preset number of phrase vectors; accumulate the second preset number of phrase vectors and then calculate an average value; use the average value as the topic vector corresponding to the first question.
[0032] In one embodiment of the present disclosure, the second determination module is further configured to: splice the context data according to the order of the context data; if the number of words in the spliced context data is greater than the third preset number, delete the spliced context data to make the number of words in the deleted context data less than or equal to the third preset number; the generation module is specifically configured to: generate a response content according to the topic vector and / or the deleted context data, as well as the response style and the first question.
[0033] In one embodiment of the present disclosure, the generation module is specifically configured to: perform vectorization processing on the context data, the response style, and the first question respectively to obtain a context data vector, a response style vector, and a first question vector; fuse the topic vector and / or the context data vector, as well as the response style vector and the first question vector, and generate the response content based on the fused vectors.
[0034] In one embodiment of the present disclosure, the generation module is specifically configured to: splice the topic vector and / or the context data vector, as well as the response style vector and the first question vector together to obtain the fused vector.
[0035] In one embodiment of the present disclosure, the generation module is specifically configured to: obtain the previously replied content of the target agent for the first question; generate a response content according to the previously replied content, the topic vector and / or the context data, as well as the response style and the first question.
[0036] In the fourth aspect of the implementation manner of the present disclosure, a computing device is provided, including: at least one processor and a memory; the memory stores computer execution instructions; the at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the session response method provided in the first aspect.
[0037] In the embodiments of the present disclosure, by obtaining a question, then, based on the question, determining a target agent, and according to the above-mentioned question and the identity identifier of the target agent, obtaining the reply style of the target agent, thereby, according to the above-mentioned reply style and the question, generating a reply content, so that the generated reply is consistent with the language style of the agent, improving the user experience, enhancing the service quality, and at the same time reducing the time for the human agent to modify the above-mentioned reply content for answering, and improving the service efficiency of the human agent. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood. In the drawings, several embodiments of the present disclosure are shown by way of illustration and not limitation, wherein:
[0039] Figure 1 Schematically shows a schematic diagram of an application scenario provided according to an embodiment of the present disclosure;
[0040] Figure 2 Schematically shows a schematic diagram of the flow of a session answering method provided according to an embodiment of the present disclosure;
[0041] Figure 3 Schematically shows a schematic diagram of the flow of a session answering method provided according to another embodiment of the present disclosure;
[0042] Figure 4 Schematically shows a schematic diagram of the flow of a session answering method provided according to still another embodiment of the present disclosure;
[0043] Figure 5 Schematically shows a schematic diagram of the flow of a session answering method provided according to yet another embodiment of the present disclosure;
[0044] Figure 6 Schematically shows a schematic diagram of the generation of reply content provided according to an embodiment of the present disclosure;
[0045] Figure 7 Schematically shows a schematic diagram of the structure of a storage medium provided according to an embodiment of the present disclosure;
[0046] Figure 8 Schematically shows a schematic diagram of the structure of a session answering device provided according to an embodiment of the present disclosure;
[0047] Figure 9 Schematically shows a schematic diagram of the structure of a session answering device provided according to another embodiment of the present disclosure;
[0048] Figure 10 Schematically shows a schematic diagram of the structure of a computing device provided according to an embodiment of the present disclosure.
[0049] In the accompanying drawings, the same or corresponding reference numerals denote the same or corresponding parts. Detailed implementation manners
[0050] The principles and spirit of the present disclosure will be described below with reference to several exemplary implementation manners. It should be understood that these implementation manners are provided only to enable those skilled in the art to better understand and then implement the present disclosure, rather than limiting the scope of the present disclosure in any way. On the contrary, these implementation manners are provided to make the present disclosure more thorough and complete, and to be able to fully convey the scope of the present disclosure to those skilled in the art.
[0051] Those skilled in the art know that the implementation manners of the present disclosure can be implemented as a system, a device, equipment, a method, or a computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0052] According to the implementation manners of the present disclosure, a session response method, a medium, a device, and a computing device are provided.
[0053] In addition, the number of any element in the accompanying drawings is for illustration rather than limitation, and any naming is only for distinction and does not have any limiting meaning.
[0054] The principles and spirit of the present disclosure will be elaborated below with reference to several representative implementation manners of the present disclosure. Summary of the Invention
[0056] The inventor of the present disclosure has found that with the continuous development of society, the needs of users are becoming more and more diverse, and there are more and more problems in the process of users interacting with intelligent customers. However, intelligent customer service can only be used to answer a few simple and repetitive questions, and there are large matching errors and low reply correctness when dealing with more complex questions, and it is necessary to transfer to a human agent for corresponding answers. The number of human agents is relatively short, and it is necessary to be combined with a customer service system. For example, the customer service system generates a reference answer based on the user's question, and the human agent refers to this answer to answer the question raised by the user. However, when the human agent refers to the response generated by the customer service system to answer the question raised by the user, the language style often changes. For example, the user feels that the agent answering the question first and the agent answering the question later are not the same person, which makes the user experience poor and affects the service quality.
[0057] With the idea of improving the service quality of human agents, in the implementation manners of the present disclosure, considering the reply style of the agent, the response generated by the customer system is made consistent with the language style of the agent, improving the user experience and enhancing the service quality.
[0058] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure will be specifically introduced below.
[0059] Overview of Application Scenarios
[0060] Scenarios applicable to the embodiments of the present disclosure include session response scenarios.
[0061] First, refer to Figure 1 , Figure 1 , which schematically shows a schematic diagram of an application scenario provided according to an embodiment of the present disclosure. The devices involved in this application scenario include a first terminal 101, a server 102, and a second terminal 103. The first terminal 101 and the server 102 can communicate through a network. Similarly, the second terminal 103 and the server 102 can also communicate through a network. At this time, the first terminal 101 can be the user's terminal, and the second terminal 103 can be the terminal of the target seat. In addition, the first terminal 101 and the second terminal 103 can be deployed with application programs related to session response.
[0062] When the application scenario is session response: The user can open an application program related to session response on the first terminal 101 and interact with the application program, such as inputting a question that needs to be answered by the seat. The server 102 obtains the above question, determines the target seat according to the above question, and then, based on the above question and the identity identifier of the target seat, obtains the response style of the target seat, and generates a response content according to the response style and the above question, so that the generated response is consistent with the language style of the target seat, and then sends the above response content to the second terminal 103. Then, the target seat can view the above response content on the second terminal 103, open the above application program related to session response, and reply to the above question based on the above response content. The user can view the reply of the target seat on the first terminal 101, so that the user experience is better and the seat service quality is improved.
[0063] Exemplary Method
[0064] Next, in combination with the Figure 1 application scenario, refer to Figures 2 - 6 to describe the session response method provided according to an exemplary embodiment of the present disclosure. It should be noted that the above application scenario is only shown for the convenience of understanding the spirit and principle of the present disclosure, and the embodiments of the present disclosure are not limited in this regard. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.
[0065] It should be noted that the embodiments of the present disclosure can be applied to electronic devices, which can be terminals or servers, that is, the session response method provided by the exemplary embodiments of the present disclosure can be executed on terminals or servers. For example, if the electronic device is a server, after generating the above reply content, the above reply content can be sent to the terminal of the target seat, so that the target seat can quickly reply to the above question based on the above reply content. Another example is that if the electronic device is the terminal of the target seat, after generating the above reply content, the target seat can view the above reply content to reply, reducing the situation of changing language styles, improving the user experience, and enhancing the service quality.
[0066] Among them, the terminal can be a personal digital assistant (PDA) device, a handheld device with wireless communication function (such as a smart phone, a tablet computer), a computing device (such as a personal computer (PC)), a vehicle-mounted device, a wearable device (such as a smart watch, a smart bracelet), a smart home device (such as a smart display device), etc.
[0067] The server can be an integrated server or a distributed server across multiple computers or computer data centers. The server can also be of various types, such as, but not limited to, a web server, an application server, or a database server, or a proxy server.
[0068] Optionally, the server can include hardware, software, or an embedded logic component for performing the appropriate functions supported or implemented by the server or a combination of two or more such components. For example, the server such as a blade server, a cloud server, etc., or can be a server group composed of multiple servers, and can include one or more of the above types of servers, etc.
[0069] It should be noted that according to the session response method provided by the exemplary embodiments of the present disclosure, it can be executed on the same device or on different devices.
[0070] Reference Figure 2 , Figure 2 schematically shows a flowchart of a session response method provided by an embodiment of the present disclosure. The execution subject of this embodiment can be determined according to the actual application scenario, and the embodiments of the present disclosure do not make special limitations on this. As Figure 2 shown, the session response method includes:
[0071] S201. Obtain a first question.
[0072] Among them, the above first question can be determined according to the actual situation. For example, referring to the conversation content between the visitor and the seat in Table 1 below, the above first question is the statement corresponding to serial number 6, that is, "Can't other watches use points?".
[0073] Table 1
[0074]
[0075] S202. Determine the target seat according to the above first question.
[0076] Here, after obtaining the above first question, in this embodiment, the target seat can be determined according to the above first question. As shown in Table 1 above, obtain the question of serial number 6, and use this question as the above first question. Further, the seat that interacts with the visitor in the above Table 1 is used as the above target seat.
[0077] S203. Obtain the reply style of the above target seat based on the above first question and the identity identifier of the target seat.
[0078] In this embodiment, in order to accurately determine the reply style of the above target seat, in the historical interaction database, based on the above first question and the identity identifier of the target seat, obtain the first historical reply, and then, according to this first historical reply, determine the reply style of the above target seat.
[0079] Among them, the above historical interaction database is constructed based on historical questions, historical replies corresponding to historical questions, and the identity identifiers of the human seats that process historical questions.
[0080] Exemplarily, when constructing the above historical interaction database, historical questions, historical replies corresponding to historical questions, and the identity identifiers of the human seats that process historical questions can be obtained, and the above historical interaction database is constructed based on the obtained historical questions, historical replies corresponding to historical questions, and the identity identifiers of the human seats that process historical questions.
[0081] Here, the above historical questions, historical replies corresponding to historical questions, and the identity identifiers of the human seats that process historical questions can be determined by collecting the conversation materials of all the ended human seats within a preset time period. For example, merge the consecutive statements of the same role (visitor or seat) from the above collected conversation materials, and after merging, obtain the conversation with intervals between the visitor and the seat.
[0082] For example, if a visitor continuously says "agent" and "Can't my 1000 points be used to offset money?", they will be combined into "agent, Can't my 1000 points be used to offset money?". After the combination, the combined expression of the visitor is used as a historical question, and the response of the agent after the visitor's expression is used as the historical response corresponding to this historical question. For example, "You can check on the points page to see if there are any products you like and use the points redemption method to" is used as the historical response corresponding to the above historical question. Among them, the conversation materials of all the completed agent seats within the preset time period collected above also include the identity identifiers of the agent seats. Taking the conversation materials between a certain user and agent A as an example, the identity identifier of agent A, such as the number and work ID of agent A, is included in this conversation material. In this embodiment, after determining the historical question and the historical response corresponding to the historical question from the conversation materials collected above, the identity identifier of the agent seat that processes the historical question can be determined according to the identity identifier of the agent seat included in the above conversation materials.
[0083] Among them, in order to accurately determine the above historical question and the historical response corresponding to the historical question, after collecting the above conversation materials, the above conversation materials can be filtered. For example, incomplete conversation materials (such as conversations transferred to other personnel for processing) can be filtered, and some image, video, and voice content in the conversation materials can be filtered. The filtered image, video, voice content, etc. can be set according to the actual situation (such as meaningless expression images, video, voice content, etc.), so that the filtered conversation materials are complete and accurate, improving the accuracy of subsequent processing results.
[0084] In addition, in this embodiment, the above first historical response can correspond to the identity identifier of the above first question and the target seat, and / or correspond to the identity identifier of the second question and the above target seat. The second question is a similar question corresponding to the above first question, and the semantic similarity between this similar question and the above first question is higher than the preset semantic similarity threshold. For example, if the first question is "Can't other watches be used with points?", the second question, which is a similar question corresponding to the above first question, can be "Which other watches can be used with points?", or "What watches can be used with points?", etc.
[0085] Here, the above-mentioned first historical reply can be the historical reply in the above-mentioned historical interaction database corresponding to the identity identification of the above-mentioned first question and the target seat, and / or the historical reply in the above-mentioned historical interaction database corresponding to the second question and the identity identification of the target seat, where the second question is a similar question corresponding to the above-mentioned first question. In this way, the number of the first historical replies obtained from the above-mentioned historical interaction database is larger and the content is richer. Subsequently, the reply style of the above-mentioned target seat can be determined completely and accurately based on the first historical reply. Among them, the above-mentioned semantic similarity threshold can be set according to the actual situation, such as 60%. If the semantic similarity between the above-mentioned second question and the first question is higher than the preset semantic similarity threshold, such as the above-mentioned 60%, then the above-mentioned second question is a similar question corresponding to the above-mentioned first question.
[0086] Optionally, when determining the reply style of the above-mentioned target seat based on the above-mentioned first historical reply, the above-mentioned first historical reply can be segmented first to obtain a plurality of segmentation results, and then, according to the parts of speech of the above-mentioned plurality of segmentation results, the part-of-speech sequence of the above-mentioned first historical reply is determined, so that, based on this part-of-speech sequence, the reply style of the above-mentioned target seat is obtained.
[0087] Suppose the above-mentioned first question is "Can't other watches use points?", and the obtained first historical reply is "Points support deduction oh". In this embodiment, it is segmented to obtain a plurality of segmentation results, such as "points", "support", "deduction", "oh", and the corresponding parts of speech are "noun", "verb", "verb", "function word" respectively. Furthermore, according to the parts of speech of the above-mentioned plurality of segmentation results, the part-of-speech sequence of the above-mentioned first historical reply is determined, so as to obtain the reply style of the above-mentioned target seat.
[0088] S204. Generate a reply content according to the above-mentioned reply style and the first question.
[0089] Here, the above-mentioned reply style and the first question can be vectorized respectively to obtain a reply style vector and a first question vector, and the reply style vector and the first question vector are fused, and the above-mentioned reply content is generated based on the fused vector. For example, a preset encoder (such as Convolutional Neural Networks (CNN), Recurrent Neural Network (RNN), Transformer, etc.) can be used to vectorize the above-mentioned reply style and the first question.
[0090] Exemplarily, in this embodiment, the above-mentioned reply style vector and the first question vector can be concatenated together to obtain the above-mentioned fused vector.
[0091] Optionally, after obtaining the above-mentioned fused vector, the above-mentioned fused vector can be input into a preset decoder (such as RNN, Long Short-Term Memory (LSTM), Transformer, etc.) to generate the above-mentioned reply content, where the above-mentioned decoder is used to generate text content based on the vector.
[0092] In addition, before generating the above-mentioned reply content, this embodiment can also obtain the replied content of the above-mentioned target agent to the above-mentioned first question, such as the content "supported" in item 8 of Table 1. Furthermore, according to the above-mentioned replied content, the above-mentioned reply style, and the above-mentioned first question, a complete and accurate reply content is generated. Among them, the above-mentioned replied content can be vectorized to obtain a replied content vector, and the replied content vector, the above-mentioned reply style vector, and the first question vector are fused, and based on the fused vector, a reply content is generated. For example, the above-mentioned replied content vector, the reply style vector, and the first question vector are concatenated together to obtain a fused vector and a reply content is generated.
[0093] In the embodiments of the present disclosure, by obtaining a question, then determining a target agent based on the question, and obtaining the reply style of the target agent according to the above-mentioned question and the identity identifier of the target agent, thus, according to the above-mentioned reply style and the question, a reply content consistent with the language style of the agent is generated, which provides a better user experience, improves the service quality, and at the same time reduces the time for the human agent to modify the above-mentioned reply content for answering, and improves the service efficiency of the human agent.
[0094] In addition, when the existing human agent refers to the reply generated by the customer service system to answer the question raised by the user, there are often situations where the reply is incorrect and the accuracy rate is low. Therefore, in order to reduce the situation of incorrect replies and improve the reply accuracy rate, before generating the reply content according to the above-mentioned reply style and the first question, this embodiment of the present disclosure also considers determining a topic vector corresponding to the above-mentioned first question according to the above-mentioned first question, and / or determining context data corresponding to the above-mentioned first question according to the above-mentioned first question, thus, according to the above-mentioned topic vector and / or context data, as well as the above-mentioned reply style and the first question, a complete and accurate reply content is generated, which improves the accuracy rate of the human agent referring to the reply generated by the customer service system to answer the question raised by the user, and makes the generated reply content consistent with the language style of the agent, improving the user experience and enhancing the service quality.
[0095] Figure 3 It is a schematic flowchart of a session response method provided for another embodiment of the present disclosure, as Figure 3As shown, in this embodiment, before generating the response content according to the above response style and the first question, it is also considered to determine the topic vector corresponding to the first question according to the first question, so that, according to the topic vector, as well as the above response style and the first question, the response content is generated. The method includes:
[0096] S301. Obtain the first question.
[0097] S302. Determine the target seat according to the first question.
[0098] S303. Obtain the response style of the target seat based on the first question and the identity identifier of the target seat.
[0099] Among them, the implementation manners of steps S301 - S303 can be referred to the relevant descriptions in the Figure 2 embodiment and will not be elaborated here.
[0100] S304. Determine the topic vector corresponding to the first question according to the first question.
[0101] Here, in the above historical interaction database, the topic vector corresponding to the first question can be determined according to the first question.
[0102] Exemplarily, in this embodiment, in the above historical interaction database, the second historical response can be obtained according to the first question, where the second historical response corresponds to the first question and / or corresponds to the second question, so that, based on the second historical response, the topic vector corresponding to the first question is determined. Among them, the second question is a similar question corresponding to the first question, and the semantic similarity between the similar question and the first question is higher than the preset semantic similarity threshold.
[0103] Here, in the above historical interaction database, the responses of all seats corresponding to the first question and / or corresponding to the second question are obtained and used as the second historical response, so that the content of the obtained second historical response is more comprehensive, and thus, subsequently, the topic vector corresponding to the first question can be accurately determined based on the obtained second historical response.
[0104] Optionally, before determining the topic vector corresponding to the first question based on the second historical response, this embodiment can also obtain the length of the second historical response, and then, according to the preset response length range and the length of the second historical response, filter the second historical response, so that subsequently, the topic vector corresponding to the first question is determined based on the filtered second historical response.
[0105] Among them, the above-mentioned preset reply length range is determined according to the average value and variance of the length of the above-mentioned second historical reply. For example, by counting the length of the above-mentioned second historical reply, this length can be understood as how many words are included in the above-mentioned second historical reply. Furthermore, the average value μ and variance σ of the length are calculated. Based on this average value μ and variance σ, the shortest length is determined as The maximum length is That is, it is determined how many words at least and at most are included in the above-mentioned second historical reply. Thus, based on the above-mentioned shortest length and maximum length, the above-mentioned preset reply length range is determined. For example, after the above-mentioned server counts, the average value of the length of the above-mentioned second historical reply is 5.4, and the variance is 1.1. Then the shortest length is determined as (rounded up), the maximum length is (rounded down), and the above-mentioned preset reply length range is further determined as 4 - 7. For example, if the above-mentioned first question is "Can't other watches use points?", and the above-mentioned second historical reply is "I'm not sure if other watches can use them", with a length of 12. When filtering the above-mentioned second historical reply in this embodiment, the above-mentioned preset reply length range can be determined based on the above-mentioned shortest length and maximum length. Then, according to the above-mentioned preset reply length range, the above-mentioned second historical reply is filtered. For example, the shortest length is 4, the maximum length is 7, the above-mentioned preset reply length range is 4 - 7, and the length of the above-mentioned second historical reply is 12, which is not within the range of 4 - 7. In this embodiment, the above-mentioned second historical reply can be deleted.
[0106] Here, this embodiment takes into account that the quality of replies that are too short or too long is often not high. Therefore, according to the average value and variance of the length of the above-mentioned second historical reply, a reply length range is determined, and all replies whose answer lengths are not within this reply length range are deleted to improve the reply quality. Then, based on the filtered second historical reply, the topic vector corresponding to the above-mentioned first question is determined to improve the quality of this topic vector.
[0107] In this embodiment, when determining the topic vector corresponding to the above-mentioned first question based on the above-mentioned second historical reply, topic extraction can be performed on the above-mentioned second historical reply to obtain the topic vector corresponding to the above-mentioned first question. Exemplarily, this embodiment can obtain a first preset number of topics from the above-mentioned second historical reply, where each topic carries a corresponding weight, and each topic includes a second preset number of phrases. Then, according to the weight corresponding to each topic, the topic with the largest weight is obtained from the above-mentioned first preset number of topics. Thus, based on the second preset number of phrases included in the topic with the largest weight, the topic vector corresponding to the above-mentioned first question is determined. Here, both the above-mentioned first preset number and the second preset number can be determined according to the actual situation. For example, the above-mentioned first preset number is 3, and the above-mentioned second preset number is also 3.
[0108] Optionally, the second preset number of phrases included in the above-mentioned topic with the largest weight can be vectorized to obtain the second preset number of phrase vectors, the second preset number of phrase vectors are accumulated and then the average value is calculated, and the average value is used as the topic vector corresponding to the above-mentioned first question.
[0109] When performing the above-mentioned topic extraction on the historical reply, taking the following statement as an example for the above-mentioned topic extraction:
[0110] Automobile A is a world-famous luxury automobile brand;
[0111] Automobile B, an automobile brand in Country A;
[0112] Automobile C, with its company headquarters located in City C, Province B, and its business spanning four major industries: automobiles, rail transit, new energy, and electronics.
[0113] Before performing the topic extraction on the above statement in this embodiment, the first preset number of topics can be set, and the second preset number of phrases are included in each extracted topic. Here, taking the above first preset number as 3 and the above second preset number as 3 as an example. When performing the topic extraction on the above statement, first determine the multiple topics included in the above statement, and then determine the probability distribution of each word in the above statement belonging to each of the multiple topics, as well as the probability distribution of words on each topic. Furthermore, based on the probability distribution of each word in the above statement belonging to each of the multiple topics, determine the weight of each topic, sort them from largest to smallest according to the weight of each topic, and obtain the top 3 topics from the sorting result. As shown in Table 2 below, obtain Topic 1, Topic 2, and Topic 3. The weight of Topic 1 is 0.45, the weight of Topic 2 is 0.35, and the weight of Topic 3 is 0.2. And, based on the probability distribution of words on each topic, sort the words on each topic. For example, sort the words on each topic from largest to smallest according to the probability distribution of words on each topic, and obtain the top 3 words from the sorting result. As shown in Table 2 below, the top 3 words in Topic 1 are Automobile A, Automobile B, and Automobile C, the top 3 words in Topic 2 are Country A, Province B, and City C, and the top 3 words in Topic 3 are automobiles, electronics, and new energy.
[0114] Table 2
[0115] Subject 1 (0.45) Subject 2 (0.35) Subject 3 (0.2) Automobile A Country A Automobile Automobile B Province B Electronics Automobile C City C New Energy
[0116] Optionally, in this embodiment, according to the weights corresponding to each of the above-mentioned topics, the topic with the largest weight can be obtained from the above three topics, that is, Topic 1. Thus, based on the three phrases included in Topic 1, a topic vector corresponding to the above first question is determined. For example, the three phrases included in Topic 1 (Automobile A, Automobile B, Automobile C) are vectorized. For example, the three phrases included in Topic 1 are respectively input into a vectorization model, which is used to convert text into a vector expressing the semantics of the text. Furthermore, three phrase vectors corresponding to the three phrases included in the above Topic 1 are obtained. Among them, the dimension of the vector obtained by the above vectorization model can be determined according to the actual situation. Here, taking the dimension of the vector obtained by the above vectorization model as a four-dimensional vector as an example, the phrase vector corresponding to the phrase "Automobile A" is [0.0115525, 0.71636848, 0.75681735, 0.61298513], the phrase vector corresponding to the phrase "Automobile B" is [0.29095593, 0.79231239, 0.08199059, 0.56924747], and the phrase vector corresponding to the phrase "Automobile C" is [0.26886547, 0.41897932, 0.25461575, 0.0446018]. Further, in this embodiment, the average value can be calculated after adding the above three phrase vectors ([0.19045797, 0.6425534, 0.36447456, 0.4089448]), and this average value is used as the topic vector corresponding to the above first question.
[0117] Here, in this embodiment, a topic vector corresponding to the above first question is obtained, so that subsequently, based on the above topic vector, the above reply style and the first question, a more comprehensive reply content can be generated, enabling the artificial agent to reply to the question raised by the user completely and accurately based on the above reply content, improving the service quality, and also reducing the workload of the agent, saving costs and improving efficiency.
[0118] S305. Generate a reply content according to the above topic vector, the above reply style and the first question.
[0119] Here, the above reply style and the first question can be vectorized respectively to obtain a reply style vector and a first question vector, and the above topic vector, this reply style vector and the first question vector are fused, and based on the fused vector, the above reply content is generated. Exemplarily, the above server can splice the above topic vector, the above reply style vector and the first question vector together to obtain the above fused vector.
[0120] In addition, before generating the above response content, this embodiment may further obtain the content already replied to the above first question by the above target seat. Then, based on the above replied content, the above topic vector, the above response style, and the above first question, a complete and accurate response content is generated. Among them, the above server may perform vectorization processing on the above replied content to obtain a replied content vector, and fuse the replied content vector, the above topic vector, the above response style vector, and the first question vector, and generate a response content based on the fused vector. For example, the above server splices the above replied content vector, the above topic vector, the response style vector, and the first question vector together to obtain a fused vector and generate a response content.
[0121] In the embodiments of the present disclosure, before generating a response content according to the above response style and the first question, it is also considered to determine a topic vector corresponding to the above first question according to the above first question. Thus, based on the above topic vector, as well as the above response style and the first question, a more comprehensive response content is generated, enabling the artificial seat to reply to the question raised by the user completely and accurately based on the above response content, improving the accuracy of the reply, and making the generated response content consistent with the language style of the seat, improving the user experience and enhancing the service quality.
[0122] In addition, Figure 4 is a schematic flowchart of a session response method provided by another embodiment of the present disclosure. As Figure 4 shown, in this embodiment, before generating a response content according to the above response style and the first question, it is also considered to determine context data corresponding to the above first question according to the above first question. Thus, based on the above context data, as well as the above response style and the first question, a response content is generated. The method includes:
[0123] S401. Obtain the first question.
[0124] S402. Determine the target seat according to the above first question.
[0125] S403. Obtain the response style of the above target seat based on the above first question and the identity identifier of the target seat.
[0126] Among them, the implementation manners of steps S401 - S403 can be referred to the relevant descriptions in the Figure 2 embodiment and will not be elaborated here.
[0127] S404. Determine the context data corresponding to the above first question according to the above first question.
[0128] Here, after obtaining the first question, the corresponding context data can be determined based on the first question. For example, in Table 1, obtain question number 6 and use it as the first question. Furthermore, the conversations that have occurred in sequence numbers 1 to 5 in Table 1 are used as the preceding context data corresponding to the first question, and the conversation that has occurred in sequence number 7 in Table 1 is used as the following context data corresponding to the first question, thereby determining the context data corresponding to the first question.
[0129] Optionally, after determining the context data corresponding to the first question, this embodiment may also splice the context data according to the order of the context data. If the number of words in the spliced context data is greater than a third preset number, the spliced context data is deleted so that the number of words in the deleted context data is less than or equal to the third preset number.
[0130] Among them, taking the conversations with sequence numbers 1 to 5 that have occurred in Table 1 as the upper text data corresponding to the above-mentioned first question, and the conversation with sequence number 7 that has occurred in Table 1 as the lower text data corresponding to the above-mentioned first question as an example, the above-mentioned server splices the conversations with sequence numbers 1 to 5 and 7 that have occurred according to the order of sequence numbers 1 to 5 and 7 that have occurred in Table 1, and obtains a long sentence, namely "Manual, can't my 1,000 points be used as cash? You can check on the points page to see if there are any products you like, and you can use points to redeem them. Isn't it 100 yuan per point? At the same time, our points are used when customizing watches. If other watches can use points, how to use them?" Further, if the number of words in the spliced long sentence is greater than the third preset number, the spliced long sentence is deleted. Here, the above-mentioned third preset number can be determined according to actual conditions, for example, 128 words.
[0131] If the number of words in the spliced long sentence is greater than the third preset number, such as greater than 128 words, it means that the spliced long sentence contains a lot of content. If the spliced long sentence is directly used for subsequent processing, the processing speed may be slow. Therefore, the spliced long sentence is deleted so that the number of words in the deleted long sentence is less than or equal to the third preset number, such as less than or equal to 128 words. Optionally, when deleting the spliced long sentence, the present embodiment can delete the spliced long sentence according to the preset deletion words so that the number of words in the deleted long sentence is less than or equal to the third preset number, wherein the preset deletion words can be set according to actual conditions, such as modal particles that have no practical meaning. In addition, when deleting the spliced long sentence, the spliced long sentence can also be deleted from a preset position so that the number of words in the deleted long sentence is less than or equal to the third preset number, wherein the preset position can be set according to actual conditions, such as setting the starting position of the spliced long sentence to the preset position.
[0132] After determining the context data corresponding to the above first problem in this embodiment, the above context data can also be spliced, deleted, etc., to improve the subsequent processing speed, thereby improving the service efficiency of the human agent.
[0133] S405. Generate a reply content according to the above context data, the above reply style, and the first problem.
[0134] Here, the above server can respectively perform vectorization processing on the above context data, reply style, and first problem to obtain a context data vector, a reply style vector, and a first problem vector, and fuse the above context data vector, reply style vector, and first problem vector, and generate the above reply content based on the fused vector. Exemplarily, the above server can splice the above context data vector, the above reply style vector, and the first problem vector together to obtain the above fused vector. Among them, in the above vectorization processing, the vectorization processing of the above context data is described. In this embodiment, a vectorization model can be used to perform vectorization on the above context data. Here, the above vectorization model is used to convert text into a vector expressing the semantics of the text. When using the vectorization model to perform vectorization on the above context data, the above context data can be input into the above vectorization model to obtain the context data vector corresponding to the above context data. Among them, the dimension of the vector converted by the above vectorization model can be determined according to the actual situation. Here, taking the dimension of the vector converted by the above vectorization model as a two-dimensional vector as an example, if the above context data is "Artificial, can't my 1000 points be used to offset money? You can check on the points page to see if there are any products you like. You can use the points redemption method. Isn't it 100 yuan per point? At the same time, our points are used when customizing watches. If other watches can use points, how to use them", input it into the above vectorization model, and the context data vector corresponding to the above context data obtained is [0.48539348, 0.34782834].
[0135] In addition, before generating the above reply content, this embodiment can also obtain the previously replied content of the above target agent to the above first problem. Furthermore, a complete and accurate reply content is generated according to the above previously replied content, the above context data, the above reply style, and the above first problem. Among them, the above previously replied content can be vectorized to obtain a previously replied content vector, and the above previously replied content vector, the above context data vector, the above reply style vector, and the first problem vector are fused, and a reply content is generated based on the fused vector. For example, the above previously replied content vector, the above context data vector, the reply style vector, and the first problem vector are spliced together to obtain the fused vector, and a reply content is generated.
[0136] In an embodiment of the present disclosure, before generating a response content according to the above response style and the first question, it is also considered to determine context data corresponding to the first question according to the first question, so that, according to the context data, as well as the response style and the first question, a more complete response content is generated, improving the accuracy of the artificial agent to answer the user's question based on the response content. Moreover, the generated response is consistent with the language style of the agent, providing a better user experience and improving the service quality.
[0137] Figure 5 It is a schematic flowchart of a session response method provided by another embodiment of the present disclosure, as Figure 5 shown. In this embodiment, before generating a response content according to the above response style and the first question, it is also considered to determine a topic vector corresponding to the first question according to the first question, and determine context data corresponding to the first question according to the first question. Thus, according to the topic vector, context data, as well as the response style and the first question, a response content is generated. The method includes:
[0138] S501. Obtain the first question.
[0139] S502. Determine the target agent according to the first question.
[0140] Among them, for the implementation manners of steps S501 - S502, refer to Figure 2 the relevant descriptions in the embodiment, which will not be elaborated here.
[0141] S503. Obtain the response style of the target agent based on the first question and the identity identifier of the target agent.
[0142] Among them, in this embodiment, in the historical interaction database, based on the first question and the identity identifier of the target agent, a first historical response can be obtained, and then, according to the first historical response, the response style of the target agent is determined.
[0143] S504. Determine a topic vector corresponding to the first question according to the first question, and determine context data corresponding to the first question according to the first question.
[0144] Here, in the historical interaction database, a topic vector corresponding to the first question can be determined according to the first question.
[0145] Exemplarily, this embodiment may obtain a second historical response from the historical interaction database based on the first question, wherein the second historical response corresponds to the first question and / or to the second question, thereby determining a topic vector corresponding to the first question based on the second historical response. The second question is a similar question to the first question, and the semantic similarity between the similar question and the first question is greater than the preset semantic similarity threshold.
[0146] Furthermore, after determining the context data corresponding to the first question, this embodiment may concatenate the context data according to the order of the context data and delete the concatenated context data. If the number of characters in the concatenated context data exceeds a third predetermined number, the server deletes the concatenated context data so that the number of characters in the deleted context data is less than or equal to the third predetermined number.
[0147] S505: Generate response content based on the topic vector, context data, response style, and the first question.
[0148] For example, Figure 6 As shown, this embodiment can first construct a historical interaction database, obtain historical questions, historical answers corresponding to historical questions, and the identity of the human agent who handled the historical questions, and construct the above-mentioned historical interaction database based on the obtained historical questions, historical answers corresponding to historical questions, and the identity of the human agent who handled the historical questions.
[0149] Then, in the historical interaction database, based on the first question and the identity of the target agent, a first historical answer is obtained, and then, based on the first historical answer, the answer style of the target agent is determined.
[0150] Among them, when determining the response style of the target agent based on the first historical response, the first historical response can be segmented to obtain multiple segmentation results, and then the part-of-speech sequence of the first historical response can be determined based on the parts-of-speech of the multiple segmentation results. Thus, based on the part-of-speech sequence, the response style of the target agent can be obtained. For example, if the first question is "other watches cannot use points, right?", the first historical response obtained is "points can be deducted." This embodiment performs segmentation processing to obtain multiple segmentation results, such as "points," "support," "deduction," and "oh." The corresponding parts of speech are "noun," "verb," "verb," and "function word," respectively. Then, based on the parts-of-speech of the multiple segmentation results, the part-of-speech sequence of the first historical response is determined, thereby obtaining the response style of the target agent.
[0151] Optionally, in this embodiment, the second historical reply may also be obtained from the above historical interaction database according to the above first question, and the second historical reply may be filtered, such as obtaining the length of the second historical reply. Further, according to the preset reply length range and the length of the second historical reply, the second historical reply is filtered. After the filtering is completed, the server may perform topic extraction on the filtered second historical reply to obtain a topic vector corresponding to the first question.
[0152] Exemplarily, in this embodiment, the first preset number of topics may be obtained from the second historical reply, where each topic carries a corresponding weight, and each topic includes the second preset number of phrases. Further, according to the weight corresponding to each topic, the topic with the largest weight is obtained from the first preset number of topics. Thus, based on the second preset number of phrases included in the topic with the largest weight, the topic vector corresponding to the first question is determined.
[0153] Optionally, after obtaining the first question in this embodiment, the corresponding context data may be determined according to the first question, and the context data may be concatenated according to the order of the context data. If the number of words in the concatenated context data is greater than the third preset number, the concatenated context data is trimmed so that the number of words in the trimmed context data is less than or equal to the third preset number.
[0154] Here, after obtaining the reply style, topic vector, and context data, this embodiment may perform vectorization processing on the context data, reply style, and first question respectively to obtain a context data vector, a reply style vector, and a first question vector, and fuse the topic vector, context data vector, reply style vector, and first question vector. Based on the fused vector, the reply content is generated. Exemplarily, the topic vector, context data vector, reply style vector, and first question vector may be concatenated together to obtain the fused vector.
[0155] Among them, in the above vectorization process, in this embodiment, a vectorization model can be used to vectorize the above context data vector, response style vector, and first question vector. Here, the above vectorization model is used to convert text into a vector expressing the semantics of the text. In the vectorization process, in this embodiment, the above context data vector, response style vector, and first question vector can be input into the above vectorization model to obtain the context data vector corresponding to the above context data, the response style vector corresponding to the above response style, and the first question vector corresponding to the above first question. Among them, the dimension of the vector obtained by the above vectorization model conversion can be determined according to the actual situation. Here, taking the dimension of the vector obtained by the above vectorization model conversion as a two-dimensional vector as an example, the context data vector corresponding to the above context data is [0.48539348, 0.34782834], the response style vector corresponding to the above response style is [0.87664415, 0.93101361], and the first question vector corresponding to the above first question is [0.92049985, 0.17425929]. If the above topic vector is known to be [0.38434537, 0.75824908], then in this embodiment, the above topic vector, context data vector, and the above response style vector and first question vector can be concatenated together to obtain the above fused vector [0.48539348, 0.34782834, 0.38434537, 0.75824908, 0.87664415, 0.93101361, 0.92049985, 0.17425929].
[0156] Further, as Figure 6 shown, after obtaining the above fused vector, the above fused vector can be input into the above preset decoder to generate the above response content.
[0157] In addition, before generating the above response content, the already replied content of the above target agent to the above first question can also be obtained. Furthermore, based on the above already replied content, the above topic vector, the above context data, the above response style, and the above first question, a more complete and accurate response content can be generated. Among them, the already replied content can be vectorized to obtain an already replied content vector, and the already replied content vector, the above topic vector, the above context data vector, the above response style vector, and the first question vector can be fused, and based on the fused vector, a response content can be generated. For example, the already replied content vector, the above topic vector, the above context data vector, the response style vector, and the first question vector are concatenated together to obtain a fused vector, and a response content is generated.
[0158] Compared with the prior art, in this embodiment, the response style of the target agent is obtained, and according to this response style and the question, response content is generated, so that the generated response is consistent with the language style of the agent, improving the user experience and enhancing the service quality. Moreover, before generating the response content according to the above response style and question, this embodiment also considers determining the topic vector corresponding to the above question and the context data corresponding to the above question according to the above question. Thus, according to the above topic vector, context data, response style and question, complete and accurate response content is generated, improving the accuracy of the response of the human agent referring to the response generated by the customer service system to answer the question raised by the user. In addition, before generating the above response content, this embodiment also considers the content already replied to the above question by the target agent. Furthermore, according to the above already replied content, topic vector, context data, response style and question, more complete and accurate response content is generated, further improving the response accuracy.
[0159] Exemplary Medium
[0160] After introducing the method of the exemplary embodiment of the present disclosure, next, reference is made to Figure 7 to describe the storage medium of the exemplary embodiment of the present disclosure.
[0161] Reference is made to Figure 7 As shown, in the storage medium 70, there is stored a program product for implementing the above method according to the embodiment of the present disclosure. It can be a portable compact disc read-only memory (CD-ROM) and includes program code, and can run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto.
[0162] The program product can adopt any combination of one or more readable media. The readable media can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0163] The readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which the readable program code is carried. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable signal medium can also be any readable medium other than the readable storage medium.
[0164] Program code for performing the operations disclosed in this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN).
[0165] Exemplary Device
[0166] After introducing the media of the exemplary embodiments of the present disclosure, next, reference is made to Figures 8 - 9 The session response device of the exemplary embodiment of the present disclosure is described, where the session response device is used to implement the session response method provided in any of the above method embodiments, and its implementation principle and technical effects are similar, and will not be elaborated here.
[0167] Reference is made to Figure 8 , Figure 8 which is a schematic structural diagram of a session response device provided by an embodiment of the present disclosure. As Figure 8 shown, the session response device includes:
[0168] An acquisition module 801, configured to acquire a first question.
[0169] A first determination module 802, configured to determine a target seat according to the first question.
[0170] An obtaining module 803, configured to obtain the response style of the target seat based on the first question and the identity identifier of the target seat.
[0171] A generation module 804, configured to generate a response content according to the response style and the first question.
[0172] Reference is made to Figure 9 , Figure 9 which is a schematic structural diagram of a session response device provided by another embodiment of the present disclosure. As Figure 9 shown, the above session response device further includes:
[0173] A second determination module 805, configured to, before the generation module 804 generates a response content according to the response style and the first question, determine a topic vector corresponding to the first question according to the first question, and / or determine context data corresponding to the first question according to the first question.
[0174] The generating module 804 is specifically configured to: generate a reply content according to the topic vector and / or the context data, as well as the reply style and the first question.
[0175] In an embodiment of the present disclosure, the second determining module 805 is specifically configured to:
[0176] In the historical interaction database, determine a topic vector corresponding to the first question according to the first question, where the historical interaction database is constructed based on historical questions, historical replies corresponding to the historical questions, and identity identifiers of human agents who process the historical questions.
[0177] In another embodiment of the present disclosure, the obtaining module 803 is specifically configured to:
[0178] In the historical interaction database, obtain a first historical reply based on the first question and the identity identifier of the target agent, where the first historical reply corresponds to the first question and the identity identifier of the target agent, and / or corresponds to a second question and the identity identifier of the target agent, the second question being a similar question corresponding to the first question, and the semantic similarity between the similar question and the first question being higher than a preset semantic similarity threshold; determine the reply style of the target agent according to the first historical reply.
[0179] In another embodiment of the present disclosure, the obtaining module 803 is specifically configured to:
[0180] Perform word segmentation processing on the first historical reply to obtain a plurality of word segmentation results; determine a part-of-speech sequence of the first historical reply according to the part-of-speech of the plurality of word segmentation results; obtain the reply style of the target agent based on the part-of-speech sequence.
[0181] In another embodiment of the present disclosure, the second determining module 805 is specifically configured to:
[0182] In the historical interaction database, obtain a second historical reply according to the first question, where the second historical reply corresponds to the first question and / or corresponds to the second question; determine a topic vector corresponding to the first question based on the second historical reply.
[0183] In another embodiment of the present disclosure, the second determining module 805 is specifically configured to:
[0184] Obtain the length of the second historical reply; filter the second historical reply according to a preset reply length range and the length of the second historical reply, where the preset reply length range is determined according to the average value and variance of the length of the second historical reply; based on the filtered second historical reply, determine a topic vector corresponding to the first question.
[0185] In another embodiment of the present disclosure, the second determination module 805 is specifically configured to:
[0186] Perform topic extraction on the second historical reply to obtain a topic vector corresponding to the first question.
[0187] In another embodiment of the present disclosure, the second determination module 805 is specifically configured to:
[0188] Obtain a first preset number of topics from the second historical reply, where each topic carries a corresponding weight, and each topic includes a second preset number of phrases; according to the weight corresponding to each topic, obtain the topic with the largest weight from the first preset number of topics; based on the second preset number of phrases included in the topic with the largest weight, determine a topic vector corresponding to the first question.
[0189] In another embodiment of the present disclosure, the second determination module 805 is specifically configured to:
[0190] Perform vectorization processing on the second preset number of phrases included in the topic with the largest weight to obtain the second preset number of phrase vectors; accumulate the second preset number of phrase vectors and calculate the average value; use the average value as the topic vector corresponding to the first question.
[0191] In another embodiment of the present disclosure, the second determination module 805 is further configured to:
[0192] Splice the context data according to the order of the context data; if the number of words in the spliced context data is greater than a third preset number, delete the spliced context data so that the number of words in the deleted context data is less than or equal to the third preset number.
[0193] The generation module 804 is specifically configured to:
[0194] Generate a reply content according to the topic vector and / or the deleted context data, and the reply style and the first question.
[0195] In another embodiment of the present disclosure, the generation module 804 is specifically configured to:
[0196] Vectorize the context data, the response style, and the first question respectively to obtain a context data vector, a response style vector, and a first question vector; fuse the topic vector and / or the context data vector, and the response style vector and the first question vector, and generate the response content based on the fused vector.
[0197] In another embodiment of the present disclosure, the generating module 804 is specifically configured to:
[0198] Concatenate the topic vector and / or the context data vector, and the response style vector and the first question vector together to obtain the fused vector.
[0199] In another embodiment of the present disclosure, the generating module 804 is specifically configured to:
[0200] Obtain the previously replied content of the target agent for the first question; generate a response content according to the previously replied content, the topic vector and / or the context data, and the response style and the first question.
[0201] Exemplary Computing Device
[0202] After introducing the methods, media, and devices of the exemplary embodiments of the present disclosure, next, refer to Figure 10 Describe the computing device of the exemplary embodiment of the present disclosure.
[0203] Figure 10 The displayed computing device 100 is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.
[0204] As Figure 10 shown, the computing device 100 is presented in the form of a general-purpose computing device. The components of the computing device 100 may include but are not limited to: at least one of the above-mentioned processing units 1001, at least one of the above-mentioned storage units 1002, and a bus 1003 connecting different system components (including the processing unit 1001 and the storage unit 1002).
[0205] The bus 1003 includes a data bus, a control bus, and an address bus.
[0206] The storage unit 1002 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 10021 and / or a cache memory 10022, and may further include a readable medium in the form of a non-volatile memory, such as a read-only memory (ROM) 10023.
[0207] The storage unit 1002 may also include a program / utilities 10025 having a set (at least one) of program modules 10024. Such program modules 10024 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment.
[0208] The computing device 100 may also communicate with one or more external devices 1004 (such as a keyboard, a pointing device, etc.). Such communication may be carried out through an input / output (I / O) interface 1005. Also, the computing device 100 may further communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 1006. As Figure 10 shown, the network adapter 1006 communicates with other modules of the computing device 100 through a bus 1003. It should be understood that, although not shown in the figures, other hardware and / or software modules may be used in conjunction with the computing device 100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0209] It should be noted that, although several units / modules or sub-units / modules of the session response device are mentioned in the above detailed description, such a division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more of the above-described units / modules may be embodied in one unit / module. Conversely, the features and functions of one unit / module described above may be further divided and embodied by multiple units / modules.
[0210] In addition, although the operations of the method of the present disclosure are described in a specific order in the drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution.
[0211] Although the spirit and principles of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the specific embodiments disclosed, and the division of each aspect does not mean that the features in these aspects cannot be combined for benefit. Such a division is only for the convenience of expression. The present disclosure aims to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A session response method, comprising: Obtaining a first question; Determining a target seat according to the first question; In a historical interaction database, based on the first question and the identity identifier of the target seat, obtaining a first historical reply, wherein the first historical reply corresponds to the first question and the identity identifier of the target seat, and / or corresponds to a second question and the identity identifier of the target seat, the second question being a similar question corresponding to the first question, and the semantic similarity between the similar question and the first question being higher than a preset semantic similarity threshold; wherein the historical interaction database is constructed based on historical questions, historical replies corresponding to the historical questions, and the identity identifiers of the human seats processing the historical questions; Determining the reply style of the target seat according to the first historical reply; Determining a topic vector corresponding to the first question according to the first question, and / or determining context data corresponding to the first question according to the first question; Generating a reply content consistent with the language style of the target seat according to the topic vector and / or the context data, the reply style, and the first question; The determining a topic vector corresponding to the first question according to the first question includes: In the historical interaction database, obtaining a second historical reply according to the first question, wherein the second historical reply corresponds to the first question and / or corresponds to the second question; Determining a topic vector corresponding to the first question based on the second historical reply.
2. The session response method according to claim 1, wherein the determining the reply style of the target seat based on the first historical reply includes: Performing word segmentation on the first historical reply to obtain a plurality of word segmentation results; Determining a part-of-speech sequence of the first historical reply according to the part-of-speech of the plurality of word segmentation results; Obtaining the reply style of the target seat based on the part-of-speech sequence.
3. The session response method according to claim 1, before the determining a topic vector corresponding to the first question based on the second historical reply, further comprising: Obtaining the length of the second historical reply; [[ID= Obtain a first preset number of topics from the second historical response, where each topic carries a corresponding weight, and each topic includes a second preset number of phrases; According to the weight corresponding to each topic, obtain the topic with the largest weight from the first preset number of topics; Based on the second preset number of phrases included in the topic with the largest weight, determine the topic vector corresponding to the first question.
6. The session response method according to claim 5, wherein the determining the topic vector corresponding to the first question based on the second preset number of phrases included in the topic with the largest weight includes: Perform vectorization processing on the second preset number of phrases included in the topic with the largest weight to obtain the second preset number of phrase vectors; Accumulate the second preset number of phrase vectors and calculate the average value; Use the average value as the topic vector corresponding to the first question.
7. The session response method according to claim 1 or 2, after determining the context data corresponding to the first question according to the first question, further includes: Splice the context data according to the order of the context data; If the number of words in the spliced context data is greater than a third preset number, then delete the spliced context data so that the number of words in the deleted context data is less than or equal to the third preset number; The generating the response content according to the response style and the first question includes: Generate the response content according to the topic vector and / or the deleted context data, and the response style and the first question.
8. The session response method according to claim 1 or 2, wherein the generating the response content according to the topic vector and / or the context data, and the response style and the first question includes: Perform vectorization processing on the context data, the response style, and the first question respectively to obtain a context data vector, a response style vector, and a first question vector; Fuse the topic vector and / or the context data vector, and the response style vector and the first question vector, and generate the response content based on the fused vector.
9. The session response method according to claim 8, wherein the fusing the topic vector and / or the context data vector, and the response style vector and the first question vector includes: Splice the topic vector and / or the context data vector, and the response style vector and the first question vector together to obtain the fused vector.
10. The session response method according to claim 1 or 2, before generating the response content according to the topic vector and / or the context data, and the response style and the first question, further includes: Obtain the already replied content of the target seat for the first question; The generating the response content according to the topic vector and / or the context data, and the response style and the first question includes: Generate a response content based on the replied content, the topic vector and / or the context data, as well as the response style and the first question.
11. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the session response method according to any one of claims 1 to 10.
12. A session response device, comprising: An acquisition module for acquiring a first question. A first determination module for determining a target seat according to the first question. An obtaining module for obtaining the response style of the target seat based on the first question and the identity identifier of the target seat. A generation module for generating a response content consistent with the language style of the target seat according to the response style and the first question. The obtaining module is specifically configured to obtain a first historical response in a historical interaction database based on the first question and the identity identifier of the target seat, where the first historical response corresponds to the first question and the identity identifier of the target seat, and / or corresponds to a second question and the identity identifier of the target seat, and the second question is a similar question corresponding to the first question, and the semantic similarity between the similar question and the first question is higher than a preset semantic similarity threshold; wherein the historical interaction database is constructed based on historical questions, historical responses corresponding to the historical questions, and the identity identifiers of the artificial seats processing the historical questions; determine the response style of the target seat according to the first historical response. A second determination module for determining a topic vector corresponding to the first question according to the first question, and / or determining context data corresponding to the first question according to the first question. The generation module is specifically configured to generate a response content according to the topic vector and / or the context data, as well as the response style and the first question. The second determination module is specifically configured to obtain a second historical response in the historical interaction database according to the first question, where the second historical response corresponds to the first question and / or corresponds to the second question; determine a topic vector corresponding to the first question based on the second historical response.
13. The session response device according to claim 12, wherein the obtaining module is specifically configured to: Perform word segmentation on the first historical response to obtain a plurality of word segmentation results. Determine the part-of-speech sequence of the first historical response according to the part-of-speech of the plurality of word segmentation results. Obtain the response style of the target seat based on the part-of-speech sequence.
14. The session response device according to claim 12, wherein the second determination module is specifically configured to: Obtain the length of the second historical response. Filter the second historical response according to a preset response length range and the length of the second historical response, where, The preset response length range is determined according to the average value and variance of the length of the second historical response. Determine a topic vector corresponding to the first question based on the filtered second historical response.
15. The session response device according to claim 12, wherein the second determination module is specifically configured to: Perform topic extraction on the second historical reply to obtain a topic vector corresponding to the first question.
16. The session response device according to claim 15, wherein the second determination module is specifically configured to: Obtain a first preset number of topics from the second historical response, where Each topic carries a corresponding weight, and each topic includes a second preset number of phrases; According to the weight corresponding to each topic, obtain the topic with the largest weight from the first preset number of topics; Based on the second preset number of phrases included in the topic with the largest weight, determine a topic vector corresponding to the first question.
17. The session response device according to claim 16, wherein the second determination module is specifically configured to: Perform vectorization processing on the second preset number of phrases included in the topic with the largest weight to obtain the second preset number of phrase vectors; Accumulate the second preset number of phrase vectors and calculate the average value; Use the average value as the topic vector corresponding to the first question.
18. The session response device according to claim 12 or 13, wherein the second determination module is further configured to: Concatenate the context data according to the order of the context data; If the number of words in the concatenated context data is greater than a third preset number, delete the concatenated context data so that the number of words in the deleted context data is less than or equal to the third preset number; The generation module is specifically configured to: Generate a reply content according to the topic vector and / or the deleted context data, and the reply style and the first question.
19. The session response device according to claim 12 or 13, wherein the generation module is specifically configured to: Perform vectorization processing on the context data, the reply style, and the first question respectively to obtain a context data vector, a reply style vector, and a first question vector; Fuse the topic vector and / or the context data vector, and the reply style vector and the first question vector, and generate the reply content based on the fused vector.
20. The session response device according to claim 19, wherein the generation module is specifically configured to: Concatenate the topic vector and / or the context data vector, and the reply style vector and the first question vector together to obtain the fused vector.
21. The session response device according to claim 12 or 13, wherein the generation module is specifically configured to: Obtain the replied content of the target agent to the first question; Generate a reply content according to the replied content, the topic vector and / or the context data, and the reply style and the first question.
22. A computing device, comprising: At least one processor and a memory; The memory stores computer execution instructions; The at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the session response method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Customer service method, device and system
CN112543185A
Reply message generation method and device, electronic equipment and storage medium
CN113037932A