A search question answering method and system combining ElasticSearch and AI

By combining ElasticSearch and AI technology, using the BERT model to classify and feature extraction, and calling ElasticSearch for accurate search, the problem that existing RAG technology is difficult to cope with complex problems is solved, and more accurate and timely answers are achieved, improving user experience and system response capabilities.

CN119474326BActive Publication Date: 2025-04-04REACH24H CONSULTING GRP CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510060927.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-04-04
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

The existing AI customer service system based on RAG technology is difficult to provide accurate and timely answers when dealing with complex or diverse problems, resulting in a decline in user experience and insufficient system response capabilities.

Method used

Combining ElasticSearch and AI technology, we use the BERT model and neural network structure to perform feature extraction and classification processing by pre-classifying user questions, and call ElasticSearch for accurate searches to generate comprehensive answers.

Benefits of technology

It significantly improves the AI ​​customer service system's ability to respond to diverse questions and answer accuracy, improves user experience, and enhances users' trust and stickiness in the AI ​​system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474326B_ABST
    Figure CN119474326B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data search technology, and specifically discloses a search question-answering method combining ElasticSearch and AI. The method comprises: pre-classifying questions, then obtaining questions input by users, pre-processing questions, obtaining question text feature data, calculating question text feature data, obtaining question classification values, and judging whether the question classification values ​​are within a preset threshold interval, and classifying the classified questions to answer user questions. The present invention can use the BERT model and its internal neural network structure to calculate the question classification probability and determine the final classification result. It has obvious advantages over the relatively simple question classification method in RAG technology. RAG technology cannot fully consider the deep semantic relationship of questions during classification, resulting in inaccurate classification, and then it will be difficult to answer or answer the wrong questions. It can effectively improve user experience and user stickiness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data search technology, and in particular to a search question-answering method and a system thereof that combine ElasticSearch and AI. Background Art

[0002] With the rapid development of artificial intelligence technology, AI is increasingly used in the field of customer service. At present, AI customer service systems that provide users with question-and-answer services based on site content usually use retrieval augmentation generation (RAG) technology. However, RAG technology still has certain limitations in application. For example, for queries that require time ranges and specific domain knowledge (such as "What news has been published in the past three months?"), RAG often cannot accurately answer. This is because RAG usually relies on a static knowledge base for retrieval. When users ask questions that go beyond the scope of existing information in the database, it is difficult for the system to provide accurate and timely answers, which may lead to users questioning the system's capabilities and reducing the user experience.

[0003] In addition, when dealing with user questions, existing RAG-based question-answering methods often simply convert questions into search terms for retrieval. This coarse-grained retrieval method cannot fully capture the semantic hierarchy and contextual relationships contained in user questions. When the user's request cannot be answered by directly searching the database content, the system is prone to giving inappropriate answers or answering questions that are not relevant, which seriously affects user satisfaction and usage stickiness.

[0004] Therefore, a new technical solution is urgently needed to break through the limitations of existing RAG technology and improve the AI ​​customer service system's ability to respond to diverse questions and the accuracy of its answers. Summary of the invention

[0005] The object of the present invention is to provide a search question answering method combining ElasticSearch and AI, comprising:

[0006] Classify the questions in advance, where the question types are divided into: questions about basic website information (a), questions related to website content (b), and general questions (c);

[0007] Obtaining a question text input by a user, and preprocessing the question text to obtain a processed question text;

[0008] Extract features from the problem text to obtain the problem text features;

[0009] Calculate the question text feature data based on the BERT model and neural network structure to obtain the question classification value, and determine whether the question classification value is within the preset threshold range;

[0010] If the question classification value is within the preset threshold range, it is classified as a question related to the website content b;

[0011] If the question classification value is greater than the maximum value of the preset threshold interval, it is classified as question a of the basic information of the website;

[0012] If the problem classification value is less than the minimum value of the preset threshold interval, it is classified as a general problem c;

[0013] The classified question types are classified to answer user questions.

[0014] Furthermore, the step of extracting features from the processed question text to obtain feature data of the question text includes:

[0015] Convert the user input question into a one-hot encoding vector;

