Intelligent question and answer method and device, computer equipment and readable storage medium

Through the intelligent question and answer method of network search, text database matching and vector database retrieval, it solves the correlation problem caused by search engines' reliance on character matching and achieves more accurate and detailed answers.

CN118733744AInactive Publication Date: 2024-10-01深圳高灯计算机科技有限公司

Patent Information

Application Number
CN202411207252.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-10-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Question retrieval based on search engines usually relies on character matching, resulting in the retrieved answers having little relevance to the question and failing to fully understand the user's intention.

Method used

By obtaining the question text, we use three methods: network search, text database matching and vector database retrieval to obtain reference information, perform multi-dimensional vectorization processing and reordering model sorting, and screen out target reference information that is highly relevant to the question text to determine the answer. .

Benefits of technology

It improves the matching between questions and answers, enhances the accuracy and detail of answers, enables a more comprehensive understanding of user questions, and reduces unnecessary information interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733744A_ABST
    Figure CN118733744A_ABST
Patent Text Reader

Abstract

The invention relates to an intelligent question and answer method and device, computer equipment and a readable storage medium. The method comprises the steps of obtaining a question text; obtaining first reference information of the question text based on network search; matching the question text with a question text in a text database to obtain second reference information of the question text; obtaining a question vector corresponding to the question text, and matching the question vector with a question vector in a vector database to obtain third reference information of the question text; summarizing the first reference information, the second reference information and the third reference information to obtain a summarized reference information set; and sorting the reference information in the summarized reference information set based on a resorting model, determining target reference information from a sorting result, and determining an answer of the question text based on the target reference information. By adopting the method, the questions can be comprehensively, thoroughly and accurately answered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to an intelligent question-answering method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Art

[0002] With the development of Internet technology, search engine technology has emerged. Through search engines, people can ask questions on the Internet and get corresponding answers. However, question retrieval based on search engines is usually based on character matching, which may result in the retrieved answers being less relevant to the questions. Summary of the invention

[0003] Based on this, it is necessary to provide an intelligent question-answering method, apparatus, computer device, computer-readable storage medium and computer program product that can improve the matching degree between questions and answers in response to the above technical problems.

[0004] In a first aspect, the present application provides an intelligent question-answering method, comprising:

[0005] Get the question text;

[0006] Obtaining first reference information of the question text based on network search; matching the question text with a question text in a text database to obtain second reference information of the question text; obtaining a question vector corresponding to the question text, and matching the question vector with a question vector in a vector database to obtain third reference information of the question text; the text database is used to store an association list between the question text and the corresponding reference information, and the vector database is used to store an association list between the question vector and the corresponding reference information;

[0007] Aggregating the first reference information, the second reference information, and the third reference information to obtain an aggregated reference information set;

[0008] The reference information in the summarized reference information set is sorted based on the re-sorting model, target reference information is determined from the sorting result, and the answer to the question text is determined based on the target reference information.

[0009] In one embodiment, the step of obtaining the question vector corresponding to the question text includes: performing multi-dimensional vectorization on the question text to obtain multiple vectors of the question text in multiple dimensions.

[0010] In one embodiment, the step of performing multi-dimensional vectorization on the question text to obtain multiple vectors of the question text in multiple dimensions includes:

[0011] Extracting multiple keywords from the question text, and obtaining a first vector of the question text based on the keywords;

[0012] Rewriting the question text with synonyms to generate a synonymous text, vectorizing the synonymous text to obtain a synonymous text vector, and using the synonymous text vector as a second vector of the question text;

[0013] Derivatively generating a corresponding derived question text from the question text, performing vectorization processing on the derived question text, and using a derived vector of the derived question text as a third vector of the question text;

[0014] Attention adjustment is performed on the question text to generate a corresponding optimized question text, vectorization is performed on the optimized question text, and the optimized vector of the optimized question text is used as the fourth vector of the question text.

[0015] In one embodiment, the step of obtaining the first reference information of the question text based on a network search includes:

[0016] Perform keyword segmentation on the question text to obtain a segmentation result of the question text;

[0017] Using a search engine to search the split results to obtain search results;

[0018] Sorting the search results based on the re-ranking model to obtain a ranked list;

[0019] The search results in the sorted list that meet the preset conditions are determined as the first reference information.

[0020] In one embodiment, the step of determining the answer to the question text based on the target reference information includes:

[0021] Dividing the question text into a plurality of secondary questions;

[0022] Extracting the answer corresponding to each of the secondary questions from the target reference information;

[0023] Integrate multiple responses;

[0024] The integrated answer is determined as the answer to the question text.

[0025] In one embodiment, the steps before obtaining the question text include:

[0026] Get historical questions input by the user;

[0027] The question information input by the user this time is supplemented based on the historical question, and the supplemented question information is used as the question text.

[0028] In a second aspect, the present application further provides an intelligent question-answering device, the device comprising:

[0029] An acquisition module is used to obtain the question text;

[0030] A retrieval module is used to obtain first reference information of the question text based on a network search; match the question text with a question text in a text database to obtain second reference information of the question text; obtain a question vector corresponding to the question text, and match the question vector with a question vector in a vector database to obtain third reference information of the question text; the text database is used to store an association list between the question text and the corresponding reference information, and the vector database is used to store an association list between the question vector and the corresponding reference information;

