Question answering method, device, storage medium and gateway system

By generating an expanded question bank and using topic models for matching, the problem of traditional customer service systems being unable to respond to users' diverse questions is solved, more accurate and personalized answers are achieved, and user satisfaction is improved.

CN118551024BActive Publication Date: 2024-10-11NETTHINK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411017633.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-10-11
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

The traditional static question-answer pair model cannot effectively cope with the complexity of users' diverse questioning methods and semantic expressions, and cannot accurately understand and cover users' personalized expressions.

Method used

By obtaining the standard question library and answer library, determine the word segmentation vector and part of speech of each standard question, generate a synonym set, and use the pre-trained topic model to perform topic matching to generate an expanded question library, and then generate answers to user questions based on the topic matching probability .

Benefits of technology

It improves the customer service system's understanding and coverage of users' diverse questioning methods, ensures the accuracy and relevance of answers, can more accurately capture users' semantics and intentions, and provides the most relevant solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118551024B_ABST
    Figure CN118551024B_ABST
Patent Text Reader

Abstract

In the question answering method, device, storage medium and gateway system provided by the present application, a standard question library and an answer library are obtained, and in the answer library, the answer corresponding to each standard question in the standard question library is determined; for each standard question, the vector and part of speech of each word segment in the standard question are determined, and the synonym set corresponding to each word segment is determined according to the vector and part of speech of each word segment, and the standard question is associated with each synonym set, so as to generate an extended question library according to each standard question and the corresponding synonym set; when a user question is received, the user question and the extended question library are matched with the topic model to obtain the topic matching probability of the user question and each standard question; the topic probabilities are sorted in descending order, and the answers corresponding to the top N standard questions with the topic matching probability are generated according to the answers. In this way, the user's diverse questioning methods and semantic expressions can be effectively responded to.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a question answering method, device, storage medium and gateway system. Background Art

[0002] In today's digital service environment, customer service systems are not only a bridge between companies and customers, but also an important factor affecting customer satisfaction and brand image. With the rise of the Internet and social media, users' expectations and methods of service have undergone profound changes. The way users ask questions has become increasingly diverse, and the semantic expressions have become more personalized and complex. Users may express the same question in different languages, or combine multiple topics and needs in one question.

[0003] Traditional customer service systems usually use static question-answer pairs, which means that each question has a preset answer. This model used to be effective in the past because most users' questions were relatively standardized and predictable. However, over time, the traditional static question-answer pair model can no longer effectively cope with the diverse questioning methods and semantic expressions of users. Summary of the invention

[0004] The purpose of the present application is to solve at least one of the above-mentioned technical deficiencies, especially the technical defect that the traditional static question-answer pair model in the prior art can no longer effectively cope with the user's diverse questioning methods and semantic expressions.

[0005] In a first aspect, the present application provides a question answering method, the method comprising:

[0006] Obtain a standard question library and an answer library, and determine in the answer library the answer corresponding to each standard question in the standard question library;

[0007] For each standard question, determine the vector and part of speech of each word in the standard question, determine the synonym set corresponding to each word according to the vector and part of speech of each word, and associate the standard question with each synonym set, so as to generate an expanded question library according to each standard question and the corresponding synonym set;

[0008] When receiving a user question, the pre-trained topic model is used to perform topic matching between the user question and the expanded question library to obtain the topic matching probability between the user question and each standard question;

[0009] The topics are sorted in descending order of probability, and the answers to the top N standard questions with the highest topic matching probability are used to generate answers to the user's questions, where N is a preset constant.

[0010] In one embodiment, for each standard question, the step of determining the vector and part of speech of each word segment in the standard question includes:

[0011] For each standard question, after cleaning and segmenting the words, the standard question is parsed. According to the grammatical analysis results, each word segment corresponding to the standard question is tagged with a part of speech, and the string of each word segment is converted into a number to obtain the vector of each word segment.

[0012] In one embodiment, the step of determining a synonym set corresponding to each word segment includes:

[0013] For each word segmentation, according to the vector and part of speech of the word segmentation, a synonym subset of the word segmentation is obtained from the basic corpus, and the accuracy of the synonym subset of the word segmentation is evaluated, and the synonym subset of the word segmentation is continued to be obtained until the accuracy of the synonym subset of the word segmentation reaches the preset threshold, and the synonym set corresponding to the word segmentation is obtained.

[0014] In one embodiment, the step of using a pre-trained topic model to perform topic matching on the user question and the expanded question library to obtain the topic matching probability between the user question and each standard question includes:

[0015] Using a topic model, the user question is converted into a first topic distribution, and each standard question and corresponding synonym set in the expanded question library is converted into a second topic distribution;

