An intelligent question-answering system and method based on adaptive feedback loop

By introducing natural language processing and machine learning technology into the RAG question and answer system, combining user portraits and adaptive feedback loops, the shortcomings of traditional systems in error correction, context understanding, multi-intention recognition and adaptive optimization are solved, and more efficient user needs understanding and customized answer generation are achieved.

CN119149707BActive Publication Date: 2025-03-04ZHEJIANG THIRDNET TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411606599.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-03-04
Estimated Expiration
2044-11-12

Smart Images

  • Figure CN119149707B_ABST
    Figure CN119149707B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of intelligent question answering, and in particular to an intelligent question answering system and method based on an adaptive feedback loop, the method comprising: obtaining historical conversation content within a set time period from a database to construct an initial user portrait; receiving a current question from a user, and determining the correlation between the current question and a previous round of conversation in combination with historical conversations; performing sentiment analysis on the current question to identify the user's sentiment tendency and preference; generating a satisfaction evaluation of the previous round of conversation in combination with the correlation; identifying the intention of the current question from the user, and classifying the user's intention according to the identification result to form a plurality of intention groups, each intention group including one or more intentions; generating a corresponding initial answer according to each user's intention; correcting the initial answer according to the sentiment analysis result in combination with the initial user portrait and the satisfaction evaluation, generating a final answer, and returning it to the user; and updating the historical conversation content in the database in real time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent question answering technology, and in particular to an intelligent question answering system and method based on an adaptive feedback loop. Background Art

[0002] RAG (Retrieval Augmented Generation) is an artificial intelligence technology that combines information retrieval technology with language generation models. This technology retrieves relevant information from an external knowledge base and inputs it as a prompt to a large language model (LLM) to enhance the model's ability to handle knowledge-intensive tasks such as answering, text summarization, and content generation.

[0003] However, the traditional RAG question-answering system has problems such as insufficient error correction and limited context understanding. Although the recall rate can be improved through some technical means, it is weak in handling multi-intent questions and cannot fully meet the personalized needs of users. In addition, the system's adaptive and optimization capabilities need to be improved. Summary of the invention

[0004] After receiving user questions, the system of the present invention uses natural language processing technology and machine learning models to deeply understand the context of user questions and historical conversations, and provides users with multimodal customized answers that match their context, habits and preferences through technologies such as intelligent error correction, multi-level intent recognition, context perception, dynamic knowledge base selection and adaptive feedback loops, combined with user portraits. By continuously monitoring each user question and feedback, loop optimization, and accumulating user interaction information, a feedback closed loop that continuously improves itself is formed.

[0005] The technical solution proposed by the present invention is: an intelligent question-answering method based on an adaptive feedback loop, the method comprising:

[0006] Obtain historical conversation content within a set time period from the database to build an initial user profile;

[0007] Receive the user's current question and determine the relevance of the current question to the previous round of conversation based on historical conversations;

[0008] Perform sentiment analysis on the current question to identify the user's emotional tendencies and preferences; generate a satisfaction evaluation of the previous round of conversation based on the correlation;

[0009] Identify the user's current intention in asking a question, and classify the user's intention according to the identification result to form multiple intention groups, each of which includes one or more intentions;

[0010] Generate an initial response based on each user's intent;

[0011] Based on the sentiment analysis results, the initial answer is corrected in combination with the initial user portrait and satisfaction evaluation, and the final answer is generated and returned to the user;

[0012] The final answer and the user's current question are converted into text data and sent to the database, and the historical conversation content in the database is updated in real time.

[0013] Preferably, the step of acquiring historical conversation content within a set time period from a database and constructing an initial user portrait comprises the following steps:

[0014] Set the start time point T0 and end time point T of the time period END ;

[0015] Collecting conversation data from historical conversation content, wherein the conversation data includes user question content and corresponding timestamps;

[0016] Extract timestamps and obtain timestamps at the starting time point T0 and the ending time point T END The historical dialogue content within;