[0031] a summarizing module, configured to summarize the first reference information, the second reference information and the third reference information to obtain a summarized reference information set;

[0032] The answer module is used to sort the reference information in the summary reference information set based on the re-sorting model, determine the target reference information from the sorting result, and use the target reference information to answer the question text.

[0033] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0034] Get the question text;

[0035] Obtaining first reference information of the question text based on network search; matching the question text with a question text in a text database to obtain second reference information of the question text; obtaining a question vector corresponding to the question text, and matching the question vector with a question vector in a vector database to obtain third reference information of the question text; the text database is used to store an association list between the question text and the corresponding reference information, and the vector database is used to store an association list between the question vector and the corresponding reference information;

[0036] Aggregating the first reference information, the second reference information, and the third reference information to obtain an aggregated reference information set;

[0037] The reference information in the summarized reference information set is sorted based on the re-sorting model, target reference information is determined from the sorting result, and the answer to the question text is determined based on the target reference information.

[0038] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0039] Get the question text;

[0040] Obtaining first reference information of the question text based on network search; matching the question text with a question text in a text database to obtain second reference information of the question text; obtaining a question vector corresponding to the question text, and matching the question vector with a question vector in a vector database to obtain third reference information of the question text; the text database is used to store an association list between the question text and the corresponding reference information, and the vector database is used to store an association list between the question vector and the corresponding reference information;

[0041] Aggregating the first reference information, the second reference information, and the third reference information to obtain an aggregated reference information set;

[0042] The reference information in the summarized reference information set is sorted based on the re-sorting model, target reference information is determined from the sorting result, and the answer to the question text is determined based on the target reference information.

[0043] In a fifth aspect, the present application further provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the following steps are implemented:

[0044] Get the question text;

[0045] Obtaining first reference information of the question text based on network search; matching the question text with a question text in a text database to obtain second reference information of the question text; obtaining a question vector corresponding to the question text, and matching the question vector with a question vector in a vector database to obtain third reference information of the question text; the text database is used to store an association list between the question text and the corresponding reference information, and the vector database is used to store an association list between the question vector and the corresponding reference information;

[0046] Aggregating the first reference information, the second reference information, and the third reference information to obtain an aggregated reference information set;

[0047] The reference information in the summarized reference information set is sorted based on the re-sorting model, target reference information is determined from the sorting result, and the answer to the question text is determined based on the target reference information.

[0048] The above-mentioned intelligent question-answering method, apparatus, computer equipment, computer-readable storage medium and computer program product obtain question text and retrieve reference information for the question text in three ways. The first is to obtain the first reference information of the question text based on network search, the second is to match the question text with the question text in the text database to obtain the second reference information of the question text, and the third is to obtain the question vector corresponding to the question text, and match the question vector with the question vector in the vector database to obtain the third reference information of the question text. In this way, the corresponding answer to the question text can be obtained from the first reference information, the second reference information and the third reference information. By processing the question text in multiple ways, a comprehensive analysis of the question text can be achieved, so that the question text can be fully understood, and then the target reference information can be screened out from the first reference information, the second reference information and the third reference information. When determining the answer to the question text based on the target reference information, the matching degree between the determined answer and the question text can be improved, thereby enhancing the accuracy of the answer. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions 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 related drawings can be obtained based on these drawings without paying creative work.

[0050] Figure 1 is an application environment diagram of an intelligent question-answering method in an embodiment;

[0051] Figure 2 1 is a flow chart of an intelligent question-answering method in one embodiment;

[0052] Figure 3 A flowchart of the step of obtaining a question text in one embodiment;

[0053] Figure 4 A schematic diagram of a process for obtaining first reference information in an embodiment;

[0054] Figure 5 A schematic diagram of a process for obtaining second reference information in an embodiment;

[0055] Figure 6 A schematic diagram of a first interface of an intelligent question-answering system in one embodiment;

[0056] Figure 7 A schematic diagram of a second interface of an intelligent question-answering system in one embodiment;

[0057] Figure 8is a flowchart of an intelligent question-answering method in another embodiment;

[0058] Fig. 9 is a schematic diagram of the architecture of an intelligent question-answering system in one embodiment;

[0059] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0061] The intelligent question-answering method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal can integrate an intelligent question and answer system. The user sends questions to the server through the intelligent question and answer system. The server can process the questions entered by the user to obtain a question text. The server can then analyze the question text to obtain reference information that can answer the question text. Specifically, the server can obtain the first reference information of the question text based on a network search. Match the question text with the question text in the text database to obtain the second reference information of the question text. Obtain the question vector corresponding to the question text, and match the question vector with the question vector in the vector database to obtain the third reference information of the question text. Among them, the text database is used to store an association list of question texts and corresponding reference information, and the vector database is used to store an association list of question vectors and corresponding reference information. After obtaining the first reference information, the second reference information and the third reference information, in order to obtain reference information with high relevance to the question text from these reference information and reduce the interference of unnecessary reference information, the server can summarize the first reference information, the second reference information and the third reference information to obtain a summary reference information set; then sort the reference information in the summary reference information set based on the re-sorting model, determine the target reference information from the sorting result, and determine the answer to the question text based on the target reference information. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0062] In an exemplary embodiment, Figure 2 As shown, an intelligent question answering method is provided, which is applied to Figure 1 The server in the example is used to illustrate, including the following steps 202 to 212. Among them:

