Question and answer response method and electronic equipment
By building a preset question-and-answer index during the system's idle period and using reinforcement learning models to optimize the response path, the problem of slow response speed of the question-and-answer system is solved, and efficient and fast question-and-answer response is achieved.
Patent Information
- Application Number
- CN202510400014.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-07-18
AI Technical Summary
The existing question-and-answer system responds slowly when facing massive document data, especially when inference of complex problems, and it is difficult to meet the real-time needs of users.
Build a preset question and answer index during the idle period of the system, use the preset question and answer index to quickly respond to question information, combine the reinforcement learning model to select the optimal response path, and optimize the construction and retrieval process of question and answer index.
It significantly reduces the Q&A response time, improves the Q&A response speed and efficiency, and ensures efficient answers to user questions without occupying system resources.
Smart Images

Figure CN120336466A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a question-answer response method and an electronic device. Background Art
[0002] At present, with the development of artificial intelligence (AI) technology, intelligent question-answering systems are gradually being widely used; however, faced with massive document data, the response speed of question-answering systems is often unsatisfactory, especially when faced with complex problem reasoning, the response time will be greatly extended; it can be seen that how to reduce the response time of question-answering and improve the response speed of question-answering is a technical problem that needs to be solved urgently. Summary of the invention
[0003] Embodiments of the present application provide a question-and-answer response method and an electronic device.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides a question-answer response method, the method comprising:
[0006] In response to the system entering an idle period, building a preset question-and-answer index during the idle period;
[0007] In response to the input question information, response information corresponding to the question information is determined based on a preset question-and-answer index.
[0008] In a second aspect, an embodiment of the present application provides an electronic device, including a construction unit and a determination unit;
[0009] A construction unit, configured to construct a preset question-and-answer index in the idle period in response to the system entering the idle period;
[0010] The determination unit is used to determine the response information corresponding to the question information based on the preset question and answer index in response to the input question information.
[0011] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory storing instructions executable by the processor; when the instructions are executed by the processor, the following steps are implemented:
[0012] In response to the system entering an idle period, building a preset question-and-answer index during the idle period;
[0013] In response to the input question information, response information corresponding to the question information is determined based on a preset question-and-answer index.
[0014] In an embodiment of the present application, a question-and-answer response method and an electronic device are provided. The electronic device, in response to the system entering an idle period, constructs a preset question-and-answer index during the idle period; and in response to the input question information, determines the response information corresponding to the question information based on the preset question-and-answer index. Thus, it can be seen that the electronic device can construct the preset question-and-answer index each time the system enters the idle period, thereby being able to construct the preset question-and-answer index without occupying system resources, improving the efficiency of constructing the question-and-answer index. Furthermore, when the electronic device receives the input question information, it can use the previously constructed preset question-and-answer index to respond to the question and complete the answer, significantly reducing the time required for question-and-answer response and improving the speed of question-and-answer response. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present application.
[0016] Figure 1 Schematic flowchart of the implementation of the question-and-answer response method proposed in the embodiment of the present application Figure 1 ;
[0017] Figure 2 Schematic flowchart of the implementation of the question-and-answer response method proposed in the embodiment of the present application Figure 2 ;
[0018] Figure 3 Schematic diagram of the implementation of the question-and-answer response method proposed in the embodiment of the present application;
[0019] Figure 4 Schematic diagram of the composition structure of the electronic device proposed in the embodiment of the present application Figure 1 ;
[0020] Figure 5 Schematic diagram of the composition structure of the electronic device proposed in the embodiment of the present application Figure 2 . DETAILED DESCRIPTION OF THE EMBODIMENTS
[0021] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It can be understood that the specific embodiments described herein are only for explaining the related application and not for limiting the application. Additionally, it should be noted that for the sake of description, only the parts related to the related application are shown in the drawings.
[0022] With the development of AI technology, more and more companies are gradually adopting enhanced knowledge retrieval (RAG) systems to combine internal corporate knowledge with the reasoning capabilities of AI big models to create intelligent question-answering systems; however, faced with massive corporate documents, the system's response speed is often unsatisfactory, especially when it comes to complex problem reasoning, the response time is greatly extended, seriously affecting the user experience; in order to improve performance while ensuring the quality of knowledge questions and answers, how to balance the reasoning time and the accuracy of the answer has become a difficult problem that needs to be solved urgently; currently, AI big models have significantly improved the depth and quality of knowledge reasoning by introducing the thought chain reasoning method. For example, the o1 model of OpenAI uses thought chain reasoning, which can provide a more detailed reasoning process and improve the ability to answer complex questions, but thought chain reasoning will greatly increase the reasoning time, which reduces the response speed of the overall question-answering system and makes it difficult to meet the real-time needs of users.
[0023] That is to say, the current related question-answering methods include optimizing the reasoning performance by improving the computing power of the AI model. Although it can speed up the reasoning speed of the AI model, it cannot significantly improve the performance of knowledge retrieval. If the retrieval speed becomes a bottleneck, even if the model performance is improved, the overall question-answering response time is still limited by the retrieval speed, and the response time cannot be effectively reduced; or pre-training of enterprise documents. Although it can reduce the computing requirements in the question-answering process, this method is costly, has a long pre-training cycle, and requires frequent model updates, which is difficult to meet the timeliness and economy requirements of enterprises; and using the Chain of Thought (CoT) to reason and improve the reasoning quality. Although the introduction of the Chain of Thought reasoning can significantly improve the ability of the AI model to answer complex questions, this process will also significantly increase the reasoning time, resulting in a slower system response speed. For example, when OpenAI's o1 model uses the Chain of Thought reasoning, although the logic and accuracy of the answer are improved, the extension of the reasoning time greatly limits the real-time response capability of the system. It can be seen that how to optimize the response time of the question-answering without reducing the quality of the question-answering, especially in the context of large-scale knowledge documents, is a technical problem that needs to be solved urgently.
[0024] In order to solve the problems existing in the current question and answer system, the present application proposes a question and answer response method and an electronic device. In response to the system entering an idle period, the electronic device constructs a preset question and answer index during the idle period; in response to the input question information, the response information corresponding to the question information is determined based on the preset question and answer index, thereby significantly reducing the time required for the question and answer response and improving the speed of the question and answer response.
[0025] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0026] An embodiment of the present application provides a question-and-answer response method. As Figure 1 shown, the question-and-answer response method of the electronic device may include the following steps:
[0027] Step 101, in response to the system entering the idle period, construct a preset question-and-answer index during the idle period.
[0028] In the embodiment of the present application, the electronic device may, in response to the system entering the idle period, construct a preset question-and-answer index during the idle period.
[0029] In the embodiment of the present application, the system of the electronic device may integrate hardware, software, and the interaction logic therebetween. The system may be used to execute tasks or functions, such as performing computing tasks.
[0030] In the embodiment of the present application, the idle period represents a period when the computing power resources of the system are less occupied; for example, a period when the usage rate of the Central Processing Unit (CPU) of the electronic device is low, or a period when the electronic device is in a low-power state.
[0031] In the embodiment of the present application, the preset question-and-answer index may be an index constructed based on document data that can efficiently store and retrieve information in the document to quickly answer user queries or questions.
[0032] In some embodiments of the present application, the idle period may include a first idle period and a second idle period; wherein, the first idle period represents the predicted idle period of the system, and the second idle period represents the idle period of the system monitored in real time.
[0033] Exemplarily, if the first idle period is from 1:00 to 3:00 every day, the electronic device may, in response to the system time being 1:00, determine that it enters the idle period and construct the preset question-and-answer index during the period from 1:00 to 3:00; the electronic device may also monitor the operation of the system in real time. Assuming that it is determined that the system is in an idle state at time t1, it may be determined that the system enters the idle period and start constructing the preset question-and-answer index.
[0034] In some embodiments of the present application, the electronic device may use the historical resource usage data of the system to predict the idle period and obtain the first idle period.
[0035] In some embodiments of the present application, an electronic device may determine a first idle period. When determining the first idle period, the electronic device may perform a fitting process of a linear relationship on the historical resource usage data of the system to obtain a fitting result; then determine a resource usage prediction result for the period to be predicted based on the fitting result; and further determine the period corresponding to the resource usage data in the resource usage prediction result that is less than a first threshold as the first idle period.
[0036] In the embodiments of the present application, the types of data included in the historical resource usage data are not limited in the present application. For example, the historical resource usage data may include at least one of the CPU usage rate, memory occupancy rate, input / output (I / O) usage rate, and bandwidth usage rate during the historical usage period.
[0037] In the embodiments of the present application, the fitting result may be the result of obtaining a linear regression model by performing linear fitting on the historical resource usage data.
[0038] Exemplarily, when performing a fitting process of a linear relationship on the historical resource usage data of the system, the running time of the system may be used as a feature, and a linear regression model between the time and the resource usage situation of the system may be determined using the historical resource usage data. For example, the obtained linear regression model is y = 5 + 0.15t, where t is the running time of the system and y is the resource usage data of the system; that is to say, the linear regression model can be used to reflect the relationship between the running time of the system and the resource usage situation.
[0039] In the embodiments of the present application, when determining the resource usage prediction result for the period to be predicted based on the fitting result, the period to be predicted may be substituted into the linear regression model to obtain the resource usage prediction result for the period to be predicted.
[0040] In the embodiments of the present application, the resource usage prediction result represents the prediction result of the resource usage data of the system during the period to be predicted; the resource usage prediction result may include at least one of the prediction results of the CPU usage rate, memory occupancy rate, input / output usage rate, and bandwidth usage rate of the system during the period to be predicted.
[0041] Exemplarily, the idle period within the next 100 minutes of the system may be predicted. Then, these 100 minutes may be used as the period to be predicted and substituted into the linear regression model to obtain the resource usage prediction result of the system within these 100 minutes. For example, the resource usage prediction result may include the prediction result of the CPU usage rate within these 100 minutes.
[0042] In the embodiments of the present application, the specific value of the first threshold is not limited in the present application, and the first threshold may be set accordingly according to different types of resource usage data.
[0043] Exemplarily, the first threshold is 30%. After obtaining the prediction result of the CPU usage rate of the system in a certain future time period, the time period corresponding to the CPU usage rate less than 30% in the prediction result of the CPU usage rate can be used as the first idle period. For example, the time periods corresponding to the CPU usage rate less than 30% include the time period from t2 to t3 and the time period from t5 to t6. Then, the time period from t2 to t3 and the time period from t5 to t6 can be determined as the first idle period.
[0044] In some embodiments of the present application, the electronic device can determine a second idle period. When determining the second idle period, the electronic device can obtain the current resource usage data of the system when the running time interval reaches a preset time interval; then determine the current resource occupancy reference value according to the current resource usage data; and then, when the current resource occupancy reference value is less than the second threshold, determine the first time period corresponding to the current time as the second idle period.
[0045] In the embodiments of the present application, the preset time interval is not specifically limited in the present application. For example, the preset time interval can be 30 minutes, and the electronic device can determine the current resource usage data of the system every 30 minutes.
[0046] In some embodiments of the present application, the electronic device can use a sliding time window to obtain the current resource usage data of the system. For example, the size of the sliding time window is 10 minutes, and the electronic device can use the sliding time window to obtain the current resource usage data of the system every 10 minutes.
[0047] In some embodiments of the present application, the current resource usage data of the system may include the resource usage data of the system within a preset time interval.
[0048] Exemplarily, the electronic device uses a sliding time window to obtain the resource usage data of the system within 10 minutes every 10 minutes as the current resource usage data of the system.
[0049] In some embodiments of the present application, the resource occupancy reference value may be the average value corresponding to the current resource usage data.
[0050] Exemplarily, if the electronic device uses a sliding time window to obtain the CPU usage rate within 10 minutes, the electronic device can calculate the average value of the CPU usage rate within these 10 minutes and use the average value of the CPU usage rate as the current resource occupancy reference value.
[0051] In some embodiments of the present application, the specific value of the second threshold is not limited in the present application.
[0052] In some embodiments of the present application, the electronic device may also dynamically adjust the second threshold according to the running status of the system. For example, if the system maintains a high CPU usage rate for a long time, the second threshold may be increased so that the system can trigger the construction of the preset Q&A index during the idle period as much as possible.
[0053] Exemplarily, if the electronic device determines that the average value of the CPU usage rate of the system within a preset time interval is 50% and the second threshold is 35%, it can be determined that the current resource occupancy reference value is greater than the second threshold, and the current time cannot be used as the idle period of the system; while if the electronic device determines that the average value of the CPU usage rate of the system within a certain preset time interval is 25%, it can be determined that the current resource occupancy reference value is less than the second threshold.
[0054] In some embodiments of the present application, the duration of the first period is not limited in the present application. For example, the first period can be 10 minutes. Assume that the electronic device determines that the current resource occupancy reference value is less than the second threshold and the current time is t3. Then, starting from the t3 moment, the 10 minutes corresponding to the t3 moment, that is, the 10 minutes after the t3 moment, can be determined as the second idle period.
[0055] In some embodiments of the present application, when the electronic device constructs the preset Q&A index during the idle period, it can determine the initial Q&A index according to the document data within the idle period; furthermore, it can optimize the indexes in the initial Q&A index based on the historical Q&A data to obtain the preset Q&A index.
[0056] In some embodiments of the present application, when the electronic device determines the initial Q&A index according to the document data, it can perform paragraph segmentation processing on the document data to obtain the segmented paragraph information; perform semantic analysis processing on the segmented paragraph information to obtain semantic information; perform topic clustering processing on the semantic information to obtain the clustered semantic information; perform extraction processing of Q&A pairs based on the clustered semantic information to obtain Q&A pair information; and determine the initial Q&A index based on the Q&A pair information.
[0057] In some embodiments of the present application, the electronic device can use the trained model to perform semantic analysis processing and subject clustering processing on the segmented paragraph information to extract the key knowledge points and concepts in the document paragraphs; the trained model is not limited in the present application. For example, it can be the trained Bidirectional Encoder Representations from Transformers (BERT) based on Transformer, or it can also be the Generative Pre-trained Transformer (GPT).
[0058] In an embodiment of the present application, the Q&A pair information can be understood as a structured information unit extracted from a large amount of document data. The Q&A pair information usually consists of a question and its corresponding answer.
[0059] In some embodiments of the present application, when the electronic device optimizes the indexes in the initial Q&A index based on the historical Q&A data to obtain a preset Q&A index, it can classify the historical question information in the historical Q&A data to obtain the classified question information; then, it marks the question information whose question initiation frequency meets the preset frequency condition in the classified question information to obtain the marked question classification; furthermore, it optimizes the weight of the index corresponding to the marked question classification in the initial Q&A index to obtain the preset Q&A index.
[0060] In an embodiment of the present application, the question information that meets the preset frequency condition represents the question information with a relatively high initiation frequency; the present application does not limit the preset frequency condition. For example, the preset frequency condition can be a preset frequency threshold, so as to mark the question information whose initiation frequency is greater than or equal to the preset frequency threshold.
[0061] In some embodiments of the present application, when the electronic device classifies the historical question information in the historical Q&A data, it can use a clustering algorithm, such as the K-means clustering algorithm, to complete the classification of the historical question information and obtain the classified question information.
[0062] It can be understood that in an embodiment of the present application, the marked question classification is the question classification with a relatively high initiation frequency during the user's historical search process.
[0063] In some embodiments of the present application, optimizing the weight of the index corresponding to the marked question classification in the initial Q&A index can be to increase the weight of the index corresponding to the marked question classification, so that the answers to the high-frequency categories that the user is concerned about can be quickly found from the preset Q&A index.
[0064] In some embodiments of the present application, when the electronic device optimizes the indexes in the initial Q&A index based on the historical Q&A data to obtain a preset Q&A index, it can also perform a similarity matching process on the historical answer information in the historical Q&A data and the indexes in the initial Q&A index to obtain a similarity matching result; then, it determines the index corresponding to the similarity greater than the third threshold in the similarity matching result as the index to be optimized; and it optimizes the weight of the index to be optimized to obtain the optimized Q&A index.
[0065] It can be understood that in the embodiments of the present application, the similarity matching result represents the similarity between the historical answer information and the index in the initial question-and-answer index; the method for similarity matching processing is not limited in the present application. For example, the similarity between the historical answer information and the index in the initial question-and-answer index can be determined through a BERT model.
[0066] In the embodiments of the present application, the specific value of the third threshold is not specifically limited in the present application.
[0067] Exemplarily, when the electronic device performs similarity matching processing on the historical answer information of a certain user and the index in the initial question-and-answer index, and among the obtained similarity matching results, the index corresponding to the similarity greater than the third threshold is the index corresponding to the "English learning" question, then the index corresponding to the "English learning" question can be determined as the optimized index, and further, the weight of the index corresponding to the "English learning" question is increased to ensure that the "popular" questions frequently searched by the user can be quickly found from the preset question-and-answer index.
[0068] In some embodiments of the present application, the preset question-and-answer index can be a question-and-answer index that is continuously optimized using the historical question-and-answer data of the user. That is to say, after the electronic device constructs the preset question-and-answer index, it can still continuously collect the question-and-answer data searched by the user, so that after a certain period of time, these obtained historical question-and-answer data can be used to optimize the weight of the index in the preset question-and-answer index.
[0069] Step 102: In response to the input question information, determine the response information corresponding to the question information based on the preset question-and-answer index.
[0070] In the embodiments of the present application, after the electronic device constructs the preset question-and-answer index during the idle period in response to the system entering the idle period, it can, in response to the input question information, determine the response information corresponding to the question information based on the preset question-and-answer index.
[0071] In the embodiments of the present application, the question information can be a question input by the user received by the electronic device; for example, the question information can be "Which document does the XX content come from".
[0072] It can be understood that in the embodiments of the present application, the response information can be the answer corresponding to the question information.
[0073] In the embodiments of the present application, determining the response information corresponding to the question information based on the preset question-and-answer index can be to find, through the index in the preset question-and-answer index, a question that matches the question information, and thus use the corresponding answer as the response information.
[0074] In some embodiments of the present application, such as Figure 2As shown, after the electronic device responds to the system entering the idle period and constructs a preset question-and-answer index during the idle period, that is, after step 101, the following steps may further be included:
[0075] Step 103, in response to the question information, determine a target response path among a first response path for answer response based on the preset question-and-answer index and a second response path for answer response based on real-time documents.
[0076] In an embodiment of the present application, after the electronic device responds to the system entering the idle period and constructs a preset question-and-answer index during the idle period, it can, in response to the question information, determine a target response path among a first response path for answer response based on the preset question-and-answer index and a second response path for answer response based on real-time documents.
[0077] In an embodiment of the present application, when the electronic device receives the question information, it can select a path that is most suitable for querying the current question information among a first response path for answer response based on the preset question-and-answer index and a second response path for answer response based on real-time documents to determine the response information.
[0078] It can be understood that, in an embodiment of the present application, the target response path represents a path with better response speed and response accuracy.
[0079] In some embodiments of the present application, when the electronic device determines the target response path among a first response path for answer response based on the preset question-and-answer index and a second response path for answer response based on real-time documents, it can predict the state characteristics corresponding to the question information based on a reinforcement learning model (Deep Q-Network, DQN); and then determine a first reward function value of the first response path and a second reward function value of the second response path according to the state characteristics; thereby determining the response path corresponding to the largest reward function value among the first reward function value and the second reward function value as the target response path.
[0080] In an embodiment of the present application, the state characteristics may include at least one of the matching degree between the question information and the index in the preset question-and-answer index, the query response time, and the query accuracy; the query response time may include the response times for answer response to the question information based on the first response path and the second response path respectively; the query accuracy may include the accuracies for answer response based on the first response path and the second response path respectively;
[0081] In some embodiments of the present application, by determining the maximum reward function value among the first reward function value of the first response path and the second reward function value of the second response path, the target response path with the best comprehensive performance can be determined from the current first response path and the second response path under the three factors of the matching degree between the question information and the index in the preset Q&A index, the query response time, and the query accuracy.
[0082] Exemplarily, when the electronic device determines the first reward function value of the first response path and the second reward function value of the second response path, and the obtained first reward function value is A and the second reward function value is B, and A is greater than B, then the target response path can be determined as the first response path.
[0083] Step 104: Determine the response information corresponding to the question information based on the target response path.
[0084] In the embodiments of the present application, after the electronic device determines the target response path in the first response path for answering based on the preset Q&A index and the second response path for answering based on the real-time document in response to the question information, it can determine the response information corresponding to the question information based on the target response path.
[0085] It can be understood that in the embodiments of the present application, when the target response path is the first response path, the electronic device can determine the response information of the question information based on the preset Q&A index; when the target response path is the second response path, the electronic device can perform real-time document search to determine the response information.
[0086] In some embodiments of the present application, the electronic device can also monitor the respective performance information of the system under the first response path and the second response path, so as to adjust the parameters of the reinforcement learning model according to the performance information, so as to ensure that the optimal target response path can be determined from the first response path and the second response path based on the reinforcement learning model.
[0087] The embodiments of the present application provide a Q&A response method. When the electronic device responds to the system entering the idle period, it constructs a preset Q&A index during the idle period; in response to the input question information, it determines the response information corresponding to the question information based on the preset Q&A index. It can be seen that the electronic device can construct a preset Q&A index every time the system enters the idle period, thereby being able to construct a preset Q&A index without occupying system resources, improving the efficiency of constructing the Q&A index, and then when the electronic device receives the input question information, it can use the previously constructed preset Q&A index to respond to the question and complete the answer, significantly reducing the time required for Q&A response and improving the speed of Q&A response.
[0088] Based on the above embodiments, in another embodiment of the present application, for example, for the Q&A system of an enterprise, as Figure 3 shown, after the electronic device receives the question information input by any user in the enterprise, it can determine a path as the target response path from the first response path corresponding to the preset Q&A index and the second response path corresponding to the real-time document retrieval. Among them, the real-time document can be vectorized document data; thus, the answer to the question information is determined based on the target response path; among them, the preset Q&A index can be constructed in response to the system being in the idle period, and after the preset Q&A index is constructed, the indexes in the preset Q&A index can be continuously optimized, including optimizing with the historical Q&A data of the user; correspondingly, the feedback information of each user on the answer can also be obtained to optimize the preset Q&A index with the feedback information.
[0089] In some embodiments of the present application, the electronic device can monitor the resource usage data of the system in real time, such as at least one of the CPU usage rate, memory occupancy rate, input / output usage rate, and bandwidth usage rate; thus, when it is determined that the resource usage data drops below the second threshold, the construction of the preset Q&A index can be triggered.
[0090] In some embodiments of the present application, the electronic device can use a sliding time window to obtain the current resource usage data of the system. For example, if the size of the sliding time window is 10 minutes, the electronic device can use the sliding time window to obtain the current resource usage data of the system every 10 minutes, calculate the average value, and use the average value as the current resource occupancy reference value. When the resource occupancy reference value is less than the second threshold, the construction of the preset Q&A index can be triggered.
[0091] In some embodiments of the present application, the electronic device can also dynamically adjust the second threshold according to the running situation of the system. For example, if the system maintains a high CPU usage rate for a long time, the second threshold can be increased so that the system can try to trigger the construction of the preset Q&A index during the idle period.
[0092] In some embodiments of the present application, the electronic device can also perform linear relationship fitting processing on the historical resource usage data of the system to obtain a prediction result of the future resource usage situation of the system, thereby determining the possible idle period during the future operation of the system. Furthermore, when it is determined that the system enters the predicted idle period, the construction of the preset Q&A index can be triggered.
[0093] It can be understood that in the embodiments of the present application, by constructing the preset Q&A index during the idle period of the system, it can be ensured that the operation of constructing the preset Q&A index does not interfere with the system's execution of other high-priority tasks, while ensuring the smooth execution of constructing the preset Q&A index and improving the efficiency of constructing the preset Q&A index.
[0094] In some embodiments of the present application, after the system enters the idle period, the electronic device will trigger the construction of a preset question-and-answer index. The electronic device can perform in-depth analysis on enterprise documents based on Natural Language Processing (NLP) and knowledge graph technology to generate a preset question-and-answer index.
[0095] In some embodiments of the present application, the electronic device can perform paragraph segmentation processing on document data to obtain segmented paragraph information; perform semantic analysis processing on the segmented paragraph information to obtain semantic information; perform topic clustering processing on the semantic information to obtain clustered semantic information; perform extraction processing on question-and-answer pairs based on the clustered semantic information to obtain question-and-answer pair information; and determine an initial question-and-answer index based on the question-and-answer pair information.
[0096] In some embodiments of the present application, after obtaining the initial question-and-answer index, the electronic device can use a clustering algorithm to classify the historical question information of the user to obtain classified question information, and then perform marking processing on the question information whose question initiation frequency meets the preset frequency condition in the classified question information to obtain a marked question classification, and further perform weight optimization processing on the weight of the index corresponding to the marked question classification to obtain a preset question-and-answer index.
[0097] In some embodiments of the present application, the electronic device can perform similarity matching processing on the historical answer information in the historical question-and-answer data and the index in the initial question-and-answer index based on the BERT model to obtain a similarity matching result; and then determine the index corresponding to the similarity greater than the third threshold in the similarity matching result as the index to be optimized; and perform weight optimization processing on the weight of the index to be optimized to obtain an optimized question-and-answer index.
[0098] It can be understood that in the embodiments of the present application, by optimizing the weight of the index in the preset question-and-answer index, it can be ensured that the answers to the questions that users often search for or are more concerned about can be quickly retrieved from the index.
[0099] In some embodiments of the present application, whenever the user inputs question information, the electronic device can predict the effects of obtaining answers using the preset question-and-answer index and real-time document retrieval respectively based on a reinforcement learning model, so as to automatically select the optimal processing path to ensure the efficiency and accuracy of query response.
[0100] In some embodiments of the present application, the electronic device may predict state features corresponding to problem information based on a reinforcement learning model, including at least one of the matching degree between the problem information and the indexes in the preset question-and-answer index, the query response time, and the query accuracy. Furthermore, the electronic device may determine a first reward function value of the first response path and a second reward function value of the second response path according to the state features, and determine the response path corresponding to the maximum reward function value among the first reward function value and the second reward function value as the target response path, so as to determine the answer to the problem information based on the target response path.
[0101] In some embodiments of the present application, the electronic device may also monitor the performance information of the system under the first response path and the second response path respectively, so as to adjust the parameters of the reinforcement learning model according to the performance information, ensuring that the optimal target response path can be determined from the first response path and the second response path based on the reinforcement learning model.
[0102] In some embodiments of the present application, after answering the problem information, the electronic device may also collect the feedback information of the user, and continuously optimize the processing flow of the entire system in combination with the actual response time and the accuracy of the query result. The electronic device may use deep reinforcement learning (Proximal Policy Optimization, PPO) to learn from the feedback information, so as to adjust the weights of the indexes in the preset question-and-answer index according to the satisfaction score of the user for the answer in the feedback information, ensuring that high-frequency questions can be processed with higher priority.
[0103] In some embodiments of the present application, the electronic device may also periodically use the gradient descent algorithm to fine-tune each parameter in different response paths to ensure that the system can achieve an optimal balance between resource utilization and response speed.
[0104] In summary, the embodiments of the present application ensure the construction efficiency of the preset question-and-answer index by automatically monitoring whether the system is idle or predicting when the system is idle; use the hierarchical structure of document knowledge and the knowledge association algorithm based on the graph network to generate an efficient preset question-and-answer index; the construction of the index is based on the semantic analysis and context dependence of the document, combined with the existing question-and-answer historical data, to achieve multi-level index optimization; analyze the user's question-and-answer history through a deep learning model, such as BERT, to dynamically update the document index; and can continuously optimize the parts of the document with higher relevance to the question-and-answer to enhance the accuracy of the preset question-and-answer index; can also automatically determine whether to use the preset question-and-answer index or perform real-time retrieval and reasoning according to the matching degree between the user query and the preprocessed index through a routing algorithm based on reinforcement learning, reducing unnecessary real-time document search and reasoning, and improving the response speed.
[0105] Embodiments of the present application provide a question-and-answer response method. The electronic device responds to the system entering an idle period, constructs a preset question-and-answer index during the idle period, and responds to the input question information, and determines the response information corresponding to the question information based on the preset question-and-answer index. It can be seen that the electronic device can construct a preset question-and-answer index each time the system enters an idle period, thereby being able to construct a preset question-and-answer index without occupying system resources, improving the efficiency of constructing the question-and-answer index. Furthermore, when the electronic device receives the input question information, it can use the previously constructed preset question-and-answer index to respond to the question and complete the answer, significantly reducing the time required for question-and-answer response and improving the speed of question-and-answer response.
[0106] Based on the above embodiments, in another embodiment of the present application, an electronic device is provided. As Figure 4 shown, the electronic device 1 may include a construction unit 11 and a determination unit 12.
[0107] The construction unit 11 can be used to respond to the system entering an idle period and construct a preset question-and-answer index during the idle period.
[0108] The determination unit 12 can be used to respond to the input question information and determine the response information corresponding to the question information based on the preset question-and-answer index.
[0109] In some embodiments of the present application, the idle period includes a first idle period. The determination unit 12 can also be used to perform a fitting process on the historical resource usage data of the system to obtain a fitting result, determine the resource usage prediction result of the period to be predicted based on the fitting result, and determine the period corresponding to the resource usage data less than the first threshold in the resource usage prediction result as the first idle period.
[0110] In some embodiments of the present application, the idle period includes a second idle period. The determination unit 12 can also be used to obtain the current resource usage data of the system when the running time interval reaches a preset time interval, determine the current resource occupancy reference value according to the current resource usage data, and determine the first period corresponding to the current time as the second idle period when the current resource occupancy reference value is less than the second threshold.
[0111] In some embodiments of the present application, the construction unit 11 can also be used to determine an initial question-and-answer index according to the document data during the idle period, and optimize the indexes in the initial question-and-answer index based on the historical question-and-answer data to obtain a preset question-and-answer index.
[0112] In some embodiments of the present application, the construction unit 11 may also be used to classify the historical question information in the historical Q&A data to obtain the classified question information; and mark the question information whose question initiation frequency meets the preset frequency condition in the classified question information to obtain the marked question classification; and perform weight optimization processing on the weight of the index corresponding to the marked question classification in the initial Q&A index to obtain the preset Q&A index.
[0113] In some embodiments of the present application, the construction unit 11 may also be used to perform similarity matching processing on the historical answer information in the historical Q&A data and the index in the initial Q&A index to obtain a similarity matching result; and determine the index corresponding to the similarity greater than the third threshold in the similarity matching result as the index to be optimized; and perform weight optimization processing on the weight of the index to be optimized to obtain the optimized Q&A index.
[0114] In some embodiments of the present application, the determination unit 12 may also be used to, in response to the question information, determine a target response path between a first response path for answering based on the preset Q&A index and a second response path for answering based on real-time documents; and determine the response information corresponding to the question information based on the target response path.
[0115] In some embodiments of the present application, the determination unit 12 may also be used to predict the state characteristics corresponding to the question information based on a reinforcement learning model; wherein the state characteristics include at least one of the matching degree between the question information and the index in the preset Q&A index, the query response time, and the query accuracy; the query response time includes the response time for answering the question information based on the first response path and the second response path respectively; the query accuracy includes the accuracy for answering based on the first response path and the second response path respectively; and determine the first reward function value of the first response path and the second reward function value of the second response path according to the state characteristics; and determine the response path corresponding to the largest reward function value among the first reward function value and the second reward function value as the target response path.
[0116] In the embodiments of the present application, further, Figure 5 is the schematic composition structure of the electronic device provided by the embodiments of the present application Figure 2 , as Figure 5 shown, the electronic device 1 provided by the embodiments of the present application may further include a processor 13 and a memory 14 storing instructions executable by the processor 13; further, the electronic device 1 may further include a communication interface 15 and a bus 16 for connecting the processor 13, the memory 14, and the communication interface 15.
[0117] In an embodiment of the present application, the above-mentioned processor 13 may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a central processing unit, a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic devices for implementing the functions of the above-mentioned processor may also be others, and the embodiments of the present application do not make specific limitations. The electronic device 10 may further include a memory 14, and the memory 14 may be connected to the processor 13. Among them, the memory 14 is used to store executable program codes, and the program codes include computer operation instructions. The memory 14 may include a high-speed RAM memory and may also include non-volatile memory, for example, at least two disk memories.
[0118] In an embodiment of the present application, the bus 16 is used to connect the communication interface 15, the processor 13, and the memory 14 and for mutual communication between these devices.
[0119] In an embodiment of the present application, the memory 14 is used to store instructions and data.
[0120] Further, in an embodiment of the present application, the above-mentioned processor 13 is used to, in response to the system entering an idle period, build a preset question-and-answer index during the idle period; and in response to the input question information, determine the response information corresponding to the question information based on the preset question-and-answer index.
[0121] In practical applications, the above-mentioned memory 14 may be a volatile memory, such as a Random-Access Memory (RAM); or a non-volatile memory, such as a Read-Only Memory (ROM), a flash memory, a Hard Disk Drive (HDD), or a Solid-State Drive (SSD); or a combination of the above types of memories, and provide instructions and data to the processor 13.
[0122] In addition, each functional module in this embodiment may be integrated into a processing unit, may exist separately as individual units physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional module.
[0123] If the integrated unit is implemented in the form of a software functional module and is not sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of this technical solution, may be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method of this embodiment. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0124] The embodiment of the present application provides an electronic device, which includes a construction unit and a determination unit; the construction unit is used to construct a preset question-and-answer index during the idle period in response to the system entering the idle period; the determination unit is used to determine the response information corresponding to the question information based on the preset question-and-answer index in response to the input question information. It can be seen that the electronic device can construct a preset question-and-answer index every time the system enters the idle period, thereby being able to construct the preset question-and-answer index without occupying system resources, improving the efficiency of constructing the question-and-answer index. Furthermore, when the electronic device receives the input question information, it can use the previously constructed preset question-and-answer index to respond to the question and complete the answer, significantly reducing the time required for question-and-answer response and improving the speed of question-and-answer response.
[0125] Specifically, the program instructions corresponding to a question-and-answer response method in this embodiment may be stored on storage media such as optical discs, hard disks, and USB flash drives. When the program instructions corresponding to a question-and-answer response method in the storage medium are read or executed by an electronic device, the following steps are included:
[0126] In response to the system entering the idle period, construct a preset question-and-answer index during the idle period;
[0127] In response to the input question information, determine the response information corresponding to the question information based on the preset question-and-answer index.
[0128] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.
[0129] The present application is described with reference to the schematic flowcharts and / or block diagrams of the implementation processes of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the schematic flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the processes and / or blocks in the schematic flowchart and / or block diagram can also be implemented. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in one or more of the following processes or multiple processes and / or blocks. Figure 1 one or more of the following processes Figure 1 or multiple blocks
[0130] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implements the functions specified in one or more of the following processes or multiple processes and / or blocks. Figure 1 one or more of the following processes Figure 1 or multiple blocks
[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Therefore, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more of the following processes or multiple processes and / or blocks. Figure 1 one or more of the following processes Figure 1 or multiple blocks
[0132] The above embodiments are only preferred embodiments given to fully illustrate the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or transformations made by those skilled in the art on the basis of the present invention are within the protection scope of the present invention.
Claims
1. A question-and-answer response method, the method comprising: In response to the system entering an idle period, constructing a preset question-and-answer index during the idle period; In response to the input question information, determining response information corresponding to the question information based on the preset question-and-answer index.
2. The Q&A response method according to claim 1, wherein, The idle period includes a first idle period; the method further comprises: Performing a fitting process of a linear relationship on historical resource usage data of the system to obtain a fitting result; Determining a resource usage prediction result for a to-be-predicted period based on the fitting result; Determining the period corresponding to the resource usage data in the resource usage prediction result that is less than a first threshold as the first idle period.
3. The Q&A response method according to claim 2, wherein, The idle period includes a second idle period; the method further comprises: When a running time interval reaches a preset time interval, acquiring current resource usage data of the system; Determining a current resource occupancy reference value according to the current resource usage data; When the current resource occupancy reference value is less than a second threshold, determining a first period corresponding to the current time as the second idle period.
4. The Q&A response method according to any one of claims 1 to 3, wherein, The method further comprises: During the idle period, determining an initial question-and-answer index according to document data; Optimizing indexes in the initial question-and-answer index based on historical question-and-answer data to obtain the preset question-and-answer index.
5. The Q&A response method according to claim 4, wherein The optimizing indexes in the initial question-and-answer index based on historical question-and-answer data to obtain the preset question-and-answer index includes: Classifying historical question information in the historical question-and-answer data to obtain classified question information; Performing a marking process on question information in the classified question information whose question initiation frequency meets a preset frequency condition to obtain a marked question classification; Performing a weight optimization process on weights of indexes in the initial question-and-answer index corresponding to the marked question classification to obtain the preset question-and-answer index.
6. The Q&A response method according to claim 4, wherein, The optimizing indexes in the initial question-and-answer index based on historical question-and-answer data to obtain the preset question-and-answer index includes: Performing a similarity matching process on historical answer information in the historical question-and-answer data and indexes in the initial question-and-answer index to obtain a similarity matching result; Determining indexes corresponding to similarities greater than a third threshold in the similarity matching result as indexes to be optimized; Performing a weight optimization process on weights of the indexes to be optimized to obtain the optimized question-and-answer index.
7. The Q&A response method according to claim 1, wherein, The method further comprises: In response to the question information, determining a target response path among a first response path for answer response based on the preset question-and-answer index and a second response path for answer response based on real-time documents; Determining the response information corresponding to the question information based on the target response path.
8. The Q&A response method according to claim 7, wherein, The determining a target response path among a first response path for answer response based on the preset question-and-answer index and a second response path for answer response based on real-time documents includes: Predict the state features corresponding to the problem information based on the reinforcement learning model; wherein, the state features include at least one of the matching degree between the problem information and the index in the preset Q&A index, the query response time, and the query accuracy; the query response time includes the response times for answering the problem information based on the first response path and the second response path respectively; the query accuracy includes the accuracies for answering the problem information based on the first response path and the second response path respectively. Determine the first reward function value of the first response path and the second reward function value of the second response path according to the state features. Determine the response path corresponding to the maximum reward function value among the first reward function value and the second reward function value as the target response path.
9. An electronic device, the electronic device includes a construction unit and a determination unit; The construction unit is configured to, in response to the system entering the idle period, construct a preset Q&A index during the idle period. The determination unit is configured to, in response to the input problem information, determine the response information corresponding to the problem information based on the preset Q&A index.
10. An electronic device, the electronic device includes a processor and a memory storing instructions executable by the processor; when the instructions are executed by the processor, the following steps are implemented: In response to the system entering the idle period, construct a preset Q&A index during the idle period. In response to the input problem information, determine the response information corresponding to the problem information based on the preset Q&A index.