[0017] Segment the user's questions in historical conversations and remove stop words, and use the TF-IDF algorithm to calculate the weight of each word;

[0018] Use the pre-trained language model Word2Vec or BERT model to convert text into vector representation;

[0019] Use the K-means clustering algorithm to perform cluster analysis on users, and generate a type label for each user based on the cluster analysis results;

[0020] Use the principal component analysis algorithm PCA to reduce the high-dimensional data to a two-dimensional space, and draw a scatter plot to display the user clustering results; at the same time, use the word cloud to display the user's main keywords;

[0021] Generate an initial user portrait based on cluster analysis results and main keywords.

[0022] Preferably, the receiving of the current question from the user and determining the relevance between the current question and the previous round of conversation in combination with the historical conversation comprises the following steps:

[0023] Receive the user's current question and convert the question content into text format data;

[0024] Get the historical conversation content and use the timestamp to get the previous round of conversation content from the historical conversation content;

[0025] Preprocess the current question content and the previous round of conversation content, then convert them into TF-IDF vectors, and use the cosine similarity algorithm to calculate the cosine similarity between the current question content and the previous round of conversation content;

[0026] According to the calculated cosine similarity , through cosine similarity Indicates the relevance between the current question and the previous round of dialogue.

[0027] Preferably, the emotional analysis of the current question to identify the user's emotional tendencies and preferences includes the following steps:

[0028] Get the text format data of the current question content;

[0029] Convert text format data into numerical vectors through TF-IDF algorithm;

[0030] Importing a pre-trained sentiment analysis model, wherein the sentiment analysis model is built based on a support vector machine (SVM);

[0031] The sentiment analysis model is used to classify the current question content by sentiment and preference, and a sentiment classification label is added to each question content, wherein the sentiment classification label includes one or more of negative, neutral, and positive.

[0032] Preferably, generating a previous round of dialogue satisfaction evaluation by combining the correlation degree comprises the following steps:

[0033] Get the sentiment classification label of the current question;

[0034] Get the relevance between the current question and the previous round of dialogue;

[0035] if , to determine whether the current question is related to the previous round of dialogue, where represents the relevance threshold;

[0036] Quantify the sentiment classification labels and calculate the satisfaction evaluation parameters ;in, Represents the quantized value of the sentiment classification label;

[0037] Importing a preset satisfaction evaluation table, wherein the satisfaction evaluation table is used to define satisfaction evaluation scores corresponding to different satisfaction evaluation parameter intervals;

[0038] According to the satisfaction evaluation parameters obtained , get the corresponding satisfaction evaluation score from the satisfaction evaluation table .

[0039] Preferably, the identifying the intention of the user's current question, classifying the user's intention according to the identification result to form a plurality of intention groups, each intention group including one or more intentions, comprises the following steps:

[0040] Get the text data of the current question and the previous round of dialogue;

[0041] The Transformer model is used to understand the context and determine whether the current question is a follow-up to the question in the previous conversation. If not, the user's current question is retrieved.

[0042] If yes, the pre-trained intent classification model is used to extract and classify features from the text data of the current question, including the following steps:

[0043] Input the text data of the current question into the intent classification model;

[0044] The intent classification model extracts one or more keywords from the text data of the current question;

[0045] Determine user intent based on keywords, establish multiple user intent classification sets to represent different user intent categories, and add category labels to each user intent classification set; the intent classification model is built based on a convolutional neural network (CNN);

[0046] The intent classification model includes an input layer, multiple convolutional layers and an output layer, in which the probabilities of different intent categories are output through a Softmax function;

[0047] Arrange the order of multiple intent classification sets according to the probability.

[0048] Preferably, the method of correcting the initial answer based on the sentiment analysis result, combining the initial user portrait and the satisfaction evaluation, generating a final answer, and returning it to the user includes the following steps:

[0049] Obtain sentiment classification labels to identify the user's sentiment tendency;

[0050] Obtain the initial user portrait to identify the user's age and interests;