[0063] Step 202, obtaining the question text.

[0064] Among them, the question text refers to the text obtained by the server after processing the original question entered by the user. For example, if the original question entered by the user is a voice, the server needs to convert the voice into text first, and then process the text to understand the voice entered by the user, so as to obtain the question text. For another example, the original question entered by the user is not standard enough, such as not concise enough, with typos, etc. At this time, the server can also process the original question to make the question text concise, so as to facilitate the subsequent search for reference information that can answer the original question based on the question text. The question text focuses more on the core issue of the original question, so that the server can fully understand the original question entered by the user and reduce the adverse effects of the interfering text of the original question on finding the answer.

[0065] Step 204: obtaining first reference information of the question text based on a network search.

[0066] In the process of finding reference information that can answer the original question, three methods can be used. The first method is to find reference information in a search engine. That is, obtain the first reference information corresponding to the question text based on a network search. In other words, find reference information related to the question text on the Internet. Among them, the question text corresponds to the question that the user needs to solve. The reference information is information that can answer this question. The first reference information is based on a search engine searching the Internet based on the question text, and obtaining multiple search results. For example, it can be a certain file on the Internet and the content in the file, and for example, it can be the page content of a certain website on the Internet.

[0067] Since the information on the Internet is huge, the amount of reference information obtained based on network search may be large. The search engine usually displays the reference information related to the question in the form of one by one. Since the search engine usually ranks the reference information with high relevance to the question text in the front, the server can retrieve the first preset number of reference information ranked in the front as the first reference information.

[0068] Optionally, after obtaining the first ten reference information ranked in the front, the obtained first ten reference information can be re-ranked, and the second preset number of reference information ranked in the front after re-ranking is used as the first reference information. The second preset number can be less than or equal to the first preset number. In this way, the search results of the network search can be further analyzed to enhance the relevance of the first reference information to the question text, and reduce the adverse effects of search results irrelevant to the question text on the first reference information. For example, the network search may search out advertising websites and rank them in the front. At this time, when the server further analyzes the search results, if the correlation between the advertising website and the question text is low, the ranking of the advertising website is placed in the latter few places when the reference information is re-ranked. Thereby, the information interference of the advertising website on the question text can be reduced.

[0069] Alternatively, the question text may be a complete question sentence. The search logic of the network search may be based on character matching logic. Therefore, the question text may be split into keywords, and the split results may be used as the input of the search engine to obtain reference information related to the question text.

[0070] Step 206: Match the question text with the question text in the text database to obtain second reference information of the question text.

[0071] The second method of finding reference information that can answer the original question is to compare the question text with the data in the text database. The text database is the data stored in the data storage system. The server can collect big data regularly and process the collected data to build a text database. The processed data is imported into the text database in the form of text question and answer pairs. Specifically, the server can slice the collected knowledge text based on the number of words, segment the text, and finally import the segmentation results into the text database.

[0072] The knowledge text includes questions and answers. For example, the question can be the title of the collected web page or the title converted into the form of a question. Or it can be a corresponding question generated by analyzing the collected files and other materials. The question and the corresponding files and other materials are imported into the text database. Among them, the reference information is obtained based on the collected materials. Optionally, a label can be set for each question-material pair data, so that the label can be used to query the question-material pair related to the question text in the text database later. In this way, a text database can be constructed. In other words, the text database stores each question text and its corresponding reference information that can answer the question text.

[0073] In this step, in order to expand the number of reference information of the question text, not to miss the correct answer and to improve the richness of the answer, the server can match the question text with the question text in the text database. The question text and the corresponding reference information whose matching degree reaches the preset value are used as the second reference information. If the matching degree between the question text and the question text is high, it means that the question text is likely to ask a question related to the question text, so the reference information corresponding to the question text can be used as the reference information of the question text.

[0074] Optionally, when matching the question text with the question text, the degree of matching can be determined by the degree of keyword matching between the question text and the question text. Keyword matching involves word segmentation of the text. The question text can also be rewritten with synonyms and then compared with the question text.

[0075] Step 208: Obtain a question vector corresponding to the question text, and match the question vector with the question vector in the vector database to obtain third reference information of the question text.

[0076] The third method is a vector retrieval-based method. To overcome the limitations of text retrieval, for example, text comparison may not consider semantics. When two questions are expressed in completely different ways but express the same question, text retrieval may miss some reference information. Therefore, the server also processes the collected data to build a vector database. Specifically, the server slices the collected knowledge text based on the number of tokens, and then stores the vectors corresponding to the knowledge text in the vector database based on the embedding conversion volume. The vector database stores the vectors corresponding to each question text and its corresponding reference information that can answer the question text.