[0016] Assume that the input question consists of n words after word segmentation and stop words removal. Represents the i-th word (i=1,2,...n), index ( ) indicates a word The index in the vocabulary, the calculation formula for the generated one-hot encoding vector v is:

[0017]

[0018] Where j=0,1,2…,v-1.

[0019] Further, the steps of calculating the question text feature data to obtain the question classification value and determining whether the question classification value is within a preset threshold range include:

[0020] After the previous preprocessing steps, the problem has been converted into a format that the model can handle, where the vector shape is set to [sequence length L, word vector dimension d];

[0021] The calculation formula for problem classification is:

[0022]

[0023] S is the problem classification value;

[0024] Determine the type of question entered by the user;

[0025] like , then the final classification result is question a about the basic information of the website;

[0026] like , then the final classification result is question b related to the website content;

[0027] like , then the final classification result is general problem c.

[0028] Further, the step of classifying the classified question types to answer the user's questions includes:

[0029] For category a, the question is first matched with the question template or keywords in the preset information database;

[0030] Next, LLM is used to generate answers based on the retrieved preset website information;

[0031] Finally, the generated answer is output to the user;

[0032] For category c, first, search in the historical chat record database;

[0033] Next, the retrieved chat records are screened, with recent chat records of users with similar characteristics to the current user being prioritized, and pre-answer content is generated;

[0034] Based on the content of the pre-answer, self-check the pre-answer to determine whether there is any error content;

[0035] If there is any erroneous content, the erroneous content is corrected, and a revised answer is generated, which is then output to the user;

[0036] If there is no error content, the pre-answer content is directly output to the user.

[0037] Furthermore, the step of classifying the classified question types to answer the user's questions also includes:

[0038] Identify the language of the question and determine the reply language;

[0039] Extract search parameters for questions, including column, time range, country, region and keywords;

[0040] Determine the type of response that users expect, which can be divided into pure search and non-pure search that requires in-depth reading;

[0041] Call ElasticSearch to search and solve related engineering problems, including converting countries and regions into labels, rewriting search parameters, and multi-column search strategies;

[0042] Based on the user's expected results, decide whether to return directly to the search list or continue processing.

[0043] Furthermore, if it is a pure search type, the search list is returned directly;

[0044] If it is not a pure search, continue with the following steps:

[0045] Get the body content of the search results;

[0046] Combine the body text and metadata information into Markdown format;

[0047] Use AI to determine the relevance of content and generate summaries based on user questions;

[0048] Remove irrelevant content;

[0049] Reorder the list of AI summaries;

[0050] Use AI to comprehensively answer user questions based on a list of summarized results.

[0051] The present invention also discloses a search question-answering system combining ElasticSearch and AI, comprising:

[0052] The classification module is used to pre-classify questions, where the question types are divided into: questions about basic website information a, questions related to website content b, and general questions c;

[0053] The acquisition module is used to obtain the questions input by the user;

[0054] The conversion module is used to pre-process the questions, including word segmentation, stop word removal, and converting the text into format data for model processing;

[0055] The extraction module is used to extract features from the format data processed by the model;

[0056] The calculation module is used to calculate and judge the question classification probability based on the extracted features through the BERT model and the internal neural network structure;

[0057] A judgment module is used to judge the final classification result of the user input question;

[0058] The processing module is used to classify the classified question types to answer user questions.

[0059] Furthermore, the processing module includes:

[0060] A recognition unit, used to recognize the language of the question and determine the reply language;

[0061] An extraction unit is used to extract search parameters for questions, including columns, time ranges, countries and regions, and keywords;

[0062] A judgment unit is used to judge the type of reply expected by the user, which is divided into pure search type and non-pure search type that requires in-depth reading;

[0063] The search unit is used to call ElasticSearch to search and solve related engineering problems, including converting countries and regions into labels, rewriting search parameters, and multi-column search strategies;

[0064] The processing unit is used to judge the result according to the user's expectations and decide whether to return to the search list directly or continue processing.

[0065] The present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0066] The present application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0067] The beneficial effects of this application are:

