Question reply method and device based on question list and electronic equipment

CN118170873BActive Publication Date: 2026-11-03CHINA TELECOM CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211579073.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-08
Publication Date
2026-11-03
Estimated Expiration
2042-12-08

AI Technical Summary

Technical Problem

When handling public feedback, functional departments encounter numerous repetitive and similar issues, leading to inefficient manual screening, failure to provide timely and efficient responses, and a waste of human resources.

Method used

A machine learning algorithm based on a question list is adopted. Hidden Markov Model and Viterbi algorithm are used to segment, label and sequence the questions. The algorithm generates highly similar response texts using a pre-set question list library, reducing human intervention.

Benefits of technology

It improved the efficiency and accuracy of problem responses, reduced manual intervention, saved working time for functional departments, and achieved rapid and efficient response processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118170873B_ABST
    Figure CN118170873B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a question reply method and device based on a question list, electronic equipment and a readable storage medium. The method comprises: obtaining a question to be replied; splitting the question to be replied to obtain word segmentation of the question to be replied; adding a business label to the word segmentation based on a preset label library; inputting the word segmentation with the added business label into a preset hidden Markov model to obtain a state value set; obtaining a plaintext sequence of the question to be replied according to the state value set; determining a similarity of the plaintext sequence of the question to be replied and a plaintext sequence of a question in a preset question list library, and taking a reply script corresponding to the question with the similarity satisfying a specified condition as a candidate reply script of the question to be replied. Embodiments of the present application can reply to questions in a timely manner and improve the reply efficiency of questions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of artificial intelligence technology, and in particular to a question response method based on a question list, a question response device based on a question list, an electronic device, and a computer-readable storage medium. Background Technology

[0002] In their management practices, functional departments adopt a problem-oriented approach, driving digital reforms and process mechanism restructuring. Issues raised through the public, inspections, audits, and other channels require manual sorting and management by functional department staff, along with responding to and processing each issue, consuming significant manpower and time.

[0003] However, a large portion of these issues are repetitive, similar, or even identical, requiring manual screening and analysis before appropriate decisions can be made. For critical issues of public concern or requiring timely responses, the need for functional departments to act quickly and efficiently, provide timely feedback to the public, and maximize the use of their staff's working hours has become an urgent problem to solve. Summary of the Invention

[0004] This invention provides a method, apparatus, electronic device, and computer-readable storage medium for responding to questions based on a question list, in order to solve the problem of being unable to respond to questions in a timely manner and improve the efficiency of question response.

[0005] This invention discloses a question response method based on a question list, including:

[0006] Get the questions that need to be answered;

[0007] The question to be answered is segmented to obtain the word segments of the question to be answered;

[0008] Add business tags to the word segmentation based on a preset tag library;

[0009] The word segmentation with added business tags is input into a preset hidden Markov model to obtain a set of state values;

[0010] The plaintext sequence of the question to be answered is obtained based on the set of state values;

[0011] Determine the similarity between the plaintext sequence of the question to be answered and the plaintext sequences of questions in a preset question list library, and take the response text corresponding to the question whose similarity meets the specified condition as the candidate response text for the question to be answered.

[0012] Optionally, after segmenting the question to be answered to obtain the word segments of the question to be answered, the method further includes:

[0013] Calculate the word frequency of each segment in the question to be answered;

[0014] Remove the word segments of the question to be answered that have a word frequency lower than a preset word frequency threshold.

[0015] Optionally, the set of state values ​​includes a sequence of implicit states, and obtaining the plaintext sequence of the question to be answered based on the set of state values ​​includes:

[0016] Determine the sequence state of the hidden state sequence itself;

[0017] The Viterbi algorithm is used to concatenate the hidden state sequences based on their own sequence states, and the sequence with the shortest distance is taken as the plaintext sequence of the problem to be solved.

[0018] Optionally, determining the similarity between the plaintext sequence of the question to be answered and the plaintext sequences of questions in a preset question list database includes:

[0019] The Levenstein distance algorithm is used to determine the similarity between the plaintext sequence of the question to be answered and the plaintext sequences of questions in a preset question list library. The Levenstein distance algorithm is as follows:

[0020]

[0021] Wherein, 'a' represents the plaintext sequence of the question to be answered, and 'b' represents the plaintext sequence of questions in the preset question list library.

[0022] Optionally, after determining the similarity between the plaintext sequence of the question to be answered and the plaintext sequences of questions in a preset question list library, and selecting the response texts corresponding to the questions whose similarity satisfies a specified condition as candidate response texts for the question to be answered, the method further includes:

[0023] Determine the response template for the question to be answered;