[0077] Optionally, when constructing the vector database, the information corresponding to the question can be extracted and the summary can be vectorized so that when searching for reference materials related to the question text in the vector database, the question text can be compared with the summary vector of each data in the vector database.

[0078] In this step, since the question text is in text form rather than vector form, the server needs to vectorize the question text first to obtain the question vector corresponding to the question text. Then the question vector is matched with the question vector in the vector database. The reference information corresponding to the question vector whose matching degree with the question vector reaches a preset value is used as the third reference information.

[0079] Optionally, the matching degree can be reflected by the similarity between vectors. Vectorizing the question text can be achieved by using Embedding technology.

[0080] Step 210: Aggregate the first reference information, the second reference information, and the third reference information to obtain an aggregated reference information set.

[0081] Step 212: sort the reference information in the summary reference information set based on the re-sorting model, determine the target reference information from the sorting result, and determine the answer to the question text based on the target reference information.

[0082] After the above steps, the server can obtain three reference information related to the question text in three ways. The number of each reference information is not limited to one. The three reference information are first reference information obtained based on network search, second reference information obtained based on text database matching, and third reference information obtained based on vector database matching.

[0083] The relevance of each reference information obtained through the three methods to the question text may be different, or the same reference information may exist in the obtained reference information. Therefore, the server needs to compare the relevance of each reference information in the first reference information, the second reference information, and the third reference information, so as to select the target reference information whose relevance to the question text meets the preset conditions from these reference information. In this way, the amount of information that needs to be referenced when answering the question text using the target reference information can be reduced, and the referenced information can be guaranteed to have a high relevance to the question text.

[0084] Before comparing each of the first reference information, the second reference information, and the third reference information with the question text, the first reference information, the second reference information, and the third reference information may be aggregated to obtain an aggregated reference information set. The comparison process may be achieved by sorting the reference information in the aggregated reference information set. The reference information at the top of the sorting result may be used as the target reference information to determine the answer to the question text.

[0085] The reranking model may be a Rerank model. The model improves the quality of search results by reranking. The reranking may be based on a variety of factors, such as relevance, user preference, etc., to optimize the sorting order of search results, thereby improving user satisfaction and search results.

[0086] In the above-mentioned intelligent question-answering method, by obtaining the question text, reference information of the question text is retrieved in three ways. The first is to obtain the first reference information of the question text based on network search, the second is to match the question text with the question text in the text database to obtain the second reference information of the question text, and the third is to obtain the question vector corresponding to the question text, and match the question vector with the question vector in the vector database to obtain the third reference information of the question text. In this way, the corresponding answer to the question text can be obtained from the first reference information, the second reference information, and the third reference information. By processing the question text in various ways, a comprehensive analysis of the question text can be achieved, so that the question text can be fully understood, and then the target reference information can be screened out from the first reference information, the second reference information, and the third reference information. When determining the answer to the question text based on the target reference information, the matching degree between the determined answer and the question text can be improved, and the accuracy and detail of the answer can be enhanced.

[0087] In an exemplary embodiment, the question text may be different from the original question input by the user. For example, the original question may be processed to remove the modal particles in the original question, so that the question text is more focused on the question itself and is not disturbed by other irrelevant words. For another example, if the original question is too simple, if the original question is directly used as the question text for reference information retrieval, it may result in irrelevant answers. In this case, it may be necessary to contact the historical information entered by the user in the chat box of the terminal to process the original question. Figure 3 As shown, before obtaining the question text, steps 302 to 304 are included. Among them:

[0088] Step 302, obtaining historical questions input by the user.

[0089] Among them, the historical questions can be each original question asked within a preset time period input by the user in the input module (such as a chat box) of the system or application of the terminal that integrates the intelligent question-answering method of the present application. The preset time period can be the original questions asked within a certain period of time in the past from the question time of the original question corresponding to the question text this time. For example, it is the questions asked in the past hour. The range of historical questions can also be the range of the size of the historical messages entered by the user. For example, the historical question is 3,000 words of historical information entered by the user.

[0090] Step 304: supplement the original question input by the user this time based on the historical questions, and use the supplemented original question as the question text.

[0091] In this step, the server obtains the historical questions input by the user, and supplements the original question input by the user this time based on the historical questions, and uses the supplemented original question as the question text.

[0092] For example, the original question entered by the user is "What about Zhang San?" Obviously, if the original question is not supplemented, and the original question is directly searched on the Internet or compared with the questions in the database, the answer obtained will definitely be divergent and not the answer the user really wants to know. Therefore, the server obtains the historical questions entered by the user before asking the original question to understand the specific question the user wants to ask. If the historical question is "How old is Reese?", then the server can get the question text as "How old is Zhang San?" by analyzing the historical questions and the original question.

[0093] In this embodiment, by obtaining the historical questions input by the user, the original question input by the user this time is supplemented based on the historical questions, and the supplemented original question is used as the question text, the purpose of enhanced search can be achieved, and the question that the user really wants to ask can be fully understood, thereby supporting the user's continuous questioning and improving the server's ability to understand the question.