[0016] The topic matching probability between the first topic distribution and each second topic distribution is calculated to obtain the topic matching probability between the user question and each standard question.

[0017] In one embodiment, the step of generating an answer to the user's question based on the answers corresponding to the top N standard questions ranked by topic matching probability includes:

[0018] Perform sentiment analysis on user questions, and adjust the answers to the top N standard questions with the highest topic matching probability according to the sentiment analysis results to get answers to user questions.

[0019] In one embodiment, the step of generating an answer to the user's question based on the answers corresponding to the top N standard questions ranked by topic matching probability further includes:

[0020] Interact with the knowledge graph and retrieve knowledge information related to the user's question from the knowledge graph. Based on the knowledge information, adjust the answers corresponding to the top N standard questions with the highest topic matching probability to get the answer to the user's question.

[0021] In one embodiment, before the step of using the pre-trained topic model to perform topic matching on the user question and the expanded question library, the step further includes:

[0022] Identify user questions and expand the language of the question library;

[0023] If the language corresponding to the user question is different from the language corresponding to the expanded question library, the user question is converted so that the language corresponding to the user question is converted into the language corresponding to the expanded question library.

[0024] In a second aspect, the present application provides a question answering device, the device comprising:

[0025] A standard question library acquisition module is used to acquire a standard question library and an answer library, and determine the answer corresponding to each standard question in the standard question library in the answer library;

[0026] An extended question library generation module is used to determine, for each standard question, the vector and part of speech of each word in the standard question, and determine the synonym set corresponding to each word according to the vector and part of speech of each word, and associate the standard question with each synonym set, so as to generate an extended question library according to each standard question and the corresponding synonym set;

[0027] The topic matching module is used to use the pre-trained topic model to perform topic matching on the user question and the expanded question library when receiving the user question, and obtain the topic matching probability between the user question and each standard question;

[0028] The answer generation module is used to generate answers to user questions based on the answers corresponding to the top N standard questions ranked by topic matching probability, sorting the topics in descending order, where N is a preset constant.

[0029] In a third aspect, the present application provides a storage medium: the storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the question answering method in any of the above embodiments.

[0030] In a fourth aspect, the present application provides a gateway system, comprising: one or more processors, and a memory;

[0031] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the steps of the question answering method in any of the above embodiments are performed.

[0032] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0033] In the question answering method, device, storage medium and gateway system provided by the present application, by associating the standard question library with the synonym set to generate an expanded question library, it is possible to effectively respond to the diverse ways of asking questions by users and capture the same question raised using different vocabulary and expressions, thereby improving the system's understanding and coverage of user questions. Using the vectors, parts of speech and synonym sets of the word segmentation in each standard question, the user's semantics and intentions can be understood more accurately, which helps the customer service system to generate more accurate answers in the context of more personalized and complex semantic expressions. Through the pre-trained topic model, the user's questions are matched with the expanded question library for topics, and the probability of topic matching between the user's questions and each standard question can be quickly determined, which not only improves the efficiency of answer matching, but also improves the accuracy of the answers, ensuring that users can obtain relevant and useful answers. The answers corresponding to the top N standard questions ranked according to the probability of topic matching are generated to answer the user's questions, which can ensure that the user receives the most relevant and most likely to solve the problem when receiving the answer. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0035] Figure 1 A flowchart of a question answering method provided in an embodiment of the present application;

[0036] Figure 2 An example flow chart of a synonym set generation process provided in an embodiment of the present application;

[0037] Figure 3 An example diagram of the topic model training process provided in an embodiment of the present application;

[0038] Figure 4 An example diagram of the parallelization process of the topic model provided in the embodiment of the present application;

[0039] Figure 5 A schematic diagram of the structure of a question answering device provided in an embodiment of the present application;

[0040] Figure 6 A schematic diagram of the internal structure of the gateway system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0042] The present application provides a question answering method. The following embodiments are described by taking the method applied to a gateway system as an example. It can be understood that the gateway system can be any device with data processing functions, such as but not limited to a single server, a server cluster, a personal laptop, a desktop computer, etc. Figure 1 As shown, the method includes:

[0043] S101: Obtain a standard question library and an answer library, and determine in the answer library the answer corresponding to each standard question in the standard question library.

[0044] Among them, the standard question library refers to a set of common user questions or standard questions that are collected and organized in advance. These questions are usually determined based on historical data, customer feedback or common service requests. The standard question library is used by the system to predict and respond to questions that users may ask, and is the basic knowledge base of the customer service system. The answer library is a pre-defined standard answer or reply corresponding to each standard question corresponding to the standard question library. These answers usually contain solutions, suggestions, instructions or other relevant information. The answer library is used to enable the system to provide corresponding answers or solutions based on matching questions after users ask questions.