[0024] Based on the options in the response template, target phrases are selected from the candidate response texts of the question to be answered, and the target phrases are assembled into the options in the response template to obtain the response text.

[0025] Optionally, the preset tag library is generated in the following manner:

[0026] Obtain problem samples;

[0027] The problem samples are sorted to obtain business tags, and the business tags are saved to a preset tag library.

[0028] This invention also discloses a question response device based on a question list, comprising:

[0029] The retrieval module is used to retrieve questions that need to be answered.

[0030] The segmentation module is used to segment the question to be answered to obtain the word segments of the question to be answered;

[0031] An add module is used to add business tags to the word segmentation based on a preset tag library;

[0032] The input module is used to input the word segmentation with added business tags into a preset hidden Markov model to obtain a set of state values;

[0033] The generation module is used to obtain the plaintext sequence of the question to be answered based on the set of state values;

[0034] The comparison module is used to determine the similarity between the plaintext sequence of the question to be answered and the plaintext sequence of the questions in the preset question list library, and to take the response text corresponding to the question whose similarity meets the specified conditions as the candidate response text of the question to be answered.

[0035] Optionally, the device further includes a statistics module for:

[0036] Calculate the word frequency of each segment in the question to be answered;

[0037] Remove the word segments of the question to be answered that have a word frequency lower than a preset word frequency threshold.

[0038] Optionally, the generation module is specifically used for

[0039] Determine the sequence state of the hidden state sequence itself;

[0040] The Viterbi algorithm is used to concatenate the hidden state sequences based on their own sequence states, and the sequence with the shortest distance is taken as the plaintext sequence of the problem to be solved.

[0041] Optionally, the comparison module is specifically used for:

[0042] The Levenstein distance algorithm is used to determine the similarity between the plaintext sequence of the question to be answered and the plaintext sequences of questions in a preset question list library. The Levenstein distance algorithm is as follows:

[0043]

[0044] Wherein, 'a' represents the plaintext sequence of the question to be answered, and 'b' represents the plaintext sequence of questions in the preset question list library.

[0045] Optionally, the device further includes a response module for:

[0046] Determine the response template for the question to be answered;

[0047] Based on the options in the response template, target phrases are selected from the candidate response texts of the question to be answered, and the target phrases are assembled into the options in the response template to obtain the response text.

[0048] Optionally, the device further includes a storage module for:

[0049] Obtain problem samples;

[0050] The problem samples are sorted to obtain business tags, and the business tags are saved to a preset tag library.

[0051] This invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0052] The memory is used to store computer programs;

[0053] When the processor executes a program stored in the memory, it implements the method described in the embodiments of the present invention.

[0054] This invention also discloses a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in this invention.

[0055] This invention also discloses a computer-readable storage medium storing instructions that, when executed by one or more processors, cause the processors to perform the methods described in this invention.

[0056] The embodiments of the present invention have the following advantages:

[0057] In this embodiment of the invention, the question to be answered is segmented to obtain word segments. Business tags are added to the word segments based on a preset tag library, and then input into a preset Hidden Markov Model to obtain a set of state values. Then, a plaintext sequence of the question to be answered is obtained based on the state value set. The similarity between the plaintext sequence of the question to be answered and the plaintext sequences of questions in a preset question list library is determined. The response texts corresponding to questions whose similarity meets specified conditions are used as candidate response texts for the question to be answered. This embodiment of the invention, after obtaining the set of state values ​​for the question to be answered, further obtains plaintext sequence data based on the state sequence of the state value set itself, and then compares and analyzes it one by one with the plaintext data of questions in the question list library to obtain similarity, thereby serving as alternative response schemes for the question to be answered. Based on the alternative response schemes, the question to be answered can be answered in a timely manner, improving the efficiency of answering the question. Furthermore, since the responses to the questions to be answered can be implemented by machines without human intervention, the working time of office staff in functional departments can be utilized most efficiently. Attached Figure Description

[0058] Figure 1 This is a flowchart illustrating the steps of a question response method based on a question list provided in an embodiment of the present invention;

[0059] Figure 2 This is a flowchart of an intelligent screening system for a problem list provided in an embodiment of the present invention;

[0060] Figure 3 This is a schematic diagram illustrating the principle of machine learning word segmentation provided in an embodiment of the present invention;

[0061] Figure 4 This is a schematic diagram illustrating the working principle of a probability comparator provided in an embodiment of the present invention;

[0062] Figure 5 This is a schematic diagram of a fence-type network provided in an embodiment of the present invention;

[0063] Figure 6 This is a structural block diagram of a question response device based on a question list provided in an embodiment of the present invention;