[0094] In order to improve the richness of the reference information for answering the original question, both in terms of content and quantity, the server can obtain reference information of the question text from the Internet as a reference for answering. In one possible implementation, keywords can be extracted from the question text to search for materials related to the question text on the Internet using the keywords. Figure 4 As shown, the step of obtaining the first reference information of the question text based on network search includes steps 402 to 408. Among them:

[0095] Step 402, perform keyword segmentation on the question text to obtain the segmentation result of the question text.

[0096] Step 404: Use a search engine to search the split results to obtain search results.

[0097] Step 406: sort the search results based on the re-ranking model to obtain a sorted list.

[0098] Step 408: Determine the search results in the sorted list that meet the preset conditions as the first reference information.

[0099] Among them, keyword splitting is the splitting of the question text that is beneficial to the hit of the network search. The algorithm for keyword splitting can be, for example, the TF-IDF algorithm, the TextRank algorithm. In some embodiments, the question text can also be keyword split based on a recurrent neural network model or a convolutional neural network model. The preset condition can be the search results that are in the top few in the sorted list, for example, the search results that are in the top ten in the sorted list. The search result is each piece of data displayed by the search engine after searching using the search engine. Each piece of data is related to the question text to a certain extent. The server can input the split results of the question text into the search engine, and the result returned by the search engine is the search result. The server can also call the interface of the search engine to obtain the search results.

[0100] In this embodiment, the question text is split by keywords to obtain the split results of the question text, and then the split results are searched by a search engine to obtain search results. In this way, information related to the question text can be obtained from the Internet, and the timeliness of the answer determined by the information can be improved. After that, the search results are sorted based on the re-ranking model to obtain a sorted list, and the search results that meet the preset conditions in the sorted list are determined as the first reference information. By sorting the search results and screening the first reference information from the sorted list, the relevance of the first reference information to the question text can be ensured, so that the reference information can enhance the ability to answer the question text.

[0101] After the above steps, the server obtains the first reference information. In one embodiment, when constructing the text database, the word segmentation results of the question are stored to facilitate text retrieval. Therefore, the server can obtain the word segmentation results of the question text before matching the question text with the question text in the text database. Figure 5 As shown, the step of matching the question text with the question text in the text database to obtain the second reference information of the question text includes steps 502 to 504. Among them:

[0102] Step 502: Segment the question text into words to obtain a segmentation result of the question text.

[0103] Among them, question segmentation for question text is to segment text from a continuous text sequence into meaningful words or phrases. That is, the question text is segmented into meaningful words or phrases. The segmentation method can be a method based on string matching and a method based on statistical learning.

[0104] Step 504: Obtain the similarity between the word segmentation result and the question text in the text database to obtain second reference information based on the target question text.

[0105] Among them, the similarity between the target question text and the word segmentation result reaches a preset value.

[0106] In this embodiment, after the server obtains the question text, it performs question sentence segmentation on the question text. The segmentation method used here is different from the keyword splitting method in step 402. The segmentation method used in this step is more conducive to text search hits.

[0107] In this embodiment, by performing question segmentation on the question text, the segmentation result of the question text is obtained, which is conducive to improving the hit rate with the question text in the text database based on the segmentation result. Then the similarity between the segmentation result and the question text is calculated to match the question text with the question text, and the question text with the similarity reaching the preset value is used as the target question text, and the reference information corresponding to the target question text in the text database is used as the second reference information. Since the information in the text database is analyzed and processed, the dimension of the reference information used to answer the question can be enriched based on the second reference information, thereby improving the matching degree between the reference information and the question text.

[0108] The process in which the server processes the question text to obtain the first reference information, the second reference information, and the third reference information may be performed in parallel.

[0109] In an exemplary embodiment, in order to obtain the third reference information, it is necessary to obtain a vector expression of the question text. The step of obtaining the question vector corresponding to the question text includes performing multi-dimensional vectorization on the question text to obtain multiple vectors of the question text in multiple dimensions.

[0110] The server vectorizes the text from multiple angles to obtain multiple vector expressions of the question text, so as to achieve the purpose of fully understanding the question. Multi-dimensionality may include a derivative method. The derivative method refers to deriving the question text to generate a corresponding derived question text, vectorizing the derived question text, and using the derived vector of the derived question text as the third vector of the question text. Multi-dimensionality may also include an attention adjustment method. The attention adjustment method is to adjust the attention of the question text to generate a corresponding optimized question text, vectorize the optimized question text, and use the optimized vector of the optimized question text as the fourth vector of the question text. The question text is vectorized in multiple dimensions to obtain multiple vectors of the question text in multiple dimensions, including steps 602 to 608. Among them:

[0111] Step 602: extract multiple keywords from the question text, and obtain a first vector of the question text based on the keywords.

[0112] The server extracts keywords from the question text, for example, extracts multiple short atomic phrases from the question text, and then calculates the first vector of the question text based on the keywords.

[0113] Step 604, perform synonym rewriting on the question text to generate a synonym text, perform vectorization on the synonym text to obtain a synonym text vector, and use the synonym text vector as the second vector of the question text.

[0114] Since one thing can have multiple different expressions, the server can also perform synonym rewriting on the question text to generate synonymous text, thereby achieving semantic understanding of the question text. Synonym rewriting can be a rewriting of keywords after keyword extraction.

