Intelligent question and answer method and device and storage medium
By introducing data cache layer and preprocessing technology into the Q&A system, combining database query and neural network model, the problems of low query efficiency and high computing power consumption in the existing Q&A system are solved, and efficient and low-cost Q&A services are realized.
Patent Information
- Application Number
- CN202510366818.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-07-04
AI Technical Summary
In the existing question and answer system, the keyword matching mechanism has limitations, which leads to excessive consumption of computing power of large models and difficulty in dealing with complex semantic relationships and contextual information, difficulty in maintaining and updating, and inefficient query.
The data cache layer is used to cache data with high frequency of querying historical problems, combine preset search algorithms and preprocessing steps to quickly match answer data, and perform supplementary queries at the database layer, use neural network models to process new problems, clean cached data regularly, and optimize database structure.
It significantly improves query efficiency, reduces the computing power consumption of large models, improves the system's response speed and resource utilization, reduces operational costs, and improves user experience.
Smart Images

Figure CN120258143A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent question answering, and in particular, to an intelligent question answering method, device and storage medium. Background Art
[0002] With the rapid development of artificial intelligence technology, large models have demonstrated powerful capabilities in the field of natural language processing and are widely used in many scenarios such as question answering systems and interpretation systems. However, the operation of large models has extremely high requirements for computing power resources. In large model question answering applications, when a user asks a question, the system usually needs to input the question into the large model for complex calculations, reasoning, and semantic understanding to generate corresponding answers.
[0003] The existing problem keyword matching mechanism has obvious limitations. For questions with similar semantics but different keyword expressions, they may not be accurately identified as the same question, and thus will still be sent to the large model, resulting in waste of computing power. And it is difficult to handle complex semantic relationships and context information. For some questions that require in-depth understanding of semantic logic to answer, the keyword matching mechanism often cannot provide effective solutions and ultimately still relies on the large model for processing, unable to fundamentally solve the problem of excessive computing power consumption of the large model. In addition, with the increase in the number of questions and the richness of semantic diversity, the maintenance and update of the keyword-answer database become extremely difficult, and it is difficult to ensure the long-term effectiveness and accuracy of the system. Summary of the Invention
[0004] The present invention provides an intelligent question answering method, device and storage medium to solve the problems of obvious limitations of the existing problem keyword matching mechanism and excessive computing power consumption of the large model.
[0005] According to one aspect of the present invention, an intelligent question answering method is provided, and the method includes:
[0006] In response to an information inquiry request, obtain first inquiry information input at a target terminal, parse the first inquiry information to obtain second inquiry information, and perform a search in a data cache layer based on the second inquiry information and a preset search algorithm;
[0007] In the case where first question data matching the second inquiry information is retrieved, display answer data corresponding to the first inquiry information on the target terminal; wherein, the data cache layer is used to cache first question data with a historical question query frequency greater than a preset query frequency and first answer data corresponding to the first question data.
[0008] According to another aspect of the present invention, an intelligent question answering device is provided, and the device includes:
[0009] A data retrieval module, configured to, in response to an information inquiry request, obtain first inquiry information input at a target terminal, parse the first inquiry information to obtain second inquiry information, and perform a retrieval in a data cache layer based on the second inquiry information and a preset retrieval algorithm;
[0010] An answer display module, configured to, when first question data matching the second inquiry information is retrieved, display answer data corresponding to the first inquiry information on the target terminal; wherein, the data cache layer is used to cache first question data with a historical question query frequency greater than a preset query frequency and first answer data corresponding to the first question data.
[0011] According to another aspect of the present invention, there is provided an electronic device, which includes:
[0012] At least one processor; and
[0013] A memory communicatively connected to the at least one processor; wherein,
[0014] The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute the intelligent question and answer method according to any embodiment of the present invention.
[0015] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions, and when the computer instructions are executed by a processor, the intelligent question and answer method according to any embodiment of the present invention is implemented.
[0016] The technical solution of the embodiment of the present invention, by responding to an information inquiry request, obtaining first inquiry information input at a target terminal, parsing the first inquiry information to obtain second inquiry information, and performing a retrieval in a data cache layer based on the second inquiry information and a preset retrieval algorithm, improves the retrieval efficiency. When first question data matching the second inquiry information is retrieved, answer data corresponding to the first inquiry information is displayed on the target terminal; wherein, the data cache layer is used to cache first question data with a historical question query frequency greater than a preset query frequency and first answer data corresponding to the first question data, solves the problems of low query efficiency and excessive consumption of large model computing power, and achieves the beneficial effects of significantly improving the query efficiency and avoiding excessive consumption of large model computing power.
[0017] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.
[0019] Figure 1 is a flowchart of an intelligent question and answer method provided in Embodiment 1 of the present invention;
[0020] Figure 2a is a flowchart of an intelligent question and answer method provided in Embodiment 2 of the present invention;
[0021] Figure 2b is a data preprocessing flowchart of an optional example of an intelligent question and answer method provided in Embodiment 2 of the present invention;
[0022] Figure 2c is a question retrieval flowchart of an optional example of an intelligent question and answer method provided in Embodiment 2 of the present invention;
[0023] Figure 3 is a structural schematic diagram of an intelligent question and answer device provided in Embodiment 3 of the present invention;
[0024] Figure 4 is a structural schematic diagram of an electronic device for implementing the intelligent question and answer method of the embodiments of the present invention. Detailed implementation manners
[0025] To enable those skilled in the art to better understand the solutions of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0026] It should be noted that the terms "first", "second", etc. in the description, claims and above-mentioned drawings of the present invention are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention described here can be implemented in an order other than those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily limit to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0027] Embodiment 1
[0028] Figure 1 The following is a flowchart of an intelligent question-answering method provided for Embodiment 1 of the present invention. This embodiment is applicable to the situation of intelligent question-answering. This method can be executed by an intelligent question-answering device, which can be implemented in the form of hardware and / or software, and the intelligent question-answering device can be configured in an electronic device. As Figure 1 shown, the method includes:
[0029] S110. In response to an information inquiry request, obtain the first inquiry information input at the target terminal, parse the first inquiry information to obtain the second inquiry information, and perform a search in the data cache layer based on the second inquiry information and a preset retrieval algorithm.
[0030] Among them, the first inquiry information can be understood as the original inquiry information. The second inquiry information can be understood as the key inquiry information. The preset retrieval algorithm includes hash table retrieval or index retrieval.
[0031] Specifically, in response to an information inquiry request, obtain the original information that the user wants to query and input at the target terminal, that is, the first inquiry information. Parse the received first inquiry information, and the purpose is to extract the key inquiry information, that is, the second inquiry information. According to the system configuration or user requirements, select an appropriate preset retrieval algorithm to perform a search in the data cache layer. Hash table retrieval is applicable to the situation of quickly finding specific key-value pairs, while index retrieval is applicable to ordered searching according to the index structure.
[0032] Optionally, before parsing the first inquiry information, it further includes:
[0033] Perform preprocessing on the first inquiry information, and update the first inquiry information based on the preprocessing result, where the preprocessing includes at least one of text normalization processing, text formatting processing, and text segmentation processing.
[0034] Specifically, perform text standardization processing on the first query information to convert the text into a unified and standardized form for subsequent retrieval and analysis. Perform text formatting processing on the first query information to adjust the text format to ensure compliance with the requirements of the retrieval system. Perform text segmentation processing on the first query information to split the long text into smaller and more manageable text units, such as sentences, paragraphs, or keywords. This helps the retrieval system to more accurately understand the meaning of the text because the segmented text units are easier to match with the entries in the index or database. After the preprocessing is completed, update the first query information based on the preprocessing results to obtain optimized text data as the input for the subsequent retrieval steps. This helps to improve the accuracy and efficiency of the retrieval and provide a better information retrieval experience for users.
[0035] S120. In the case where the first question data matching the second query information is retrieved, display the answer data corresponding to the first query information on the target terminal.
[0036] Among them, the data cache layer is used to cache the first question data with a historical question query frequency greater than the preset query frequency and the first answer data corresponding to the first question data.
[0037] Specifically, in the case where the first question data matching the second query information is retrieved, retrieve the answer data associated with the first question data, and perform formatting of the answer data, extraction of key information, generation of a summary, or other forms of processing on the answer data associated with the first question data to ensure the accuracy and readability of the answer data. Display the processed answer data associated with the first question data on the target terminal. The display method may include displaying multimedia content such as text, images, videos, or audio on the user interface.
[0038] Optionally, after displaying the answer data, the system can collect the user's feedback. User feedback may include evaluations of aspects such as the accuracy, relevance, and satisfaction of the answer, as well as possible improvement suggestions. The user feedback can be used to optimize the retrieval algorithm, improve the data preprocessing steps, or enhance the accuracy and readability of the answer data.
[0039] The technical solution of the embodiment of the present invention is to obtain the first inquiry information input on the target terminal in response to an information inquiry request, parse the first inquiry information to obtain the second inquiry information, and perform a search in the data cache layer based on the second inquiry information and a preset retrieval algorithm; improve the retrieval efficiency. When the first question data matching the second inquiry information is retrieved, the answer data corresponding to the first inquiry information is displayed on the target terminal; wherein, the data cache layer is used to cache the first question data with a historical question query frequency greater than the preset query frequency and the first answer data corresponding to the first question data, which solves the problems of low query efficiency and excessive consumption of the computing power of the large model, and achieves the beneficial effects of significantly improving the query efficiency and avoiding excessive consumption of the computing power of the large model.
[0040] Embodiment 2
[0041] Figure 2a It is a flowchart of an intelligent question-answering method provided by Embodiment 2 of the present invention, and this embodiment is a further optimization of the above embodiment. Optionally, the method further includes: determining the data access frequency of the question data stored in the data cache layer based on a preset time period, and deleting the question data and its corresponding answer data whose data access frequency is lower than the preset access frequency.
[0042] As Figure 2a shown, the method includes:
[0043] S210. In response to an information inquiry request, obtain the first inquiry information input on the target terminal, parse the first inquiry information to obtain the second inquiry information, and perform a search in the data cache layer based on the second inquiry information and a preset retrieval algorithm.
[0044] Optionally, after performing the search in the data cache layer based on the second inquiry information and a preset retrieval algorithm, it further includes: when the question data of the first inquiry information is not retrieved in the data cache layer, constructing a target query statement based on the second inquiry information; performing a query in the database layer based on the target query statement, and when the second question data matching the target query statement is retrieved, displaying the answer data corresponding to the second question data on the target terminal.
[0045] Among them, the target query statement can be an SQL (Structured Query Language) query statement. The second question data can be understood as the question data stored in the database layer.
[0046] Specifically, if no matching first problem data is found in the cache layer, further search is performed in the database layer. For database queries, for relational databases, optimized SQL statements can be used, or for non-relational databases, search can be performed through a specific query API (Application Programming Interface), and exact or fuzzy matching search is performed according to the characteristics of the problem and the index information. If matching second problem data is found in the database layer, the answer data corresponding to the second problem data is retrieved and displayed on the target terminal. While returning the answer data corresponding to the second problem data to the user, the question and its answer are updated to the cache layer for quick response to the same question in the future.
[0047] Optionally, after querying in the database layer based on the target query statement, it further includes: in the case where no second problem data matching the first query information is found in the database layer, inputting the second query information into the target question-and-answer model, and displaying the answer data output by the target question-and-answer model on the target terminal, where the target question-and-answer model is obtained by training a pre-established neural network model based on sample question data and sample answer data.
[0048] Specifically, if no matching second problem data is found in the database, it indicates that the second query information appears for the first time, and it is sent to the target question-and-answer model for processing. After the target question-and-answer model finishes processing, the answer data output by the target question-and-answer model is displayed on the target terminal.
[0049] Optionally, after displaying the answer data output by the target question-and-answer model on the target terminal, it further includes: associatively storing the second query information and its corresponding answer data in the data cache layer and the database layer.
[0050] Specifically, the second query information that appears for the first time and its corresponding answer data are associatively stored in the data cache layer and the database layer, which is convenient for improving the subsequent question query efficiency and accuracy.
[0051] Optionally, before inputting the second query information into the target question-answering model, it further includes: constructing a data set, dividing the data set into a training set and a test set; wherein, the data set includes various types of sample question data and sample answer data corresponding to the sample question data; training a pre-established neural network model based on the training set, determining a model loss based on the answer data output by the training and the sample answer data, and adjusting the model parameters based on the neural network model loss; testing the neural network model that has completed training each time based on the test set to obtain multiple model performance metrics, and determining the target question-answering model based on the multiple model performance metrics.
[0052] Specifically, construct a data set, collect various types of sample question data, and the sample question data covers a wide range of the target field, including but not limited to common sense questions, professional knowledge questions, logical reasoning questions, etc. For each sample question data, collect the corresponding correct answer as the sample answer data. The sample answer data includes forms such as text, numbers, lists, etc. Clean the collected data to remove duplicate, invalid or incorrect data. Perform preprocessing operations such as word segmentation, stop word removal, and stemming on the text data to improve the processing efficiency of the model. Divide the data set into a training set, a validation set, and a test set. For example: the training set accounts for 70%, and the validation set and the test set each account for 15%. The validation set is used to adjust the model parameters during the training process, and the test set is used to finally evaluate the model performance. Train the pre-established neural network model based on the training set. During the training process, for each training sample, the model will output a predicted answer and compare it with the sample answer to calculate the loss value. Based on the loss value, use the backpropagation algorithm to adjust the model parameters to minimize the loss and improve the model performance. During the training process, regularly evaluate the model performance using the validation set. This helps monitor the training progress of the model and prevent overfitting. If the performance on the validation set starts to decline, it may be necessary to stop training or adjust hyperparameters such as the learning rate. Test the trained model using the test set. The test set should contain questions and answers different from those in the training set and the validation set to ensure the generalization ability of the model. For each test sample, record the predicted answer of the model and compare it with the sample answer to calculate multiple performance metrics. Based on the multiple performance metrics, comprehensively evaluate the performance of the model. If a certain model performs well in multiple metrics, it can be considered as the target question-answering model. Other factors such as the computational efficiency and memory occupancy of the model can also be considered to determine the final target question-answering model.
[0053] S220. In the case where the first question data matching the second query information is retrieved, display the answer data corresponding to the first query information on the target terminal.
[0054] Optionally, when second question data matching the target query statement is queried, the method further includes: updating the second question data and answer data corresponding to the second question data into the data cache layer.
[0055] Specifically, the second question data and the answer data corresponding to the second question data are updated to the data cache layer to facilitate quick response to subsequent identical questions.
[0056] S230. Determine the data access frequency of the question data stored in the data cache layer based on a preset time period, and delete the question data and its corresponding answer data whose data access frequency is lower than the preset access frequency.
[0057] The data access frequency can be understood as the number of times a certain problem data is accessed within a specific time period.
[0058] Specifically, the problem data stored in the cache layer is cleaned and updated regularly, and expired problem data is deleted. At the same time, the data content in the cache is dynamically adjusted according to the new data in the database or the change of data access frequency. For example, the LRU (Least Recently Used) least recently used algorithm or other intelligent cache replacement strategies can be used to ensure that the most valuable problem data is always stored in the cache. The preset access frequency can be pre-set based on experience, and this embodiment does not limit it.
[0059] Optionally, for the database layer, establish a data backup and recovery mechanism and perform regular data backup to prevent data loss. At the same time, as new questions and answers continue to accumulate, optimize the database performance, such as index optimization, data partitioning, etc., to ensure the efficiency and stability of database queries. In addition, according to business needs and data growth, expand and upgrade the database in a timely manner to adapt to the long-term development of the system.
[0060] The technical solution of the embodiment of the present invention determines the data access frequency of the question data stored in the data cache layer based on a preset time period, and deletes the question data and its corresponding answer data whose data access frequency is lower than the preset access frequency. By regularly cleaning up inactive data, it can be ensured that the data stored in the cache are currently active or may be accessed soon. This can make more efficient use of limited cache space and avoid wasting space. Based on the cache cleaning strategy of data access frequency, deleting data with low access frequency means that the remaining data in the cache is more likely to be requested by the user. Therefore, when a user initiates a query, the cache can hit the requested data more frequently, reducing the number of accesses to the back-end storage system, thereby improving the response speed and overall performance of the system.
[0061] As an optional example of the first embodiment of the present invention, the intelligent question - answering method of this embodiment specifically includes the following steps:
[0062] I. Overall architecture design
[0063] Build a question - answering system architecture that includes a cache layer, a database layer, and an interface for interacting with the large - model. The cache layer uses high - speed caching technology to quickly store and retrieve frequently - occurring user questions and their corresponding answers generated by the large - model in the near future. The database layer is used to persistently store a large amount of historical question - and - answer data to ensure the long - term availability and scalability of the data, as well as the specific design of the interface for interacting with the large - model, etc.
[0064] II. Data pre - processing and storage
[0065] Step 1.1 When a user first asks a question, the system standardizes the question, Figure 2b provides a data pre - processing flowchart for an optional example of an intelligent question - answering method. As Figure 2b shown, it includes operations such as removing stop words and converting to a unified format (such as lower - casing) to improve the accuracy and efficiency of subsequent matching.
[0066] Step 1.2 Send the pre - processed question to the large - model for calculation to obtain an answer. At the same time, store the question and the answer in the cache layer and the database layer respectively. Set a reasonable expiration time in the cache. For example, dynamically adjust the expiration duration according to the historical access frequency of the question. The cache time for frequently - accessed questions can be appropriately extended, while that for low - frequency questions is relatively short to balance the utilization of cache space and data timeliness. In the database, store the data in a structured manner according to dimensions such as the classification and time of the question for convenient subsequent query and management.
[0067] III. Question receiving and processing flow
[0068] Figure 2c provides a question retrieval flowchart for an optional example of an intelligent question - answering method. As Figure 2c shown, in step 2.1, after the new first inquiry information enters the system, parse the first inquiry information to obtain second inquiry information, and perform a search in the data cache layer based on the second inquiry information and a preset search algorithm; in the case of retrieving first question data that matches the second inquiry information, display the answer data corresponding to the first inquiry information on the target terminal.
[0069] Specifically, first, search and match in the cache layer (data processing has been described in data preprocessing and storage). Utilize the efficient retrieval mechanism of the cache (such as data structures based on hash tables or indexes) to quickly determine whether the problem already exists in the cache. If a matching problem is found in the cache, directly extract the corresponding answer from the cache and return it to the user. The entire process does not require the participation of the large model, greatly saving computing power consumption and response time.
[0070] Step 2.2 In the case where the problem data corresponding to the first query information is not retrieved in the data cache layer, construct a target query statement based on the second query information; perform a query in the database layer based on the target query statement. In the case where second problem data matching the target query statement is queried, display the answer data corresponding to the second problem data on the target terminal.
[0071] Specifically, if no matching problem is found in the cache layer, further search in the database layer. Database queries use optimized SQL statements (for relational databases) or specific query APIs (for non-relational databases) to perform exact or fuzzy matching searches based on the characteristics and index information of the problem. If a matching problem is found in the database, extract the corresponding answer, and while returning it to the user, update the problem and its answer to the cache layer for quick response to the same problem in the future.
[0072] Step 2.3 In the case where second problem data matching the first query information is not queried in the database layer, input the second query information into the target question-answering model, and display the answer data output by the target question-answering model on the target terminal, where the target question-answering model is obtained by training a pre-established neural network model based on sample question data and sample answer data.
[0073] Specifically, if no matching problem is found in the database layer either, it indicates that the problem appears for the first time. Send it to the target question-answering model for processing. After the target question-answering model finishes processing, obtain the answer, store the question and the answer in the cache layer and the database layer respectively, and then return the answer to the user.
[0074] IV. Update and Maintenance Mechanism of Cache and Database
[0075] Step 3.1 Determine the data access frequency of the problem data stored in the data cache layer based on a preset time period, and delete the problem data and its corresponding answer data whose data access frequency is lower than the preset access frequency.
[0076] Specifically, the data in the cache layer is regularly cleaned and updated, and the expired problematic data is deleted. At the same time, according to the new data in the database or the change of data access frequency, the data content in the cache is dynamically adjusted. For example, the LRU (Least Recently Used) algorithm or other intelligent cache replacement strategies can be adopted to ensure that the most valuable problematic data is always stored in the cache.
[0077] Step 3.2 For the database, establish a data backup and recovery mechanism, and perform data backup regularly to prevent data loss. At the same time, as new questions and answers continue to accumulate, perform performance optimization on the database, such as index optimization, data partitioning, etc., to ensure the high efficiency and stability of database queries. In addition, according to business requirements and data growth, perform database expansion and upgrade operations in a timely manner to adapt to the long-term development of the system.
[0078] The technical solution of the embodiment of the present invention realizes the collaborative work and data interaction between each layer by designing a three-layer architecture including a cache layer, a database layer, and an interface for interacting with the large model. After standardizing the user questions, the questions and answers are stored in the cache layer and the database layer respectively, and the cache expiration time and the database storage structure are reasonably set according to factors such as the access frequency of the questions. When a new question enters the system, it is first searched in the cache layer. If not found, it is then searched in the database layer, and different situations are processed separately. If neither is found, it is sent to the large model for processing, and the result is stored in the cache and the database. Regularly clean and update the cache, adopt an intelligent cache replacement strategy, and at the same time perform operations such as database backup, performance optimization, and expansion and upgrade on the database. Adopt an asynchronous request and batch processing mechanism to reduce the number of interactions with the large model and the overhead, improve the overall concurrency processing ability and resource utilization rate of the system. The specific implementation methods of asynchronous requests and batch processing include the batch collection method of questions, the concurrency control and data transmission format for interacting with the large model, etc. Store the questions asked by the user and their answers in the cache and the database. When a new user question is received, first query and match in the cache and the database. If the same question is found, directly return the stored answer, avoiding sending another request to the large model, thereby significantly reducing the request hit rate of the same question to the large model, fundamentally reducing the consumption of computing power by the large model, improving the overall performance and efficiency of the large model question-and-answer system, reducing the operation cost, and enhancing the user experience.
[0079] Embodiment III
[0080] Figure 3 It is a schematic structural diagram of an intelligent question-and-answer device provided by Embodiment III of the present invention. As Figure 3 shown, the device includes: a data retrieval module 310 and an answer display module 320.
[0081] Among them, the data retrieval module 310 is configured to, in response to an information inquiry request, obtain the first inquiry information input at the target terminal, parse the first inquiry information to obtain the second inquiry information, and perform a retrieval in the data cache layer based on the second inquiry information and a preset retrieval algorithm; the answer display module 320 is configured to, when the first question data matching the second inquiry information is retrieved, display the answer data corresponding to the first inquiry information on the target terminal; wherein, the data cache layer is used to cache the first question data with a historical question query frequency greater than a preset query frequency and the first answer data corresponding to the first question data.
[0082] The technical solution of the embodiment of the present invention, through the data retrieval module, in response to an information inquiry request, obtains the first inquiry information input at the target terminal, parses the first inquiry information to obtain the second inquiry information, and performs a retrieval in the data cache layer based on the second inquiry information and a preset retrieval algorithm; improves the retrieval efficiency. Through the answer display module, when the first question data matching the second inquiry information is retrieved, the answer data corresponding to the first inquiry information is displayed on the target terminal; wherein, the data cache layer is used to cache the first question data with a historical question query frequency greater than a preset query frequency and the first answer data corresponding to the first question data, solves the problems of low query efficiency and excessive consumption of the large model computing power, and achieves the beneficial effects of significantly improving the query efficiency and avoiding excessive consumption of the large model computing power.
[0083] Optionally, the device further includes:
[0084] A query statement construction module, configured to, after performing a retrieval in the data cache layer based on the second inquiry information and a preset retrieval algorithm, when the question data of the first inquiry information is not retrieved in the data cache layer, construct a target query statement based on the second inquiry information;
[0085] A second display module, configured to perform a query in the database layer based on the target query statement, and when the second question data matching the target query statement is retrieved, display the answer data corresponding to the second question data on the target terminal.
[0086] Optionally, the device further includes:
[0087] A first data update module, configured to, when the second question data matching the target query statement is retrieved, update the second question data and the answer data corresponding to the second question data to the data cache layer.
[0088] Optionally, the device further includes:
[0089] A third display module, configured to, after querying in the database layer based on the target query statement, in the case where no second question data matching the first inquiry information is queried in the database layer, input the second inquiry information into a target question-answering model, and display the answer data output by the target question-answering model on the target terminal, where the target question-answering model is obtained by training a pre-established neural network model based on sample question data and sample answer data.
[0090] Optionally, the apparatus further includes:
[0091] A dataset construction module, configured to construct a dataset and divide the dataset into a training set and a test set before inputting the second inquiry information into the target question-answering model; where the dataset includes various types of sample question data and sample answer data corresponding to the sample question data;
[0092] A model training module, configured to train a pre-established neural network model based on the training set, determine a model loss based on the answer data output by the training and the sample answer data, and adjust model parameters based on the neural network model loss;
[0093] A model determination module, configured to test the neural network model that has completed training each time based on the test set to obtain multiple model performance metrics, and determine the target question-answering model based on the multiple model performance metrics.
[0094] Optionally, the apparatus further includes:
[0095] A second data update module, configured to, after determining the third answer data as the target answer data, associatively store the second inquiry information and its corresponding answer data in the data cache layer and the database.
[0096] Optionally, the apparatus further includes:
[0097] A data deletion module, configured to determine the data access frequency of the question data stored in the data cache layer based on a preset time period, and delete the question data whose data access frequency is lower than the preset access frequency and its corresponding answer data.
[0098] Optionally, the apparatus further includes:
[0099] A preprocessing module, configured to preprocess the first inquiry information before parsing the first inquiry information, and update the first inquiry information based on the preprocessing result, where the preprocessing includes at least one of text normalization processing, text formatting processing, and text segmentation processing.
[0100] The intelligent question-answering device provided by the embodiments of the present invention can execute the intelligent question-answering method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.
[0101] Embodiment 4
[0102] Figure 4 FIG. shows a schematic structural diagram of an electronic device 10 that can be used to implement the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as, for example, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, for example, personal digital processors, cellular telephones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0103] As Figure 4 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. The memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0104] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0105] Processor 11 may be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 executes the various methods and processes described above, such as the method of intelligent question answering.
[0106] In some embodiments, the method of intelligent question answering may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed onto electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method of intelligent question answering described above may be executed. Alternatively, in other embodiments, processor 11 may be configured to execute the method of intelligent question answering by any other suitable means (e.g., by means of firmware).
[0107] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), systems on a chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0108] The computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowchart and / or block diagram are implemented. The computer program can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0109] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0110] To provide interaction with a service acquirer, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the service acquirer; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the service acquirer can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the service acquirer; for example, the feedback provided to the service acquirer can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the service acquirer can be received in any form (including acoustic input, voice input, or tactile input).
[0111] The systems and techniques described herein can be implemented in a computing system including a backend component (e.g., as a data server), or a computing system including a middleware component (e.g., an application server), or a computing system including a frontend component (e.g., a service acquirer computer having a graphical service acquirer interface or a web browser through which the service acquirer can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by any form or medium of digital data communication (e.g., a communication network). Examples of the communication network include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0112] A computing system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The client-server relationship is created by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0113] It should be understood that various forms of processes shown above can be used, with steps reordered, added or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is imposed herein.
[0114] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. An intelligent question-answering method, characterized in that, Including: In response to an information inquiry request, obtain the first inquiry information input at the target terminal, parse the first inquiry information to obtain second inquiry information, and perform a search in the data cache layer based on the second inquiry information and a preset retrieval algorithm; In the case where first question data matching the second inquiry information is retrieved, display the answer data corresponding to the first inquiry information on the target terminal; wherein, the data cache layer is used to cache first question data with a historical question query frequency greater than a preset query frequency and the first answer data corresponding to the first question data.
2. The method according to claim 1, characterized in that, After performing the search in the data cache layer based on the second inquiry information and the preset retrieval algorithm, it further includes: In the case where question data of the first inquiry information is not retrieved in the data cache layer, construct a target query statement based on the second inquiry information; Perform a query in the database layer based on the target query statement, and in the case where second question data matching the target query statement is retrieved, display the answer data corresponding to the second question data on the target terminal.
3. The method according to claim 2, characterized in that, In the case where second question data matching the target query statement is retrieved, it further includes: Update the second question data and the answer data corresponding to the second question data to the data cache layer.
4. The method according to claim 2, wherein After performing the query in the database layer based on the target query statement, it further includes: In the case where second question data matching the first inquiry information is not retrieved in the database layer, input the second inquiry information into a target question and answer model, and display the answer data output by the target question and answer model on the target terminal, wherein the target question and answer model is obtained by training a pre-established neural network model based on sample question data and sample answer data.
5. The method according to claim 4, wherein Before inputting the second inquiry information into the target question and answer model, it further includes: Construct a data set, and divide the data set into a training set and a test set; wherein, the data set includes various types of sample question data and the sample answer data corresponding to the sample question data; Train the pre-established neural network model based on the training set, determine the model loss based on the answer data output by the training and the sample answer data, and adjust the model parameters based on the neural network model loss; Test the neural network model that has completed training each time based on the test set to obtain multiple model performance indicators, and determine the target question and answer model based on the multiple model performance indicators.
6. The method according to claim 4, wherein After displaying the answer data output by the target question and answer model on the target terminal, it further includes: Associatively store the second inquiry information and its corresponding answer data in the data cache layer and the database layer.
7. The method according to claim 1, wherein It further includes: Determine the data access frequency of the question data stored in the data cache layer based on a preset time period, and delete the question data with a data access frequency lower than the preset access frequency and the answer data corresponding thereto.
8. The method according to claim 1, characterized in that Before parsing the first inquiry information, it further includes: Preprocess the first inquiry information, and update the first inquiry information based on the preprocessing result, where the preprocessing includes at least one of text normalization processing, text formatting processing, and text segmentation processing.
9. An intelligent question-answering device, characterized in that, Including: A data retrieval module, configured to, in response to an information inquiry request, obtain the first inquiry information input at the target terminal, parse the first inquiry information to obtain second inquiry information, and perform a retrieval in the data cache layer based on the second inquiry information and a preset retrieval algorithm; An answer display module, configured to, when first question data matching the second inquiry information is retrieved, display the answer data corresponding to the first inquiry information on the target terminal; wherein, the data cache layer is used to cache first question data with a historical question query frequency greater than a preset query frequency and first answer data corresponding to the first question data.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a processor to implement the intelligent question-answering method according to any one of claims 1-8 when executed.
Citation Information
Cited By
Answer retrieval method and device, equipment, storage medium and product
CN121388094A