[0045] In this step, you can collect various possible user questions through historical customer service records, FAQ lists, customer feedback and other channels. These questions should cover different fields and various types of user concerns as much as possible. For each standard question collected, determine one or more standardized answers. These answers can include text descriptions, links, operation guides or other forms of solutions. Associate each question with its corresponding answer to form a question-answer pair. Make sure the answer has the appropriate amount of information and clear explanations to accurately respond to the questions raised by the user.

[0046] S102: For each standard question, determine the vector and part of speech of each word in the standard question, and determine the synonym set corresponding to each word based on the vector and part of speech of each word, and associate the standard question with each synonym set to generate an expanded question library based on each standard question and the corresponding synonym set.

[0047] Among them, word segmentation is the process of dividing text into separate words. For example, dividing the sentence "How to connect to a wireless network?" into the words "how", "connect", "wireless", and "network" is the result of the word segmentation process. Word vectors are mathematical representations that map words to real number vectors. These vectors are usually designed to capture the characteristics of the semantic relationship between words. Part of speech refers to the grammatical role played by a word in a sentence or the grammatical function it expresses, such as nouns, verbs, adjectives, etc. A synonym set is a set of other words that have similar meanings to the original word. These words can be similar to the original word in semantics or usage. Expanding the question bank is to enrich the question set by adding synonym questions or variant questions on the basis of standard questions, so as to improve the system's coverage and responsiveness to user questions.

[0048] In this step, for each standard question, first perform word segmentation to split the question into individual words. Then, obtain the vector representation of each word. You can use pre-trained word vector models such as Word2Vec, GloVe, etc. At the same time, you can use natural language processing tools to determine the part of speech of each word. For each word segmentation, use a word vector model or a thesaurus to find other words with similar semantics and build a set of synonyms. These synonyms can be direct synonyms or semantically related but not exactly the same words.

[0049] Associate each word in each standard question with its corresponding synonym set. This means that each word can be expanded into other words or phrases in its synonym set. Combine each standard question with its associated synonym set to generate a new set of questions. These new questions can be synonym replacements or rearrangements of each word in the original question, as well as combinations between words, to form extensions or variants of the original question.

[0050] S103: When a user question is received, a pre-trained topic model is used to perform topic matching on the user question and the expanded question library to obtain a topic matching probability between the user question and each standard question.

[0051] Among them, user questions are specific questions or queries asked by users when interacting with a system or service. A topic model is a statistical model used to discover hidden topic structures in text data. A pre-trained topic model refers to a model trained on large-scale text data that can automatically identify the topic features of different questions or texts. Topic matching refers to comparing the topic similarity or matching degree between two texts based on the output of the topic model. When a topic model is applied for topic matching, a topic matching measure between the user question and each standard question can be obtained, which is usually expressed in the form of probability, indicating the degree of similarity between the two questions in terms of topic.