[0051] Generate optimized answer text data based on the user's emotional tendencies, age, and interest information through a pre-trained sentiment analysis model;

[0052] Obtain the initial answer content, optimized answer content and the content of the previous round of dialogue, calculate the cosine similarity between the initial answer content and the optimized answer content and the content of the previous round of dialogue, and determine the output answer content based on the cosine similarity;

[0053] Use natural language processing (NLP) technology to identify grammatical errors in answer texts and correct them;

[0054] Specifically include: using NLTK's dictionary and fuzzy matching to correct spelling errors;

[0055] Use StanfordNLP's dependency parser to generate an abnormal relationship tree of sentences in the answer text, identify the parts of the sentences in the answer text that do not conform to grammatical rules, and correct grammatical errors based on the grammatical rule library;

[0056] Use SpaCy to perform word form restoration and simplify the sentence structure to make it conform to natural language habits.

[0057] Preferably, judging the output answer content according to the cosine similarity comprises the following steps:

[0058] Get the cosine similarity between the initial answer text and the previous round of dialogue content And optimize the cosine similarity between the answer content and the previous round of dialogue content ;

[0059] if > , the optimized answer content is used instead of the initial answer content as the final answer content and returned to the user;

[0060] if < , the initial answer content is used as the final answer content and returned to the user;

[0061] The updating of the historical conversation content in the database comprises the following steps:

[0062] Get the timestamp of the historical conversation content to determine the final answer and the insertion position of the user's current question;

[0063] Get the timestamp of the final answer and the timestamp of the user's current question, and insert the user's current question and the final answer to the end of the historical conversation content;

[0064] Replace the end time point T with the timestamp of the final answer content END ; Make the historical conversation content obtained next time include the final answer content;

[0065] Before a new conversation begins, the user portrait is constructed using the historical conversation content including the final answer content to update the user portrait.

[0066] The present invention also provides an intelligent question-answering system based on an adaptive feedback loop, wherein the system is used to execute the intelligent question-answering method based on an adaptive feedback loop.

[0067] The present invention also provides a computer-readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the intelligent question-answering method based on an adaptive feedback loop.

[0068] Beneficial effects of the present invention:

[0069] 1. The present invention can understand user needs more accurately and efficiently through precise optimization and splitting of user questions, provide customized answers that meet user context, habits and preferences, and continuously update and optimize user portraits and system strategies through adaptive feedback loops, thereby improving user experience and system performance. It solves the problems of traditional technologies in error correction, context understanding, multi-intent recognition, personalized processing and self-optimization.

[0070] 2. The present invention extracts one or more keywords from the text data of the current question through a pre-trained intent classification model; determines the user intent based on the keywords, and establishes multiple user intent classification sets to represent different intent categories of the user, and adds category labels to each user intent classification set. The intent classification model includes an input layer, multiple convolutional layers, and an output layer. In the output layer, the probabilities of different intent categories are output through a Softmax function; the order of multiple intent classification sets is arranged according to the size of the probability, realizing the functions of multi-intent recognition and sorting of multiple intents, and then generating the answer content corresponding to the intent in order.

[0071] 3. The present invention inserts the user's current question and the final answer to the end of the historical conversation content according to the timestamp of the final answer content and the timestamp of the user's current question. The timestamp of the final answer content is used to replace the end time point T END , so that the historical conversation content obtained next time includes the final answer content. Before the start of a new conversation, the historical conversation content including the final answer content is used to update the user portrait, thereby realizing the function of cyclically optimizing the user portrait. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] Figure 1 The present invention is a flow chart of an intelligent question-answering method based on an adaptive feedback loop. DETAILED DESCRIPTION

[0073] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art can think of other obvious variations. The basic principles of the present invention defined in the following description can be applied to other embodiments, variations, improvements, equivalents, and other technical solutions that do not deviate from the spirit and scope of the present invention.

[0074] It is to be understood that the term "one" should be understood as "at least one" or "one or more", that is, in one embodiment, the number of an element may be one, while in another embodiment, the number of the element may be multiple, and the term "one" should not be understood as a limitation on the quantity.