[0064] Figure 7 This is a schematic diagram of the hardware structure of an electronic device that implements various embodiments of the present invention. Detailed Implementation

[0065] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0066] In related technologies, basic text analysis algorithms and relatively independent big data algorithms are mainly provided, but there is a lack of processing models for specific problems, resulting in low processing efficiency. To address the above problems, this invention proposes to use artificial intelligence machine learning algorithms to intelligently screen similar and related problems based on a list of problems occurring in multiple fields, generate response texts based on historical processing cases, promptly address public concerns, and improve the work efficiency and effectiveness of functional departments.

[0067] Reference Figure 1 The diagram illustrates a step-by-step flowchart of a question response method based on a question list provided in an embodiment of the present invention, which may specifically include the following steps:

[0068] Step 101: Obtain the questions to be answered;

[0069] Step 102: Segment the question to be answered to obtain the word segments of the question to be answered;

[0070] Step 103: Add business tags to the word segmentation based on the preset tag library;

[0071] In this embodiment of the invention, the first step is to obtain questions to be answered. These questions can be issues submitted by the public to relevant government departments, such as, "It's almost December, why is the heating still not working? I'm very upset. Could the relevant government departments please stop being inactive and handle this as soon as possible? Thank you, please!"

[0072] In practical implementation, a problem mainly includes problem attributes and tag attributes. Problem attributes mainly include basic information such as problem name, summary, problem description, discovery method, discoverer, location of occurrence, time of occurrence, person in charge, and time of handling. Tag attributes mainly associate specific problems with corresponding tag data, which are mainly formed by manual or big data processing to form a tag library. The business tags stored in the tag library can at least include party building leadership, economic construction, political construction, propaganda and ideological and cultural construction, social governance, ecological civilization, etc. Of course, in practice, it is not limited to these.

[0073] In this embodiment of the invention, after obtaining the question to be answered, the question to be answered can be segmented by mechanical word segmentation using a text analysis algorithm, and then business tags can be added to the segmented words of the question to be answered based on a preset tag library.

[0074] Step 104: Input the word segmentation with added business tags into a preset hidden Markov model to obtain a set of state values;

[0075] Step 105: Obtain the plaintext sequence of the question to be answered based on the set of state values;

[0076] Hidden Markov Models (HMMs) are statistical models used to describe a Markov process with hidden, unknown parameters. The challenge lies in determining these hidden parameters from the observable parameters and then using them for further analysis. Specifically, an HMM is a quintuple consisting of StatusSet (set of states), InitStatus (set of initial states), ObservedSet (set of observed values), TransProbMatrix (set of transition probabilities), and EmitProbMatrix (set of emission probabilities). StatusSet (set of states) is (B: start, M: middle, E: end, S: word), where each state represents the position of a character within a word. ObservedSet (set of observed values) is the set of all Chinese character strings, including punctuation marks.

[0077] In this embodiment of the invention, after adding business tags to the word segments of the question to be answered, the word segments of the question to be answered with the added business tags can be input into a preset Hidden Markov Model to obtain a set of state values ​​for the question to be answered. Then, the plaintext sequence of the question to be answered can be calculated based on the set of state values. The set of state values ​​can be a fence-like network.

[0078] Step 106: Determine the similarity between the plaintext sequence of the question to be answered and the plaintext sequence of the questions in the preset question list library, and take the response text corresponding to the question whose similarity meets the specified condition as the candidate response text of the question to be answered.

[0079] The system comprises a question list database, collected from historical cases, containing both questions and their corresponding responses. After obtaining the plaintext sequence of the question to be answered, the similarity between this sequence and the plaintext sequences of questions in the database is calculated. Responses to questions with similarity scores meeting specified criteria (e.g., 80%) are then selected as candidate responses. Optionally, responses from questions in the database that meet the specified criteria can be used directly, or a template can be created based on responses from those responses to better address public concerns and prevent irrelevant content from being included in responses, which could cause confusion and lead to repeated inquiries.

[0080] In the aforementioned question response method based on a question list, the question to be responded to is segmented to obtain word segments. Business tags are added to the word segments based on a preset tag library, and then input into a preset Hidden Markov Model to obtain a set of state values. Then, a plaintext sequence of the question to be responded to is obtained based on the state value set. The similarity between the plaintext sequence of the question to be responded to and the plaintext sequences of questions in the preset question list library is determined. The response texts corresponding to questions whose similarity meets specified conditions are used as candidate response texts for the question to be responded to. This embodiment of the invention, after obtaining the set of state values ​​for the question to be responded to, further obtains plaintext sequence data based on the state sequence of the state value set itself. Then, it compares and analyzes the plaintext sequence data of each question with the plaintext data of questions in the question list library to obtain similarity, thus providing alternative response schemes for the question to be responded to. Based on the alternative response schemes, the question to be responded to can be responded to in a timely manner, improving the response efficiency. Furthermore, since the responses to the questions to be responded to can be implemented by machines without human intervention, the working time of office staff in functional departments can be utilized most efficiently.