[0052] In this step, the question raised by the user is first received. This question can be a text in natural language form. The user question can be preprocessed, including word segmentation, removal of stop words, word form restoration, etc., for subsequent processing and comparison. Use a pre-trained topic model to convert the user question into a representation in the topic space. The topic model may be based on a probabilistic graph model (such as Latent Dirichlet Allocation, LDA) or a deep learning model (such as a derivative version of BERT's topic modeling). For each standard question in the question library, calculate the probability of its topic matching with the user question. This is usually a value between 0 and 1, indicating the similarity or degree of match between the user question and the standard question in terms of topic.

[0053] S104: Generate an answer to the user's question based on the answers corresponding to the top N standard questions ranked by topic matching probability, according to the order of probability of each topic from large to small, where N is a preset constant.

[0054] In this step, each standard question is sorted from large to small according to the probability of subject matching with the user's question. In this way, the questions at the top are more relevant to the user's question in terms of subject. According to the preset constant N, the standard questions with the top N subject matching probabilities are selected. For the top N selected standard questions, the system extracts their pre-associated answers. These answers can be pre-defined text replies, links to related resources or documents, or further system operation instructions. The generated answers are presented to the user as a response to the question he asked.

[0055] In the above embodiment, by associating the standard question library with the synonym set to generate an expanded question library, it is possible to effectively respond to the diverse ways of asking questions by users and capture the same question raised using different vocabulary and expressions, thereby improving the system's understanding and coverage of user questions. Using the vectors, parts of speech, and synonym sets of the word segments in each standard question, the user's semantics and intentions can be understood more accurately, which helps the customer service system to generate more accurate answers in the context of more personalized and complex semantic expressions. Through the pre-trained topic model, the user's questions are matched with the expanded question library for topics, and the probability of topic matching between the user's questions and each standard question can be quickly determined, which not only improves the efficiency of answer matching, but also improves the accuracy of the answers, ensuring that users can obtain relevant and useful answers. Generating answers to user questions based on the answers corresponding to the top N standard questions ranked according to the probability of topic matching can ensure that users receive the most relevant and most likely information to solve the problem when receiving the answer.

[0056] In one embodiment, for each standard question, the step of determining the vector and part of speech of each word segment in the standard question includes:

[0057] For each standard question, after cleaning and segmenting the words, the standard question is parsed. According to the grammatical analysis results, each word segment corresponding to the standard question is tagged with a part of speech, and the string of each word segment is converted into a number to obtain the vector of each word segment.

[0058] Specifically, first, for each standard question, text cleaning is required, including removing punctuation, special characters, and non-contributing words and characters (tone, exclamation), as well as processing uppercase and lowercase letters, to ensure the consistency and comparability of the text. Then, the cleaned text is segmented to divide the text into a sequence of words or phrases. This step allows the question to be better processed and understood by the computer.

[0059] Grammatical analysis is an important task in NLP, and its purpose is to understand the structure and grammatical relationship of a sentence. In this step, grammatical analysis is performed on each standard question after cleaning and segmentation, and the dependency relationship between words in the sentence (such as subject-verb-object relationship, modification relationship, etc.) can be identified. Common grammatical analysis methods include dependency syntax analysis and phrase structure analysis. Based on grammatical analysis, part-of-speech tagging is performed on each segmented word. Part-of-speech tagging marks each word as a corresponding part-of-speech category, such as noun, verb, adjective, etc. This step helps to further understand the grammatical role and semantic features of each word in the sentence.

[0060] Convert each word after cleaning, word segmentation, grammatical analysis and part-of-speech tagging into a digital vector. This can be achieved through pre-trained word vector models (such as Word2Vec, GloVe, etc.), or through context-independent word embedding (such as BERT and other models), or using the Bag of Word (BOW) model, that is, regardless of the order of the words in the sentence, directly put each word or symbol in a set (such as a list), and then count the number of occurrences. The vector of each word captures its distribution characteristics in the semantic space, which helps to calculate semantic similarity in the computer or be used as input for machine learning models.

[0061] In this embodiment, through grammatical analysis and part-of-speech tagging, the structure and meaning of each standard question can be better understood, reducing ambiguity and misunderstanding. After the question is converted into a vector representation, the question and answer can be matched more accurately. The introduction of word vectors enables the processing of more advanced NLP tasks such as semantic similarity and semantic reasoning, thereby answering the user's query more comprehensively.

[0062] In one embodiment, the step of determining a synonym set corresponding to each word segment includes:

[0063] For each word segmentation, according to the vector and part of speech of the word segmentation, a synonym subset of the word segmentation is obtained from the basic corpus, and the accuracy of the synonym subset of the word segmentation is evaluated, and the synonym subset of the word segmentation is continued to be obtained until the accuracy of the synonym subset of the word segmentation reaches the preset threshold, and the synonym set corresponding to the word segmentation is obtained.

[0064] Specifically, a large-scale basic corpus (such as Wikipedia, large text corpus, etc.) is used to retrieve and collect a set of synonym candidates related to the word segmentation according to its vector and part of speech.

[0065] For each synonym candidate obtained, an accuracy evaluation is performed. This can be done in a variety of ways, including semantic similarity calculation, for example, using cosine similarity or other similarity metrics between word vectors to evaluate the semantic proximity of the candidate word to the original word; context dependency evaluation, for example, considering the use of words in different contexts to determine whether the candidate word can replace the original word and maintain semantic consistency; language model scoring, for example, using language models (such as BERT, GPT, etc.) to evaluate the fluency and rationality of the candidate word in a given context.

[0066] According to the accuracy evaluation, the synonyms with higher scores are selected as the synonym subset of the word segmentation. If the accuracy does not reach the preset threshold, more synonym candidates are obtained from the corpus, and the above steps are repeated until the threshold requirement is met. When the accuracy of the synonym subset reaches the preset threshold, these synonyms are integrated into the final synonym set.

[0067] In one example, if Figure 2 As shown, the features corresponding to the original data of the standard question library are used to generate synonym subsets, and the features of the original data are also the parts of speech and vectors. Then the subsets are evaluated. When the preset stopping criteria are not met, the synonym subsets are continued to be generated. When the preset stopping criteria are met, the results are verified to obtain the final synonym set. The result verification method can be manual verification or machine learning model verification.

[0068] In this embodiment, by obtaining an accurate synonym set, the standard question library can be accurately understood and processed. Using an accurate synonym set can enrich the semantic expression ability of the standard question library, enabling it to handle more semantic changes and richness, and improve its adaptability in different contexts. Accurate acquisition of synonym sets can improve the retrieval quality of user questions and can more accurately generate answers to user questions, thereby improving user experience and system efficiency.

[0069] In one embodiment, the steps of using a pre-trained topic model to perform topic matching on the user question and the expanded question library to obtain the topic matching probability between the user question and each standard question include:

[0070] Using a topic model, the user question is converted into a first topic distribution, and each standard question and corresponding synonym set in the expanded question library is converted into a second topic distribution;

[0071] The topic matching probability between the first topic distribution and each second topic distribution is calculated to obtain the topic matching probability between the user question and each standard question.

[0072] Specifically, first, a topic model (such as Latent Dirichlet Allocation, LDA) is used to convert the questions asked by the user into a first topic distribution. This step represents the user question as a distribution of topics, each of which represents a concept or topic. For each standard question and its synonym set in the expanded question library, the second topic distribution is also generated using the topic model. For each standard question, its second topic distribution is compared with the first topic distribution of the user question, which can be achieved by calculating the Kullback-Leibler (KL) divergence or Jensen-Shannon (JS) divergence between them. These metrics can evaluate the similarity between two probability distributions. For each standard question, a topic matching probability is obtained as a measure of the semantic similarity between the user question and the standard question. This probability can be interpreted as the degree of match between the user question and the standard question at the topic or concept level.

[0073] In one example, if Figure 3 As shown, the LDA (topic model) training method is as follows:

[0074] Step 1: Randomly initialize the topic of each word and count two frequency count matrices: Doc-Topic count matrix N(t,d), which describes the topic frequency distribution in each document; Word-Topic count matrix N(w,t), which represents the frequency distribution of words under each topic;

[0075] Traverse the training corpus, resample the topic corresponding to each word, and update the counts of N(t,d) and N(w,t); represents the distribution of topic k, a V-dimensional vector, Represents the topic distribution of document m, a K-dimensional vector;

[0076] Step 3: Repeat step 2 until the model converges. The formula for resampling the topic z of word w in document d has a very clear physical meaning, expressed as P(w|z)P(z|d), which is intuitively represented as a "path selection" process.

[0077] In this example, further, the parallelization of the model can be mainly explained from two perspectives, data parallelism and model parallelism.

[0078] Data parallelism - the training data is divided into M pieces according to the number of workers (M is the number of workers), and each worker saves a global N(w,t) matrix. In one iteration, each worker calculates independently. After the iteration, the local updates of each worker are merged. We can use general parallel computing frameworks such as Spark, Hadoop, Graphlab, etc. to achieve this.

[0079] Model parallelism - split N(w,t) into multiple slices. N(w,t) is stored using a global parameter server, or it can be stored on different workers and communicated using MPI AllReduce.

[0080] Data and model parallelism can be vividly described as a chessboard. The rows of the chessboard are divided according to the data, and the columns of the chessboard are divided according to the model. The parallelization of LDA is to divide the originally huge matrix that cannot be stored on a single machine into different machines through such division, so that each machine can store the parameters in memory. Then, each worker calculates relatively independently, and synchronizes the model data from time to time according to certain strategies during the calculation process.

[0081] like Figure 4 As shown in the figure, the training data is divided into multiple blocks, and the model is synchronized through the parameter server. Each data block, similar to sliding windows, will calculate the sampling of V2 only after calculating the sampling of V1. In the figure, V1, V2, and V3 represent the division of the word space, that is, the division of the model.

[0082] In this embodiment, the topic model can capture the potential semantic structure between questions and answers, rather than just the superficial lexical similarity, and improve the semantic match between the expanded question library and the user's questions. Considering a synonym set can better understand the user's intention, because users may express the same question in different ways. By integrating the synonym set into the topic model, the coverage of questions can be effectively expanded, the adaptability to diverse language expressions can be improved, and answers can be provided to users more quickly and accurately, thereby improving the efficiency of answering user questions.

[0083] In one embodiment, the step of generating an answer to the user's question based on the answers corresponding to the top N standard questions ranked by topic matching probability includes:

[0084] Perform sentiment analysis on user questions, and adjust the answers to the top N standard questions with the highest topic matching probability according to the sentiment analysis results to get answers to user questions.

[0085] Specifically, first, sentiment analysis is performed on the questions asked by the user. Sentiment analysis can determine the emotions contained in the question, such as positive, negative or neutral, or more specific emotion categories such as anger, joy, sadness, etc. Sentiment analysis can be performed using a model, and the sentiment analysis model will output a score that represents the intensity and type of emotion contained in the question. For the top N standard questions with the highest probability of topic matching, the corresponding answer content is adjusted according to the results of sentiment tendency analysis. For example, if the user question expresses positive or negative emotions, the system can adjust the tone and wording of the answer to make it more consistent with the user's current emotional state, or select those answers that have better topic matching and are more emotionally resonant with the user in terms of content based on the results of sentiment analysis. The sentiment-adjusted answer content is combined with the context and intent of the user's question to generate the final answer to the user's question. This answer should take into account the topic matching probability and sentiment analysis results to be as accurate as possible and meet the user's needs.

[0086] In this embodiment, through sentiment analysis, the user's emotional state and needs can be better understood, and the answer content can be adjusted to make it more consistent with the user's current emotional state, thereby improving the personalization of the answer and user satisfaction. Users often have emotional colors when asking questions, and sensitively capturing and making corresponding adjustments can not only improve the intelligent response capability, but also enhance the interactive experience between users and the system.

[0087] In one embodiment, the step of generating an answer to the user's question based on the answers corresponding to the top N standard questions ranked by topic matching probability further includes:

[0088] Interact with the knowledge graph and retrieve knowledge information related to the user's question from the knowledge graph. Based on the knowledge information, adjust the answers corresponding to the top N standard questions with the highest topic matching probability to get the answer to the user's question.

[0089] Specifically, first, receive the questions raised by the user. According to the user's question, interact with the knowledge graph to retrieve relevant knowledge information. The knowledge graph may contain structured data, relations and entities, which can help the system understand the semantics and related concepts behind the question. Extract the knowledge fragments, entity attributes or relations related to the user's question from the knowledge graph. Analyze the information obtained from the knowledge graph to understand its role and importance in the user's question, including the classification, relevance evaluation and semantic understanding of the information. Use the information extracted from the knowledge graph to adjust the answers corresponding to the top N standard questions. For example, integrate the specific information obtained from the knowledge graph into the answer to make it richer and more accurate; optimize the logical order or structure of the answer according to the content of the knowledge graph to make it more in line with the information needs of the user's question. Associate the answer content adjusted by the knowledge graph information with the standard question with a high probability of topic matching, generate the final answer to the user's question, and present the final generated answer to the user.

[0090] In this embodiment, the rich information resources of the knowledge graph can be used to more accurately understand and answer user questions, thereby improving the quality and accuracy of the answers. The structured information in the knowledge graph can enrich the content of the answers, including specific facts, relationships, and attributes, making the answers more comprehensive and persuasive.

[0091] Adjusting the answer content based on the specific needs of the user's question and the information in the knowledge graph can better meet the user's personalized needs and enhance the user's satisfaction and experience.

[0092] In one embodiment, before the step of using the pre-trained topic model to perform topic matching on the user question and the expanded question library, the method further includes:

[0093] Identify user questions and expand the language of the question library;

[0094] If the language corresponding to the user question is different from the language corresponding to the expanded question library, the user question is converted so that the language corresponding to the user question is converted into the language corresponding to the expanded question library.

[0095] Specifically, when a user inputs a question, it is first necessary to identify the language used by the user, which can be achieved through a language identification model or a language identification tool to determine the language type of the user's question. Similarly, it is also necessary to identify the language of the questions in the question library. Compare the language of the user's question with the language of each question in the question library. If the language of the user's question does not match the language of the question in the question library, the next step of language conversion processing is required. In order to match the language of the user's question with the language of the question in the question library, a suitable language conversion method can be selected. For example, language translation is used, that is, machine translation technology is used to translate the user's question into the language used in the question library; or a language conversion model is used. If there are specific models or algorithms for multi-language conversion, these models can be directly applied to perform language conversion. Once the language of the user's question matches the language of the question in the question library, the questions in the question library that match the user's question can be queried.

[0096] In this embodiment, user questions are processed in a multilingual environment, which enhances global applicability and user usability. By effectively identifying and processing user questions in a multilingual environment, answers can be provided to users accurately and quickly, improving the overall user experience and satisfaction. The multilingual information in the question bank is fully utilized to ensure that each user can obtain answers that are suitable for their language and cultural background, thereby enhancing the effect and quality of knowledge transfer.

[0097] The following describes the question answering device provided in the embodiment of the present application. The question answering device described below and the question answering method described above can be referred to in correspondence with each other. Figure 5 As shown, the present application provides a question answering device, the device comprising:

[0098] The standard question library acquisition module 201 is used to acquire the standard question library and the answer library, and determine the answer corresponding to each standard question in the standard question library in the answer library;

[0099] An extended question library generation module 202 is used to determine, for each standard question, the vector and part of speech of each word in the standard question, and determine the synonym set corresponding to each word according to the vector and part of speech of each word, and associate the standard question with each synonym set, so as to generate an extended question library according to each standard question and the corresponding synonym set;

[0100] The topic matching module 203 is used to use the pre-trained topic model to perform topic matching on the user question and the expanded question library when receiving the user question, and obtain the topic matching probability between the user question and each standard question;

[0101] The answer generation module 204 is used to generate an answer to the user's question based on the answers corresponding to the top N standard questions ranked by topic matching probability, according to the order of the probability of each topic from large to small, where N is a preset constant.

[0102] In one embodiment, the expanded question library generation module 202 includes:

[0103] The part-of-speech vector determination unit is used to perform grammatical analysis on each standard question after cleaning and segmenting the standard question. According to the grammatical analysis result, the part-of-speech tagging is performed on each segmented word corresponding to the standard question, and the character string of each segmented word is converted into a number to obtain the vector of each segmented word.

[0104] In one embodiment, the expanded question library generation module 202 includes:

[0105] The synonym combination determination unit is used to obtain a synonym subset of each word from the basic corpus according to the vector and part of speech of the word, and to evaluate the accuracy of the synonym subset of the word, and to continue to obtain the synonym subset of the word until the accuracy of the synonym subset of the word reaches a preset threshold, thereby obtaining the synonym set corresponding to the word.

[0106] In one embodiment, the topic matching module 203 includes:

[0107] A topic distribution determination unit, configured to use a topic model to convert the user question into a first topic distribution, and to convert each standard question and the corresponding synonym set in the expanded question library into a second topic distribution;

[0108] The topic matching unit is used to calculate the topic matching probability between the first topic distribution and each second topic distribution to obtain the topic matching probability between the user question and each standard question.

[0109] In one embodiment, the answer generation module 204 includes:

[0110] The first answer generation unit is used to perform sentiment tendency analysis on user questions, and adjust the answers corresponding to the top N standard questions with the highest topic matching probability according to the sentiment tendency analysis results to obtain answers to user questions.

[0111] In one embodiment, the answer generation module 204 further includes:

[0112] The second answer generation unit is used to interact with the knowledge graph and retrieve knowledge information related to the user's question from the knowledge graph, and adjust the answers corresponding to the top N standard questions with the topic matching probability ranking according to the knowledge information to obtain the answer to the user's question.

[0113] In one embodiment, before the topic matching module 203, the method further includes:

[0114] Language identification module, used to identify the language corresponding to user questions and expand the question library;

[0115] The language conversion module is used to convert the user question if the language corresponding to the user question is different from the language corresponding to the expanded question library, so that the language corresponding to the user question is converted into the language corresponding to the expanded question library.

[0116] In one embodiment, the present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the question answering method described in any of the above embodiments.

[0117] In one embodiment, the present application also provides a gateway system, in which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the question answering method described in any of the above embodiments.

[0118] In one example, the gateway system can be a component in an intelligent customer service robot system, which is designed to efficiently and accurately understand and process natural language input by users, and provide users with fast, accurate and valuable responses. Its main functions include but are not limited to the following aspects: a data acquisition module, which is responsible for collecting text data input by users, and performing preliminary cleaning and preprocessing to remove noise and invalid information, and provide a high-quality data foundation for subsequent analysis; a language parsing module, which uses natural language processing technology, including lexical analysis, syntactic analysis and semantic analysis, to deeply parse the input text and extract key information and semantic structure; an intent recognition module, which is used to accurately identify the user's intent and needs based on the parsed text through machine learning models and rule engines, and classify them into different business scenarios and question types; a knowledge retrieval module, which is used to interact with the knowledge graph, quickly retrieve and match relevant knowledge and information based on the identified intent and key information, and provide data support for answer generation; The answer generation module is used to comprehensively consider the user's intention, emotion, context and retrieved knowledge, and use natural language generation technology to generate natural, fluent, accurate and reasonable answer text; the sentiment analysis module is used to use the sentiment dictionary and deep learning model to analyze the sentiment tendency of the text input by the user, and provide a basis for the adjustment of the answer strategy; the multilingual processing module is responsible for the conversion and processing between different languages ​​​​to ensure accurate understanding and answers in a multilingual environment; the learning optimization module is used to continuously optimize the model parameters and rules through continuous learning and analysis of user interaction data, and improve the performance and accuracy of the gateway; the interface management module is used to provide interfaces with other components of the intelligent customer service robot and external systems to achieve data interaction and collaborative work, and ensure the successful call of this gateway with the general customer service system.

[0119] Indicatively, if Figure 6 As shown, Figure 6 This is a schematic diagram of the internal structure of a gateway system provided in an embodiment of the present application. The gateway system 300 may be provided as a server. Figure 6 The gateway system 300 includes a processing component 302, which further includes one or more processors, and a memory resource represented by a memory 301 for storing instructions executable by the processing component 302, such as an application. The application stored in the memory 301 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 302 is configured to execute instructions to perform the question answering method of any of the above embodiments.

[0120] The gateway system 300 may also include a power supply component 303 configured to perform power management of the gateway system 300, a wired or wireless network interface 304 configured to connect the gateway system 300 to the network, and an input / output (I / O) interface 305. The gateway system 300 may operate based on an operating system stored in the memory 301, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or the like.

[0121] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the gateway system to which the scheme of the present application is applied. The specific gateway system may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0122] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements. Herein, "one", "one", "said", "the" and "it" may also include plural forms, unless the context clearly indicates another way. A plurality refers to at least two cases, such as 2, 3, 5 or 8, etc. "And / or" includes any and all combinations of the relevant listed items.