[0075] refer to Figure 1 The technical solution provided by the present invention is: an intelligent question-answering method based on an adaptive feedback loop, comprising the following steps:

[0076] 1. Obtain the historical conversation content within the set time period from the database and build the initial user profile, which specifically includes the following steps:

[0077] Set the start time point T0 and end time point T of the time period END . Collect the conversation data of this time period from the historical conversation content. The conversation data includes the user question content and the corresponding timestamp.

[0078] The user question content in the historical conversation is segmented and stop words are removed, and the TF-IDF algorithm is used to calculate the weight of each word to evaluate the importance of the word.

[0079] Use the pre-trained language model Word2Vec or BERT model to convert text into vector representation; Word2Vec can learn sub-vectors by predicting context, and BERT understands words in context through a deep bidirectional Transformer network. Choose according to your needs.

[0080] The clustering algorithm K-means is used to perform cluster analysis on users, and a type label is generated for each user based on the cluster analysis results; the K-means algorithm searches for K clusters based on the vector representation, so that the user similarity within the same cluster is maximized and the user similarity between different clusters is minimized, the principal component analysis algorithm PCA is used to reduce the high-dimensional data to a two-dimensional space, and the matplotlib library is used to draw a scatter plot to display the user clustering results; at the same time, a word cloud is used to display the user's main keywords; an initial user portrait is generated based on the cluster analysis results and the main keywords. The user initial portrait contains information such as the user's interest preferences, behavior model, and demand characteristics, providing a corresponding reference for the subsequent analysis process.

[0081] 2. Receive the user's current question, and determine the relevance between the current question and the previous round of conversation based on the historical conversation. Specifically, the following steps are included: Receive the user's current question, convert the question content into text format data; obtain the historical conversation content, and use the timestamp to obtain the previous round of conversation content from the historical conversation content; pre-process the current question content and the previous round of conversation content, and then convert them into TF-IDF vectors, and use the cosine similarity algorithm to calculate the cosine similarity of the current question content and the previous round of conversation content; according to the calculated cosine similarity , through cosine similarity Indicates the relevance between the current question and the previous round of dialogue.

[0082] 3. Perform sentiment analysis on the current question to identify the user's sentiment tendency and preference; generate a satisfaction evaluation of the previous round of conversation based on the correlation, which specifically includes the following steps:

[0083] The text format data of the current question content is obtained; the text format data is converted into a numerical vector through the TF-IDF algorithm; a pre-trained sentiment analysis model is imported, the sentiment analysis model is built based on a support vector machine (SVM), and is trained using historical sentiment data. The specific training process is an existing technology and will not be described in detail here.

[0084] The sentiment analysis model is used to classify the current question content by sentiment and preference, and a sentiment classification label is added to each question content. In this embodiment, the sentiment classification label includes one or more of negative, neutral, and positive.

[0085] Get the sentiment classification label of the current question content; get the relevance of the current question with the previous round of dialogue.

[0086] if , to determine whether the current question is related to the previous round of dialogue, where represents the relevance threshold. In this embodiment, the relevance threshold is set to 0.5; the sentiment classification label is quantified to calculate the satisfaction evaluation parameter ;in, Indicates the quantized value of the sentiment classification label. In this embodiment, the quantized value of "negative" can be -1, the quantized value of "positive" can be 1, and the quantized value of "neutral" can be 0;

[0087] Import a preset satisfaction evaluation table, which is used to define satisfaction evaluation scores corresponding to different satisfaction evaluation parameter intervals; , get the corresponding satisfaction evaluation score from the satisfaction evaluation table In this embodiment: When the corresponding satisfaction evaluation score is 90 points, The corresponding satisfaction evaluation score is 80 points. The corresponding satisfaction score is 70. The satisfaction evaluation score reflects the user's satisfaction with the answer, which can help the system to clarify the direction of improvement, such as adjusting the subsequent conversation style and content level.

