Memory-driven question and answer optimization method and device, equipment and storage medium
By introducing memory stream database and self-optimization mechanism into the intelligent question-and-answer system, scoring and preserving historical memory and generating high-level questions, the system solves the accuracy and personalization of the system in complex scenarios, and significantly improves the intelligence of the system Level and user experience.
Patent Information
- Application Number
- CN202411265220.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-31
AI Technical Summary
The existing intelligent question-and-answer system lacks long-term dialogue historical memory capabilities and self-optimization mechanisms, resulting in the inability to provide accurate and personalized answers, especially in complex scenarios.
Through the memory stream database, select high-scoring memories as prompt information and input them into the language model, generate text answers, and save user questions and answers to the database, monitor cumulative score mark key memories, and generate high-level questions based on key memories. , generate optimized answers through language models.
It enhances the memory ability and self-optimization ability of the Q&A system, significantly improves the accuracy of response and user experience quality, can handle complex user interactions and adapt to dynamically changing user needs.
Smart Images

Figure CN119226436A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a memory-driven question-answering optimization method, device, equipment and storage medium. Background Art
[0002] In the financial sector, with the rapid development of digital and intelligent technologies, the traditional financial service model is undergoing profound changes. In particular, in terms of customer service and user interaction, the application of intelligent question-answering systems and intelligent assistants is rapidly gaining popularity. By integrating artificial intelligence (AI) and natural language processing (NLP) technologies, these systems can provide users with a more efficient and personalized service experience, thereby significantly improving the overall quality of financial services.
[0003] More and more financial institutions are beginning to introduce AI-based intelligent question-answering systems. These systems can automatically understand and answer users' questions, greatly improving service efficiency and user satisfaction. However, existing intelligent question-answering systems still face some urgent problems that limit their further application and development in financial services:
[0004] Limited memory capacity: Most current intelligent question-answering systems can only process short-term conversation content and lack the ability to remember long-term conversation history. This means that the system cannot provide more accurate and personalized answers based on the user's historical interaction data, especially when the user asks the same question multiple times, and cannot show truly intelligent performance.
[0005] Lack of reflection and self-optimization mechanism: The current intelligent question-answering system mainly relies on preset rules and models to generate answers, which makes the system limited when facing complex and changing user needs. Due to the lack of self-reflection and self-optimization mechanism, the system cannot continuously improve its answer quality and accuracy through autonomous learning, making it difficult to adapt to the dynamic changes in user needs.
[0006] In addition, the application effect of existing question-answering systems in complex scenarios still needs to be improved. For example, in the field of financial services, user consultations often involve multiple links and complex business processes, such as loan applications, investment consultations, risk assessments, etc. These scenarios place higher demands on the system's understanding ability and answer accuracy. To achieve truly intelligent and personalized financial services, further technological breakthroughs are needed in the memory mechanism and self-optimization capabilities of the question-answering system. Summary of the invention
[0007] The main purpose of the present invention is to provide a memory-driven question-answering optimization method, device, equipment and storage medium, aiming to solve the technical problem that the prior art question-answering system lacks the ability to remember long-term conversation history and self-optimization mechanism, resulting in the inability to provide accurate answers.
[0008] To achieve the above object, the present invention provides a memory-driven question-answering optimization method, comprising:
[0009] Obtaining a current user text question, and assigning points to historical memories in a memory stream database based on the current user text question;
[0010] Selecting a first preset number of history memories ranked high in the scoring order as current prompt information and inputting them into a preset language model to generate a current text answer based on the current user text question;
[0011] The current user text question and the current text answer are saved together in the memory stream database for providing an answer reference when a subsequent user asks a question;
[0012] Monitoring the cumulative scores of historical memories in the memory stream database, and marking historical memories whose cumulative scores reach a preset threshold as key memories;
[0013] Combining the key memory with the current prompt information and inputting it into the preset language model, generating a second preset number of high-level questions;
[0014] Based on the high-level question, an optimized answer is generated through the preset language model, and the optimized answer is saved in the memory stream database to provide a more accurate answer reference when the user asks questions later.
[0015] In one embodiment, scoring the historical memories in the memory stream database based on the current user text question includes:
[0016] Extracting keywords, sentence structures and themes from the current user text question, and matching relevant historical memories from the memory stream database based on the keywords, sentence structures or themes;
[0017] The time distance score is calculated based on the proximity between the timestamp of each historical memory record and the timestamp of the current user's text question.
[0018] Each historical memory is scored according to its frequency of use, user feedback, and success rate in past conversations.
[0019] Scoring the relevance of each historical memory based on the matching degree between it and the keywords of the current user's text question;
[0020] A comprehensive score is generated for each historical memory based on the time distance score, importance score and relevance score, and the scores are sorted by high or low.
[0021] In one embodiment, the cumulative scores of historical memories in the memory stream database are monitored, and before the historical memories whose cumulative scores reach a preset threshold are marked as key memories, the method further includes:
[0022] In the memory stream database, a cumulative score field is provided for each historical memory record to store and update the cumulative score after each user interaction, and a threshold for the cumulative score is set;
[0023] After each user interaction, a comprehensive score is generated for each historical memory, and the newly calculated comprehensive score is added to the cumulative score field of the corresponding historical memory, and the cumulative score is updated in real time;
[0024] Periodically scan the historical memories in the memory stream database, check and update the cumulative score of each historical memory, and set the time decay coefficient of the cumulative score for each historical memory.
[0025] In one embodiment, the key memory and the current prompt information are combined and input into the preset language model to generate a second preset number of high-level questions, including:
[0026] Convert each word or phrase in the key memory and the prompt information into a semantic vector by using an embedding representation technology;
[0027] Through the cosine similarity calculation method, the similarity score is calculated for each semantic vector of the prompt information and each semantic vector of the key memory, and the semantic segments with similarity higher than the similarity threshold are retained and marked as high-relevance segments;
[0028] A multi-head self-attention mechanism is used to fuse highly relevant fragments to generate a comprehensive semantic representation, which represents the integrated key memory and prompt information;
[0029] Input the integrated comprehensive semantic representation into a preset language model to generate preliminary questions;
[0030] A semantic analysis tool is used to perform a semantic depth score on each generated preliminary question, and a second preset number of preliminary questions with the highest scores are used as the high-level questions.
[0031] In one embodiment, the current user text question and the current text answer are saved together in the memory stream database, including:
[0032] Combining the current user text question and the current text answer into a complete historical memory, and saving it in the memory stream database;
[0033] Record and store the timestamp of historical memory, marking the specific storage time of the conversation content;
[0034] Periodically scanning the memory flow database to mark historical memories that have not been called for a period exceeding a preset time threshold;
[0035] According to the preset cleanup strategy, processing operations are performed on the marked historical memory, including permanent deletion, data compression or archiving, to optimize the storage efficiency of the memory stream database.
[0036] In one embodiment, obtaining the current user text question includes:
[0037] Receiving multimodal data input by a user, identifying and separating the multimodal data according to data types, and obtaining a plurality of single-type data;
[0038] If the single type of data is voice data, use voice recognition technology to convert the voice data into text information;
[0039] If the single type of data is image data, using optical character recognition technology to extract text information from the image data;
[0040] If the single type of data is video data, extract key frames from the video data, and apply optical character recognition technology or speech recognition technology to each key frame to extract text information;
[0041] Summarize the text information extracted from multimodal data to generate preliminary user text questions;
[0042] The generated preliminary user text question is semantically optimized and proofread to obtain the current user text question.
[0043] In one embodiment, after generating a current text answer based on the current user text question, the method further includes:
[0044] Replacing the punctuation marks of the sentences in the current text answer with a standard format for speech synthesis;
[0045] Replacing corresponding words in the current text answer according to a preset vocabulary that conforms to voice output habits;
[0046] Select a matching target speech model based on the user's language settings and accent preferences, and load relevant parameters for speech synthesis, including speech rate, pitch, and volume settings;
[0047] The optimized current text answer is input into the target speech model to generate a corresponding target speech answer.
[0048] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a memory-driven question and answer optimization device, wherein the memory-driven question and answer optimization device comprises a memory, a processor, and a memory-driven question and answer optimization program stored in the memory and executable on the processor, wherein the memory-driven question and answer optimization program, when executed by the processor, implements the steps of the memory-driven question and answer optimization method as described above.
[0049] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a computer storage medium, on which a memory-driven question-and-answer optimization program is stored, and when the memory-driven question-and-answer optimization program is executed by a processor, the steps of the memory-driven question-and-answer optimization method as described above are implemented.
[0050] Beneficial effects: The present invention relates to a memory-driven question-answering optimization method, which obtains text questions input by users, assigns scores to historical memories in a memory stream database, selects historical memories with higher scores as prompt information and inputs them into a language model to generate corresponding text answers. The user's questions and generated answers are saved to the memory stream database at the same time, and the cumulative scores of historical memories are monitored. When the cumulative score reaches a preset threshold, it is marked as a key memory. A high-level question is generated by combining the key memory with the current prompt information, and an updated answer is generated through a language model and saved to a database for subsequent reference. The present invention enhances the memory and self-optimization capabilities of the question-answering system, can handle complex user interactions, and significantly improves the system's response accuracy and user experience quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0052] Figure 1 A schematic diagram of a flow chart of an embodiment of a memory-driven question-answering optimization method of the present invention;
[0053] Figure 2 It is a functional module diagram of a preferred embodiment of the memory-driven question-answer optimization device of the present invention;
[0054] Figure 3 This is a structural diagram of the device hardware operating environment involved in the embodiment of the memory-driven question-and-answer optimization device of the present invention. DETAILED DESCRIPTION
[0055] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0056] In the financial sector, with the rapid development of digital and intelligent technologies, the traditional financial service model is undergoing profound changes. In particular, in terms of customer service and user interaction, the application of intelligent question-answering systems and intelligent assistants is rapidly gaining popularity. By integrating artificial intelligence (AI) and natural language processing (NLP) technologies, these systems can provide users with a more efficient and personalized service experience, thereby significantly improving the overall quality of financial services.
[0057] More and more financial institutions are beginning to introduce AI-based intelligent question-answering systems. These systems can automatically understand and answer users' questions, greatly improving service efficiency and user satisfaction. However, existing intelligent question-answering systems still face some urgent problems that limit their further application and development in financial services:
[0058] Limited memory capacity: Most current intelligent question-answering systems can only process short-term conversation content and lack the ability to remember long-term conversation history. This means that the system cannot provide more accurate and personalized answers based on the user's historical interaction data, especially when the user asks the same question multiple times, and cannot show truly intelligent performance.
[0059] Lack of reflection and self-optimization mechanism: The current intelligent question-answering system mainly relies on preset rules and models to generate answers, which makes the system limited when facing complex and changing user needs. Due to the lack of self-reflection and self-optimization mechanism, the system cannot continuously improve its answer quality and accuracy through autonomous learning, making it difficult to adapt to the dynamic changes in user needs.
[0060] In addition, the application effect of existing question-answering systems in complex scenarios still needs to be improved. For example, in the field of financial services, user consultations often involve multiple links and complex business processes, such as loan applications, investment consultations, risk assessments, etc. These scenarios place higher demands on the system's understanding ability and answer accuracy. To achieve truly intelligent and personalized financial services, further technological breakthroughs are needed in the memory mechanism and self-optimization capabilities of the question-answering system.
[0061] See also Figure 1 , Figure 1 A flowchart of an embodiment of a memory-driven question-answering optimization method provided by the present invention. It should be noted that although a logical sequence is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0062] like Figure 1 As shown, the memory-driven question-answering optimization method proposed in the present invention comprises the following steps:
[0063] S10, obtaining a current user text question, and assigning points to historical memories in a memory stream database based on the current user text question;
[0064] In this embodiment, the system receives input data from the user terminal, which may be multimodal data such as text, voice, image or video. This step does not limit the data form, which means that the system can receive and process data in any form input by the user.
[0065] For the received multimodal data, the system converts it into a processable text form through the corresponding parsing module. For example, voice data is converted into text through speech recognition (ASR) technology, and image data is extracted from text content through optical character recognition (OCR) technology. Here, the parsing methods have equivalent operations, speech recognition can be replaced by other speech processing technologies, and OCR can be replaced by more efficient image text extraction technology.
[0066] The system performs semantic analysis on the converted text data to extract key elements such as keywords, sentence structure, and themes. Semantic analysis can be implemented in a variety of ways, including rule-based natural language processing (NLP) methods or semantic analysis models based on deep learning.
[0067] The system uses the semantic information in the current user's text question to retrieve relevant historical memories in the memory stream database. This retrieval process can be done in many ways, such as based on keyword matching, topic similarity calculation, or context relevance analysis.
[0068] The system assigns points based on the relevance of the retrieved historical memory to the current question. The scoring criteria usually include temporal proximity, usage frequency, user feedback, and semantic matching. Temporal proximity can be calculated through timestamp difference, time weighting function, etc.; usage frequency and user feedback can be implemented through counting and scoring models; semantic matching depends on semantic similarity algorithms.
[0069] The system weights each scoring criterion to generate a comprehensive score for each historical memory. The weighting method can be flexibly adjusted according to the design requirements of the system, such as linear weighting, nonlinear weighting, etc. These weighting methods produce a unified scoring result based on the scoring.
[0070] In one specific implementation, a user inquires about the credit card points redemption rules. The system converts voice input into text through voice recognition and extracts keywords such as "credit card", "points", and "redemption". In the process of assigning points, the system pays special attention to the user's historical consumption behavior, associates the user's consumption record with the historical memory in the memory stream database, and assigns points. The system finally selects several historical memories with the highest score as prompt information, generates answers, and saves them. When saving historical records, the system not only saves the user's questions and generated answers, but also saves the user's consumption behavior analysis results to optimize future queries.
[0071] Through the above steps, not only can accurate answers be generated based on the user's current questions, but also past interaction history can be effectively utilized to improve the intelligence level of the question-answering system. The system's memory depth and self-optimization capabilities are significantly enhanced, which can better handle complex user queries and significantly improve user experience and service quality in financial scenarios.
[0072] S20, selecting a first preset number of history memories ranked high in the scoring order as current prompt information and inputting them into a preset language model to generate a current text answer based on the current user text question;
[0073] In this embodiment, in the memory stream database, by assigning scores to all relevant historical memories, the system selects a number of items with the highest scores (determined according to a first preset number). These scores are based on a series of criteria, such as temporal proximity, frequency of use, semantic matching, user feedback, etc. The scoring process can use a variety of algorithms, such as weighted average, scoring model, etc., with the purpose of screening out the historical memories that are most relevant to the current user text question.
[0074] The selected historical memories with the highest ratings will be used as prompts. These prompts include content snippets related to the current user's question, which will be input into the preset language model in the subsequent steps to help the model generate more accurate and relevant answers.
[0075] The selected prompt information will be passed as input data to a pre-trained language model. The language model can be a deep learning model such as GPT-3, which has the ability to process and generate natural language text. The role of the prompt information is to provide context and background for the model, so that the model can better understand the context of the current question and generate a more accurate text answer.
[0076] By inputting prompt information, the preset language model generates an answer based on the current user's text question. The answer is generated under the guidance of the prompt information, strives to be highly relevant to the user's question, and can accurately respond to the user's needs.
[0077] In one specific implementation, a user asks for a risk assessment of an investment portfolio on a financial platform. The system first selects several historical memories with high scores from the memory stream database. These memories include the user's previous portfolio performance, current market volatility, and risk assessment results of similar portfolios. In the scoring process, the system specifically considers the impact of market volatility and uses market volatility data to dynamically adjust the scores of historical memories. These high-scoring historical memories are input into a preset language model to generate a risk assessment report for the user's current investment portfolio. The report content reflects the latest market conditions and provides users with detailed risk management recommendations.
[0078] By using the score selection history memory as prompt information, the system can significantly improve the accuracy and relevance of the answers generated by the language model. It not only enhances the system's ability to understand user questions, but also makes the generated answers closer to the user's actual needs. In financial scenarios, it helps to improve service quality and user satisfaction, ensuring that users can obtain the most relevant financial information and suggestions in a timely manner.
[0079] S30, saving the current user text question and the current text answer together in the memory stream database, so as to provide an answer reference when a subsequent user asks a question;
[0080] In this embodiment, the system combines the current user's text question and the generated text answer into a complete history record. This record contains not only the content of the question and answer, but also related metadata such as timestamp, user ID, session context, etc. This information is saved to the memory stream database in a structured data form (such as JSON, XML, etc.). This step ensures that the system can quickly and accurately retrieve the complete question and answer pair in future queries.
[0081] When saving data, the system automatically adds a timestamp to each record, marking the specific time when the record was generated. This operation helps to prioritize historical records based on the time when subsequent users ask questions. In addition, if the same question has multiple answers at different times, the system may use a version control mechanism to retain different versions of the answers for easy comparison and optimization.
[0082] To optimize storage efficiency, the system may compress or archive stored data. For records that have not been used for a long time, the system can compress and archive them to save storage space while ensuring that these records can still be retrieved when needed. Optimization of data storage ensures that the system can still maintain efficient performance when processing a large number of user questions.
[0083] The saved historical question-answer pairs will be used as references in future user questions. When the system receives similar questions, it can prioritize retrieving these saved records to provide a quick response based on historical data. The system decides whether to directly adopt the historical answer or use the historical answer as a reference for generating a new answer by matching the semantic similarity between the current question and the saved records.
[0084] In another specific implementation, a user inquires about the details of a loan interest rate. After the system generates an answer, it saves the question and the answer, and also saves the current market interest rate as metadata. This record is marked as "sensitive to market changes". When market interest rates change in the future, the system will automatically update these records to ensure that historical answers can reflect the latest market conditions. When the user asks the question again, the system will prioritize retrieving these records and adjust the answer content as needed. In addition, the system introduces a version control mechanism. When the same question has different answers at different time points, the system saves multiple versions for comparison and optimization.
[0085] By saving the current user's questions and answers together in the memory stream database, the system can effectively record and utilize historical interaction data. Not only does it enhance the system's memory ability, it also enables the system to quickly provide references for future user questions, thereby improving response speed and the relevance of answers. In financial scenarios, saving these historical records is particularly important because they can help the system provide more accurate and timely services when faced with complex and frequently changing market conditions.
[0086] S40, monitoring the cumulative scores of historical memories in the memory stream database, and marking historical memories whose cumulative scores reach a preset threshold as key memories;
[0087] In this embodiment, a cumulative score field is set for each historical memory in the memory flow database to record the cumulative score of the memory in multiple user interactions. Whenever the system interacts with the user and involves a historical memory, the system will score the memory based on factors such as relevance, frequency of use, and time proximity, and accumulate the score into the cumulative score field.
[0088] The system continuously monitors the cumulative scores of all historical memories to ensure that each score update is reflected in the cumulative score field. The monitoring process may involve a variety of technical implementations, such as periodic database scanning, triggered updates (updating the score immediately after each interaction), etc. Different monitoring methods can be adjusted according to the needs of the system and the frequency of user interactions.
[0089] The system sets a predetermined threshold for the cumulative score, such as 100 points. When the cumulative score of a historical memory reaches or exceeds the threshold, the system triggers a specific action, such as marking the memory as a "key memory". The threshold setting can be adjusted based on historical data analysis or system optimization strategy.
[0090] Once the cumulative score of a historical memory reaches a preset threshold, the system automatically adds a label or tag to the memory, marking it as "important memory." This operation enables the system to prioritize these important memories in future queries, ensuring that they have higher weight and priority when generating answers. The labeling process includes not only simple labeling operations, but may also involve priority sorting, index updates, etc.
[0091] By continuously monitoring the cumulative score of historical memories and marking them as key memories when they reach the preset threshold, the system can dynamically adjust the data priority in the memory stream database. This not only improves the accuracy and efficiency of system responses, but also ensures that when users make future inquiries, the system can prioritize the most relevant historical data, providing users with more accurate and personalized services, and significantly improving user experience and service quality.
[0092] S50, combining the key memory and the current prompt information and inputting them into the preset language model to generate a second preset number of high-level questions;
[0093] In this embodiment, the system first selects the key memories whose cumulative scores reach the threshold. These memories represent the historical interaction data that is highly relevant to the current user's question. At the same time, the current prompt information is the high-scoring historical memory that is most relevant to the current user's text question that is selected from the memory stream database. The system integrates these key memories with the current prompt information to form a comprehensive data input.
[0094] The system takes the integrated key memory and current prompt information as input and passes them into the preset language model. This model is usually a natural language processing model based on deep learning, such as the GPT series or similar language generation models. The model processes these inputs to identify key semantic information and relationships.
[0095] The preset language model generates a set of high-level questions based on the input semantic information. These questions are derived through deep semantic analysis of the input key memory and prompt information. High-level questions usually represent the deeper meaning or broader association of the current user's question, aiming to help the system further understand user needs and provide more accurate answers.
[0096] The system screens the generated high-level questions and retains the top two preset questions with the most relevance and depth. These questions will serve as key reference points when the system generates answers to ensure that the generated answers can effectively respond to the user's complex needs.
[0097] In one specific implementation, a user queries a high-level risk assessment of a portfolio on a financial platform. After the system selects the key memory and the current prompt information, it uses a fusion method based on the contextual attention mechanism to integrate the two. Specifically, the system performs deep semantic analysis on the key memory and the prompt information through the contextual attention mechanism, identifies the implicit semantic relationship between the two, and generates high-level questions based on this. The contextual attention mechanism can effectively capture long-distance dependencies in the input data, thereby generating more insightful high-level questions.
[0098] In other specific embodiments, the user queries the high-level rules for points redemption on the credit card service platform. After integrating the key memories and current prompt information, the system adopts a generation method based on generative adversarial networks. Through GANs, i.e., Generative Adversarial Networks, the system generates a set of high-level questions. The generator of the model is responsible for creating possible high-level questions, while the discriminator continuously optimizes the quality of these questions. The adversarial training mechanism of GANs can prompt the system to generate more innovative and relevant high-level questions.
[0099] Generative adversarial networks are a deep learning model that consists of two neural networks: a generator and a discriminator. The two networks are trained in a competitive manner. Generator: The task of the generator is to generate samples similar to real data based on the input. The generator will try to generate possible high-level questions. These questions should be as close as possible to what the system considers to be "ideal answers" or high-quality questions. Discriminator: The task of the discriminator is to distinguish between samples generated by the generator and real samples. In this process, the discriminator will evaluate the high-level questions generated by the generator to determine whether these questions are sufficiently relevant and innovative. Through continuous training, the discriminator can force the generator to generate higher quality and more relevant questions.
[0100] By combining key memory with the current prompt information input language model to generate high-level questions, the system can understand user needs at a deeper level and provide more accurate and personalized answers. This effectively improves the intelligence level of the system, especially when dealing with complex and diverse user questions, and can significantly improve the relevance of answers and user satisfaction.
[0101] S60, based on the high-level question, generate an optimized answer through the preset language model, and save the optimized answer to the memory stream database to provide a more accurate answer reference when the user asks questions later.
[0102] In this embodiment, the system generates optimized answers through a preset language model. Specifically, high-level questions are passed into the language model as input data, and the model generates corresponding answers based on the semantic structure and content of the high-level questions. This step ensures that the generated answers are based on deep analysis and highly relevant context, making the answers more accurate and in-depth.
[0103] The generated optimized answers may undergo further optimization, including semantic verification, logical consistency checks, etc. The system may use additional natural language processing techniques or machine learning algorithms to ensure that the generated answers are not only correct, but also highly semantically relevant and coherent.
[0104] Verified and optimized answers will be saved in the memory stream database. This step ensures that the system can refer to and call these optimized answers in future user questions, thereby improving response speed and answer accuracy. When saving, the system may store the answers together with related high-level questions, timestamps, user IDs and other metadata for subsequent retrieval and use.
[0105] The saved optimized answers will be given priority reference by the system when users ask questions in the future. The system will decide whether to directly provide the saved answers or generate new answers by matching the current user questions with the saved high-level questions and answers. In this way, the system can continuously accumulate knowledge and gradually improve the accuracy and relevance of answers.
[0106] In one embodiment, during the initial interaction between the user and the system, the system has generated and saved the relevant text answer, and saved it together with the user's text question in the memory stream database. The system also scores and marks this historical memory to make it a key memory. Subsequently, the user inputs a new question to the system again. The user inputs a new question, such as "Does my investment portfolio need to be adjusted in the current market environment?" The system first extracts the keywords, sentence structure and theme of the current user's question, and uses this information to match it in the memory stream database.
[0107] The system identifies the previously saved key memory, which contains the user's previous query about the portfolio and the system-generated answer. This memory has been accessed many times and has a high cumulative score, so it is selected first when matching. The system combines the current user question with the key memory, converts the text content into a semantic vector through the embedding representation technology, and uses the multi-head self-attention mechanism to generate a comprehensive semantic representation.
[0108] This comprehensive semantic representation is fed into a pre-set language model, and the system generates several high-level questions, such as “How has the current market environment changed compared to the past?” and “What external economic factors may affect the performance of the current portfolio?”
[0109] Based on the generated high-level questions, the system combines current market data and user historical data to generate text answers to the current questions. The answers may include content such as "Based on the current market volatility, it is recommended to make appropriate adjustments to the investment portfolio to reduce risks."
[0110] The system saves the new user text questions and the generated text answers into the memory stream database, updates the relevant cumulative score fields, and dynamically adjusts the key memory marks according to the new interaction situation.
[0111] By utilizing the updated memory stream database, the system can better understand the user's historical interactions and generate more accurate responses. This enables the system to provide more in-depth and coherent suggestions when processing repeated or related user queries, significantly improving the accuracy of responses and user experience. At the same time, the system further improves its self-learning capabilities and intelligent performance by continuously updating and optimizing the memory stream database.
[0112] In another specific implementation, a user asks about the best repayment strategy for a loan. Based on high-level questions, the system uses a multimodal fusion-based answer generation method. The system integrates multimodal data such as loan interest rate changes, user historical repayment behavior, and market economic indicators into the model to generate a multi-dimensional answer. The generated answer not only takes into account the interest rate factor, but also comprehensively considers multiple factors such as the user's credit score and repayment history to ensure the comprehensiveness of the answer. The final answer is saved in the memory stream database for future user queries.
[0113] By generating optimized answers based on high-level questions and saving them to the memory stream database, the system can continuously accumulate and update the knowledge base, making future answers more accurate and relevant. This not only improves the system's ability to handle complex questions, but also significantly enhances the user experience, ensuring that users can get more valuable and timely answers.
[0114] The present invention relates to a memory-driven question-answering optimization method, which obtains text questions input by users, assigns points to historical memories in a memory stream database, selects historical memories with higher scores as prompt information and inputs them into a language model to generate corresponding text answers. The user's questions and generated answers are saved to the memory stream database at the same time, and the cumulative scores of historical memories are monitored. When the cumulative scores reach a preset threshold, they are marked as key memories. High-level questions are generated by combining key memories with current prompt information, and updated answers are generated through a language model and saved to a database for subsequent reference. The present invention enhances the memory and self-optimization capabilities of the question-answering system, can handle complex user interactions, and significantly improves the system's response accuracy and user experience quality.
[0115] In one embodiment, in the above S10, scoring the historical memories in the memory stream database based on the current user text question includes:
[0116] S101, extracting keywords, sentence structures and themes from the current user text question, and matching relevant historical memories from the memory stream database based on the keywords, sentence structures or themes;
[0117] S102, scoring the time distance according to the proximity between the timestamp of each historical memory record and the timestamp of the current user text question;
[0118] S103, scoring the importance of each historical memory based on its usage frequency, user feedback, and success rate in past conversations;
[0119] S104, scoring the relevance of each historical memory according to the matching degree between each historical memory and the keyword of the current user text question;
[0120] S105, generating a comprehensive score for each historical memory based on the time distance score, importance score and relevance score, and sorting them by score.
[0121] In this embodiment, the system first performs a semantic analysis on the current user text question to extract the keywords, sentence structure and theme. Keywords may be the core words or phrases in the user's question, the sentence structure includes grammatical features and sentence patterns, and the theme is the core content or intention of the question. Through natural language processing (NLP) technology, such as word vectors (Word2Vec) or topic modeling (LDA), the system can accurately identify and extract these elements. Based on the extracted keywords, sentence structure and theme, the system searches and matches relevant historical memories in the memory stream database. The matching process can be achieved through semantic similarity calculations (such as cosine similarity) to ensure that historical records that are highly relevant to the current question are found.
[0122] For each matched historical memory, the system will score its time-relevance based on its timestamp and the timestamp of the current user's question. The time-relevance score reflects the time relevance of the historical memory to the current question. Generally, newer memories may have higher relevance and therefore higher scores. Time-relevance scoring can be implemented using a linear decay function or other time-related scoring mechanisms.
[0123] For each matched historical memory, the system will score it based on how close its timestamp is to the timestamp of the current user's text question. The closer the time is, the higher the score. This scoring method ensures that the system prioritizes those historical memories that are most relevant to the current time.
[0124] The system scores the importance of each historical memory based on its frequency of use in past conversations, user feedback (such as whether the user is satisfied with the answer) and success rate (such as the accuracy of the answer). Memories that are frequently used and receive positive feedback will receive higher scores.
[0125] The system scores each historical memory based on the degree of match between the keywords of the current user's text question and the historical memory. By comparing the keywords of the current question with the keywords in the historical memory, the semantic similarity is calculated to obtain a relevance score. The higher the relevance, the higher the score. Based on the time distance score, importance score, and relevance score, the system generates a comprehensive score for each historical memory and sorts them by score. The sorted historical memories will be used as reference data in subsequent steps.
[0126] In one specific implementation, the system extracts keywords, sentence structures, and topics from the current user text question to match historical memories in the memory stream database. In this implementation, the system uses a keyword matching technology based on semantic embedding to semantically embed keywords and historical memories in user questions, and then calculates their distance in a high-dimensional semantic space. In this way, the system can capture deeper semantic associations between keywords and historical memories, rather than just relying on superficial word matching.
[0127] In another specific implementation, the system scores the matched historical memories based on their time distance. In this implementation, the system uses a time decay function to process the timestamps of the historical memories. The time decay function can dynamically adjust the weight of the historical memories based on how far away they are from the current time. For example, the system can set an exponential decay function so that the more distant the historical memories are, the faster their scores decay, thereby giving priority to newer historical data.
[0128] Through the above steps, this embodiment can effectively filter out the historical memory that is most relevant to the current user's question. This ensures that the system can refer to the most valuable historical data when generating answers, thereby providing more accurate and relevant answers. This is particularly important in fields such as finance and investment that require highly accurate answers, and significantly improves the system's intelligent performance and user satisfaction.
[0129] In one embodiment, before the above S40, the method further includes:
[0130] S401, in the memory stream database, a cumulative score field is set for each historical memory record to store and update the cumulative score after each user interaction, and a threshold value of the cumulative score is set;
[0131] S402, after each user interaction, generate a comprehensive score for each historical memory, add the newly calculated comprehensive score to the cumulative score field of the corresponding historical memory, and update the cumulative score in real time;
[0132] S403, regularly scan the historical memories in the memory flow database, check and update the cumulative score of each historical memory, and set a time decay coefficient of the cumulative score for each historical memory.
[0133] In this embodiment, the system sets a cumulative score field for each historical memory record in the memory stream database. This field is used to store the cumulative score after each user interaction, and will be continuously updated with multiple user interactions. The system sets a cumulative score threshold. When the cumulative score reaches or exceeds this threshold, the system will mark the historical memory as a key memory. Each time a user interacts with the system, the system will generate a comprehensive score based on multiple dimensions such as time distance, importance, and relevance. The system adds this comprehensive score to the cumulative score field of the corresponding historical memory. This update process is carried out in real time to ensure that the cumulative score of each historical memory always reflects the latest user interaction information. The system will regularly scan all historical memories in the memory stream database, check and update the cumulative score of each historical memory. In order to avoid the cumulative score being too high to affect the judgment of the system, the system sets a time decay coefficient for each historical memory. This coefficient will reduce the cumulative score according to the passage of time, thereby ensuring that more recent interactions and memories have a greater weight in the score.
[0134] In one specific implementation, the system uses a cumulative score update method based on weighted moving average when monitoring the cumulative score of historical memories in the memory stream database. After each user interaction, the system not only updates the comprehensive score, but also applies a weighted moving average algorithm to give a higher weight to the latest score to dynamically adjust the growth rate of the cumulative score. The weighted moving average makes the most recent user behavior have a greater impact on the cumulative score, thereby identifying historical memories with higher relevance more quickly.
[0135] In another specific embodiment, the system uses a time decay model based on threshold segmentation when periodically scanning the memory stream database. Different from a simple time decay coefficient, the system sets different decay coefficients for different time periods. For example, memories within the last month use a lower decay coefficient, while memories older than that use a higher decay coefficient. This segmented decay model can more accurately control the impact of memories in different time periods, so that newer data contributes more to the cumulative score.
[0136] In this embodiment, by setting the cumulative score field, updating the score in real time, scanning regularly and applying the time decay coefficient, the system can dynamically adjust the priority of historical memory, ensuring that the system can give priority to the latest and most relevant memory, thereby providing more accurate and effective answers to users' future queries.
[0137] In one embodiment, the above S50 includes:
[0138] S501, converting each word or phrase in the key memory and the prompt information into a semantic vector by using an embedding representation technology;
[0139] S502, using a cosine similarity calculation method, scoring the similarity between each semantic vector of the prompt information and each semantic vector of the key memory, retaining semantic segments with similarity higher than a similarity threshold, and marking them as highly relevant segments;
[0140] S503, using a multi-head self-attention mechanism to fuse the highly relevant fragments to generate a comprehensive semantic representation, where the comprehensive semantic representation represents the integrated key memory and prompt information;
[0141] S504, inputting the integrated comprehensive semantic representation into a preset language model to generate a preliminary question;
[0142] S505, using a semantic analysis tool to perform semantic depth scoring on each generated preliminary question, and taking a second preset number of preliminary questions with higher scores as the high-level questions.
[0143] In this embodiment, the system first embeds each word or phrase in the key memory and current prompt information, that is, converts these words or phrases into semantic vectors through embedding representation technology. Embedding representation (such as Word2Vec, BERT and other technologies) converts text content into high-dimensional vectors, making words with similar semantics closer in the vector space.
[0144] The system measures the similarity between each semantic vector of the prompt information and each semantic vector of the key memory by calculating the cosine similarity. Cosine similarity is a commonly used similarity measurement method, which is suitable for measuring the angular similarity between vectors in high-dimensional space. The system retains semantic fragments with similarity higher than the preset threshold and marks these fragments as highly relevant fragments. These fragments represent the strongly relevant semantic content between the prompt information and the key memory.
[0145] The multi-head self-attention mechanism is used to fuse the semantic fragments marked as highly relevant to generate a comprehensive semantic representation. The multi-head self-attention mechanism can simultaneously capture the dependencies between different parts of the input data, so that the generated comprehensive semantic representation better reflects the semantic content of the integrated key memory and prompt information.
[0146] The generated comprehensive semantic representation is input into the preset language model, and the model generates a set of preliminary questions by processing the semantic representation. These questions reflect the deep semantic needs of the current user's text questions and contain important information related to key memory and prompt information.
[0147] The system uses semantic analysis tools to score the semantic depth of the generated preliminary questions. These scores are based on the semantic complexity, relevance, and potential value of each question. Ultimately, the system will select the second preset number of preliminary questions with the highest scores as high-level questions. These questions will be used to generate more accurate answers in the future.
[0148] This embodiment can better capture the deep semantic connotation of user needs by processing the key memory and prompt information into semantic vectors and generating high-level questions through a multi-head self-attention mechanism. This enables the system to generate more accurate and relevant questions, thereby improving the quality of answers and user satisfaction, and significantly enhancing the intelligent performance of the system, especially in complex fields such as financial services.
[0149] In one embodiment, in the above S30, saving the current user text question and the current text answer together in the memory stream database includes:
[0150] S301, combining the current user text question and the current text answer into a complete historical memory, and saving it in the memory stream database;
[0151] S302, recording and storing the timestamp of historical memory, marking the specific storage time of the conversation content;
[0152] S303, periodically scanning the memory flow database, marking historical memories that have not been called for a period exceeding a preset time threshold;
[0153] S304, according to the preset cleaning strategy, performing processing operations on the marked historical memory, the processing methods include permanent deletion, data compression or archiving, so as to optimize the storage efficiency of the memory stream database.
[0154] In this embodiment, the system combines the current user's text question and the generated text answer into a complete historical memory record. This record not only includes the user's question content and the system's answer content, but may also contain relevant context information and metadata. The combined historical memory will be stored in the memory stream database as basic data for future reference and answer generation.
[0155] When saving historical memories, the system will record and store the timestamp associated with the memory. This timestamp marks the specific time when the user asked the question and the system answered it, allowing the system to filter, sort and clean up the memory based on the time dimension in the future.
[0156] The system periodically scans the memory stream database to check all stored historical memories. The system marks historical memories that have not been called up within a certain period of time, that is, records that have not been referenced, used or queried again. This marking process helps identify old data that may need to be cleaned or compressed.
[0157] According to the system's preset cleanup strategy, the marked historical memory will be processed. Processing methods include but are not limited to permanent deletion (completely removing data from the database), data compression (reducing the storage space occupied by data), or archiving (moving data to a lower priority storage area). These operations are designed to optimize the storage efficiency of the memory stream database, ensure that the system can run efficiently, and retain the most relevant data for future queries.
[0158] In one specific implementation, the system uses a distributed storage method based on blockchain when saving the current user text question and the current text answer to the memory stream database. Whenever a user interacts with the system, the system will package the generated complete historical memory into blocks and save it to multiple nodes through blockchain technology. This not only improves the security of the data, but also prevents the data from being tampered with. The immutability of blockchain technology ensures the authenticity and integrity of historical memory.
[0159] In another specific implementation, the system uses high-precision time synchronization technology when recording and storing the timestamps of historical memories. This technology uses the precise time signal provided by the Network Time Protocol (NTP) or the Global Positioning System (GPS) to ensure that the timestamp of each historical memory has microsecond accuracy. This method is particularly suitable for time-sensitive application scenarios to ensure the temporal consistency and accuracy of historical data.
[0160] This embodiment saves the user text questions and system answers together in the memory stream database, and scans and cleans them regularly, so that the system can efficiently manage and optimize its storage resources. This not only ensures that the system can save and use the most relevant historical memory, but also improves the overall performance and response speed of the database by cleaning invalid or redundant data.
[0161] In one embodiment, in the above S10, obtaining the current user text question includes:
[0162] S106, receiving multimodal data input by a user, identifying and separating the multimodal data according to data types, and obtaining a plurality of single-type data;
[0163] S107, if the single type of data is voice data, convert the voice data into text information using voice recognition technology;
[0164] S108, if the single type of data is image data, extract text information from the image data using optical character recognition technology;
[0165] S109, if the single type of data is video data, extract key frames from the video data, and apply optical character recognition technology or speech recognition technology to each key frame to extract text information;
[0166] S110, summarizing text information extracted from the multimodal data to generate preliminary user text questions;
[0167] S111, semantically optimizing and proofreading the generated preliminary user text question to obtain the current user text question.
[0168] In this embodiment, the system first receives multimodal data input by the user, which can be in various forms such as voice, image, video, etc. Through data type recognition technology, the system can automatically identify and separate these multimodal data and classify them into a single type of data. This step ensures that different types of data can be processed separately, maximizing the efficiency and accuracy of data processing.
[0169] If the system recognizes that the input data is of voice type, the system will use speech recognition technology (such as ASR, Automatic Speech Recognition) to convert the voice data into text information. Speech recognition technology converts the user's voice into corresponding text content by analyzing the audio signal, ensuring that the voice input can be recognized and used by subsequent processing steps.
[0170] If the input data is of image type, the system will use optical character recognition (OCR) technology to extract text information from the image data. OCR technology analyzes the shape of characters in the image and converts them into digital text, so that the text content in the image can be recognized and processed.
[0171] If the input is video data, the system will first extract key frames from the video, which represent images with important information in the video. Then, the system applies OCR technology or speech recognition technology to each key frame to extract text information from it. In this way, the system can extract useful text data from the video to support subsequent processing.
[0172] The system summarizes all text information extracted from multimodal data and generates preliminary user text questions. The summarized text information may come from multiple sources (voice, image, video), and the system forms a preliminary text question representation by integrating this information.
[0173] The system performs semantic optimization and proofreading on the generated preliminary user text questions. This step includes optimizing the grammar, logical structure, and semantic consistency of the text questions to ensure that the final user text questions accurately reflect the user's true intentions.
[0174] In one specific implementation, the system uses a key frame extraction technology based on time series modeling when processing video data. Different from the traditional method of extracting key frames based on the importance of content, the time series modeling technology analyzes the time series relationship between video frames, identifies the key frames that best represent the video content, and further extracts text information from them.
[0175] By identifying, processing, summarizing and optimizing multimodal data, the system can more accurately generate text questions that reflect the user's intentions, significantly improving the system's ability to process complex input data, and enhancing the accuracy of user interaction and the fluency of user experience.
[0176] In one embodiment, in the above S20, after generating the current text answer based on the current user text question, the method further includes:
[0177] S201, replacing the punctuation marks of the sentence in the current text answer with a standard format for speech synthesis;
[0178] S202, replacing corresponding words in the current text answer according to a preset vocabulary that conforms to voice output habits;
[0179] S203, selecting a matching target speech model according to the user's language settings and accent preferences, and loading relevant parameters for speech synthesis, including speech speed, pitch, and volume settings;
[0180] S204, inputting the optimized current text answer into the target speech model to generate a corresponding target speech answer.
[0181] In this embodiment, after generating the current text answer, the system replaces the punctuation marks in the text with a format that meets the speech synthesis standard. Different speech synthesis systems may have different ways of handling punctuation marks, such as converting a period into a speech mark suitable for a pause, or converting a question mark into an instruction to increase the tone of voice. Through this replacement, the system can ensure that the generated voice answer has a natural and fluent voice expression effect. The system replaces certain words in the current text answer according to the voice output habits. For example, certain abbreviations or technical terms may not be suitable for direct use in speech synthesis, so they need to be replaced with a more understandable form. The system presets a vocabulary table and performs replacement operations according to the rules of the table to ensure that the speech synthesis result is more natural and adapts to the understanding of the target audience.
[0182] Based on the user's language settings and accent preferences, the system selects a matching target voice model. This step ensures that the generated voice response conforms to the user's language and accent habits. In addition, the system also loads relevant parameters for speech synthesis, such as speech rate, pitch, and volume settings. These parameters are adjusted according to the user's preferences to generate more personalized voice output. After completing the above optimization steps, the system inputs the final text into the target voice model to generate the corresponding voice response. This voice response will be provided to the user in a synthesized manner to ensure that it is natural and fluent in voice and meets the user's expectations.
[0183] In one specific implementation, after generating a text answer, the system uses a context-aware punctuation replacement algorithm to replace the punctuation of the sentence with the standard format for speech synthesis. The algorithm intelligently determines the tone and structure of the sentence by analyzing the context of the text, and then replaces the punctuation. For example, when a sentence is detected to be a question, the system may replace the period with a marker that increases the tone in speech synthesis, and may add a pause marker in a declarative sentence to enhance the naturalness of the speech.
[0184] In another specific implementation, in the vocabulary replacement phase, the system adopts a dynamic vocabulary replacement model based on user preferences. The system no longer relies solely on a preset vocabulary list, but dynamically adjusts the vocabulary list based on the user's historical usage habits and preferences. For example, the system will analyze which expressions the user prefers to use in past interactions, and then when generating voice answers, it will prioritize replacing them with words that the user is accustomed to, thereby improving the user experience.
[0185] This embodiment can generate a more natural voice answer that is more in line with user habits by performing punctuation replacement, vocabulary replacement, voice model selection and parameter loading after generating the current text answer. This ensures the fluency and accuracy of voice output, and can provide highly personalized voice services, especially when different languages, accents and user preferences are involved. This not only improves the user experience, but also enhances the applicability and flexibility of the system in speech synthesis.
[0186] The present invention also provides a memory-driven question-answering optimization device, referring to Figure 2 , Figure 2 This is a functional module diagram of a preferred embodiment of the memory-driven question-answering optimization device of the present invention. The memory-driven question-answering optimization device comprises:
[0187] A text processing and scoring module, which obtains a current user text question and scores the historical memory in the memory stream database based on the current user text question;
[0188] A prompt selection and answer generation module selects a first preset number of history memories with the highest scores as current prompt information and inputs them into a preset language model to generate a current text answer based on the current user text question;
[0189] A memory stream update module saves the current user text question and the current text answer together in the memory stream database, so as to provide an answer reference when a subsequent user asks a question;
[0190] A key memory marking module monitors the cumulative score of historical memories in the memory stream database, and marks historical memories whose cumulative scores reach a preset threshold as key memories;
[0191] A question generation module combines the key memory and the current prompt information and inputs them into the preset language model to generate a second preset number of high-level questions;
[0192] The memory reflection module generates an optimized answer based on the high-level question through the preset language model, and saves the optimized answer to the memory stream database to provide a more accurate answer reference when the user asks questions later.
[0193] The specific implementation of the memory-driven question-and-answer optimization device of the present invention is basically the same as the various embodiments of the above-mentioned memory-driven question-and-answer optimization method, and will not be repeated here.
[0194] The present invention also provides a memory-driven question-answering optimization device, such as Figure 3As shown, the memory-driven question-answer optimization device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0195] Those skilled in the art will understand that Figure 3 The hardware structure of the memory-driven question-and-answer optimization device shown in the figure does not constitute a limitation of the memory-driven question-and-answer optimization device, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0196] like Figure 3 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a memory-driven question-answering optimization program. The operating system is a program for managing and controlling the memory-driven question-answering optimization device and software resources, and supports the operation of the network communication module, the user interface module, the memory-driven question-answering optimization program, and other programs or software; the network communication module is used to manage and control the network interface 1004; and the user interface module is used to manage and control the user interface 1003.
[0197] exist Figure 3 In the hardware structure of the memory-driven question-and-answer optimization device shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the client and communicate data with the client; the processor 1001 can call the memory-driven question-and-answer optimization program stored in the memory 1005, and perform the same operations as the memory-driven question-and-answer optimization method.
[0198] The specific implementation of the memory-driven question-and-answer optimization device of the present invention is basically the same as the various embodiments of the above-mentioned memory-driven question-and-answer optimization method, and will not be repeated here.
[0199] In addition, an embodiment of the present invention also proposes a computer storage medium, on which a memory-driven question-and-answer optimization program is stored. When the memory-driven question-and-answer optimization program is executed by a processor, the steps of the memory-driven question-and-answer optimization method as described above are implemented.
[0200] The specific implementation of the computer storage medium of the present invention is basically the same as the various embodiments of the above-mentioned memory-driven question-answering optimization method, and will not be repeated here.
Claims
1. A memory-driven question-answering optimization method, characterized in that: The following steps are involved: Obtaining a current user text question, and assigning points to historical memories in a memory stream database based on the current user text question; Selecting a first preset number of history memories ranked high in the scoring order as current prompt information and inputting them into a preset language model to generate a current text answer based on the current user text question; The current user text question and the current text answer are saved together in the memory stream database for providing an answer reference when a subsequent user asks a question; Monitoring the cumulative scores of historical memories in the memory stream database, and marking historical memories whose cumulative scores reach a preset threshold as key memories; Combining the key memory with the current prompt information and inputting it into the preset language model, generating a second preset number of high-level questions; Based on the high-level question, an optimized answer is generated through the preset language model, and the optimized answer is saved in the memory stream database to provide a more accurate answer reference when the user asks questions later.
2. The memory-driven question-answering optimization method according to claim 1, characterized in that: Assigning points to the historical memories in the memory stream database based on the current user text question includes: Extracting keywords, sentence structures and themes from the current user text question, and matching relevant historical memories from the memory stream database based on the keywords, sentence structures or themes; The time distance score is calculated based on the proximity between the timestamp of each historical memory record and the timestamp of the current user's text question. Each historical memory is scored according to its frequency of use, user feedback, and success rate in past conversations; Scoring the relevance of each historical memory based on the matching degree between it and the keywords of the current user's text question; A comprehensive score is generated for each historical memory based on the time distance score, importance score and relevance score, and the scores are sorted by high or low.
3. The memory-driven question-answering optimization method according to claim 1, characterized in that: Monitoring the cumulative scores of historical memories in the memory stream database and marking the historical memories whose cumulative scores reach a preset threshold as key memories, further comprising: In the memory stream database, a cumulative score field is provided for each historical memory record to store and update the cumulative score after each user interaction, and a threshold for the cumulative score is set; After each user interaction, a comprehensive score is generated for each historical memory, and the newly calculated comprehensive score is added to the cumulative score field of the corresponding historical memory, and the cumulative score is updated in real time; Periodically scan the historical memories in the memory stream database, check and update the cumulative score of each historical memory, and set the time decay coefficient of the cumulative score for each historical memory.
4. The memory-driven question-answering optimization method according to claim 1, characterized in that: The key memory and the current prompt information are combined and input into the preset language model to generate a second preset number of high-level questions, including: Convert each word or phrase in the key memory and the prompt information into a semantic vector by using an embedding representation technology; Through the cosine similarity calculation method, the similarity score is calculated for each semantic vector of the prompt information and each semantic vector of the key memory, and the semantic segments with similarity higher than the similarity threshold are retained and marked as high-relevance segments; A multi-head self-attention mechanism is used to fuse highly relevant fragments to generate a comprehensive semantic representation, which represents the integrated key memory and prompt information; Input the integrated comprehensive semantic representation into a preset language model to generate preliminary questions; A semantic analysis tool is used to perform a semantic depth score on each generated preliminary question, and a second preset number of preliminary questions with the highest scores are used as the high-level questions.
5. The memory-driven question-answering optimization method according to claim 1, characterized in that: Saving the current user text question and the current text answer together in the memory stream database includes: Combining the current user text question and the current text answer into a complete historical memory, and saving it in the memory stream database; Record and store the timestamp of historical memory, marking the specific storage time of the conversation content; Periodically scanning the memory flow database to mark historical memories that have not been called for a period exceeding a preset time threshold; According to the preset cleanup strategy, processing operations are performed on the marked historical memory, including permanent deletion, data compression or archiving, to optimize the storage efficiency of the memory stream database.
6. The memory-driven question-answering optimization method as claimed in claim 1, characterized in that: Get the current user text question, including: Receiving multimodal data input by a user, identifying and separating the multimodal data according to data types, and obtaining a plurality of single-type data; If the single type of data is voice data, use voice recognition technology to convert the voice data into text information; If the single type of data is image data, using optical character recognition technology to extract text information from the image data; If the single type of data is video data, extract key frames from the video data, and apply optical character recognition technology or speech recognition technology to each key frame to extract text information; Summarize the text information extracted from multimodal data to generate preliminary user text questions; The generated preliminary user text question is semantically optimized and proofread to obtain the current user text question.
7. The memory-driven question-answering optimization method according to claim 1, characterized in that: After generating the current text answer based on the current user text question, the method further includes: Replacing the punctuation marks of the sentences in the current text answer with a standard format for speech synthesis; Replacing corresponding words in the current text answer according to a preset vocabulary that conforms to voice output habits; Select a matching target speech model based on the user's language settings and accent preferences, and load relevant parameters for speech synthesis, including speech rate, pitch, and volume settings; The optimized current text answer is input into the target speech model to generate a corresponding target speech answer.
8. A memory-driven question-answering optimization device, characterized in that: The memory-driven question-answering optimization device comprises: A text processing and scoring module, which obtains a current user text question and scores the historical memory in the memory stream database based on the current user text question; A prompt selection and answer generation module selects a first preset number of history memories with the highest scores as current prompt information and inputs them into a preset language model to generate a current text answer based on the current user text question; A memory stream update module saves the current user text question and the current text answer together in the memory stream database, so as to provide an answer reference when a subsequent user asks a question; A key memory marking module monitors the cumulative score of historical memories in the memory stream database, and marks historical memories whose cumulative scores reach a preset threshold as key memories; A question generation module combines the key memory and the current prompt information and inputs them into the preset language model to generate a second preset number of high-level questions; The memory reflection module generates an optimized answer based on the high-level question through the preset language model, and saves the optimized answer to the memory stream database to provide a more accurate answer reference when the user asks questions later.
9. A memory-driven question-answering optimization device, characterized in that: The memory-driven question-and-answer optimization device includes a memory, a processor, and a memory-driven question-and-answer optimization program stored in the memory and executable on the processor. When the memory-driven question-and-answer optimization program is executed by the processor, the steps of the memory-driven question-and-answer optimization method as described in any one of claims 1 to 7 are implemented.
10. A computer storage medium, characterized in that: The storage medium stores a memory-driven question-and-answer optimization program, which, when executed by a processor, implements the steps of the memory-driven question-and-answer optimization method according to any one of claims 1 to 7.
Citation Information
Cited By
Universal memory management method and system based on language model
CN119962574A
Customer consultation question processing method and system based on machine learning
CN119990335A
Intelligent dialogue method and device, equipment and storage medium
CN120892542A
An intelligent conversation method, device, apparatus and storage medium
CN120892542B
Intelligent agent question and answer interaction method based on large model and generative artificial intelligence
CN121168645A