[0115] Step 606: derive the question text to generate a corresponding derived question text, perform vectorization processing on the derived question text, and use the derived vector of the derived question text as the third vector of the question text.

[0116] The derived question text is a question text obtained by diverging the question corresponding to the question text. For example, the question text is a relatively one-sided or specific question: Has Zhang San ever won the Best Actor Award? By diverging from the question text, the derived question text can be: What awards has Zhang San won in his acting career? This can expand the scope of the search and reduce the one-sided and small reference information caused by the question being too specific, so that the correct answer to the question cannot be obtained. This also makes it easier to search for hits, which is conducive to search enhancement.

[0117] Step 608, perform attention adjustment on the question text to generate a corresponding optimized question text, perform vectorization processing on the optimized question text, and use the optimized vector of the optimized question text as the fourth vector of the question text.

[0118] In some embodiments, there may be too much impurity content in the question text, such as modal particles or some information irrelevant to the question itself. These impurity contents may interfere with the answer, so that the generated answer includes other content irrelevant to the real question. Therefore, the server can adjust the attention of the question text to generate a corresponding optimized question text. The optimized question text is a text that focuses on the core question itself in the question text. For example, the question text is "Team A's performance in today's game is too crazy! What is Python?". The server processes the question text, and it can be known that the question the user really wants to ask is "What is Python?". Therefore, the optimized question text generated by the server is "Introduce what Python is?". In this way, based on the optimized question text, the reference information corresponding to the optimized question text is searched in the vector database, so that the original question can be more focused on the question itself, and the original question can be adjusted to a more understandable and single question, so as to achieve the purpose of enhancing the search results.

[0119] By vectorizing the question text in multiple dimensions and searching for corresponding reference information based on the vectorized results, the purpose of fully understanding the question can be achieved. In addition, this application uses a vector database to integrate and analyze knowledge scattered in various websites and documents, which can reduce the threshold and difficulty of knowledge acquisition. Searching for reference information from a vector database when searching for reference information can also improve the timeliness of answers.

[0120] In an exemplary embodiment, in order to reduce the time cost of users obtaining answers to questions, a disassembled answer can be given to the question. For example, the target reference information can be analyzed, the key points can be highlighted, and the questions raised by the user can be answered one by one. The step of determining the answer to the question text based on the target reference information includes steps 702 to 708. Among them:

[0121] Step 702, dividing the question text into multiple secondary questions.

[0122] Step 704: extract the answer corresponding to each secondary question from the target reference information.

[0123] Step 706, integrating multiple answers.

[0124] Step 708, determining the integrated answer as the answer to the question text.

[0125] Among them, the secondary questions can be the questions involved in the question text and some questions related to the question.

[0126] For example, the question text is "Has Zhang San ever won the Best Actor award?" If the answer is just yes or no, it is obviously too simple and does not make too many derivatives. Therefore, by analyzing the question text, the secondary question can be "In which year did Zhang San win the Best Actor award?" Based on the richness of the reference information, the server can find the relevant content of Zhang San winning the Best Actor award from the target reference information, so that when giving an answer, it can not only answer whether Zhang San has won the Best Actor award, but also give the answer in which year Zhang San won the Best Actor award.

[0127] Optionally, the secondary question may also be a sub-question divided from the original question. After extracting the answer corresponding to each sub-question from the target reference information, the multiple answers are integrated and the integrated answer is determined as the answer to the question text.

[0128] In this embodiment, by comprehensively answering the question text in detail step by step, a comprehensive and thorough answer to the original question can be given, thereby improving the user experience.

[0129] In an exemplary embodiment, a user logs in to an intelligent question-answering system, such as a financial knowledge intelligent question-answering system, through account information. Figure 6 As shown in Figure 1, the intelligent question-answering system integrates multiple plug-ins, such as a web search plug-in, a financial encyclopedia plug-in, and an industrial and commercial information plug-in. Each plug-in has a different algorithm for answering question texts. After the user enters the intelligent question-answering system, the interface of the intelligent question-answering system is as follows: Figure 6 As shown. The interface includes a plug-in selection area 610, a chat input box area 620, and a history record area 630. The plug-in selection area 610 is used to display multiple plug-ins integrated in the intelligent question-answering system, and the user can select one of the plug-ins to answer the question information. The user enters the question information in the chat input box area 620. The history record area 630 displays the historical question information raised by the user.

[0130] The intelligent question-answering method in this embodiment is applied to one of the plug-ins. For example, it is applied to the financial encyclopedia plug-in. The user selects the financial encyclopedia plug-in and enters the question information in the chat input box for the first time. At this time, the interface of the intelligent question-answering system includes a history record area 730, a chat input box area 710, and a chat record area 720. Figure 7 After the server obtains the question information, it processes the question information according to the established logic to obtain the answer corresponding to the question information. The answer is then sent to the terminal to be displayed in the chat record area 720 of the intelligent question-answering system. The user can continue to ask questions based on the answer displayed by the system. In this case, the server will first obtain the historical questions entered by the user, and based on the historical questions, supplement the question information entered by the user this time, use the supplemented question information as the question text, and then process the question text according to the established logic to obtain the answer. Figure 8 As shown, after the user asks a question, the server obtains the user's original question at the gateway layer, and integrates the historical messages of the original question to obtain the question text, that is, obtains the historical questions input by the user, supplements the question information input by the user this time based on the historical questions, and uses the supplemented question information as the question text.