[0088] 4. Identify the user's current intention of asking a question, and classify the user's intention according to the identification result to form multiple intention groups, each of which includes one or more intentions; specifically, the following steps are included:

[0089] Get the text data of the current question and the previous round of conversation, use the Transformer model to understand the context, and determine whether the current question is a follow-up to the question in the previous conversation; if not, re-get the user's current question;

[0090] If yes, then the pre-trained intent classification model is used to extract features and classify the text data of the current question, including the following steps:

[0091] The text data of the current question is input into the intent classification model; the intent classification model extracts one or more keywords from the text data of the current question. The user intent is judged based on the keywords, and multiple user intent classification sets are established to represent different intent categories of the user, and a category label is added to each user intent classification set. The intent classification model is constructed based on a convolutional neural network (CNN). The intent classification model includes an input layer, multiple convolutional layers and an output layer. In the output layer, the probabilities of different intent categories are output through a Softmax function. The order of multiple intent classification sets is arranged according to the size of the probability.

[0092] That is, if the question contains a clear intent, we generate an answer for that intent. If the question contains multiple intents, we generate a corresponding answer for each intent. We sort the intents by their probability (importance or priority). The above method forms a multi-intent recognition mechanism for the conversation content.

[0093] 5. Generate the corresponding initial answer based on each user's intention;

[0094] 6. Based on the sentiment analysis results, the initial answer is corrected in combination with the initial user portrait and satisfaction evaluation, and the final answer is generated and returned to the user. The specific steps include:

[0095] Get sentiment classification labels to identify the user's sentiment tendency. Get the initial user portrait to identify the user's age and interest information. Generate optimized answer text data based on the user's sentiment tendency and the user's age and interest information through the pre-trained sentiment analysis model.

[0096] Get the initial answer content, optimized answer content and the content of the previous round of dialogue, calculate the cosine similarity between the initial answer content and the optimized answer content and the content of the previous round of dialogue, and judge the output answer content based on the cosine similarity. Specifically include: Get the cosine similarity between the initial answer text and the content of the previous round of dialogue And optimize the cosine similarity between the answer content and the previous round of dialogue content ;if > , the optimized answer content is used instead of the initial answer content as the final answer content and returned to the user; if < , the initial answer content is used as the final answer content and returned to the user.

[0097] In this embodiment, the content of the answer can be efficiently queried through a dynamically selected appropriate knowledge base and knowledge graph, or through API access to a language model (GPT), etc., to generate information and answers related to the question.

[0098] The natural language processing technology NLP is used to identify grammatical errors in the answer text and correct them, including: using NLTK's dictionary and fuzzy matching to correct spelling errors; using StanfordNLP's dependency parser to generate abnormal relationship trees of sentences in the answer text, identifying parts of the sentences in the answer text that do not conform to grammatical rules, and correcting grammatical errors based on the grammatical rule library. SpaCy is used to restore word forms and simplify sentence structures to make them conform to natural language habits.

[0099] In this embodiment, the answer content or question is optimized in terms of grammar and semantics by combining the user's conversation background, emotional inclination and preference. Ambiguous references can be eliminated and the wording and tone can be adjusted to generate a grammatically correct, semantically complete and self-consistent rewritten version to ensure that the question can independently and clearly express the user's intention.

[0100] 7. Convert the final answer and the user's current question into text data and send it to the database, and update the historical conversation content in the database in real time. The specific steps include:

[0101] Get the timestamp of the historical conversation content, determine the insertion position of the final answer and the user's current question; get the timestamp of the final answer content and the timestamp of the user's current question, insert the user's current question and the final answer to the end of the historical conversation content; use the timestamp of the final answer content to replace the end time point T END ; Make the historical conversation content obtained next time include the final answer content; before a new conversation begins, use the historical conversation content including the final answer content to update the user portrait.

[0102] The present invention also provides an intelligent question-answering system based on an adaptive feedback loop, wherein the system is used to execute the intelligent question-answering method based on an adaptive feedback loop.