[0081] In a preferred embodiment of the present invention, after segmenting the question to be answered to obtain the word segments of the question to be answered, the method may further include:

[0082] Calculate the word frequency of each segment in the question to be answered;

[0083] Remove the word segments of the question to be answered that have a word frequency lower than a preset word frequency threshold.

[0084] In this embodiment of the invention, after segmenting the question to be answered into multiple segments, the word frequency of each segment can be statistically analyzed. For example, assuming the segments of the question to be answered include "coal gas," "not hot," "sad," and "inaction," their corresponding word frequencies can be statistically analyzed as "3," "5," "2," and "7," respectively. These segments can be analyzed and displayed according to their word frequencies. Simultaneously, segments with word frequencies lower than a preset word frequency threshold can be removed. For example, if the word frequency of "sad" is lower than the preset word frequency threshold, it can be removed. This improves the accuracy of the output results and reduces the computational process of the Hidden Markov Model when the segments carrying business tags are subsequently input into the Hidden Markov Model, thereby increasing overall computational efficiency.

[0085] In a preferred embodiment of the present invention, the state value set includes a hidden state sequence, and obtaining the plaintext sequence of the question to be answered based on the state value set includes:

[0086] Determine the sequence state of the hidden state sequence itself;

[0087] The Viterbi algorithm is used to concatenate the hidden state sequences based on their own sequence states, and the sequence with the shortest distance is taken as the plaintext sequence of the problem to be solved.

[0088] In a specific implementation, after the segmented question carrying the business tag is input into the Hidden Markov Model, the output of the model can be a StatusSet (a set of state values), which includes a sequence of hidden states. In this embodiment of the invention, the Viterbi algorithm can be used to concatenate the hidden state sequences based on their own sequence states, and the sequence with the shortest distance can be used as the plaintext sequence of the question to be answered. Specifically, the Viterbi algorithm is a dynamic programming algorithm that solves the shortest path problem. The Viterbi algorithm mainly uses references to find the Viterbi path most likely to produce the sequence of observed events—the optimal hidden state sequence.

[0089] It should be noted that, in addition to the Viterbi algorithm mentioned above, other algorithms can also be used in this embodiment of the invention to calculate the plaintext sequence of the problem to be solved based on the sequence state of the hidden state sequence itself, and this embodiment of the invention does not impose any restrictions on this.

[0090] In a preferred embodiment of the present invention, step 106, determining the similarity between the plaintext sequence of the question to be answered and the plaintext sequences of questions in a preset question list library, may include:

[0091] The Levenstein distance algorithm is used to determine the similarity between the plaintext sequence of the question to be answered and the plaintext sequences of questions in a preset question list library. The Levenstein distance algorithm is as follows:

[0092]

[0093] Specifically, a and b are two arrays (strings, i.e., the plaintext sequence of the questions to be answered and the plaintext sequence of the questions in the question list, respectively), and i / j are array indices. The Levenstein distance represents the minimum number of transformations required to change a to b (or b to a).

[0094] As an optional example, the probability comparator is a method for calculating the probability of plaintext sequences overlapping. When comparing plaintext sequences, the probability comparator can use the Levenshtein distance algorithm to calculate the similarity between the values ​​of two plaintext sequences, that is, the similarity between the plaintext sequence of the question to be answered and the plaintext sequence of the questions in the preset question list library. Then, if the similarity between the two reaches a preset condition, the corresponding question in the preset question list library can be used as the response text for the question to be answered.

[0095] It should be noted that, in addition to using the Levenstein distance algorithm to calculate the similarity between two plaintext sequences, other algorithms such as Mahalanobis distance, Euclidean distance, and Chebyshev distance can also be used to calculate the similarity, and the embodiments of the present invention do not impose any restrictions on this.

[0096] In a preferred embodiment of the present invention, after determining the similarity between the plaintext sequence of the question to be answered and the plaintext sequences of questions in a preset question list library, and selecting the response texts corresponding to the questions whose similarity satisfies a specified condition as candidate response texts for the question to be answered, the method further includes:

[0097] Determine the response template for the question to be answered;

[0098] Based on the options in the response template, target phrases are selected from the candidate response texts of the question to be answered, and the target phrases are assembled into the options in the response template to obtain the response text.

