Dialogue generation method and device based on artificial intelligence
By collecting user conversations in real time and fusion of context and semantic information, and generating dialogue content with the intention model, the challenges of existing dialogue generation systems in real-time, context understanding and intent recognition are solved, achieving more flexible and accurate dialogue generation.
Patent Information
- Application Number
- CN202510135028.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-07
- Publication Date
- 2025-03-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing dialogue generation systems have challenges in real-time, contextual understanding, semantic parsing and intent recognition, resulting in high response delays, poor flexibility, lost or misunderstanding of information, and difficulty in dealing with diverse dialogue scenarios and user needs.
By collecting user conversations in real time, using predefined basic reply templates to generate initial conversations, and the initial conversation record information is fusion and semantic information fusion are fusion, the fused feature vector is obtained, and the intent model that has been trained has been combined to generate dialogue content that meets the user's intentions.
It realizes rapid response to user input, improves the flexibility and accuracy of the dialogue generation system, can better understand the user's intentions and the consistency of dialogue, and generates more accurate, smooth and in line with user expectations.
Smart Images

Figure CN119597895A_ABST
Abstract
Description
Technical Field
[0001] The present invention proposes a dialogue generation method and device based on artificial intelligence, belonging to the technical field of intelligent dialogue generation. Background Art
[0002] With the rapid development of artificial intelligence technology, dialogue generation systems have been widely used in many fields, such as intelligent customer service, smart home, and in-vehicle navigation systems. These systems provide users with convenient information query, task execution and other services by simulating human conversation. However, existing dialogue generation methods still face many challenges, especially in terms of real-time, context understanding, semantic parsing, and intent recognition. In terms of real-time, traditional dialogue generation systems often rely on complex preprocessing processes, resulting in high response delays and unable to meet users' needs for instant feedback. In addition, these systems often lack sufficient flexibility when processing user input and are difficult to cope with diverse dialogue scenarios and user needs. In terms of context understanding, existing dialogue generation systems can usually only handle single-round dialogues and lack effective fusion of context information. This leads to information loss or misunderstanding when the system processes multiple rounds of dialogues, thus affecting the fluency and accuracy of the dialogue. In terms of semantic parsing, although existing natural language processing technology has made certain progress, it still faces difficulties such as semantic ambiguity and lexical polysemy in practical applications. These problems limit the accurate understanding of user input by the dialogue generation system, which in turn affects the quality and effect of the dialogue. In terms of intent recognition, traditional dialogue generation systems often rely on fixed rules or templates for intent matching, lacking adaptability and generalization capabilities. With the continuous changes in user needs and the diversification of dialogue scenarios, this rule-based approach has been unable to meet the needs of practical applications.
[0003] In view of the above problems, the present invention proposes a dialogue generation method based on artificial intelligence. The method realizes a rapid response to user input by collecting user dialogues in real time and using predefined basic reply templates to generate initial dialogues. At the same time, by fusing the context information and semantic information of the initial dialogue record information, the fused context feature vector and semantic feature vector are obtained. The secondary fusion of these two feature vectors further improves the dialogue generation system's ability to understand and express user input. Finally, by combining the fused feature vector with the trained intent model, a dialogue content that meets the user's intent is generated for reply, thereby realizing more intelligent, flexible and efficient dialogue generation. Summary of the invention
[0004] The present invention provides a method and device for generating a dialogue based on artificial intelligence to solve the above-mentioned technical problems existing in the prior art. The technical solutions adopted are as follows: A method for generating a dialogue based on artificial intelligence, the method comprising: Collect user conversations in real time, generate initial conversations using predefined basic reply templates, reply to user conversations, and obtain initial conversation record information; Perform context information fusion on the initial conversation record information to obtain the fused context feature vector; Perform semantic information fusion on the initial conversation record information to obtain the fused semantic feature vector; Performing secondary fusion on the fused context feature vector and the fused semantic feature vector to obtain a fused feature vector; The fused feature vector is combined with the trained intent model to generate conversation content for response.
[0005] Furthermore, context information fusion is performed on the initial conversation record information to obtain a fused context feature vector, including: Extracting key context information from the initial conversation record information, wherein the key context information includes topics, questions, requests, etc.; Preprocessing the context information to obtain preprocessed context information, wherein the preprocessing includes but is not limited to word segmentation processing and named entity recognition processing; Vectorizing the preprocessed context information to obtain a context vector corresponding to the preprocessed context information; Normalizing the context vector corresponding to the preprocessed context information to obtain a context vector of a uniform scale as a reference context vector; The reference context vector and the target context vector are fused to obtain a fused context feature vector.
[0006] Further, the reference context vector and the target context vector are fused to obtain a fused context feature vector, including: After the initial conversation record information, collect the user's conversation data information in real time; Convert each conversation data of the user after the initial conversation record information into a vector, and normalize the converted vector to obtain a context vector with the same scale as the reference context vector as the target context vector; Comparing the target context vector with each reference context vector for similarity, and setting a weight value for each target context vector according to the similarity value; The target context vector and the reference context vector are combined using the weight value corresponding to the target context vector to obtain a fused context feature vector; The fused context feature vector is obtained by the following formula:
[0007] Among them, U represents the fused context feature vector; n represents the number of reference context vectors; m represents the number of target context vectors; R i represents the i-th reference context vector; T j represents the jth target context vector; w ij represents the jth target context vector T j Relative to the i-th reference context vector R i The weight of ; b represents the bias term.
[0008] Further, the target context vector is compared with each reference context vector for similarity, and a weight value is set for each target context vector according to the similarity value, including: Compare the target context vector with each reference context vector for similarity, and obtain a similarity value between the target context vector and each reference context vector; The similarity value is obtained by the following formula:
[0009] Where Sij represents the similarity value between the j-th target context vector and the i-th reference context vector; R i represents the i-th reference context vector; T j represents the j-th target context vector; a represents the base of the preset logarithmic function; ε represents the preset minimum constant to prevent the denominator from being 0; Obtaining a weight value corresponding to each target context vector relative to each reference context vector using the similarity value; The weight value of each target context vector relative to each reference context vector is obtained by the following formula:
[0010] Among them, w ij represents the jth target context vector T j Relative to the i-th reference context vector R i The weight of the context vector; Sij represents the similarity value between the j-th target context vector and the i-th reference context vector; S jmax represents the maximum similarity between the jth target context vector and the n reference context vectors; std(S j) represents the standard deviation of the similarity between the jth target context vector and the n reference context vectors; m represents the number of target context vectors; x and y represent positive real number parameters, which are used to adjust the sensitivity of the exponential power, and the size of x affects the sensitivity of p to std(Sj). When x is small, the power of std(S j) When x is large, p is more sensitive to the change of std(Sj). Therefore, the value of x needs to be selected according to the discreteness of the data and the task requirements. The size of y will further adjust the sensitivity of x to std(Sj). j ). When y is small, the regulatory effect of x is weakened; when y is large, the regulatory effect of x is strengthened. Similarly, the value of y also needs to be selected according to the characteristics of the data and the task requirements.
[0011] Furthermore, semantic information fusion is performed on the initial conversation record information to obtain a fused semantic feature vector, including: Performing word segmentation processing on the initial conversation record information, obtaining the word segmentation result corresponding to the initial conversation record information, and performing part-of-speech tagging on each word in the word segmentation result; Convert each word after segmentation into a vector to generate a semantic vector; Normalizing the semantic vector to obtain a semantic vector with a unified scale corresponding to the initial conversation record information as a reference semantic vector; The reference semantic vector and the target semantic vector are fused to obtain a fused semantic feature vector.
[0012] Further, the reference semantic vector and the target semantic vector are fused to obtain a fused semantic feature vector, including: After the initial conversation record information, collect the user's conversation data information in real time; Perform semantic analysis on each conversation data of the user after the initial conversation record information to obtain a semantic vector with the same scale as the reference semantic vector as the target semantic vector; Comparing the target semantic vector with each reference semantic vector for similarity, and setting a weight value for each target semantic vector according to the similarity value; The target semantic vector and the reference semantic vector are combined using the weight value corresponding to the target semantic vector to obtain a fused semantic feature vector; The fused semantic feature vector is obtained by the following formula:
[0013] Where K represents the fused semantic feature vector; z represents the number of reference semantic vectors; t represents the number of target semantic vectors; B irepresents the i-th reference semantic vector; A j represents the jth target semantic vector; λ ij Represents the jth target semantic vector A j Relative to the i-th reference semantic vector B i The weight of ; r represents the adjustment factor, which is used to adjust the influence of the average value of the reference semantic vector on the fusion result. r can be a positive real number, and its value range can be adjusted according to the specific task and data.
[0014] Further, the target semantic vector is compared with each reference semantic vector for similarity, and a weight value is set for each target semantic vector according to the similarity value, including: Comparing the target semantic vector with each reference semantic vector in terms of similarity to obtain a similarity value between the target semantic vector and each reference semantic vector; The similarity value is obtained by the following formula:
[0015] Among them, Y ij represents the similarity value between the jth target semantic vector and the ith reference semantic vector; B i represents the i-th reference semantic vector; A j represents the jth target semantic vector; d represents the dimension of the target semantic vector and the reference semantic vector; and Represents the target semantic vector A j and the reference semantic vector B i The k-th dimension component of ; b represents the base of the logarithm in the semantic vector fusion process; Using the similarity value to obtain a weight value corresponding to each target semantic vector and each reference semantic vector; The weight value corresponding to each target semantic vector and each reference semantic vector is obtained by the following formula:
[0016] Among them, λ ij Represents the jth target semantic vector A j Relative to the i-th reference semantic vector B i The weight of Y; t represents the number of target semantic vectors; std(Y j ) represents the standard deviation of the similarity between the jth target semantic vector and the ith reference semantic vector; Y ij represents the similarity value between the jth target semantic vector and the ith reference semantic vector; B i represents the i-th reference semantic vector; A jrepresents the jth target semantic vector; Var(Y j ) represents the variance of the j-th target semantic vector relative to the ith reference semantic vector.
[0017] Further, the fused context feature vector and the fused semantic feature vector are fused again to obtain a fused feature vector, including: Extracting a fused context feature vector and a fused semantic feature vector; The fused context feature vector and the fused semantic feature vector are normalized to generate a normalized context feature vector and a semantic feature vector; wherein the normalized context feature vector and the semantic feature vector have the same dimension; The standardized context feature vector and the semantic feature vector are fused again to generate a fused feature vector.
[0018] Furthermore, the fused feature vector is combined with the trained intent model to generate conversation content for reply, including: Retrieve the trained intent model; Inputting the fused feature vector into the trained intent model to perform intent recognition and obtain an intent recognition result; Retrieve the trained dialogue generation model; Inputting the intention recognition result into a dialogue generation model to generate dialogue content corresponding to the intention recognition result; The conversation content corresponding to the intention recognition result is replied to the user conversation interface.
[0019] A dialogue generation device based on artificial intelligence, the dialogue generation device based on artificial intelligence comprising: The initial conversation record information acquisition module is used to collect the user's conversation in real time, generate the initial conversation using the predefined basic reply template, reply to the user's conversation, and obtain the initial conversation record information; A context feature vector acquisition module is used to fuse the context information of the initial conversation record information to obtain the fused context feature vector; A semantic feature vector acquisition module is used to perform semantic information fusion on the initial conversation record information to obtain a fused semantic feature vector; A feature vector fusion module is used to perform secondary fusion on the fused context feature vector and the fused semantic feature vector to obtain a fused feature vector; An intention recognition result acquisition module is used to input the fused feature vector into the trained intention model to perform intention recognition and obtain the intention recognition result; The dialogue response module is used to generate dialogue content for response by combining the fused feature vector with the trained intent model.
[0020] Beneficial effects of the present invention: The artificial intelligence-based dialogue generation method and device proposed in the present invention can more accurately understand the user's intention and the coherence of the dialogue through the fusion of context information and semantic information. This helps to generate more accurate, smooth and user-expected dialogue content. Compared with the traditional rule-based or template-based dialogue generation method, the method of the present invention does not rely on fixed rules or templates. Instead, it trains an intention model that can adapt to different dialogue scenarios and user needs by learning a large amount of dialogue data. This enables the system to show stronger generalization ability and adaptability when facing diverse dialogue scenarios and user needs. By collecting user dialogues in real time and quickly generating replies, the system can provide users with a more immediate and convenient service experience. At the same time, by accurately understanding user intentions and generating expected dialogue content, the system can improve user satisfaction and loyalty. The method of the present invention has certain innovation and practicality in the fields of natural language processing and machine learning. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a flow chart of the method of the present invention; Figure 2 The device block diagram of the device of the present invention. DETAILED DESCRIPTION
[0022] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0023] The embodiment of the present invention proposes a dialogue generation method based on artificial intelligence, such as Figure 1 As shown, the artificial intelligence-based dialogue generation method includes: S1. Collect user conversations in real time, generate initial conversations using predefined basic reply templates, reply to user conversations, and obtain initial conversation record information; S2, performing context information fusion on the initial conversation record information to obtain a fused context feature vector; S3, performing semantic information fusion on the initial conversation record information to obtain a fused semantic feature vector; S4, performing secondary fusion on the fused context feature vector and the fused semantic feature vector to obtain a fused feature vector; S5. Use the fused feature vector combined with the trained intent model to generate conversation content for reply.
[0024] The working principle of the above technical solution is as follows: the system first collects the user's dialogue input in real time. Using the predefined basic reply template, the system quickly generates the initial dialogue content and replies to the user's dialogue. In this process, the system obtains the initial dialogue record information to provide a basis for subsequent processing.
[0025] The system conducts in-depth analysis of the initial conversation record information and extracts context information. Through a specific algorithm or model, the context information is integrated into a context feature vector. This step helps the system understand the coherence of the conversation and the continuity of the user's intention.
[0026] The system further performs semantic analysis on the initial conversation record information to extract key semantic information, such as entities, relations, emotions, etc. These semantic information are fused into semantic feature vectors to more accurately understand user intentions.
[0027] The system performs a secondary fusion of the context feature vector and the semantic feature vector. Through the fusion algorithm, a fused feature vector that integrates the context information and the semantic information is generated. This step improves the system's overall understanding of user input and the accuracy of dialogue generation.
[0028] The system uses the trained intent model to match and analyze the fused feature vectors. Based on the matching results, the system generates conversation content that meets the user's intent. Finally, the system responds to the user with the generated conversation content to complete the conversation process.
[0029] The effect of the above technical solution is that through the fusion of context information and semantic information, the system can more accurately understand the user's intention and the coherence of the conversation. This helps to generate more accurate, smooth and user-expected conversation content. Compared with the traditional rule-based or template-based conversation generation method, the method of the present invention does not rely on fixed rules or templates. Instead, by learning a large amount of conversation data, an intention model that can adapt to different conversation scenarios and user needs is trained. This enables the system to show stronger generalization ability and adaptability when facing diverse conversation scenarios and user needs. By collecting user conversations in real time and quickly generating replies, the system can provide users with a more immediate and convenient service experience. At the same time, by accurately understanding user intentions and generating conversation content that meets expectations, the system can improve user satisfaction and loyalty. The method of the present invention has certain innovation and practicality in the fields of natural language processing and machine learning. In summary, the artificial intelligence-based conversation generation method has significant technical effects and broad application prospects.
[0030] In one embodiment of the present invention, context information fusion is performed on the initial conversation record information to obtain a fused context feature vector, including: S201, extracting key context information from the initial conversation record information, wherein the key context information includes topics, questions, requests, etc.; S202, preprocessing the context information to obtain preprocessed context information, wherein the preprocessing includes but is not limited to word segmentation processing and named entity recognition processing; S203, performing vectorization processing on the preprocessed context information to obtain a context vector corresponding to the preprocessed context information; S204, normalizing the context vector corresponding to the preprocessed context information to obtain a context vector of a uniform scale as a reference context vector; S205: Fusing the reference context vector and the target context vector to obtain a fused context feature vector.
[0031] The working principle of the above technical solution is: to filter out information that is crucial to understanding the user's intention from the initial conversation record information, such as the topic of the conversation, the questions raised by the user, and the specific requests. This information forms the basis for subsequent processing. Perform necessary preprocessing operations on the extracted context information to improve the effect and accuracy of subsequent vectorization. The preprocessing steps may include word segmentation (dividing the text into independent vocabulary units), named entity recognition (identifying and marking entities in the text, such as names of people, places, and institutions, etc.). These processes help to better understand the text content and lay the foundation for vectorization processing. Convert the preprocessed context information into vector form. This step is usually implemented through word embedding technology, such as Word2Vec, GloVe, etc. These technologies can map words or phrases into high-dimensional vector space, so that semantically similar words are also close in distance in the vector space. In this way, the context information is converted into a numerical form that can be processed by the computer. The vectorized context vector is normalized to ensure that the scale of all vectors is unified. Normalization is a commonly used data preprocessing technology that can convert data of different scales into the same scale range, thereby eliminating the dimensional differences between data. In this solution, normalization helps improve the effect and accuracy of subsequent vector fusion. The normalized context vector (reference context vector) is fused with the target context vector. Fusion may involve a variety of algorithms and techniques, such as vector addition, weighted average, vector concatenation, etc. Through fusion, a feature vector that integrates multiple context information can be obtained, which can more comprehensively reflect the user's intentions and needs.
[0032] The effect of the above technical solution is: by extracting key context information and performing preprocessing and vectorization processing, the solution can understand the user's intentions and needs more accurately. This helps to improve the response quality and user experience of the dialogue system. Normalization eliminates the dimensional differences between different context information, making vector fusion processing more stable and reliable. This helps to improve the robustness and adaptability of the dialogue system in the face of diverse dialogue scenarios. By converting context information into vector form and performing fusion processing, the solution can generate dialogue content that meets the user's intentions more quickly. This helps to improve the response speed and efficiency of the dialogue system. The solution can handle complex dialogue scenarios containing multiple context information. By fusing multiple context information, the dialogue system can understand the user's intentions and needs more comprehensively and generate more accurate and natural dialogue content.
[0033] In summary, this technical solution achieves context information fusion of initial dialogue record information through multiple steps such as extracting key context information, preprocessing, vectorization, normalization and vector fusion. This solution helps to improve the accuracy of dialogue understanding, enhance the robustness of the dialogue system, improve the efficiency of dialogue generation and support the processing of complex dialogue scenarios.
[0034] In one embodiment of the present invention, the reference context vector and the target context vector are fused to obtain a fused context feature vector, including: S2051, after the initial conversation record information, collect the user's conversation data information in real time; S2052, converting each conversation data information of the user after the initial conversation record information into a vector, and normalizing the converted vector to obtain a context vector with the same scale as the reference context vector as a target context vector; S2053, comparing the target context vector with each reference context vector in terms of similarity, and setting a weight value for each target context vector according to the similarity value; S2054, using the weight value corresponding to the target context vector to combine the target context vector and the reference context vector to obtain a fused context feature vector; The fused context feature vector is obtained by the following formula:
[0035] Among them, U represents the fused context feature vector; n represents the number of reference context vectors; m represents the number of target context vectors; R i represents the i-th reference context vector; T j represents the jth target context vector; w ijrepresents the jth target context vector T j Relative to the i-th reference context vector R i The weight of ; b represents the bias term.
[0036] The working principle of the above technical solution is as follows: after the initial conversation record information, the system collects the user's conversation data information in real time. This ensures that the system can obtain the latest user input for subsequent processing and analysis. The system converts the collected user conversation data information into a vector form. This step is usually implemented through word embedding technology or other vector representation methods to convert text data into a numerical form that can be processed by a computer. Next, the converted vectors are normalized to ensure that the scales of all vectors are uniform. This helps to eliminate the dimensional differences between different vectors and facilitates subsequent processing. The system compares the target context vector (i.e., the vector collected and converted in real time) with each reference context vector for similarity. Similarity comparison can be achieved through measurement methods such as cosine similarity and Euclidean distance. According to the similarity value, the system sets a weight value for each target context vector. The size of the weight value reflects the degree of similarity or correlation between the target context vector and the reference context vector. Finally, the system uses the weight value corresponding to the target context vector, combines the target context vector and the reference context vector, and obtains the fused context feature vector through a specific fusion formula.
[0037] The effect of the above technical solution is: by collecting user dialogue data in real time and performing vector processing, the system can understand the user's intentions and needs more accurately. This helps to improve the response quality and user experience of the dialogue system. The solution can dynamically adjust the weights of the reference context vector and the target context vector according to the user's real-time input, so as to respond to diverse dialogue scenarios more flexibly. This enhances the dynamic adaptability and robustness of the dialogue system. By fusing multiple context vectors, the system can generate more coherent and user-expected dialogue content. This helps to improve the naturalness and fluency of the dialogue system. The solution can handle dialogue scenarios containing multiple context information and complex user intentions. By comprehensively considering the information and weights of multiple context vectors, the system can more comprehensively understand the user's intentions and needs, and generate more accurate and natural dialogue content.
[0038] On the other hand, by collecting the user's conversation data information in real time and converting it into a vector, the scheme can instantly capture the user's intention and context changes, improving the response speed and accuracy of the dialogue system. The normalization process ensures the uniformity of the target context vector and the reference context vector in scale, providing a basis for subsequent similarity comparison and fusion processing. By comparing the similarity between the target context vector and each reference context vector, the scheme can identify the reference context vector that is most relevant to the target context, and thus set a reasonable weight value for each target context vector according to the similarity value. This weight allocation mechanism makes the fused context feature vector more focused on the reference context information that is highly relevant to the target context, improving the accuracy and representativeness of the feature vector. The scheme makes the generation process of the fused context feature vector highly interpretable through clear weight allocation and fusion formulas. This helps developers understand how the model makes decisions based on context information, making it easier to debug and optimize the model. Since the scheme considers multiple reference context vectors and performs fusion processing through similarity comparison and weight allocation mechanisms, even if there is error or noise in a reference context vector, it will not have a significant impact on the final feature vector. This design and fault-tolerance mechanism enhances the robustness of the model, enabling it to maintain stable and accurate performance in complex dialogue environments. By fusing and processing multiple context vectors, the solution enables the dialogue system to better understand and perceive the user's intentions and context. This helps improve the natural language understanding ability and interactive experience of the dialogue system, allowing users to communicate with the system more smoothly and naturally. The solution has good adaptability and scalability and can be applied to different types of dialogue systems and task scenarios. With the continuous accumulation of dialogue data and the continuous optimization of the model, the solution is expected to further improve the overall performance and user experience of the dialogue system.
[0039] In summary, this technical solution achieves effective integration and utilization of context information through steps such as real-time collection and processing of dialogue data, similarity comparison and weight assignment, and fusion processing of multiple context vectors. This not only improves the flexibility and accuracy of the dialogue system, but also enhances the interpretability and robustness of the model, laying a solid foundation for improving the overall performance of the dialogue system. At the same time, this technical solution achieves effective fusion and processing of context information through multiple steps such as real-time collection of user dialogue data, vectorization processing, similarity comparison, weight setting, and vector fusion. This solution helps to improve the accuracy of dialogue understanding, enhance the dynamic adaptability of the dialogue system, improve the coherence of dialogue generation, and support the processing of complex dialogue scenarios.
[0040] In one embodiment of the present invention, the target context vector is compared with each reference context vector for similarity, and a weight value is set for each target context vector according to the similarity value, including: Step 1: Compare the target context vector with each reference context vector to obtain a similarity value between the target context vector and each reference context vector; The similarity value is obtained by the following formula:
[0041] Where Sij represents the similarity value between the j-th target context vector and the i-th reference context vector; R i represents the i-th reference context vector; T j represents the j-th target context vector; a represents the base of the preset logarithmic function; ε represents the preset minimum constant to prevent the denominator from being 0; Step 2: using the similarity value to obtain a weight value corresponding to each target context vector relative to each reference context vector; The weight value of each target context vector relative to each reference context vector is obtained by the following formula:
[0042] Among them, w ij represents the jth target context vector T j Relative to the i-th reference context vector R i The weight of the context vector; Sij represents the similarity value between the j-th target context vector and the i-th reference context vector; S jmax represents the maximum similarity between the jth target context vector and the n reference context vectors; std(S j ) represents the standard deviation of the similarity between the jth target context vector and the n reference context vectors; m represents the number of target context vectors; x and y represent positive real number parameters, which are used to adjust the sensitivity of the exponential power, and the size of x affects the sensitivity of p to std(Sj). When x is small, the power of std(S j) When x is large, p is more sensitive to the change of std(Sj). Therefore, the value of x needs to be selected according to the discreteness of the data and the task requirements. The size of y will further adjust the sensitivity of x to std(Sj). j ). When y is small, the regulatory effect of x is weakened; when y is large, the regulatory effect of x is strengthened. Similarly, the value of y also needs to be selected according to the characteristics of the data and the task requirements.
[0043] The working principle of the above technical solution is as follows: First, the solution compares the target context vector with each reference context vector for similarity. The similarity calculation is implemented by a specific formula that takes into account the cosine value of the angle between the vectors and is adjusted by a logarithmic function and a preset minimum constant to obtain a more stable and accurate similarity value. The similarity value (Sij) reflects the similarity between the jth target context vector and the i-th reference context vector. The larger this value is, the higher the similarity between the two vectors. After obtaining the similarity values, the solution further uses these values to assign weights to each target context vector relative to each reference context vector. The weight assignment is implemented by a complex formula that takes into account the similarity value, the maximum similarity, the similarity standard deviation, and two positive real number parameters x and y. These parameters jointly determine the weight assignment method and sensitivity. The size of the weight (wij) reflects the importance or correlation of the jth target context vector relative to the i-th reference context vector. This weight will play a key role in subsequent vector fusion or other processing steps.
[0044] The effect of the above technical solution is: through accurate similarity calculation and reasonable weight allocation, the solution can more accurately reflect the degree of association between the target context vector and the reference context vector. This helps to obtain more accurate and reliable fusion results in the subsequent vector fusion step. The solution effectively avoids the occurrence of abnormal situations such as the denominator being 0 by introducing adjustment means such as preset minimum constants and logarithmic functions. At the same time, by considering the adjustment effect of the similarity standard deviation and the positive real number parameters x and y, the solution can more flexibly respond to changes in different data characteristics and task requirements. This enhances the robustness and adaptability of the system. The technical solution is not only applicable to scenarios such as dialogue systems and recommendation systems that require processing context information, but can also be extended to other fields that require similarity calculation and weight allocation. For example, in tasks such as text classification, clustering, and information retrieval, the solution can play an important role. Although the solution involves complex formulas and calculation processes, through reasonable algorithm design and optimization means (such as parallel computing, caching technology, etc.), the calculation efficiency and performance can be improved while ensuring the accuracy of the calculation. This helps to achieve faster response speed and better user experience in practical applications.
[0045] On the other hand, when calculating the weight value, the scheme not only considers the similarity value between the target context vector and a single reference context vector, but also introduces the maximum similarity and the standard deviation of similarity as adjustment factors. The maximum similarity reflects the closeness between the target context vector and the most similar reference context vector, while the standard deviation of similarity reflects the discreteness of the similarity between the target context vector and each reference context vector. By introducing positive real number parameters x and y, the scheme further adjusts the sensitivity of weight allocation to the standard deviation of similarity. This adjustment mechanism makes the weight allocation more flexible and can be dynamically adjusted according to the discreteness of the data and task requirements. Since the standard deviation of similarity is considered when calculating the weight, the scheme can reduce the impact of outliers on the final fusion result to a certain extent. When the similarity between a target context vector and a reference context vector is abnormally high or low, the impact of this abnormal similarity on the weight allocation will be adjusted by the standard deviation, thereby avoiding excessive deviation of the fusion result. By dynamically adjusting the weight allocation, the scheme can adapt to different data characteristics and task requirements. Whether the data discreteness is high or low, the scheme can ensure the rationality and effectiveness of weight allocation by adjusting parameters x and y. These technical solutions are based on vector and matrix operations, and can achieve fast calculations through efficient numerical calculation libraries or parallel computing technology. Therefore, in practical applications, this solution can achieve high calculation efficiency while ensuring calculation accuracy.
[0046] In summary, this technical solution provides strong support for the effective integration and utilization of context information through technical effects such as accurate similarity measurement, dynamic weight distribution adjustment, improving the robustness of context fusion, and optimizing computing efficiency. These technical effects work together in dialogue systems or natural language processing tasks, which can significantly improve the performance of the system and user experience. At the same time, this technical solution realizes the effective association and fusion between the target context vector and the reference context vector through accurate similarity calculation and reasonable weight distribution. This solution not only improves the accuracy of vector fusion, but also enhances the robustness of the system and supports a variety of application scenarios. At the same time, by optimizing computing efficiency and performance, this solution can also achieve faster response speed and better user experience in practical applications.
[0047] In one embodiment of the present invention, semantic information fusion is performed on the initial conversation record information to obtain a fused semantic feature vector, including: S301, performing word segmentation processing on the initial conversation record information, obtaining the word segmentation result corresponding to the initial conversation record information, and performing part-of-speech tagging on each word in the word segmentation result; S302, converting each word after word segmentation into a vector to generate a semantic vector; S303, normalizing the semantic vector to obtain a semantic vector with a unified scale corresponding to the initial conversation record information as a reference semantic vector; S304: Fusing the reference semantic vector and the target semantic vector to obtain a fused semantic feature vector.
[0048] The working principle of the above technical solution is as follows: the initial conversation record information (such as text conversation) is split into individual words or phrases. This is a basic step in natural language processing and helps with subsequent word-level processing. Each word segmentation result is labeled with its part of speech (such as noun, verb, adjective, etc.). Part of speech tagging helps understand the function and role of words in a sentence, which is important for subsequent semantic analysis. Each word after word segmentation is converted into a vector form, that is, a semantic vector is generated. This is usually achieved through pre-trained word embedding models (such as Word2Vec, BERT, etc.), which can map words into a high-dimensional vector space so that semantically similar words are close in the vector space. The generated semantic vectors are normalized to ensure that all vectors have a uniform scale. Normalization helps reduce the difference in scale between different vectors, making subsequent processing more stable and reliable. The normalized reference semantic vector (that is, the semantic vector of the initial conversation record information) is fused with the target semantic vector (which may be another conversation record, background knowledge, or a semantic vector of a specific task). Fusion methods may include weighted averaging, concatenation, attention mechanisms, etc., aiming to combine the semantic information of the two to generate a more comprehensive and accurate fused semantic feature vector.
[0049] The effect of the above technical solution is: through word segmentation, part-of-speech tagging and vectorization processing, the semantic information in the conversation record can be captured more accurately. Normalization and fusion processing further enhance the completeness and accuracy of the semantic information. The fused semantic feature vector contains richer semantic information, which helps the dialogue system to better understand and respond to various complex dialogue scenarios, and improve the robustness and adaptability of the system. The fused semantic feature vector generated by this technical solution can be applied to a variety of natural language processing tasks, such as sentiment analysis, intent recognition, dialogue generation, etc., providing strong semantic support for these tasks. Through vectorization and normalization processing, the text information is converted into an efficient numerical representation, which helps to improve the computational efficiency and performance of subsequent processing steps.
[0050] In summary, this technical solution realizes the semantic information fusion of the initial conversation record information through a series of processing steps, generates a fused semantic feature vector with rich semantic information, and provides strong support for natural language processing tasks.
[0051] In one embodiment of the present invention, the reference semantic vector and the target semantic vector are fused to obtain a fused semantic feature vector, including: S3041. After the initial conversation record information, collect the user's conversation data information in real time; S3042, performing semantic analysis on each conversation data of the user after the initial conversation record information, and obtaining a semantic vector having a uniform scale with the reference semantic vector as a target semantic vector; S3043, comparing the target semantic vector with each reference semantic vector in terms of similarity, and setting a weight value for each target semantic vector according to the similarity value; S3044, using the weight value corresponding to the target semantic vector to combine the target semantic vector and the reference semantic vector to obtain a fused semantic feature vector; The fused semantic feature vector is obtained by the following formula:
[0052] Where K represents the fused semantic feature vector; z represents the number of reference semantic vectors; t represents the number of target semantic vectors; B i represents the i-th reference semantic vector; A j represents the jth target semantic vector; λ ij Represents the jth target semantic vector A j Relative to the i-th reference semantic vector B i The weight of ; r represents the adjustment factor, which is used to adjust the influence of the average value of the reference semantic vector on the fusion result. r can be a positive real number, and its value range can be adjusted according to the specific task and data.
[0053] The working principle of the above technical solution is as follows: after the initial conversation record information, the system collects the user's conversation data information in real time. This is to capture the dynamic changes of user conversations and provide real-time data for subsequent semantic analysis and fusion. The collected user conversation data information is semantically analyzed and converted into a semantic vector with the same scale as the reference semantic vector, that is, the target semantic vector. This ensures the accuracy of subsequent similarity comparison and weight setting. Each target semantic vector is compared with each reference semantic vector for similarity. The similarity value reflects the degree of semantic proximity between the target semantic vector and the reference semantic vector. According to the similarity value, a weight value is set for each target semantic vector. The size of the weight value reflects the importance of the target semantic vector in the fusion process. Using the weight value corresponding to the target semantic vector, combined with the target semantic vector and the reference semantic vector, the fused semantic feature vector is obtained through weighted averaging or other fusion strategies. The fused semantic feature vector K is calculated by the formula, where z represents the number of reference semantic vectors, t represents the number of target semantic vectors, Bi represents the i-th reference semantic vector, Aj represents the j-th target semantic vector, and λij represents the weight of the j-th target semantic vector Aj relative to the i-th reference semantic vector Bi.
[0054] The effect of the above technical solution is: by collecting user dialogue data in real time, the system can capture the dynamic changes of user dialogues and generate semantic feature vectors that are more in line with the current dialogue context. Through similarity comparison and weight setting, the system can accurately evaluate the importance of each target semantic vector in the fusion process to ensure that the fused semantic feature vector is more accurate and comprehensive. This technical solution can handle reference semantic vectors and target semantic vectors of different numbers and types, and has strong adaptability and flexibility. The fused semantic feature vector contains richer semantic information, which helps the dialogue system to better understand user intentions and improve the performance of the dialogue system and user experience. This technical solution can handle complex dialogue scenarios, such as multi-round dialogues, context dependencies, etc., and provides strong semantic support for the dialogue system.
[0055] On the other hand, by collecting the user's conversation data information in real time and performing semantic analysis, the scheme can instantly capture the user's semantic intention and improve the response speed and accuracy of the dialogue system. This helps the dialogue system to understand the user's expression more deeply, so as to provide more accurate and personalized responses. The semantic vector of the conversation data information is scaled uniformly with the reference semantic vector, ensuring that the semantic vectors from different sources and at different time points are consistent and comparable when compared and fused. This helps to improve the accuracy and reliability of the fused semantic feature vector. By comparing the similarity of the target semantic vector with each reference semantic vector and assigning weights according to the similarity values, the scheme can identify the reference semantic vector that is most relevant to the target semantic vector and assign it a higher weight. This weight allocation mechanism makes the fused semantic feature vector focus more on the reference semantic information that is highly relevant to the target semantic vector, thereby improving the accuracy and robustness of the fusion result. The adjustment factor r is introduced to adjust the influence of the average value of the reference semantic vector on the fusion result. The scheme can be flexibly adjusted according to different tasks and data to adapt to different application scenarios and needs. This helps to further improve the applicability and accuracy of the fused semantic feature vector. By fusing and processing multiple semantic vectors, this solution enables the dialogue system to better understand and perceive the user's context, thereby providing a more coherent and natural dialogue experience. This helps to improve the contextual awareness and intelligence level of the dialogue system. The solution has good scalability and adaptability and can be applied to different types of dialogue systems and task scenarios. With the continuous accumulation of dialogue data and continuous optimization of the model, the solution is expected to further improve the overall performance and user experience of the dialogue system.
[0056] In summary, this technical solution achieves effective integration and utilization of semantic information through technical means such as real-time semantic analysis, unified scale processing, similarity comparison and weight allocation, and adjustment factor optimization. This not only improves the depth and breadth of the dialogue system's understanding of semantics, but also enhances the robustness and accuracy of the fusion results, laying a solid foundation for improving the intelligence level of the dialogue system. At the same time, this technical solution achieves semantic fusion of initial dialogue record information and user's subsequent dialogue data information by real-time collection of user dialogue data, semantic analysis and vector conversion, similarity comparison and weight setting, and fusion processing, generating a more accurate and comprehensive fused semantic feature vector, providing strong support for the performance improvement of the dialogue system.
[0057] In one embodiment of the present invention, the target semantic vector is compared with each reference semantic vector for similarity, and a weight value is set for each target semantic vector according to the similarity value, including: Step 1: Compare the target semantic vector with each reference semantic vector to obtain a similarity value between the target semantic vector and each reference semantic vector; The similarity value is obtained by the following formula:
[0058] Among them, Y ij represents the similarity value between the jth target semantic vector and the ith reference semantic vector; B i represents the i-th reference semantic vector; A j represents the jth target semantic vector; d represents the dimension of the target semantic vector and the reference semantic vector; and Represents the target semantic vector A j and the reference semantic vector B i The k-th dimension component of ; b represents the base of the logarithm in the semantic vector fusion process; Step 2: using the similarity value to obtain the corresponding weight value between each target semantic vector and each reference semantic vector; The weight value corresponding to each target semantic vector and each reference semantic vector is obtained by the following formula:
[0059] Among them, λ ij Represents the jth target semantic vector A j Relative to the i-th reference semantic vector B i The weight of Y; t represents the number of target semantic vectors; std(Y j ) represents the standard deviation of the similarity between the jth target semantic vector and the ith reference semantic vector; Y ij represents the similarity value between the jth target semantic vector and the ith reference semantic vector; B i represents the i-th reference semantic vector; A j represents the jth target semantic vector; Var(Y j ) represents the variance of the j-th target semantic vector relative to the ith reference semantic vector.
[0060] The working principle of the above technical solution is: similarity is calculated using a given formula. The formula is based on the Euclidean distance (or some kind of deformation) between vectors, and the similarity value is obtained by logarithmic transformation and normalization. Specifically, d in the formula represents the dimension of the vector, specifically the component of the vector in a certain dimension, and b is the base of the logarithmic transformation (usually the natural logarithm e or 2 is taken as the base). The Euclidean distance between the two vectors is obtained by calculating the sum of the squares of the differences in the components of the two vectors in each dimension, and then the square root is taken, and then the similarity value is obtained by formula transformation. Then, the weight is calculated using the given formula. The formula takes into account the variance (or standard deviation) of the similarity values between the target semantic vector and all reference semantic vectors, and the weight value is obtained by normalizing the inverse of the variance (or standard deviation). Specifically, std(Yj) in the formula represents the standard deviation of the similarity of the jth target semantic vector relative to all reference semantic vectors, and Var(Yj) represents the variance (although the formula directly gives the calculation formula of the weight, the variance is mentioned. Here we assume that the variance is an intermediate step for calculating the standard deviation). By calculating the similarity standard deviation of each target semantic vector and taking its reciprocal for normalization, the weight value of each target semantic vector relative to each reference semantic vector is obtained.
[0061] The effect of the above technical solution is: by calculating the similarity value between vectors, the semantic proximity between the target semantic vector and the reference semantic vector can be accurately measured. The weight setting method takes into account the variance (or standard deviation) of the similarity value, making the weight allocation more flexible and able to adjust the weight according to different situations. Since the weight setting method takes into account the fluctuation of the similarity value (measured by variance or standard deviation), it has a certain robustness to slight changes in the similarity value. The calculation process of the weight value is relatively clear, and the causes and results of the weight allocation can be understood by analyzing the similarity value and variance (or standard deviation). This technical solution can be applied to various scenarios that require the calculation of similarity and weights between vectors, such as text classification, information retrieval, recommendation systems, etc.
[0062] On the other hand, the technical solution calculates the similarity value between the target semantic vector and the reference semantic vector through a specific formula. The formula takes into account the various dimensional components of the semantic vector and uses a logarithmic function for calculation, so that the similarity between the two semantic vectors can be more accurately reflected. This precise similarity measurement method provides strong support for the rationality of subsequent weight allocation. When calculating the weight value, the solution not only considers the similarity value between the target semantic vector and a single reference semantic vector, but also introduces the similarity standard deviation and variance as adjustment factors. The similarity standard deviation reflects the degree of dispersion of the similarity between the target semantic vector and each reference semantic vector, while the variance further describes the overall characteristics of this degree of dispersion. By considering these two factors at the same time, the solution can more comprehensively evaluate the similarity relationship between the target semantic vector and the reference semantic vector. Since the similarity standard deviation and variance are introduced as the basis for weight allocation, the solution can dynamically adjust the weight value according to the specific similarity distribution. When the similarity between the target semantic vector and a reference semantic vector is high and the dispersion is small, the reference semantic vector will be assigned a higher weight; otherwise, it will be assigned a lower weight. This flexible weight allocation mechanism makes the fused semantic feature vector more accurate and reliable. By considering the standard deviation and variance of similarity, the scheme can reduce the impact of outliers on weight allocation and the final fusion result to a certain extent. When the similarity between a target semantic vector and a reference semantic vector is abnormally high or low, the impact of this abnormal similarity on weight allocation will be adjusted by the standard deviation and variance, thereby avoiding excessive deviation of the fusion result. The scheme can be dynamically adjusted according to different semantic vector distributions to adapt to different application scenarios and task requirements. Whether the semantic vector distribution is more concentrated or more dispersed, the scheme can ensure the accuracy and robustness of the fused semantic feature vector through a reasonable weight allocation mechanism. The above technical scheme is based on vector and matrix operations, and can achieve fast calculations through efficient numerical calculation libraries or parallel computing technologies. Therefore, in practical applications, the scheme can achieve high computational efficiency while ensuring computational accuracy.
[0063] In summary, this technical solution provides strong support for the effective integration and utilization of semantic information through accurate similarity measurement, dynamic weight distribution mechanism, improved robustness of semantic fusion, and optimized computing efficiency. These technical effects work together in the fields of natural language processing, dialogue systems, or intelligent question and answer, and can significantly improve the performance of the system and user experience.
[0064] In one embodiment of the present invention, performing secondary fusion on the fused context feature vector and the fused semantic feature vector to obtain a fused feature vector includes: S401, extracting a fused context feature vector and a fused semantic feature vector; S402, performing normalization processing on the fused context feature vector and the fused semantic feature vector to generate a normalized context feature vector and a semantic feature vector; wherein the normalized context feature vector and the semantic feature vector have the same dimension; S403 , performing secondary fusion on the standardized context feature vector and the semantic feature vector to generate a fused feature vector.
[0065] The fused feature vector is obtained by the following formula:
[0066] Where F represents the fused feature vector; s represents the number of components contained in the fused feature vector; F i represents the i-th component in the fused feature vector; F 01 、F 02 , ..., F s Represents the component corresponding to the fused feature vector; and each component is obtained by the following formula:
[0067] Among them, F i represents the i-th component in the fused feature vector; U i represents the i-th component in the normalized context feature vector; K i represents the i-th component in the semantic feature vector after normalization; ξ represents a hyperparameter; The working principle of the above technical solution is as follows: extract the fused context feature vector and semantic feature vector from the previous processing steps. These two vectors contain the context information and semantic information of the conversation respectively. Standardize the extracted context feature vector and semantic feature vector. The purpose of standardization is to ensure that the two vectors are comparable in value, that is, their components are in the same scale or range. This usually involves scaling or translating the value of each component so that it satisfies specific statistical properties (such as a mean of 0 and a standard deviation of 1). Through standardization, the context feature vector and the semantic feature vector have the same dimension, which is a prerequisite for subsequent fusion processing. The standardized context feature vector and the semantic feature vector are fused again. The fusion method may include weighted averaging, splicing, fusion using a deep learning model, etc. The purpose of fusion is to combine the information of the two to generate a feature vector that contains both context information and semantic information. The generated fused feature vector will be used for subsequent tasks, such as dialogue generation, intent recognition, sentiment analysis, etc.
[0068] The effect of the above technical solution is: through secondary fusion, the contextual features and semantic features are integrated into a feature vector, so that the vector can more comprehensively reflect the information of the conversation. This helps to improve the performance of subsequent tasks because more information is used for decision-making or prediction. The normalization process ensures that the contextual feature vector and the semantic feature vector are numerically comparable, which helps to reduce noise and bias in the fusion process. Therefore, the generated fused feature vector is more stable and reliable, and can improve the robustness of subsequent tasks. The technical solution has a certain degree of flexibility because the normalization process and fusion method can be adjusted according to specific tasks and data sets. This means that it can adapt to different dialogue scenarios and task requirements. As the dialogue system develops and new features emerge, the technical solution can be easily expanded to include more feature vectors.
[0069] By fusing the fused contextual feature vector and the fused semantic feature vector twice, the technical solution can generate a fused feature vector containing richer information. This new feature vector not only contains contextual information, but also incorporates semantic information, thereby improving the comprehensive expression ability of the feature vector. This enables subsequent processing or analysis to be based on more comprehensive and accurate information, which helps to improve the performance and accuracy of the system.
[0070] At the same time, before the secondary fusion, the scheme normalizes the fused contextual feature vector and the fused semantic feature vector. Normalization can eliminate the dimensional differences and numerical range differences between different feature vectors, making them have the same dimensions and comparability. This helps to ensure the fairness and accuracy of the secondary fusion and avoids the deviation of the fusion results caused by the numerical differences between the feature vectors. The technical scheme adopts a flexible fusion strategy in the secondary fusion process, that is, each component is the weighted sum of the standardized contextual feature vector component and the semantic feature vector component. Among them, the hyperparameter ξ is used to adjust the contextual feature vector component and the semantic feature vector component in F i This flexible fusion strategy enables the solution to be dynamically adjusted according to specific application scenarios and task requirements to adapt to different feature distributions and data characteristics. At the same time, by adjusting the hyperparameter ξ, the fusion results can be further optimized to improve the performance and accuracy of the system. This technical solution ensures the stability and efficiency of calculations through standardized processing and flexible fusion strategies. Standardized processing can simplify subsequent calculation processes and reduce calculation complexity. The flexible fusion strategy enables the solution to be dynamically adjusted according to specific data characteristics, avoiding the problem of calculation instability caused by data differences. In addition, the solution also uses clear formulas and algorithms to describe the fusion process, making the calculation process clearer and controllable.
[0071] In summary, this technical solution improves the comprehensive expression ability of feature vectors by secondary fusion of fused context feature vectors and fused semantic feature vectors; enhances the standardization and comparability of features through standardization processing; adopts flexible fusion strategies and hyperparameter adjustments to adapt to different application scenarios and task requirements; and improves computational efficiency and stability. These technical effects work together to improve the performance and accuracy of the system, providing strong support for applications in natural language processing, dialogue systems, intelligent question and answering, and other fields. At the same time, this technical solution generates a more comprehensive and accurate feature vector by secondary fusion of context feature vectors and semantic feature vectors, providing strong support for subsequent tasks of the dialogue system. At the same time, this solution also has certain flexibility, robustness and scalability, and can adapt to different dialogue scenarios and task requirements.
[0072] In one embodiment of the present invention, the fused feature vector is combined with the trained intent model to generate the conversation content for reply, including: S501, retrieve the trained intent model; S502, inputting the fused feature vector into a trained intent model to perform intent recognition and obtain an intent recognition result; S503, retrieving the dialogue generation model that has completed training; S504, inputting the intention recognition result into a dialogue generation model to generate dialogue content corresponding to the intention recognition result; S505: Reply the conversation content corresponding to the intention recognition result to the user conversation interface.
[0073] The working principle of the above technical solution is as follows: the system loads or retrieves a trained and verified intention recognition model from the storage. This model can receive the input feature vector and output the corresponding intention recognition result. The system inputs the fused feature vector into the retrieved intention model for intention recognition. This feature vector integrates context information, semantic information, etc., and can more comprehensively reflect the user's conversation intention. Through the processing of the intention model, the system can recognize the user's current conversation intention, such as inquiry, request, confirmation, etc. After recognizing the user's intention, the system then retrieves a trained and verified conversation generation model. This model can generate corresponding conversation content based on the input intention recognition result. The system inputs the intention recognition result into the conversation generation model, and the model generates conversation content matching the intention based on this input. This process may involve multiple technologies such as natural language generation, template matching, and knowledge base query. The generated conversation content should be consistent with the user's intention and remain natural and fluent. Finally, the system sends the generated conversation content to the user conversation interface as a reply to the user's current conversation. In this way, the user can see the corresponding reply generated by the system based on their conversation content.
[0074] The effect of the above technical solution is: by performing intent recognition through the fused feature vector, the system can more comprehensively capture the user's conversation intention, thereby improving the accuracy of intent recognition. This helps the system to more accurately understand the user's real needs, thereby generating conversation content that is more in line with the user's expectations. The conversation generation model can generate a variety of possible conversation contents based on the intention recognition results, which enhances the flexibility of conversation generation. The system can select the most appropriate conversation content as a reply based on the specific scenario and user needs. Since the system can more accurately understand the user's intentions and generate conversation content that meets the user's expectations, it can significantly improve the user experience. When talking to the system, the user can experience a more natural, smooth and intelligent interactive experience. The above technical solution realizes intelligent replies based on feature vectors and training models. The system can automatically generate replies based on the user's conversation content without manual intervention. This greatly improves the automation and response speed of the system.
[0075] In summary, this technical solution achieves intelligent and accurate dialogue content generation and response by combining the fused feature vector with the trained intent model and dialogue generation model. This helps improve user experience and system performance, and provides strong support for the further development of the dialogue system.
[0076] The embodiment of the present invention proposes a dialogue generation device based on artificial intelligence, such as Figure 2 As shown, the artificial intelligence-based dialogue generation device includes: The initial conversation record information acquisition module is used to collect the user's conversation in real time, generate the initial conversation using the predefined basic reply template, reply to the user's conversation, and obtain the initial conversation record information; A context feature vector acquisition module is used to fuse the context information of the initial conversation record information to obtain the fused context feature vector; A semantic feature vector acquisition module is used to perform semantic information fusion on the initial conversation record information to obtain a fused semantic feature vector; A feature vector fusion module is used to perform secondary fusion on the fused context feature vector and the fused semantic feature vector to obtain a fused feature vector; An intention recognition result acquisition module is used to input the fused feature vector into the trained intention model to perform intention recognition and obtain the intention recognition result; The dialogue response module is used to generate dialogue content for response based on the intent recognition results using the trained dialogue generation model.
[0077] The working principle of the above technical solution is as follows: the system first collects the user's dialogue input in real time. Using the predefined basic reply template, the system quickly generates the initial dialogue content and replies to the user's dialogue. In this process, the system obtains the initial dialogue record information to provide a basis for subsequent processing.
[0078] The system conducts in-depth analysis of the initial conversation record information and extracts context information. Through a specific algorithm or model, the context information is integrated into a context feature vector. This step helps the system understand the coherence of the conversation and the continuity of the user's intention.
[0079] The system further performs semantic analysis on the initial conversation record information to extract key semantic information, such as entities, relations, emotions, etc. These semantic information are fused into semantic feature vectors to more accurately understand user intentions.
[0080] The system performs a secondary fusion of the context feature vector and the semantic feature vector. Through the fusion algorithm, a fused feature vector that integrates the context information and the semantic information is generated. This step improves the system's overall understanding of user input and the accuracy of dialogue generation.
[0081] The system uses the trained intent model to match and analyze the fused feature vectors. Based on the matching results, the system generates conversation content that meets the user's intent. Finally, the system responds to the user with the generated conversation content to complete the conversation process.
[0082] The effect of the above technical solution is that through the fusion of context information and semantic information, the system can more accurately understand the user's intention and the coherence of the conversation. This helps to generate more accurate, smooth and user-expected conversation content. Compared with the traditional rule-based or template-based conversation generation method, the method of the present invention does not rely on fixed rules or templates. Instead, by learning a large amount of conversation data, an intention model that can adapt to different conversation scenarios and user needs is trained. This enables the system to show stronger generalization ability and adaptability when facing diverse conversation scenarios and user needs. By collecting user conversations in real time and quickly generating replies, the system can provide users with a more immediate and convenient service experience. At the same time, by accurately understanding user intentions and generating conversation content that meets expectations, the system can improve user satisfaction and loyalty. The method of the present invention has certain innovation and practicality in the fields of natural language processing and machine learning. In summary, the artificial intelligence-based conversation generation method has significant technical effects and broad application prospects.
[0083] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for generating dialogue based on artificial intelligence, characterized in that: The artificial intelligence-based dialogue generation method includes: Collect user conversations in real time, generate initial conversations using predefined basic reply templates, reply to user conversations, and obtain initial conversation record information; Perform context information fusion on the initial conversation record information to obtain the fused context feature vector; Perform semantic information fusion on the initial conversation record information to obtain the fused semantic feature vector; Performing secondary fusion on the fused context feature vector and the fused semantic feature vector to obtain a fused feature vector; The fused feature vector is combined with the trained intent model to generate conversation content for response.
2. The method for generating dialogue based on artificial intelligence according to claim 1, characterized in that: The initial conversation record information is fused with context information to obtain the fused context feature vector, including: Extracting key context information from the initial conversation record information, wherein the key context information includes a topic, a question, and a request; Preprocessing the context information to obtain preprocessed context information, wherein the preprocessing includes word segmentation processing and named entity recognition processing; Vectorizing the preprocessed context information to obtain a context vector corresponding to the preprocessed context information; Normalizing the context vector corresponding to the preprocessed context information to obtain a context vector of a uniform scale as a reference context vector; The reference context vector and the target context vector are fused to obtain a fused context feature vector.
3. The method for generating dialogue based on artificial intelligence according to claim 2, characterized in that: The reference context vector and the target context vector are fused to obtain a fused context feature vector, including: After the initial conversation record information, collect the user's conversation data information in real time; Convert each conversation data of the user after the initial conversation record information into a vector, and normalize the converted vector to obtain a context vector with the same scale as the reference context vector as the target context vector; Comparing the target context vector with each reference context vector for similarity, and setting a weight value for each target context vector according to the similarity value; The target context vector and the reference context vector are combined using the weight value corresponding to the target context vector to obtain a fused context feature vector; The fused context feature vector is obtained by the following formula: ; Among them, U represents the fused context feature vector; n represents the number of reference context vectors; m represents the number of target context vectors; R i represents the i-th reference context vector; T j represents the jth target context vector; w ij represents the jth target context vector T j Relative to the i-th reference context vector R i The weight of ; b represents the bias term.
4. The method for generating dialogue based on artificial intelligence according to claim 3, characterized in that: Comparing the target context vector with each reference context vector for similarity, and setting a weight value for each target context vector according to the similarity value, including: Compare the target context vector with each reference context vector for similarity, and obtain a similarity value between the target context vector and each reference context vector; The similarity value is obtained by the following formula: ; Among them, S ij Represents the similarity value between the j-th target context vector and the i-th reference context vector; R i represents the i-th reference context vector; T j represents the j-th target context vector; a represents the base of the preset logarithmic function; ε represents the preset minimum constant to prevent the denominator from being 0; Obtaining a weight value corresponding to each target context vector relative to each reference context vector using the similarity value; The weight value corresponding to each target context vector relative to each reference context vector is obtained by the following formula: ; Among them, w ij represents the jth target context vector T j Relative to the i-th reference context vector R i The weight of S ij represents the similarity value between the jth target context vector and the ith reference context vector; S jmax represents the maximum similarity between the jth target context vector and the n reference context vectors; std(S j ) represents the similarity standard deviation of the j-th target context vector corresponding to the n reference context vectors; m represents the number of target context vectors; x and y represent positive real number parameters respectively.
5. The method for generating dialogue based on artificial intelligence according to claim 1, characterized in that: Perform semantic information fusion on the initial conversation record information to obtain the fused semantic feature vector, including: Performing word segmentation processing on the initial conversation record information, obtaining the word segmentation result corresponding to the initial conversation record information, and performing part-of-speech tagging on each word in the word segmentation result; Convert each word after segmentation into a vector to generate a semantic vector; Normalizing the semantic vector to obtain a semantic vector with a unified scale corresponding to the initial conversation record information as a reference semantic vector; The reference semantic vector and the target semantic vector are fused to obtain a fused semantic feature vector.
6. The method for generating dialogue based on artificial intelligence according to claim 5, characterized in that: The reference semantic vector and the target semantic vector are fused to obtain a fused semantic feature vector, including: After the initial conversation record information, collect the user's conversation data information in real time; Perform semantic analysis on each conversation data of the user after the initial conversation record information to obtain a semantic vector with the same scale as the reference semantic vector as the target semantic vector; Comparing the target semantic vector with each reference semantic vector for similarity, and setting a weight value for each target semantic vector according to the similarity value; The target semantic vector and the reference semantic vector are combined using the weight value corresponding to the target semantic vector to obtain a fused semantic feature vector; The fused semantic feature vector is obtained by the following formula: ; Where K represents the fused semantic feature vector; z represents the number of reference semantic vectors; t represents the number of target semantic vectors; B i represents the i-th reference semantic vector; A j represents the jth target semantic vector; λ ij Represents the jth target semantic vector A j Relative to the i-th reference semantic vector B i The weight of ; r represents the adjustment factor, which is used to control the sensitivity of the reference semantic vector; r represents the adjustment factor, which is used to control the sensitivity of the reference semantic vector.
7. The method for generating dialogue based on artificial intelligence according to claim 6, characterized in that: Comparing the target semantic vector with each reference semantic vector for similarity, and setting a weight value for each target semantic vector according to the similarity value, including: Comparing the target semantic vector with each reference semantic vector in terms of similarity to obtain a similarity value between the target semantic vector and each reference semantic vector; The similarity value is obtained by the following formula: ; Among them, Y ij represents the similarity value between the jth target semantic vector and the ith reference semantic vector; B i represents the i-th reference semantic vector; A j represents the jth target semantic vector; d represents the dimension of the target semantic vector and the reference semantic vector; and Represents the target semantic vector A j and the reference semantic vector B i The k-th dimension component of ; b represents the base of the logarithm in the semantic vector fusion process; Using the similarity value to obtain a weight value corresponding to each target semantic vector and each reference semantic vector; The weight value corresponding to each target semantic vector and each reference semantic vector is obtained by the following formula: ; Among them, λ ij Represents the jth target semantic vector A j Relative to the i-th reference semantic vector B i The weight of Y; t represents the number of target semantic vectors; std(Y j ) represents the standard deviation of the similarity between the jth target semantic vector and the ith reference semantic vector; Y ij represents the similarity value between the jth target semantic vector and the ith reference semantic vector; B i represents the i-th reference semantic vector; A j represents the jth target semantic vector; Var(Y j ) represents the variance of the j-th target semantic vector relative to the ith reference semantic vector.
8. The method for generating dialogue based on artificial intelligence according to claim 1, characterized in that: Performing secondary fusion on the fused context feature vector and the fused semantic feature vector to obtain a fused feature vector includes: Extracting a fused context feature vector and a fused semantic feature vector; Performing standardization processing on the fused context feature vector and the fused semantic feature vector to generate a standardized context feature vector and a semantic feature vector; The standardized context feature vector and the semantic feature vector are fused again to generate a fused feature vector.
9. The method for generating dialogue based on artificial intelligence according to claim 1, characterized in that: The fused feature vector is combined with the trained intent model to generate conversation content for reply, including: Retrieve the trained intent model; Inputting the fused feature vector into the trained intent model to perform intent recognition and obtain an intent recognition result; Retrieve the trained dialogue generation model; Inputting the intention recognition result into a dialogue generation model to generate dialogue content corresponding to the intention recognition result; The conversation content corresponding to the intention recognition result is replied to the user conversation interface.
10. A dialogue generation device based on artificial intelligence, characterized in that: The artificial intelligence-based dialogue generation device comprises: The initial conversation record information acquisition module is used to collect the user's conversation in real time, generate the initial conversation using the predefined basic reply template, reply to the user's conversation, and obtain the initial conversation record information; A context feature vector acquisition module is used to fuse the context information of the initial conversation record information to obtain the fused context feature vector; A semantic feature vector acquisition module is used to perform semantic information fusion on the initial conversation record information to obtain a fused semantic feature vector; A feature vector fusion module, used for performing secondary fusion on the fused context feature vector and the fused semantic feature vector to obtain a fused feature vector; The dialogue response module is used to generate dialogue content for response by combining the fused feature vector with the trained intent model.
Citation Information
Patent Citations
A statement user intention identification method and device
CN109697282A
Conversation processing method and device, electronic equipment and storage medium
CN115455982A
Chinese dialogue text intention recognition method and device, equipment and storage medium
CN117494728A
Multi-round dialogue generation method for improving dialogue consistency and topic correlation based on multi-attention fusion mechanism
CN117520506A
Driving companion comprising a natural language understanding system and method for training the natural language understanding system
WO2021254838A1
Cited By
Artificial intelligence-based dialogue generation method and apparatus
WO2026166004A1