[0131] After obtaining the question text, the server obtains reference information of the question text from three aspects, then summarizes the reference information obtained from the three aspects, and finally determines the answer to the question text from the summarized reference information. Specifically: obtain the first reference information of the question text based on network search; match the question text with the question text in the text database to obtain the second reference information of the question text; obtain the question vector corresponding to the question text, and match the question vector with the question vector in the vector database to obtain the third reference information of the question text. Summarize the first reference information, the second reference information and the third reference information to obtain a summary reference information set; sort the reference information in the summary reference information set based on the re-ranking model, determine the target reference information from the sorting result, and determine the answer to the question text based on the target reference information. In actual applications, the RPC service layer of the server, that is, the core processing logic layer, can query reference materials for the question text. Reference material query is performed from three aspects: network search, text retrieval, and vector retrieval. Among them, in the process of vector retrieval, the server can process the question text by at least one of the four aspects of keyword splitting, synonym rewriting, back-off prompt generation (derivative generation), and rewriting-retrieval-reading transformation (attention adjustment) to obtain the vector expression of the question text. After that, the server summarizes the reference information obtained by these three methods, and screens and sorts the results. Finally, the reference information in the summarized reference information set is sorted based on the re-sorting model, the target reference information is determined from the sorting result, and the answer to the question text is determined based on the target reference information. In this way, the answer to the original question can integrate the knowledge in the financial field, making the scattered knowledge more aggregated and more systematic. The time cost of users to obtain relevant knowledge is reduced as much as possible, and the process that originally required personal judgment and screening by users is now completed by the program, thereby improving efficiency. Reduce the threshold and difficulty of knowledge acquisition. A lot of knowledge is often scattered in various websites and documents, and it is difficult to obtain. Through the integration of the method of this application, the threshold and difficulty of acquisition are reduced. The analysis and interpretation of knowledge enables users to understand knowledge beyond traditional questions and answers. Instead, users can obtain analysis based on the original knowledge, and even conduct specific analysis on the parts they do not understand, making the process of knowledge learning more scientific and reasonable. By using network retrieval, the knowledge base data can be infinitely supplemented.

[0132] Among them, the architecture of the intelligent question answering system using the intelligent question answering method is as follows: Fig. 9As shown. The network layer is responsible for the overall security control and blockade of the project. The network layer includes firewalls. The code layer is responsible for the main processing logic and data access. The code layer includes the aforementioned gateway and RPC service layer. The gateway is a PHP gateway. The data layer is responsible for all data storage, including relational data, non-relational data, search engines and vectors. The data layer can be based on MySQL database, MongoDB database, Redis database, ElasticSearch database, and Milvus database. The operating environment is responsible for the environment in which the intelligent question-answering system actually needs to run. It can be deployed locally or on a cloud host.

[0133] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0134] Based on the same inventive concept, the embodiment of the present application also provides an intelligent question-answering device for implementing the intelligent question-answering method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more intelligent question-answering device embodiments provided below can refer to the limitations of the intelligent question-answering method above, and will not be repeated here.

[0135] In an exemplary embodiment, an intelligent question-answering device is provided, comprising: an acquisition module, a retrieval module, a summary module and an answer module, wherein:

[0136] The acquisition module is used to obtain the question text.

[0137] A retrieval module is used to obtain first reference information of a question text based on a network search; match the question text with a question text in a text database to obtain second reference information of the question text; obtain a question vector corresponding to the question text, and match the question vector with a question vector in a vector database to obtain third reference information of the question text; the text database is used to store an association list of question texts and corresponding reference information, and the vector database is used to store an association list of question vectors and corresponding reference information.

[0138] The aggregation module is used to aggregate the first reference information, the second reference information and the third reference information to obtain an aggregated reference information set.

[0139] The answer module is used to sort the reference information in the summary reference information set based on the re-sorting model, determine the target reference information from the sorting result, and use the target reference information to answer the question text.

[0140] In some embodiments, the retrieval module is further used to perform multi-dimensional vectorization on the question text to obtain multiple vectors of the question text in multiple dimensions.

[0141] In some embodiments, the retrieval module is also used to extract multiple keywords from the question text, obtain a first vector of the question text based on the keywords; perform synonym rewriting on the question text to generate a synonym text, vectorize the synonym text to obtain a synonym text vector, and use the synonym text vector as the second vector of the question text; derive the question text to generate a corresponding derived question text, vectorize the derived question text, and use the derived vector of the derived question text as the third vector of the question text; perform attention adjustment on the question text to generate a corresponding optimized question text, vectorize the optimized question text, and use the optimized vector of the optimized question text as the fourth vector of the question text.