[0068] The present invention utilizes the BERT model and its internal neural network structure to deeply understand the semantic and grammatical features of user questions, and on this basis performs more accurate knowledge retrieval. Unlike traditional RAG technology that only indexes and matches user questions through simple retrieval methods, BERT can mine the potential semantic information in the questions, identify implicit meanings and multiple contexts, and then retrieve content that is highly matched with user needs from a wider and more dynamic knowledge source. Through this deep semantic understanding and associated knowledge retrieval capability, the present invention can effectively avoid situations where it is difficult to answer or answers irrelevant questions due to inaccurate classification, significantly improving user experience and the effectiveness of question answering. The BERT model's excellent performance in the field of natural language processing enables the system to respond to various complex problems more flexibly and intelligently, and provide users with more targeted and timely answers, thereby enhancing users' trust in and stickiness to the AI ​​system. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 A schematic diagram of a method flow chart proposed in an embodiment of the present application;

[0070] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0071] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0072] like Figure 1 As shown, the present application provides a search question answering method combining ElasticSearch and AI, including:

[0073] S1, pre-classify the questions, where the question types are divided into: questions about basic website information a, questions related to website content b, and general questions c;

[0074] S2, obtaining a question text input by a user, and preprocessing the question text to obtain a processed question text;

[0075] S3, extracting features from the processed question text to obtain question text features;

[0076] S4, extracting features from the format data processed by the model;

[0077] S5, calculating the question text feature data based on the BERT model and the neural network structure to obtain the question classification value, and determining whether the question classification value is within a preset threshold range;

[0078] S6, if the question classification value is within the preset threshold range, classify it into question b related to the website content;

[0079] If the question classification value is greater than the maximum value of the preset threshold interval, it is classified as question a of the basic information of the website;

[0080] If the problem classification value is less than the minimum value of the preset threshold interval, it is classified as a general problem c;

[0081] S7, classify the classified question types to answer user questions.

[0082] As described in the above steps S1-S7, the present invention can use the BERT model and its internal neural network structure to calculate the probability of question classification and determine the final classification result, and can use the powerful semantic understanding ability of the BERT model. The BERT model has high performance in the field of natural language processing, and can better capture the semantic and grammatical information in the question, so as to more accurately judge the type of question. This has obvious advantages over the relatively simple question classification method in the RAG technology. The RAG technology cannot fully consider the deep semantic relationship of the problem during classification, resulting in inaccurate classification, and then it will be difficult to answer or answer the question. For example, for some questions with ambiguous or implicit semantics, the BERT model can better parse the problem through its complex neural network calculation, improve the accuracy of classification, and provide a reliable basis for subsequent targeted processing, which can effectively improve the user experience and improve user stickiness.

[0083] Furthermore, the step of converting the text into format data for model processing includes:

[0084] S8, converts the user input question into a one-hot encoding vector;

[0085] S9, assuming that the input question consists of n words after word segmentation and removal of stop words, Represents the i-th word (i=1,2,...n), index ( ) indicates a word The index in the vocabulary, the calculation formula for the generated one-hot encoding vector v is:

[0086]

[0087] Where j=0,1,2…,v-1.

[0088] As described in steps S8-S9 above, the one-hot encoding vector provides a simple and intuitive way to represent text data. Each word has a unique position in the vocabulary. By marking the corresponding position as 1 and the other positions as 0, it is possible to clearly indicate which words are contained in the question. For example, for the question "What are the popular movies recently?", if the index of "recently" in the vocabulary is 10, "popular" is 20, and "movies" is 30, and the vocabulary size is 100, then the generated one-hot encoding vector may be [0, 0, …, 0, 1, 0, …, 0, 1, 0, …, 0, 1, 0, …, 0] (where the 10th, 20th, and 30th positions are 1 and the others are 0). This representation method is easy to understand and implement, and the encoding process can be completed without complex mathematical operations.

[0089] The above model can directly process this structured vector without additional complex data conversion operations. This helps to simplify the model's input processing flow, improve computing efficiency, and better match the model's parameter settings and computing logic. For example, when training and predicting, the BERT model can directly use one-hot encoded vectors as input for operations such as feature extraction and classification calculations.