[0103] The present invention also provides a computer-readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the intelligent question-answering method based on an adaptive feedback loop.

[0104] The embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. The embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part, and / or installed from a removable medium. When the computer program is executed by the central processing unit (CPU), the above-mentioned functions defined in the method of the present application are executed. It should be noted that the above-mentioned computer-readable medium of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of an electrical, magnetic, optical, electromagnetic, infrared segment, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wire segments, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, electrical wire, optical cable, RF, etc., or any suitable combination of the foregoing.

[0105] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0106] Those skilled in the art should understand that the embodiments of the present invention described above and shown in the accompanying drawings are only examples and do not limit the present invention. The objectives of the present invention have been fully and effectively achieved. The functional and structural principles of the present invention have been demonstrated and explained in the embodiments. Without departing from the principles, the implementation methods of the present invention may be deformed or modified in any way.

Claims

1. An intelligent question-answering method based on an adaptive feedback loop, characterized in that: The method comprises: Obtain historical conversation content within a set time period from the database to build an initial user profile; Receive the user's current question and determine the relevance of the current question to the previous round of conversation based on historical conversations; Perform sentiment analysis on the current question to identify the user's emotional tendencies and preferences; generate a satisfaction evaluation of the previous round of conversation based on the correlation; The process of performing sentiment analysis on the current question to identify the user's sentiment tendency and preference includes the following steps: Obtain text format data of the current question content; convert the text format data into a numerical vector through the TF-IDF algorithm; import a pre-trained sentiment analysis model, wherein the sentiment analysis model is constructed based on a support vector machine (SVM); classify the current question content by sentiment and preference through the sentiment analysis model, and add a sentiment classification label to each question content, wherein the sentiment classification label includes one or more of negative, neutral, and positive; The step of generating a previous round of dialogue satisfaction evaluation by combining the correlation degree includes the following steps: Get the sentiment classification label of the current question; get the relevance of the current question to the previous round of dialogue; if , to determine whether the current question is related to the previous round of dialogue, where represents the correlation threshold, Indicates the cosine similarity between the current question content and the previous round of dialogue content; quantifies the sentiment classification labels and calculates the satisfaction evaluation parameters ;in, Represents the quantized value of the sentiment classification label; Importing a preset satisfaction evaluation table, wherein the satisfaction evaluation table is used to define satisfaction evaluation scores corresponding to different satisfaction evaluation parameter intervals; According to the satisfaction evaluation parameters obtained , get the corresponding satisfaction evaluation score from the satisfaction evaluation table ; Identify the user's current intention in asking a question, and classify the user's intention according to the identification result to form multiple intention groups, each of which includes one or more intentions; Generate an initial response based on each user's intent; Based on the sentiment analysis results, the initial answer is corrected in combination with the initial user portrait and satisfaction evaluation, and the final answer is generated and returned to the user, including the following steps: Obtain sentiment classification labels to identify the user's sentiment tendencies; obtain initial user portraits to identify the user's age and interest information; generate optimized answer text data based on the user's sentiment tendencies and the user's age and interest information through the pre-trained sentiment analysis model; Obtain the initial answer content, optimized answer content and the content of the previous round of dialogue, calculate the cosine similarity between the initial answer content and the optimized answer content and the content of the previous round of dialogue, and determine the output answer content based on the cosine similarity; Identify and correct grammatical errors in the answer text through natural language processing technology NLP; specifically, use NLTK's dictionary and fuzzy matching to correct spelling errors; use StanfordNLP's dependency parser to generate an abnormal relationship tree of sentences in the answer text, identify the parts of the answer text that do not conform to grammatical rules, and then correct the grammatical errors based on the grammatical rule library; Use SpaCy to perform word form restoration and simplify sentence structure to make it conform to natural language habits; The final answer and the user's current question are converted into text data and sent to the database, and the historical conversation content in the database is updated in real time.