[0142] In some embodiments, the retrieval module is also used to perform sentence segmentation on the question text to obtain a segmentation result of the question text; obtain the similarity between the segmentation result and the question text in the text database to obtain second reference information based on the target question text, and the similarity between the target question text and the segmentation result reaches a preset value.

[0143] In some embodiments, the retrieval module is also used to perform keyword splitting on the question text to obtain the split results of the question text; use a search engine to search the split results to obtain search results; sort the search results based on a re-ranking model to obtain a sorted list; and determine the search results in the sorted list that meet preset conditions as the first reference information.

[0144] In some embodiments, the answer module is also used to divide the question text into multiple secondary questions; extract the answer corresponding to each secondary question from the target reference information; integrate the multiple answers; and determine the integrated answer as the answer to the question text.

[0145] In some embodiments, the acquisition module is further used to obtain historical questions input by the user; supplement the question information input by the user this time based on the historical questions, and use the supplemented question information as the question text.

[0146] Each module in the above intelligent question-answering device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0147] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store text databases and vector databases. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an intelligent question-answering method is implemented.

[0148] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0149] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0150] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0151] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0152] It should be noted that the user information (including but not limited to user device information, user personal information, question data entered by the user, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0153] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0154] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0155] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. An intelligent question-answering method, characterized in that: The method comprises: Get the question text; Obtaining first reference information of the question text based on network search; matching the question text with a question text in a text database to obtain second reference information of the question text; obtaining a question vector corresponding to the question text, and matching the question vector with a question vector in a vector database to obtain third reference information of the question text; the text database is used to store an association list between the question text and the corresponding reference information, and the vector database is used to store an association list between the question vector and the corresponding reference information; Aggregating the first reference information, the second reference information, and the third reference information to obtain an aggregated reference information set; The reference information in the summarized reference information set is sorted based on the re-sorting model, target reference information is determined from the sorting result, and the answer to the question text is determined based on the target reference information.

2. The method according to claim 1, characterized in that The obtaining of the question vector corresponding to the question text comprises: The question text is vectorized in multiple dimensions to obtain multiple vectors of the question text in multiple dimensions.

3. The method according to claim 2, characterized in that The step of performing multi-dimensional vectorization on the question text to obtain a plurality of vectors of the question text in a plurality of dimensions includes: Extracting multiple keywords from the question text, and obtaining a first vector of the question text based on the keywords; Rewriting the question text with synonyms to generate synonymous texts, vectorizing the synonymous texts to obtain synonymous text vectors, and using the synonymous text vectors as the second vectors of the question text; Derivatively generating a corresponding derived question text from the question text, performing vectorization processing on the derived question text, and using a derived vector of the derived question text as a third vector of the question text; Attention adjustment is performed on the question text to generate a corresponding optimized question text, vectorization is performed on the optimized question text, and the optimized vector of the optimized question text is used as the fourth vector of the question text.

4. The method according to claim 1, characterized in that: The step of matching the question text with the question text in a text database to obtain the second reference information of the question text comprises: Performing question sentence segmentation on the question text to obtain a segmentation result of the question text; The similarity between the word segmentation result and the question text in the text database is obtained to obtain the second reference information based on the target question text, and the similarity between the target question text and the word segmentation result reaches a preset value.

5. The method according to claim 1, characterized in that The obtaining of the first reference information of the question text based on network search includes: Perform keyword segmentation on the question text to obtain a segmentation result of the question text; Using a search engine to search the split results to obtain search results; Sorting the search results based on the re-ranking model to obtain a ranked list; The search results in the sorted list that meet the preset conditions are determined as the first reference information.

6. The method according to claim 1, characterized in that The step of determining an answer to the question text based on the target reference information includes: Dividing the question text into a plurality of secondary questions; Extracting the answer corresponding to each of the secondary questions from the target reference information; Integrate multiple responses; The integrated answer is determined as the answer to the question text.

7. The method according to claim 1, characterized in that Before obtaining the question text, the following steps are included: Get the history questions input by the user; The question information input by the user this time is supplemented based on the historical question, and the supplemented question information is used as the question text.

8. An intelligent question-answering device, characterized in that: The device comprises: An acquisition module is used to obtain the question text; A retrieval module is used to obtain first reference information of the question text based on a network search; match the question text with a question text in a text database to obtain second reference information of the question text; obtain a question vector corresponding to the question text, and match the question vector with a question vector in a vector database to obtain third reference information of the question text; the text database is used to store an association list between the question text and the corresponding reference information, and the vector database is used to store an association list between the question vector and the corresponding reference information; a summarizing module, configured to summarize the first reference information, the second reference information and the third reference information to obtain a summarized reference information set; The answer module is used to sort the reference information in the summary reference information set based on the re-sorting model, determine the target reference information from the sorting result, and use the target reference information to answer the question text.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Searching method and device based on keywords and semantics, equipment and storage medium

    CN115438166A

  • Intelligent question and answer method and device and electronic equipment

    CN117171317A

  • Question answering method, apparatus and device, and medium

    CN117591639A

  • Knowledge question-answering method and system for wading laws and regulations

    CN118349660A

Cited By

  • Answer matching method and system of artificial intelligence large model

    CN119311843A