[0090] And in the subsequent model calculation process, the one-hot encoded vector is convenient for various mathematical operations and feature extraction operations. For example, when multiplying with the weight matrix to calculate the score or performing similarity calculations, its vector structure can be easily operated with other matrices. Moreover, by further processing the one-hot encoded vector (such as combining it with position encoding, etc.), it can provide the model with richer feature information, which helps to improve the model's understanding of the semantics of the problem and the accuracy of classification. For example, in the calculation of the self-attention mechanism of the BERT model, the one-hot encoded vector can participate in the calculation of the attention score after linear transformation, so as to better capture the relationship between words and sentences and provide support for accurate classification.

[0091] Further, the steps of calculating the question text feature data to obtain the question classification value and determining whether the question classification value is within a preset threshold range include:

[0092] S10, after the previous preprocessing steps, the problem has been converted into a format that can be processed by the model, where the vector shape is set to [sequence length L, word vector dimension d];

[0093] The calculation formula for the question classification value is:

[0094]

[0095] S is the problem classification value;

[0096] S11, determining the type of the question input by the user;

[0097] like , then the final classification result is question a about the basic information of the website;

[0098] like , then the final classification result is question b related to the website content;

[0099] like , then the final classification result is general problem c.

[0100] As described in the above steps S10-S11, by converting the question into a specific format ([sequence length L, word vector dimension d]) and using a neural network model (such as the BERT model) to calculate the probability of each category, this method fully utilizes the model's deep understanding of the problem and its powerful semantic analysis capabilities. The BERT model has been proven to have excellent performance in the field of natural language processing, and can capture rich semantic information in the question, thereby calculating a relatively accurate classification probability. For example, for a question involving consultation on a specific function of a website and with a more professional expression, the BERT model can accurately judge that it is more likely to belong to the basic information category of the website (category a) based on its learning of a large amount of text data, and give a higher probability value. Compared with traditional simple classification methods, this model-based classification method can better handle complex language structures and semantic relationships, and improve the accuracy of classification.

[0101] The final classification result can also be determined by a specific probability value range, providing a clear and definite judgment standard. This makes the classification process deterministic and explainable, and is easy to understand and follow during system development, debugging, and subsequent maintenance. This clear judgment standard helps reduce classification errors, improve the stability and reliability of the system, and ensure that questions can be accurately assigned to the corresponding processing flow, thereby improving the efficiency and accuracy of the entire search question-answering system.

[0102] Further, the step of classifying the classified question types to answer the user's questions includes:

[0103] S12, for category a, first matching the question with the question template or keywords in the preset information database;

[0104] S13, then, using LLM to generate an answer based on the retrieved preset website information;

[0105] S14, finally, outputting the generated answer to the user;

[0106] S15, for category c, first, search in the historical chat record database;

[0107] S16, then, screening the retrieved chat records, giving priority to recent chat records of users with similar characteristics to the current user, and generating pre-answer content;

[0108] S17, based on the content of the pre-answer, self-check the pre-answer to determine whether there is any error content;

[0109] S18, if there is any erroneous content, correct the erroneous content, generate a revised answer content, and then output the revised answer content to the user;

[0110] S19: If there is no error content, the pre-answer content is directly output to the user.

[0111] As described in the above steps S12-S19, by matching the question with the question template or keywords in the preset information library, the preset information related to the user's question can be quickly located. This method utilizes pre-organized and structured knowledge to improve the efficiency of information retrieval. For example, for common website basic information questions, such as "What is the registration process of the website?", the corresponding detailed registration process description can be found directly in the preset information library, avoiding the search and processing of a large amount of irrelevant information, saving time and computing resources, and being able to quickly provide users with accurate answers.