2. The intelligent question-answering method based on adaptive feedback loop according to claim 1, characterized in that: The process of obtaining historical conversation content within a set time period from the database and constructing an initial user portrait includes the following steps: Set the start time point T0 and end time point T of the time period END ; Collecting conversation data from historical conversation content, wherein the conversation data includes user question content and corresponding timestamps; Extract timestamps and obtain timestamps at the starting time point T0 and the ending time point T END The historical dialogue content within; Segment the user's questions in historical conversations and remove stop words, and use the TF-IDF algorithm to calculate the weight of each word; Use the pre-trained language model Word2Vec or BERT model to convert text into vector representation; Use the K-means clustering algorithm to perform cluster analysis on users, and generate a type label for each user based on the cluster analysis results; Use the principal component analysis algorithm PCA to reduce the high-dimensional data to a two-dimensional space, and draw a scatter plot to display the user clustering results; at the same time, use the word cloud to display the user's main keywords; Generate an initial user portrait based on cluster analysis results and main keywords.

3. The intelligent question-answering method based on adaptive feedback loop according to claim 2, characterized in that: The receiving of the current question from the user and determining the relevance between the current question and the previous round of conversation in combination with the historical conversation includes the following steps: Receive the user's current question and convert the question content into text format data; Get the historical conversation content and use the timestamp to get the previous round of conversation content from the historical conversation content; Preprocess the current question content and the previous round of conversation content, then convert them into TF-IDF vectors, and use the cosine similarity algorithm to calculate the cosine similarity between the current question content and the previous round of conversation content; According to the calculated cosine similarity , through cosine similarity Indicates the relevance between the current question and the previous round of dialogue.

4. The intelligent question-answering method based on adaptive feedback loop according to claim 1, characterized in that: The method of identifying the user's intention of the current question and classifying the user's intention according to the identification result to form a plurality of intention groups, each of which includes one or more intentions, comprises the following steps: Get the text data of the current question and the previous round of dialogue; The Transformer model is used to understand the context and determine whether the current question is a follow-up to the question in the previous conversation. If not, the user's current question is retrieved. If yes, the pre-trained intent classification model is used to extract and classify features from the text data of the current question, including the following steps: Input the text data of the current question into the intent classification model; The intent classification model extracts one or more keywords from the text data of the current question; Determine user intent based on keywords, establish multiple user intent classification sets to represent different user intent categories, and add category labels to each user intent classification set; the intent classification model is built based on a convolutional neural network (CNN); The intent classification model includes an input layer, multiple convolutional layers and an output layer, in which the probabilities of different intent categories are output through a Softmax function; Arrange the order of multiple intent classification sets according to the probability.

5. The intelligent question-answering method based on adaptive feedback loop according to claim 1, characterized in that: The step of determining the output answer content according to the cosine similarity comprises the following steps: Get the cosine similarity between the initial answer text and the previous round of dialogue content And optimize the cosine similarity between the answer content and the previous round of dialogue content ; if > , the optimized answer content is used instead of the initial answer content as the final answer content and returned to the user; if < , the initial answer content is used as the final answer content and returned to the user; The updating of the historical conversation content in the database comprises the following steps: Get the timestamp of the historical conversation content to determine the final answer and the insertion position of the user's current question; Get the timestamp of the final answer and the timestamp of the user's current question, and insert the user's current question and the final answer to the end of the historical conversation content; Replace the end time point T with the timestamp of the final answer content END ; Make the historical conversation content obtained next time include the final answer content; Before a new conversation begins, the user portrait is constructed using the historical conversation content including the final answer content to update the user portrait.

6. An intelligent question-answering system based on an adaptive feedback loop, characterized in that: The system is used to execute an intelligent question-answering method based on an adaptive feedback loop as described in any one of claims 1-5.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement an intelligent question-answering method based on an adaptive feedback loop as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Customer interaction service system based on artificial intelligence

    CN118897878A

  • Man-machine interaction method and system based on artificial intelligence

    WO2017041372A1