[0123] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.

[0124] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A question answering method, It is characterized in that The method comprises: Obtaining a standard question library and an answer library, and determining in the answer library the answer corresponding to each standard question in the standard question library; For each of the standard questions, determine the vector and part of speech of each word in the standard question, determine the synonym set corresponding to each word according to the vector and part of speech of each word, and associate the standard question with each synonym set, so as to generate an expanded question library according to each of the standard questions and the corresponding synonym set; When receiving a user question, using a pre-trained topic model, converting the user question into a first topic distribution, and converting each of the standard questions and the corresponding synonym set in the expanded question library into a second topic distribution; Calculating a topic matching probability between the first topic distribution and each of the second topic distributions to obtain a topic matching probability between the user question and each of the standard questions; According to the order of the subject probabilities from large to small, and according to the answers corresponding to the top N standard questions ranked by subject matching probability, an answer to the user question is generated, where N is a preset constant.

2. The question answering method according to claim 1, It is characterized in that The step of determining the vector and part of speech of each word segment in each standard question includes: For each of the standard questions, after cleaning and segmenting the standard question, a grammatical analysis is performed on the standard question. According to the grammatical analysis result, a part-of-speech tag is performed on each segmentation corresponding to the standard question, and the character string of each segmentation is converted into a number to obtain a vector of each segmentation.