[0112] The historical chat record database is searched and screened for recent chat records that are similar to the current user's characteristics, making full use of past interaction data. Recent chat records are more likely to reflect current user needs and common problems, while records similar to the current user's characteristics increase the relevance of the answer. For example, if the current user is a young technology enthusiast, the system gives priority to chat records of similar questions raised by users of the same type, so that the retrieved information is more likely to be of reference value to the current user, improving the accuracy and practicality of the answer. The present invention can also perform self-checking after generating the pre-answer content, and can promptly discover possible erroneous content, such as grammatical errors, factual errors, or content that does not conform to the scope of service. By correcting the erroneous content and generating revised answer content, the quality of the answer output to the user is guaranteed. For example, if the pre-answer mentions expired activity information, the system can promptly discover and update it to the latest activity content to avoid providing misleading information to the user, thereby improving the reliability and credibility of the system.

[0113] Furthermore, the step of classifying the classified question types to answer the user's questions also includes:

[0114] S20, identifying the language of the question and determining the reply language;

[0115] S21, extracting search parameters for the question, including column, time range, country, region and keywords;

[0116] S22, determining the type of response expected by the user, which is divided into pure search type and non-pure search type that requires in-depth reading;

[0117] S23, calling ElasticSearch to search and solve related engineering problems, including converting countries and regions into labels, rewriting search parameters, and multi-column search strategies;

[0118] S24, based on the user's expected judgment result, decide whether to directly return to the search list or continue processing.

[0119] As described in the above steps S20-S24, the language of the question is identified and the reply language is determined. This measure can meet the needs of multilingual users. In the context of globalization, users may ask questions in different languages. The system automatically identifies the language and replies in the corresponding language, which improves the versatility and user-friendliness of the system. For example, for a multinational company's website, users may come from different countries and regions and use multiple languages ​​for consultation. After the system identifies the language of the user's question (such as French), it replies to the user in French, eliminating language barriers, enabling users to obtain information more conveniently, and enhancing users' trust and satisfaction with the system. Extracting search parameters such as columns, time ranges, countries, regions, and keywords from the questions helps to accurately locate user needs. These parameters clarify the scope and key content of the user's desired search, making subsequent searches more targeted. For example, when a user asks "What are the regulatory updates for a country's food industry in the past year?", the system accurately extracts the time range (past year), country region, keywords (food industry, regulatory updates) and possible columns involved (regulatory database related columns), providing precise guidance for ElasticSearch searches, avoiding the retrieval of irrelevant information, improving search efficiency and accuracy, and enabling users to find relevant content more quickly.

[0120] The types of responses expected by users are divided into pure search and non-pure search that requires in-depth reading, which adapts to the needs and problem scenarios of different users. For some users who just want to quickly obtain some basic information (such as querying the specifications of a product), pure search responses can directly provide a concise list of search results to meet their needs for quick information acquisition; while for users who need to have a deep understanding of a topic (such as researching industry trend analysis), non-pure search responses can provide more detailed and in-depth content, such as abstracts and summaries of related articles. This classification judgment enables the system to provide the most appropriate answer form based on the user's expectations, improving the flexibility and personalization of the user experience.

[0121] It should be noted that the following methods can be used to determine the user's expected response type. For example, most of the questions in the user's history are simple information queries, and the user spends a short time browsing the results. The user may be accustomed to pure search-type responses. For example, the user often asks questions such as "find the price of a certain product" and "search for the contact information of a certain company", and usually ends the operation after viewing the search results list, indicating that the user is more satisfied with a simple information list.

[0122] On the other hand, if the user's past questions involved more knowledge exploration and analysis needs, such as "explain how a certain technology works" or "compare the performance differences between different products", and if the user spends a long time browsing or reading the search results in depth, and may even ask further questions about the search results, it means that the user tends to prefer non-pure search responses.

[0123] In addition, you can refer to past feedback on search results. For example, when users only paid attention to shallow information such as the number of results and update time in their past feedback on search results, or simply clicked on some search results to view the summary without further information mining needs, they tend to be more inclined to pure search.

[0124] If the user often filters search results, reads relevant information in depth, marks or collects some information in previous searches, and asks follow-up questions about certain results, such as "Can you find more detailed information?" or "Can you explain a concept in this result?", then they are more likely to expect non-pure search responses.

[0125] Furthermore, if it is a pure search type, the search list is returned directly;

[0126] S25, if it is not a pure search, continue with the following steps:

[0127] S26, obtaining the text content of the search result;

[0128] S27, combining the body text and metadata information into Markdown format;

[0129] S28, using AI to judge the relevance of content and generate summaries based on user questions;

[0130] S29, remove irrelevant content;

[0131] S30, reorder the summary list summarized by AI;

[0132] S31, uses AI to comprehensively answer user questions based on the summary result list.

[0133] As described in the above steps S25-S31, obtaining the text content of the search results ensures that the answer is based on actual detailed information rather than just a title or a brief description, providing users with more comprehensive and in-depth materials. Combining the text and metadata information into Markdown format, on the one hand, maintains the integrity of the information, and metadata (such as release time, author, source, etc.) can provide users with more references; on the other hand, the Markdown format is easy to display and read on different platforms, and has good versatility and readability. For example, for the search results of a news report, the text contains the details of the event, the views of all parties, etc. After being combined into the Markdown format, users can clearly see the news title, release time, text content and other information, which is convenient for them to quickly understand the main points of the news, and can be easily viewed and processed on a variety of devices and software.

[0134] Using AI to comprehensively answer user questions based on the summary result list can integrate scattered summary information into a coherent and complete answer. AI can organize and polish the summary according to the logic of the question and the needs of the user, making the answer more logical and readable. For example, for a question about "how to choose a fitness plan that suits you", AI can combine the summaries of multiple fitness-related articles to provide users with a systematic answer from the aspects of personal physical condition, fitness goals, and time arrangements, such as "First, you need to evaluate your physical condition, including physical fitness, whether you have a history of disease, etc. If the goal is to gain muscle, you should focus on strength training; if it is to lose fat, you need to combine aerobic exercise and a reasonable diet. At the same time, you should choose the appropriate training frequency and duration according to your daily schedule. For example, people with plenty of time can choose to do one hour of comprehensive training every day, while busy office workers can choose three times a week, half an hour of efficient training each time." Such a comprehensive answer can better help users solve problems and improve their understanding of problems and decision-making ability.

[0135] The present invention also discloses a search question-answering system combining ElasticSearch and AI, comprising:

[0136] The classification module is used to pre-classify questions, where the question types are divided into: questions about basic website information a, questions related to website content b, and general questions c;

[0137] The acquisition module is used to obtain the questions input by the user;

[0138] The conversion module is used to pre-process the questions, including word segmentation, stop word removal, and converting the text into format data for model processing;

[0139] The extraction module is used to extract features from the format data processed by the model;

[0140] The calculation module is used to calculate and judge the question classification probability based on the extracted features through the BERT model and the internal neural network structure;

[0141] A judgment module is used to judge the final classification result of the user input question;

[0142] The processing module is used to classify the classified question types to answer user questions.

[0143] Furthermore, the processing module includes:

[0144] A recognition unit, used to recognize the language of the question and determine the reply language;

[0145] An extraction unit is used to extract search parameters for questions, including columns, time ranges, countries and regions, and keywords;

[0146] A judgment unit is used to judge the type of reply expected by the user, which is divided into pure search type and non-pure search type that requires in-depth reading;

[0147] The search unit is used to call ElasticSearch to search and solve related engineering problems, including converting countries and regions into labels, rewriting search parameters, and multi-column search strategies;

[0148] The processing unit is used to judge the result according to the user's expectations and decide whether to return to the search list directly or continue processing.

[0149] The present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0150] The present application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0151] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented 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 memory, storage, value library or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0152] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.