[0099] In this embodiment of the invention, the questions and response drafts in the question list are generated based on historical processing cases. However, it is understood that in reality, it is unlikely that the public will raise questions that are exactly the same as those in the question list. Therefore, in this embodiment of the invention, after obtaining the response drafts (i.e., candidate response drafts) corresponding to the questions in the question list that meet the specified similarity conditions, a response template for the question to be answered can be obtained first. Then, according to the options in the response template, target phrases are selected one by one from the candidate response drafts, and the target phrases are assembled into the options in the response template to obtain the response draft. This makes the response to the question to be answered more matched and accurate, and there will be no redundant or mismatched content included as a response draft for the public, bringing a better user experience to the public.

[0100] In a preferred embodiment of the present invention, the preset tag library is generated in the following manner:

[0101] Obtain problem samples;

[0102] The problem samples are sorted to obtain business tags, and the business tags are saved to a preset tag library.

[0103] This invention can be applied to an intelligent problem list screening system. Before building the system, real-world problems can be tagged with business labels and saved to a pre-set label library for later use. Specifically, real-world problems mainly include problem attributes and label attributes. Problem attributes include basic information such as problem name, summary, problem description, discovery method, discoverer, location, time of occurrence, handler, and handling time. Label attributes mainly associate specific problems with corresponding label data, primarily formed through a manually curated label library. The business labels in the label library can specifically include Party building leadership, economic construction, political construction, propaganda, ideological and cultural construction, social governance, ecological civilization, etc.

[0104] To enable those skilled in the art to better understand the embodiments of the present invention, specific examples are provided below.

[0105] Reference Figure 2 This invention is applied to an intelligent problem list screening system, which mainly consists of four parts: a problem list library generated from historical processing cases; business tags that categorize historical problems by their domain, status, time, and location; big data computing nodes (including word segmentation, statistics, and plaintext sequence calculation for the problems to be answered); and a probability comparator service node (comparing the similarity between plaintext sequences). Based on these four parts, candidate response documents with a plaintext sequence similarity of at least 80% to the problem to be answered can be selected from the problem list library. The final response document for the problem to be answered can then be obtained from these candidate response documents. The response documents for the problem to be answered can be collected back into the problem list library.

[0106] Reference Figure 3 The main computation process of big data computing nodes includes: the usual practice is to mechanically segment the text content of the question to be answered based on a regular question lexicon to obtain word segments, and then perform statistical segmentation on the word segments to obtain word segmentation statistics (specifically, it can include word segments and their corresponding word frequencies, and then perform data analysis and display on the word segments according to their word frequencies), add business tags to the word segments of the question to be answered, and input them into a hidden Markov model to obtain a set of state values, and then use the Viterbi algorithm to find the optimal hidden state sequence (i.e., plaintext sequence) from the set of state values.

[0107] Reference Figure 4The main calculation process of the probability comparator service node includes: In this embodiment of the invention, the optimal hidden state sequence is found to obtain a plaintext sequence and then compared to obtain the similarity. For example, after obtaining the plaintext sequence A of the question to be answered and the plaintext sequence B of the question in the question list library, the similarity of the two plaintext sequences is compared by the probability comparator. The similarity can be calculated by algorithms such as Levenstein distance algorithm and Mahalanobis distance. Then, historical processing cases with a similarity of more than 80% can be screened, and the machine can be allowed to assemble the phrases in the historical processing cases according to the reply template and then reply.

[0108] Specifically, the process of finding the optimal hidden state sequence is a Hidden Markov Model (HMM). An HMM is a quintuple consisting of StatusSet (set of state values), InitStatus (set of initial states), ObservedSet (set of observed values), TransProbMatrix (set of transition probabilities), and EmitProbMatrix (set of emission probabilities). StatusSet is (B: start, M: middle, E: end, S: word), where each state represents the position of the character within the word. In this embodiment of the invention, the Viterbi algorithm is used with StatusSet as input to obtain the plaintext sequence as output.

[0109] Specifically, the Viterbi algorithm is a dynamic programming algorithm that solves graph problems in fence-like networks. Figure 5 The shortest path problem shown in the algorithm primarily uses the Viterbi path—the hidden state sequence—that is most likely to produce the sequence of observed events, after referencing it. Figure 5 In this diagram, S represents the input dataset; A1, A2, and A3 are feature values, i.e., the tag data in the tag library formed after word segmentation; B1, B2, and B3 are feature data (dynamic tags) in the comparison dataset; C1, C2, and C3 are intermediate state values ​​during the calculation process; and E is the final solution value, i.e., the plaintext sequence.