3. The question answering method according to claim 1, It is characterized in that The step of determining a synonym set corresponding to each participle includes: For each word segmentation, according to the vector and part of speech of the word segmentation, a synonym subset of the word segmentation is obtained from the basic corpus, and the accuracy of the synonym subset of the word segmentation is evaluated, and the synonym subset of the word segmentation is continued to be obtained until the accuracy of the synonym subset of the word segmentation reaches the preset threshold, and the synonym set corresponding to the word segmentation is obtained.

4. The question answering method according to claim 1, It is characterized in that The step of generating an answer to the user's question based on the answers corresponding to the top N standard questions ranked by topic matching probability comprises: A sentiment tendency analysis is performed on the user question, and based on the sentiment tendency analysis result, the answers corresponding to the top N standard questions with the topic matching probability ranking are adjusted to obtain the answers to the user question.

5. The question answering method according to claim 1, It is characterized in that The step of generating an answer to the user's question based on the answers corresponding to the top N standard questions ranked by topic matching probability also includes: Interact with the knowledge graph and retrieve knowledge information related to the user question from the knowledge graph, and adjust the answers corresponding to the top N standard questions with the subject matching probability ranking according to the knowledge information to obtain the answer to the user question.

6. The question answering method according to any one of claims 1 to 5, It is characterized in that Before the step of using the pre-trained topic model to perform topic matching on the user question and the expanded question library, the method further includes: Identify the languages ​​corresponding to the user question and the expanded question library; If the language corresponding to the user question is different from the language corresponding to the expanded question library, the user question is converted so that the language corresponding to the user question is converted into the language corresponding to the expanded question library.

7. A question answering device, It is characterized in that The device comprises: A standard question library acquisition module is used to acquire a standard question library and an answer library, and determine in the answer library the answer corresponding to each standard question in the standard question library; An extended question library generation module is used to determine, for each of the standard questions, the vector and part of speech of each word in the standard question, determine the synonym set corresponding to each word according to the vector and part of speech of each word, and associate the standard question with each synonym set, so as to generate an extended question library according to each of the standard questions and the corresponding synonym set; A topic matching module is used to convert the user question into a first topic distribution by using a pre-trained topic model, and convert each of the standard questions and the corresponding synonym set in the expanded question library into a second topic distribution; calculate the topic matching probability between the first topic distribution and each of the second topic distributions to obtain the topic matching probability between the user question and each of the standard questions; The answer generation module is used to generate answers to the user questions according to the order of the subject probabilities from large to small and the answers corresponding to the top N standard questions with the subject matching probability ranking, where N is a preset constant.

8. A storage medium, Features: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the question answering method as described in any one of claims 1 to 6.

9. A gateway system, It is characterized in that include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the question answering method according to any one of claims 1 to 6 are performed.