[0153] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent results or equivalent process changes made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A search question answering method combining ElasticSearch and AI, characterized in that: include: Classify the questions in advance, where the question types are divided into: questions about basic website information (a), questions related to website content (b), and general questions (c); Obtaining a question text input by a user, and preprocessing the question text to obtain a processed question text; Extract features from the processed question text to obtain question text feature data; The step of extracting features from the processed question text to obtain feature data of the question text comprises: Convert the user input question into a one-hot encoding vector; Assume that the input question consists of n words after word segmentation and stop words removal. Represents the i-th word, i=1,2,...n, index ( ) indicates a word The index in the vocabulary, the calculation formula for the generated one-hot encoding vector v is: Where j=0,1,2...,k-1, Represents question text feature data; Calculate the question text feature data based on the BERT model and neural network structure to obtain the question classification value, and determine whether the question classification value is within the preset threshold range; After the previous preprocessing steps, the problem has been converted into a format that can be processed by the model, where the vector shape is set to [sequence length L, word vector dimension d]; The calculation formula for the question classification value is: ; Among them, S is the problem classification value; Determine the type of question entered by the user; like , then the final classification result is question a about the basic information of the website; like , then the final classification result is question b related to the website content; like , then the final classification result is general problem c; If the question classification value is within the preset threshold range, it is classified as a question related to the website content b; If the question classification value is greater than the maximum value of the preset threshold interval, it is classified as question a of the basic information of the website; If the problem classification value is less than the minimum value of the preset threshold interval, it is classified as a general problem c; Classify the classified question types to answer user questions; For category a, the question is first matched with the question template or keywords in the preset information database; Next, LLM is used to generate answers based on the retrieved preset website information; Finally, the generated answer is output to the user; For category c, first, search in the historical chat record database; Next, the retrieved chat records are screened, with recent chat records of users with similar characteristics to the current user being prioritized, and pre-answer content is generated; Based on the content of the pre-answer, self-check the pre-answer to determine whether there is any error content; If there is any erroneous content, the erroneous content is corrected, and a revised answer is generated, which is then output to the user; If there is no error content, the pre-answer content is directly output to the user.

2. According to the search question and answer method combining ElasticSearch and AI according to claim 1, it is characterized in that: The steps of classifying the classified question types to answer user questions also include: Identify the language of the question and determine the reply language; Extract search parameters for questions, including column, time range, country, region and keywords; Determine the type of response that users expect, which can be divided into pure search and non-pure search that requires in-depth reading; Call ElasticSearch to search and solve related engineering problems, including converting countries and regions into labels, rewriting search parameters, and multi-column search strategies; Based on the user's expected results, decide whether to return directly to the search list or continue processing.

3. According to the search question and answer method combining ElasticSearch and AI according to claim 1, it is characterized in that: If it is a pure search type, the search list is returned directly; If it is not a pure search, continue with the following steps: Get the body content of the search results; Combine the body text and metadata information into Markdown format; Use AI to determine the relevance of content and generate summaries based on user questions; Remove irrelevant content; Reorder the AI ​​summary list; Use AI to comprehensively answer user questions based on a list of summarized results.

4. A search question answering system combining ElasticSearch and AI, used to execute the search question answering method combining ElasticSearch and AI as claimed in claim 1, characterized in that: include: The classification module is used to pre-classify questions, where the question types are divided into: questions about basic website information a, questions related to website content b, and general questions c; The acquisition module is used to obtain the questions input by the user; The conversion module is used to pre-process the questions, including word segmentation, stop word removal, and converting the text into format data for model processing; The extraction module is used to extract features from the format data processed by the model; The calculation module is used to calculate and judge the question classification probability based on the extracted features through the BERT model and the internal neural network structure; A judgment module is used to judge the final classification result of the user input question; The processing module is used to classify the classified question types to answer user questions.

5. A search question-answering system combining ElasticSearch and AI according to claim 4, characterized in that: The processing module comprises: A recognition unit, used to recognize the language of the question and determine the reply language; An extraction unit is used to extract search parameters for questions, including columns, time ranges, countries and regions, and keywords; A judgment unit is used to judge the type of reply expected by the user, which is divided into pure search type and non-pure search type that requires in-depth reading; The search unit is used to call ElasticSearch to search and solve related engineering problems, including converting countries and regions into labels, rewriting search parameters, and multi-column search strategies; The processing unit is used to judge the result according to the user's expectations and decide whether to return to the search list directly or continue processing.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of a search question-answering method combining ElasticSearch and AI as described in any one of claims 1 to 3 are implemented.

7. 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 a search question-answering method combining ElasticSearch and AI as described in any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Problem locating method and device of feedback contents, computer equipment and storage medium

    CN107330471A