[0110] For example, the Viterbi algorithm solves the shortest path problem in a fence network as follows: starting from the first layer, for each node in each layer, calculate the shortest distance from the starting point to it, and record the previous node of the corresponding shortest path. This process is repeated layer by layer until the end point is reached, at which point the overall shortest distance is obtained. Then, by backtracking according to the previous node recorded by the node, the sequence of shortest paths is obtained.

[0111] In summary, the design concept of this invention is as follows: Real-world problems mainly include problem attributes and tag attributes. Problem attributes primarily include basic information such as problem name, summary, problem description, discovery method, discoverer, location, time of occurrence, handler, and handling time. Tag attributes mainly associate specific problem-related tag data, primarily formed through a manually curated tag library. Business tags in the tag library include Party building leadership, economic construction, political construction, propaganda and ideological and cultural construction, social governance, ecological civilization, etc. The description of the problem to be responded to is segmented using a text analysis algorithm, and high-frequency words are statistically analyzed to form a segmentation data table. Based on the tag library, the segmented words of the problem to be responded to are associated and labeled, allowing the Hidden Markov Model (HMM) to automatically learn the segmentation, find the optimal hidden state sequence, and use the Viterbi algorithm to sort and concatenate the output StatusSet (set of state values) of the HMM according to its basic state sequence, forming a plaintext sequence. Then, the plaintext sequence of the questions to be answered is compared with the plaintext of the questions in the question list library one by one using a probability comparator to obtain the similarity. The response texts of the questions in the question list library with high similarity are then used as alternative machine response schemes. After being automatically filled in using the response text template, the final response text of the questions to be answered is quickly obtained.

[0112] By applying the embodiments of the present invention, the efficiency of responding to and processing questions raised by the public can be improved, the work efficiency and effectiveness of functional staff can be enhanced, functional departments can operate efficiently, labor costs can be saved, and machines can replace human labor to automatically and accurately respond to similar questions and reflect public concerns.

[0113] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0114] Reference Figure 6 The diagram illustrates a structural block diagram of a question response device based on a question list provided in an embodiment of the present invention, which may specifically include the following modules:

[0115] Module 601 is used to retrieve questions awaiting a response.

[0116] The segmentation module 602 is used to segment the question to be answered to obtain the word segments of the question to be answered;

[0117] Add module 603, used to add business tags to the word segmentation based on a preset tag library;

[0118] Input module 604 is used to input the word segmentation with added business tags into a preset hidden Markov model to obtain a set of state values;

[0119] Generation module 605 is used to obtain the plaintext sequence of the question to be answered based on the set of state values;

[0120] The comparison module 606 is used to determine the similarity between the plaintext sequence of the question to be answered and the plaintext sequence of the questions in the preset question list library, and to take the response text corresponding to the question whose similarity meets the specified condition as the candidate response text of the question to be answered.

[0121] In a preferred embodiment of the present invention, the device further includes a statistical module for:

[0122] Calculate the word frequency of each segment in the question to be answered;

[0123] Remove the word segments of the question to be answered that have a word frequency lower than a preset word frequency threshold.

[0124] In a preferred embodiment of the present invention, the generation module is specifically used for

[0125] Determine the sequence state of the hidden state sequence itself;

[0126] The Viterbi algorithm is used to concatenate the hidden state sequences based on their own sequence states, and the sequence with the shortest distance is taken as the plaintext sequence of the problem to be solved.

[0127] In a preferred embodiment of the present invention, the comparison module is specifically used for:

[0128] The Levenstein distance algorithm is used to determine the similarity between the plaintext sequence of the question to be answered and the plaintext sequences of questions in a preset question list library. The Levenstein distance algorithm is as follows:

[0129]

[0130] Wherein, 'a' represents the plaintext sequence of the question to be answered, and 'b' represents the plaintext sequence of questions in the preset question list library.

[0131] In a preferred embodiment of the present invention, the device further includes a response module for:

[0132] Determine the response template for the question to be answered;

[0133] Based on the options in the response template, target phrases are selected from the candidate response texts of the question to be answered, and the target phrases are assembled into the options in the response template to obtain the response text.

[0134] In a preferred embodiment of the present invention, the device further includes a storage module for:

[0135] Obtain problem samples;

[0136] The problem samples are sorted to obtain business tags, and the business tags are saved to a preset tag library.

[0137] In this embodiment of the invention, the question to be answered is segmented to obtain word segments. Business tags are added to the word segments based on a preset tag library, and then input into a preset Hidden Markov Model to obtain a set of state values. Then, a plaintext sequence of the question to be answered is obtained based on the state value set. The similarity between the plaintext sequence of the question to be answered and the plaintext sequences of questions in a preset question list library is determined. The response texts corresponding to questions whose similarity meets specified conditions are used as candidate response texts for the question to be answered. This embodiment of the invention, after obtaining the set of state values ​​for the question to be answered, further obtains plaintext sequence data based on the state sequence of the state value set itself, and then compares and analyzes it one by one with the plaintext data of questions in the question list library to obtain similarity, thereby serving as alternative response schemes for the question to be answered. Based on the alternative response schemes, the question to be answered can be answered in a timely manner, improving the efficiency of answering the question. Furthermore, since the responses to the questions to be answered can be implemented by machines without human intervention, the working time of office staff in functional departments can be utilized most efficiently.

[0138] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0139] In addition, this invention also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described problem response method embodiment based on a problem list and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0140] This invention also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the above-described problem-response method embodiment based on a problem list, achieving the same technical effect. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0141] This invention also provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the problem response method embodiment based on the problem list described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0142] Figure 7 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.

[0143] The electronic device 700 includes, but is not limited to, components such as: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, a processor 710, and a power supply 711. Those skilled in the art will understand that... Figure 7 The electronic device structures shown are not intended to limit the electronic device. An electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements. In embodiments of the present invention, the electronic device includes, but is not limited to, mobile phones, tablet computers, laptops, PDAs, in-vehicle terminals, wearable devices, and pedometers.

[0144] It should be understood that, in this embodiment of the invention, the radio frequency unit 701 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink data from the base station and processes it with the processor 710; additionally, it transmits uplink data to the base station. Typically, the radio frequency unit 701 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, etc. Furthermore, the radio frequency unit 701 can also communicate with networks and other devices through a wireless communication system.

[0145] Electronic devices provide users with wireless broadband internet access through network module 702, such as helping users send and receive emails, browse web pages, and access streaming media.

[0146] The audio output unit 703 can convert audio data received by the radio frequency unit 701 or the network module 702 or stored in the memory 709 into audio signals and output them as sound. Furthermore, the audio output unit 703 can also provide audio output related to specific functions performed by the electronic device 700 (e.g., call signal reception sound, message reception sound, etc.). The audio output unit 703 includes a speaker, a buzzer, and a receiver, etc.

[0147] Input unit 704 is used to receive audio or video signals. Input unit 704 may include a graphics processing unit (GPU) 7041 and a microphone 7042. The GPU 7041 processes image data of still images or videos acquired by an image capture device (such as a camera) in video capture mode or image capture mode. The processed image frames can be displayed on display unit 706. The image frames processed by GPU 7041 can be stored in memory 709 (or other storage medium) or transmitted via radio frequency unit 701 or network module 702. Microphone 7042 can receive sound and process such sound into audio data. The processed audio data can be converted into a format that can be transmitted to a mobile communication base station via radio frequency unit 701 in telephone call mode.

[0148] The electronic device 700 also includes at least one sensor 705, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 7061 according to the ambient light level, and the proximity sensor can turn off the display panel 7061 and / or backlight when the electronic device 700 is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used to identify the posture of the electronic device (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc. The sensor 705 may also include a fingerprint sensor, pressure sensor, iris sensor, molecular sensor, gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc., which will not be described in detail here.

[0149] The display unit 706 is used to display information input by the user or information provided to the user. The display unit 706 may include a display panel 7061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0150] User input unit 707 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of electronic devices. Specifically, user input unit 707 includes a touch panel 7071 and other input devices 7072. Touch panel 7071, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near touch panel 7071). Touch panel 7071 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 710, which receives and executes commands from the processor 710. In addition, touch panel 7071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. Besides touch panel 7071, user input unit 707 may also include other input devices 7072. Specifically, other input devices 7072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, joysticks, etc., which will not be described in detail here.

[0151] Furthermore, the touch panel 7071 can cover the display panel 7061. When the touch panel 7071 detects a touch operation on or near it, it transmits the information to the processor 710 to determine the type of touch event. Subsequently, the processor 710 provides corresponding visual output on the display panel 7061 based on the type of touch event. Although in Figure 7 In this embodiment, the touch panel 7071 and the display panel 7061 are two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 7071 and the display panel 7061 can be integrated to realize the input and output functions of the electronic device. The specific implementation is not limited here.

[0152] Interface unit 708 serves as an interface for connecting external devices to electronic device 700. For example, external devices may include a wired or wireless headphone port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, and so on. Interface unit 708 can be used to receive input from external devices (e.g., data, power, etc.) and transmit the received input to one or more components within electronic device 700, or it can be used to transmit data between electronic device 700 and external devices.

[0153] The memory 709 can be used to store software programs and various data. The memory 709 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback, image playback, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). Furthermore, the memory 709 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0154] The processor 710 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 709, and by calling data stored in the memory 709, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. The processor 710 may include one or more processing units; preferably, the processor 710 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 710.

[0155] The electronic device 700 may also include a power supply 711 (such as a battery) for supplying power to various components. Preferably, the power supply 711 can be logically connected to the processor 710 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system.

[0156] In addition, the electronic device 700 includes some functional modules not shown, which will not be described in detail here.

[0157] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0158] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0159] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other modifications under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these modifications are within the protection scope of the present invention.

[0160] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0161] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0162] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0163] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0164] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0165] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0166] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A question response method based on a question list, characterized in that, include: Get the questions that need to be answered; The question to be answered is segmented to obtain the word segments of the question to be answered; Add business tags to the word segmentation based on a preset tag library; The word segmentation with added business tags is input into a preset hidden Markov model to obtain a set of state values; The plaintext sequence of the question to be answered is obtained based on the set of state values; Determine the similarity between the plaintext sequence of the question to be answered and the plaintext sequence of the questions in the preset question list library, and take the response text corresponding to the question whose similarity meets the specified condition as the candidate response text of the question to be answered; The state value set includes a hidden state sequence, and obtaining the plaintext sequence of the question to be answered based on the state value set includes: Determine the sequence state of the hidden state sequence itself; The Viterbi algorithm is used to concatenate the hidden state sequences according to their own sequence states, and the sequence with the shortest distance is taken as the plaintext sequence of the question to be answered. The method further includes, after determining the similarity between the plaintext sequence of the question to be answered and the plaintext sequences of questions in a preset question list library, and selecting the response texts corresponding to the questions whose similarity satisfies a specified condition as candidate response texts for the question to be answered: Determine the response template for the question to be answered; Select target phrases from the candidate response texts of the question to be answered according to the options of the response template, and assemble the target phrases into the options of the response template to obtain the response text; The set of state values ​​includes B: start, M: middle, E: end, and S: monograph.

2. The method according to claim 1, characterized in that, After segmenting the question to be answered to obtain the word segments of the question to be answered, the method further includes: Calculate the word frequency of each segment in the question to be answered; Remove the word segments of the question to be answered that have a word frequency lower than a preset word frequency threshold.

3. The method according to claim 1, characterized in that, Determining the similarity between the plaintext sequence of the question to be answered and the plaintext sequences of questions in a preset question list database includes: The Levenstein distance algorithm is used to determine the similarity between the plaintext sequence of the question to be answered and the plaintext sequences of questions in a preset question list library. The Levenstein distance algorithm is as follows: Wherein, 'a' represents the plaintext sequence of the question to be answered, and 'b' represents the plaintext sequence of questions in the preset question list library.

4. The method according to claim 1, characterized in that, The preset tag library is generated in the following way: Obtain problem samples; The problem samples are sorted to obtain business tags, and the business tags are saved to a preset tag library.

5. A question response device based on a question list, characterized in that, include: The retrieval module is used to retrieve questions that need to be answered. The segmentation module is used to segment the question to be answered to obtain the word segments of the question to be answered; An add module is used to add business tags to the word segmentation based on a preset tag library; The input module is used to input the word segmentation with added business tags into a preset hidden Markov model to obtain a set of state values; The generation module is used to obtain the plaintext sequence of the question to be answered based on the set of state values; The comparison module is used to determine the similarity between the plaintext sequence of the question to be answered and the plaintext sequence of the questions in the preset question list library, and to take the response text corresponding to the question whose similarity meets the specified condition as the candidate response text of the question to be answered; The generation module is specifically used for Determine the sequence state of the hidden state sequence itself; The Viterbi algorithm is used to concatenate the hidden state sequences according to their own sequence states, and the sequence with the shortest distance is taken as the plaintext sequence of the question to be answered. The device further includes a response module, used for: Determine the response template for the question to be answered; Select target phrases from the candidate response texts of the question to be answered according to the options of the response template, and assemble the target phrases into the options of the response template to obtain the response text; The set of state values ​​includes B: start, M: middle, E: end, and S: monograph.

6. The apparatus according to claim 5, characterized in that, The device also includes a statistics module for: Calculate the word frequency of each segment in the question to be answered; Remove the word segments of the question to be answered that have a word frequency lower than a preset word frequency threshold.

7. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements the method as described in any one of claims 1-4.

8. A computer-readable storage medium having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Keyword identification method based on hidden markov model, keyword identification terminal device based on hidden markov model and storage medium

    CN108170680A

  • Intelligent response method, electronic device and storage medium

    CN108345672A

  • Data processing method and device

    CN113886474A