Intelligent dialogue system and method based on natural language processing
Through an intelligent dialogue system based on natural language processing, the problem of traditional dialogue systems being difficult to deal with complex natural language questions and ignoring user emotions is solved, and more accurate user intention understanding and emotional perception are achieved, and more natural and vivid dialogue is generated.
Patent Information
- Application Number
- CN202510315925.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-04-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional dialogue systems are difficult to deal with complex and changeable natural language questions, which leads to misunderstanding of user intentions or ignoring key information, and insufficient understanding and response to user emotions, resulting in dialogue appearing cold and unnatural.
Using an intelligent dialogue system based on natural language processing, the natural language description acquisition module, word segmentation embedding encoding module and word granularity semantic enhancement module are used to obtain the natural language description of user questions, word segmentation processing and semantic embedding encoding are carried out, and text feature sequence semantic correlation enhancement and user emotion type feature extraction are carried out to generate reply text.
It achieves a better understanding of the meaning of polysemes in the specific context, captures the deep structure and logical relationships of sentences, reduces the possibility of misunderstanding user intentions, accurately perceives the user's emotional state, and generates novel and context-compatible responses, making the conversation more vivid and interesting.
Smart Images

Figure CN119848219A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent dialogue, and more specifically, to an intelligent dialogue system and method based on natural language processing. Background Art
[0002] With the rapid development of artificial intelligence technology, people's expectations for human-computer interaction are increasing, especially in intelligent dialogue systems, pursuing a more natural, accurate and humanized communication experience. In today's digital age, smart devices and various online services are widely popular, and users need to interact with these systems frequently to obtain information, complete tasks or get entertainment.
[0003] However, traditional dialogue systems mainly rely on predefined rules and templates, which means that they can only select responses from a limited number of options and have difficulty handling complex and changing natural language questions. This makes them limited in dealing with lexical ambiguity, complex syntax, and contextual dependencies, and often misunderstands user intent or ignores key information. In addition, traditional systems lack understanding and response to user emotions, ignoring the importance of emotional communication in human-computer interaction, making the dialogue seem cold and unnatural, and reducing the quality of user experience.
[0004] Therefore, an intelligent dialogue solution based on natural language processing is desired. Summary of the invention
[0005] In order to solve the above technical problems, this application is proposed.
[0006] According to one aspect of the present application, an intelligent dialogue system based on natural language processing is provided, which includes: a natural language description acquisition module, which is used to acquire a natural language description of a user's question; a user question description word segmentation embedding coding module, which is used to perform word segmentation processing and semantic embedding coding on the natural language description of the user's question to obtain a sequence of user question word granularity semantic embedding coding vectors; a user question description word granularity semantic reinforcement module, which is used to perform text feature sequence semantic association reinforcement on the sequence of user question word granularity semantic embedding coding vectors to obtain a sequence of medium-granularity semantic reinforcement user question word granularity semantic embedding coding vectors, wherein the user question description word granularity semantic reinforcement module includes: a medium-granularity semantic association window determination unit, which is used to determine the user question description word granularity semantic embedding coding vector sequence. A user question medium-granularity semantic association window of each user question word granularity semantic embedding coding vector in the sequence of user question word granularity semantic embedding coding vectors; a medium-granularity user question word granularity semantic reinforcement unit, used to perform medium-granularity contextual semantic reinforcement on each user question word granularity semantic embedding coding vector in the sequence of user question word granularity semantic embedding coding vectors based on the user question medium-granularity semantic association window of each user question word granularity semantic embedding coding vector in the sequence of user question word granularity semantic embedding coding vectors to obtain a sequence of medium-granularity semantically reinforced user question word granularity semantic embedding coding vectors; a reply text generation module, used to generate a reply text based on the sequence of medium-granularity semantically reinforced user question word granularity semantic embedding coding vectors.
[0007] According to another aspect of the present application, a natural language processing-based intelligent dialogue method is provided, including: obtaining a natural language description of a user's question; performing word segmentation processing and semantic embedding coding on the natural language description of the user's question to obtain a sequence of user question word granularity semantic embedding coding vectors; performing text feature sequence semantic association enhancement on the sequence of user question word granularity semantic embedding coding vectors to obtain a sequence of medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors, including: determining a user question medium-granularity semantic association window of each user question word granularity semantic embedding coding vector in the sequence of user question word granularity semantic embedding coding vectors; performing medium-granularity contextual semantic enhancement on each user question word granularity semantic embedding coding vector in the sequence of user question word granularity semantic embedding coding vectors based on the user question medium-granularity semantic association window of each user question word granularity semantic embedding coding vector in the sequence of user question word granularity semantic embedding coding vectors to obtain a sequence of medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors; and generating a reply text based on the sequence of medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors.
[0008] Compared with the prior art, the present application provides an intelligent dialogue system and method based on natural language processing, which obtains the natural language description of the user's question, and uses AI-based natural language processing technology and processing algorithms to perform word segmentation and semantic embedding coding on the natural language description of the user's question, and then strengthens the text semantic association of the semantic embedding coding features of the granularity of each user's question word, and obtains the user's emotional type features based on the enhanced feature representation, so as to comprehensively consider the enhanced feature representations and user emotional type features to intelligently generate a reply text. Through the scheme of the present application, it is possible to better understand the meaning of polysemous words in a specific context, capture the deep structure and logical relationship of sentences, and reduce the possibility of misunderstanding user intentions. Moreover, no longer limited to predefined rules and templates, the system can accurately perceive the user's emotional state, such as positive, negative or neutral, and adjust the tone and wording accordingly, and generate novel and contextual responses according to the specific situation, making the dialogue more vivid and interesting. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0010] Figure 1 is a block diagram of an intelligent dialogue system based on natural language processing according to an embodiment of the present application.
[0011] Figure 2 A block diagram of a user question description word segmentation embedding encoding module in a natural language processing-based intelligent dialogue system according to an embodiment of the present application.
[0012] Figure 3 It is a block diagram of a granular semantic enhancement module for user question description words in a natural language processing-based intelligent dialogue system according to an embodiment of the present application.
[0013] Figure 4 The present invention is a block diagram of a reply text generation module in an intelligent dialogue system based on natural language processing according to an embodiment of the present application.
[0014] Figure 5 The present invention is a flowchart of an intelligent dialogue method based on natural language processing according to an embodiment of the present application. DETAILED DESCRIPTION
[0015] The embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, but rather these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0016] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0017] It is worth noting that in this application, all actions to obtain signals, information or data are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.
[0018] With the rapid development of artificial intelligence technology, people's expectations for human-computer interaction are increasing, especially in intelligent dialogue systems, pursuing a more natural, accurate and humanized communication experience. In today's digital age, smart devices and various online services are widely popular, and users need to interact with these systems frequently to obtain information, complete tasks or get entertainment.
[0019] However, traditional dialogue systems mainly rely on predefined rules and templates, which means that they can only select responses from a limited number of options and have difficulty handling complex and changing natural language questions. This makes them limited in dealing with lexical ambiguity, complex syntax, and contextual dependencies, and often misunderstands user intent or ignores key information. In addition, traditional systems lack understanding and response to user emotions, ignoring the importance of emotional communication in human-computer interaction, making the dialogue seem cold and unnatural, and reducing the quality of user experience.
[0020] Therefore, in response to the above technical problems, this application proposes an intelligent dialogue system based on natural language processing. Figure 1 is a block diagram of an intelligent dialogue system based on natural language processing according to an embodiment of the present application. Figure 1As shown, according to the embodiment of the present application, the intelligent dialogue system 100 based on natural language processing includes: a natural language description acquisition module 110, which is used to obtain the natural language description of the user's question; a user question description word segmentation embedding coding module 120, which is used to perform word segmentation processing and semantic embedding coding on the natural language description of the user's question to obtain a sequence of user question word granularity semantic embedding coding vectors; a user question description word granularity semantic reinforcement module 130, which is used to perform text feature sequence semantic association reinforcement on the sequence of user question word granularity semantic embedding coding vectors to obtain a sequence of medium-granularity semantically reinforced user question word granularity semantic embedding coding vectors; a reply text generation module 140, which is used to generate a reply text based on the sequence of medium-granularity semantically reinforced user question word granularity semantic embedding coding vectors.
[0021] In an embodiment of the present application, the natural language description acquisition module 110 is used to obtain a natural language description of a user's question. It should be understood that the natural language description of a user's question refers to a query or statement made by the user in the form of natural language. The "natural language" here refers to the language used by people in daily communication, including written and spoken language. Therefore, in order to better understand the personality characteristics of users, such as their preferences, habits and even emotional states, so as to provide a more personal service experience, in the technical solution of the present application, a natural language description of a user's question is obtained. That is, different natural language descriptions reflect different intentions, which may be seeking information, expressing opinions, seeking help, etc. By obtaining this description, the system can try to parse the real intention behind it, thereby generating accurate reply content that fits the user's ideas.
[0022] First of all, from the perspective of hardware devices, the system needs to be equipped with corresponding input interfaces. In modern smart devices, common ones such as smartphones and smart speakers all have input methods such as microphones and touch screens. Taking smartphones as an example, when a user opens a smart conversation application, the application will call the microphone permission of the phone and obtain the user's voice input in real time through the audio acquisition hardware. The microphone converts the sound signal into an electrical signal, and then converts it into digital audio data through the analog-to-digital conversion (ADC) process. These data will be encoded according to a certain audio coding format (such as common MP3, WAV and other formats) for subsequent transmission and processing in the system.
[0023] For touch screen-based text input, the system will provide a user-friendly text input box interface. This interface usually integrates input method software, which is responsible for converting characters entered by the user through keyboard or handwriting into standard text strings. The input method software will use its own character recognition algorithm and vocabulary to perform real-time error correction and associative supplements on the content entered by the user. For example, when the user enters a pinyin string, the input method will quickly match possible Chinese character combinations based on pinyin rules and existing vocabulary, and provide users with choices, ensuring that users can accurately and efficiently enter natural language text.
[0024] At the software level, the system needs to run a dedicated listening program to continuously monitor the user's input behavior. This listening program will continue to run in the background, and once it detects that the user has an input operation (whether voice or text), it will immediately start the corresponding processing flow. For voice input, the listening program will trigger the speech recognition engine to start working. The speech recognition engine is a complex software module built on a deep learning algorithm. It usually uses convolutional neural networks (CNN) and recurrent neural networks (RNN) and their variants (such as long short-term memory networks LSTM, gated recurrent units GRU, etc.) to process audio data. The speech recognition engine first pre-processes the input audio data, including removing noise, performing audio signal enhancement and other operations to improve the quality of the speech signal. Then, it divides the audio data into small speech segments, which are usually called "frames". For each frame, the speech recognition engine extracts its acoustic features, common acoustic features include Mel frequency cepstral coefficients (MFCC), etc. By analyzing and modeling these acoustic features, the speech recognition engine converts the speech segment into a corresponding phoneme sequence. Next, the language model is used to further process and transform the phoneme sequence, ultimately obtaining a natural language text description of the user's question.
[0025] In the process of obtaining the natural language description of the user's question, the complexity of the user's environment must also be considered. For example, in a noisy environment, voice input may be severely interfered with. To solve this problem, the system uses a series of noise reduction technologies. A common method is to use microphone array technology to collect sound signals through multiple microphones at the same time, and locate and separate the sound based on information such as the time difference and intensity difference when the sound reaches different microphones, thereby effectively removing background noise. In addition, the system can also use deep learning algorithms to train specialized noise reduction models, which can learn the speech characteristics in different noise environments and repair and enhance the noise-contaminated speech.
[0026] In addition to hardware and software technology, user experience design is also an important aspect of obtaining natural language descriptions of user questions. The system needs to provide clear and concise prompt information to guide users to input. For example, when inputting voice, the application may display an animation or icon to prompt the user when they can start speaking and whether the speaking volume is appropriate. When inputting text, some sample text may be displayed next to the input box to help users understand how to ask questions correctly. At the same time, the system also needs to have a certain degree of fault tolerance. When the user input is wrong or incomplete, it can help the user to correct it through prompts and guidance.
[0027] In terms of data transmission, once the natural language description of the user's question is obtained, whether it is obtained through voice recognition or text input, it needs to be transmitted securely and quickly to the subsequent processing module. Usually, network communication protocols such as HTTP and HTTPS are used. During the transmission process, the data will be encrypted to protect the user's privacy information. For example, encryption technologies such as SSL / TLS are used to encrypt and decrypt the transmitted data to ensure that the data is not stolen or tampered with during network transmission.
[0028] From the perspective of system architecture, the module that obtains the natural language description of user questions needs to collaborate and interact well with other modules. It needs to interact with the user management module to obtain relevant information about the user, such as the user's historical question records, preference settings, etc. This information can help the system better understand the user's question intentions. For example, if the system knows that users often ask questions about travel, then when the user enters a vague question, the system can be more inclined to understand and handle this question from the perspective of travel-related fields. At the same time, this module also needs to collaborate with the system's resource management module to ensure that system resources, such as CPU, memory, etc., can be reasonably allocated when obtaining and processing user input to ensure the efficient operation of the system.
[0029] In the embodiment of the present application, the user question description word segmentation embedding coding module 120 is used to perform word segmentation processing and semantic embedding coding on the natural language description of the user question to obtain a sequence of user question word granularity semantic embedding coding vectors. Figure 2 1 is a block diagram of a user question description word embedding encoding module in an intelligent dialogue system based on natural language processing according to an embodiment of the present application. Specifically, in the embodiment of the present application, Figure 2As shown, the user question description word segmentation embedding coding module 120 includes: a user question word granularity splitting unit 121, which is used to perform word segmentation processing on the natural language description of the user question to obtain a text sequence of user question word granularity descriptions; a user question word granularity semantic encoding unit 122, which is used to input each user question word granularity description in the text sequence of user question word granularity description into a semantic embedding encoder based on the Bert model to obtain a sequence of user question word granularity semantic embedding coding vectors.
[0030] Accordingly, considering that the natural language description of the user's question is often a continuous sentence, in order to more accurately capture the meaning of each word and its role in the sentence. This is crucial for correctly understanding the user's intention. In the technical solution of the present application, the natural language description of the user's question is segmented to break down a whole paragraph into meaningful word units, and obtain a text sequence of the user's question word granularity description, so that the semantics of each word in the sentence can be analyzed more clearly, helping the system to more accurately grasp the meaning of the sentence as a whole, and laying the foundation for further in-depth understanding of the semantic relationship of the text.
[0031] It should be understood that in order to capture and mine the contextual semantic associations between each word and each other word, to understand the context of the word in the sentence, and to generate a context-sensitive representation, in the technical solution of the present application, the semantic embedding encoder based on the Bert model is used to process each user question word granularity description in the text sequence of the user question word granularity description to obtain a sequence of user question word granularity semantic embedding encoding vectors. It should be understood that the Bert model has demonstrated excellent semantic representation capabilities in the field of natural language processing. It is a pre-trained language model based on the Transformer architecture that can fully capture the semantic information of words in different contexts. By inputting the user question word granularity description into it, each word can be converted into a vector representation containing rich semantic features, and its appropriate semantic encoding is accurately given in the vector according to the specific context, thereby more accurately reflecting the actual semantic connotation of the word, and laying the foundation for subsequent accurate understanding of the entire question content. In addition, the advantage of the Bert model is that it can consider the contextual information of words in both directions. When encoding the word-granular description of the user's question, the semantic embedding coding vector of each word will integrate the relevant semantics of the text content before and after the word to more comprehensively reflect its meaning in this specific context. The generated word-granular semantic embedding coding vector sequence can better reflect the semantic relevance and coherence of the entire text.
[0032] Taking a common sentence "How is the weather today?" as an example, the processing process of the user's question word granularity description being input into the semantic embedding encoder based on the Bert model is described in detail: First, it enters the input layer of the Bert model. The input layer will perform preliminary processing on the sentence, including word segmentation, dividing it into several word units such as "today", "weather", and "how". Then, these words will enter the word embedding layer of the Bert model. The word embedding layer uses the knowledge obtained by pre-training on large-scale text to map each word to a specific vector space. For example, the word "today" may be mapped to a vector with a certain dimension (such as 768 dimensions). This vector contains the semantic information accumulated by "today" in different contexts, so that the model can have a basic semantic representation of it at the beginning. Subsequently, the position embedding layer will add position information to each word. In this sentence, "today" is at the beginning of the sentence, and it will obtain a corresponding position vector and add it to the word embedding vector. In this way, the vector representation of "today" not only contains its own semantics, but also contains its position information in the sentence, which is very important for understanding the semantic structure of the sentence. After that, these processed vectors will enter the multi-head attention mechanism layer. In this layer, it is assumed that the model has 12 heads of attention mechanism. For the word "today", it will establish different associations with other words in different attention heads. For example, in one head, it may focus on the word "weather" because "today" and "weather" are closely connected in semantics. Through the calculation of the attention mechanism, the vector representation of "today" will be adjusted to make it more reflective of this association with "weather". Similarly, for the two words "weather" and "how", they will also interact with other words under the multi-head attention mechanism, thereby continuously enriching their own semantic representation. After being processed by the multi-head attention mechanism layer, the vector will enter the feedforward neural network layer. This layer consists of two linear transformation layers and an activation function layer. Taking the feedforward neural network's processing of the word "today" as an example, it will further nonlinearly transform the vector of "today" adjusted by the attention mechanism. Through this transformation, the semantic representation of "today" will be more accurate and more in line with the contextual requirements of the current sentence. In the network structure of the entire Bert model, there are also operations such as layer normalization and residual connection. Layer normalization normalizes the output of each layer to ensure the stability of data distribution, which is conducive to model training and convergence. Residual connection adds the input and output of each layer, effectively avoiding the gradient vanishing or gradient exploding problems that may occur in deep networks, and ensuring that the model can continue to effectively learn and update semantic information. Through such a series of complex and orderly operations, the Bert model can generate high-quality user question word granularity semantic embedding encoding vectors for words such as "today", "weather", and "how".
[0033] In the embodiment of the present application, the user question description word granularity semantic enhancement module 130 is used to perform text feature sequence semantic association enhancement on the sequence of the user question word granularity semantic embedding coding vector to obtain a sequence of medium-granularity semantic enhancement user question word granularity semantic embedding coding vector. Further, considering that words in natural language text do not exist in isolation, but have close semantic associations. Although the original user question word granularity semantic embedding coding vector has already contained certain semantic information, it may not be sufficient for the deep semantic connection mining between words. Therefore, in order to better capture the contextual information of vocabulary in a larger range, this helps to improve the understanding of the entire sentence or paragraph, and ensure that the representation of each vocabulary not only reflects its own meaning, but also takes into account its role in the entire text structure. In the technical solution of the present application, the sequence of the user question word granularity semantic embedding coding vector is subjected to text feature sequence semantic association enhancement to obtain a sequence of medium-granularity semantic enhancement user question word granularity semantic embedding coding vector. In this way, the logical relationship between different parts in the text can be identified and strengthened, such as subject-predicate-object structure, cause-effect relationship, etc. This enhancement makes the generated semantic embedding closer to human language habits, thereby improving the naturalness and fluency of the dialogue system.
[0034] Figure 3 1 is a block diagram of a user question description word granularity semantic enhancement module in an intelligent dialogue system based on natural language processing according to an embodiment of the present application. Specifically, Figure 3 As shown, the user question description word granularity semantic enhancement module 130 includes: a medium-granularity semantic association window determination unit 131, which is used to determine the user question medium-granularity semantic association window of each user question word granularity semantic embedding coding vector in the sequence of the user question word granularity semantic embedding coding vector; a medium-granularity user question word granularity semantic enhancement unit 132, which is used to perform medium-granularity contextual semantic enhancement on each user question word granularity semantic embedding coding vector in the sequence of the user question word granularity semantic embedding coding vector based on the user question medium-granularity semantic association window of each user question word granularity semantic embedding coding vector in the sequence of the user question word granularity semantic embedding coding vector to obtain a sequence of the medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors.
[0035] Specifically, the medium-granularity semantic association window determination unit 131 includes: a hyperbolic space mapping subunit, which is used to map each user question word granularity semantic embedding coding vector in the sequence of user question word granularity semantic embedding coding vectors to the hyperbolic space to obtain a sequence of hyperbolic space user question word granularity semantic embedding coding vectors. The process is expressed by the following formula: ;in, A sequence of word-granular semantic embedding encoding vectors for the user's question, and are the first, second, and third granular semantic embedding encoding vectors of the user's question words. and The user's question word-granular semantic embedding encoding vector, and are the first weight matrix in hyperbolic space and the second weight matrix in hyperbolic space respectively, For Perform hyperbolic space mapping, for The hyperbolic space user question word granularity semantic embedding encoding vector after mapping.
[0036] The semantic association window determination subunit is used to determine the user question medium granularity semantic association window of each user question word granularity semantic embedding coding vector in the sequence of user question word granularity semantic embedding coding vectors based on the sequence of hyperbolic space user question word granularity semantic embedding coding vectors.
[0037] Specifically, in the embodiment of the present application, the semantic association window determination subunit includes: a semantic grammatical depth implicit representation value calculation subunit, which is used to calculate the grammatical depth implicit representation value of each hyperbolic space user question word granularity semantic embedding coding vector in the sequence of the hyperbolic space user question word granularity semantic embedding coding vector to obtain the sequence distribution of the user question word granularity semantic grammatical depth implicit representation value, and the process is expressed by the formula as follows: ;in, for The hyperbolic space user question word granularity semantic embedding encoding vector after mapping, To calculate the square of the length of a vector, is the logarithmic function value with base 2, For calculation The syntax depth of implies the value, is the first in the sequence distribution of the user's question word granular semantic grammar depth implicit representation value The granular semantic grammar of the user's question word represents the implicit value, that is, The corresponding user question word granularity semantic grammar depth implicit representation value.
[0038] The implicit representation value guided window size determination subunit is used to determine the granular semantic association window in the user question of each user question word granular semantic embedding coding vector in the sequence of the user question word granular semantic embedding coding vector based on the sequence distribution of the user question word granular semantic grammatical depth implicit representation value.
[0039] More specifically, in an embodiment of the present application, the implicit representation value guided window size determination subunit includes: a window size determination secondary subunit, used to determine the starting position of the granular semantic association window in the user question of the first user question word granular semantic embedding coding vector in the sequence of the user question word granular semantic embedding coding vector and the ending position of the granular semantic association window in the user question; a first semantic association window determination secondary subunit, used to determine the granular semantic association window in the user question of the first user question word granular semantic embedding coding vector from the sequence of the user question word granular semantic embedding coding vector based on the starting position of the granular semantic association window in the user question and the ending position of the granular semantic association window in the user question.
[0040] More specifically, in an embodiment of the present application, the window size determines the secondary sub-unit, which is used to: extract the user question word granularity semantic grammatical depth implicit representation value of the first user question word granularity semantic embedding coding vector in the sequence of the user question word granularity semantic embedding coding vector as the starting position of the granularity semantic association window in the user question; along the sequence distribution of the user question word granularity semantic grammatical depth implicit representation values, find the user question word granularity semantic grammatical depth implicit representation value that is closest to the user question word granularity semantic grammatical depth implicit representation value of the first user question word granularity semantic embedding coding vector as the ending position of the granularity semantic association window in the user question.
[0041] The above implicit representation value guides the window size determination subunit, and the process is expressed by the following formula: ;in, and They are the sequence distribution of the granular semantic grammar depth implicit representation value of the user's question word. and The granular semantics and grammar of the user's question words have a deep implicit representation value. To find and The closest user question word granular semantic grammar depth implicit representation value corresponding position , for The size of the granular semantic association window in the user's question.
[0042] Specifically, the medium-granularity user question word granularity semantics strengthening unit 132 is used to perform medium-granularity contextual semantics strengthening on each user question word granularity semantic embedding coding vector in the sequence of user question word granularity semantics embedding coding vectors based on the user question medium-granularity semantics association window of each user question word granularity semantics embedding coding vector in the sequence of user question word granularity semantics embedding coding vectors to obtain the sequence of medium-granularity semantically strengthened user question word granularity semantics embedding coding vectors. The process is expressed by the following formula: ;in, is the scoring reference vector, is the scoring reference weight matrix, is the rating bias vector, yes The first The user's question word-granular semantic embedding encoding vector, is matrix multiplication, represents the exponential function value with the natural constant e as the base, is the first in the sequence of medium-granularity semantically enhanced user question word granularity semantic embedding encoding vectors The medium-granularity semantics enhances the granularity semantics of the user's question word embedding encoding vector.
[0043] Specifically, first, in order to better capture and reflect the complex structural characteristics of the hierarchical and nested semantics of words in natural language texts, and to lay the foundation for more accurate analysis of semantic associations in the future, the granular semantic embedding coding vectors of each user's question word are mapped to the hyperbolic space to obtain a sequence of hyperbolic space user question word granular semantic embedding coding vectors. In other words, the obtained hyperbolic space vectors can represent the semantic information of each word in a way that fits the intrinsic structure of natural language semantics, so as to better reflect the actual situation between words in terms of semantic hierarchy, conceptual association, etc., so that the subsequent calculation and analysis of semantic relationships are more in line with the essential characteristics of natural language semantics.
[0044] Next, the grammatical depth implicit representation value of each hyperbolic space user question word granular semantic embedding encoding vector is used to obtain the sequence distribution of the grammatical depth implicit representation value of the user question word granular semantics. In particular, the grammatical depth implicit representation value of each word in the hyperbolic space is calculated to evaluate its grammatical role and importance in the entire sentence. This step helps the system understand the position and role of each word, not just its surface meaning. This representation value can be used as a way to measure the strength of the grammatical relationship between words, and then assist in identifying the primary and secondary structures and logical connections within the sentence to highlight the key components and weaken the secondary elements.
[0045] Then, based on the sequence distribution of the implicit representation value of the granular semantic grammar depth of the user question word, the medium-granular semantic association window of the user question of each user question word granular semantic embedding encoding vector is determined. The essence of this step is to define the semantic association range of each word that needs to be focused on during semantic analysis. Because different words have different grammatical status and semantic roles, the scope of other words closely related to them is also different. In other words, the medium-granular semantic association window is an adaptive adjustment mechanism that can dynamically change according to the complexity of the context and capture the flexible semantics of vocabulary. By determining this association window, we can focus on the part that has substantial semantic connection with each word at the medium-granular level, avoiding meaningless, overly broad or narrow semantic association analysis. That is, after determining the medium-granular semantic association window of the user question of each user question word granular semantic embedding encoding vector, it is equivalent to defining the "effective scope of action" for each word in the semantic association analysis. In this way, when performing semantic processing in the future, the semantic connection between words can be examined according to this established range, so that the mining of semantic connection is more targeted, more in line with the semantic structure characteristics of the text itself, and it is helpful to extract medium-granular semantic information with more practical value.
[0046] Finally, based on the determined medium-granularity semantic association window of the user's question, the medium-granularity contextual semantics of the granular semantic embedding encoding vector of each user's question word are enhanced to make full use of the defined semantic association range and integrate the contextual semantic information within this range more deeply into the semantic vector representation of each word. This is done to further enhance the semantic association between words at the medium-granularity level, so that the semantic vector of each word not only contains its own basic semantics, but also incorporates the contextual semantic features closely related to it, thereby obtaining a sequence of medium-granularity semantically enhanced user question word granular semantic embedding encoding vectors.
[0047] In the embodiment of the present application, the reply text generation module 140 is used to generate a reply text based on the sequence of medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors. Figure 4 : is a block diagram of a reply text generation module in an intelligent dialogue system based on natural language processing according to an embodiment of the present application. Specifically, Figure 4 As shown, the reply text generation module 140 includes: a user emotion type feature generation unit 141, which is used to obtain a user emotion type embedding coding vector based on the sequence of medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors; an emotion type reply text unit 142, which is used to add the user emotion type embedding coding vector to the end of the sequence of medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors, and then input it into a dialogue generator based on a large language model to obtain the reply text.
[0048] Specifically, the user emotion type feature generating unit 141 is used to: input the sequence of medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors into the emotion recognizer based on the classifier to obtain the user emotion type embedding coding vector. It should be understood that when users ask natural language questions, they often have certain emotional colors, such as different emotional states such as expectation, curiosity, anxiety, dissatisfaction, etc. Therefore, in order to dig out this emotional attitude hidden behind the user's question text, and then fully understand the user's intention, rather than just being limited to the understanding of the question content itself, in the technical solution of the present application, the sequence of medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors is input into the emotion recognizer based on the classifier to analyze and classify the semantic information carried by the vector, and determine what kind of emotion the user is asking the question, so as to provide additional key basis for the subsequent generation of more accurate and user-friendly replies.
[0049] Specifically, the emotion type reply text unit 142 is used to add the user emotion type embedding coding vector to the end of the sequence of medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors, and then input it into the dialogue generator based on the large language model to obtain the reply text.
[0050] That is, the sequence of medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors contains the semantic information extracted after careful processing of the user question text, reflecting the core content of the user's question and the semantic association of each part; and the user emotion type embedding coding vector reflects the emotional state of the user when asking questions. Based on this, inputting it into the dialogue generator based on the large language model is to completely pass the two key information of semantics and emotion to the generator, so that the generator can construct the reply content based on a comprehensive and comprehensive feature representation, ensuring that the reply not only fits the actual meaning of the user's question, but also takes care of the user's emotional feelings. It is worth mentioning that the large language model has a strong language understanding and text generation capability, and can learn the language mode under different semantic and emotional combinations based on the input feature representation, and then generate a logically coherent, accurate and linguistic reply text. In particular, in a specific embodiment of the present application, the large language model can be, IntelliQ: This is an open source project that provides a multi-round question-answering system based on a large language model (LLM), combining intent recognition and word slot filling technology to improve the understanding depth and response accuracy of the dialogue system. It supports multi-round dialogue management, intent recognition, slot filling, interface slot technology, adaptive learning, and is easily integrated into multiple programming languages and platforms. LangGPT: This project explores the use of multiple prompts to work together to improve the capabilities of large models. Through carefully designed prompt chains and multi-prompt collaboration, LangGPT community members are able to create efficient multi-round dialogue and content generation workflows.
[0051] It should be understood that here, after the user question word granularity descriptions obtained based on the natural language description of the user question are respectively input into the semantic embedding encoder based on the Bert model, the sequence expression of the user question word granularity semantic embedding encoding vector is based on the encoding semantic features of the word granularity semantic context. Therefore, after further inputting the semantic optimizer based on the semantic span association constraint of the text feature sequence, the optimized encoding semantic features of the medium granularity sequence semantic association constraint can be obtained on the basis of the word granularity encoding semantic feature sequence representation. In this way, after inputting the classifier-based emotion recognizer to obtain the user emotion type embedding encoding vector, the emotion recognition encoding representation based on the word granularity-medium granularity encoding semantic feature can be obtained.
[0052] However, after the user emotion type embedding coding vector is added to the tail of the sequence of medium-granularity semantically enhanced user question word-granularity semantic embedding coding vectors, since the sequence of medium-granularity semantically enhanced user question word-granularity semantic embedding coding vectors itself contains word-granularity-medium-granularity sequence encoding semantic features, and the user emotion type embedding coding vector contains emotion recognition encoding features, it as a whole will have the problem of insufficient long-distance fusion representation, thereby affecting the text quality of the generative response text obtained by inputting the dialogue generator based on the large language model.
[0053] Therefore, preferably, after adding the user emotion type embedding coding vector to the tail of the sequence of medium-granularity semantically reinforced user question word granularity semantic embedding coding vectors, when inputting into the dialogue generator based on the large language model, the sequence of medium-granularity semantically reinforced user question word granularity semantic embedding coding vectors and the user emotion type embedding coding vector are optimized as a whole, including the steps of: concatenating the sequence of medium-granularity semantically reinforced user question word granularity semantic embedding coding vectors and the user emotion type embedding coding vector into a user question semantics-user emotion type joint embedding coding vector, and performing a probabilistic function-based optimization on the user question semantics-user emotion type joint embedding coding vector, such as The function activation is probabilized to obtain the probabilistic encoding vector of the joint embedding of user question semantics and user emotion type.
[0054] Calculate the user question semantics-user emotion type joint embedding probabilistic encoding vector The bi-norm of obtains the user question semantics-user sentiment type joint embedding base unit value .
[0055] The user question semantics-user emotion type is jointly embedded into the base unit value The user question semantics-user sentiment type joint embedding probabilistic coding vector is calculated as an index The power function is used, and the absolute value is calculated after point subtraction with the unit feature vector to obtain the intrinsic feature vector of the joint embedding dimension of user question semantics-user emotion type ,in, represents vector subtraction, i.e. point subtraction, represents the unit eigenvector.
[0056] Calculate the user question semantics-user emotion type joint embedding probabilistic encoding vector The bitwise inverse of the user question semantics-user sentiment type is jointly embedded into the base unit value The dot product of is used as the user question semantics-user sentiment type joint embedding intrinsic bias feature vector ,in, represents the Hadamard product, i.e., the dot product, It represents calculating the bit-by-bit inverse of the probabilistic coding vector jointly embedded with the user question semantics and the user emotion type, that is, calculating the inverse of each eigenvalue of the probabilistic coding vector jointly embedded with the user question semantics and the user emotion type.
[0057] The user question semantics-user emotion type is jointly embedded into the dimensional intrinsic feature vector With a learnable mapping matrix After high-order spatial mapping, the intrinsic bias feature vector is jointly embedded with the user question semantics-user emotion type as a bias The optimized user question semantics-user sentiment type joint embedding coding vector is obtained by performing the above steps. ,in, represents matrix multiplication, Represents vector addition, that is, point addition.
[0058] That is, in order to solve the problem of low overall integrated representation efficiency due to span influence under local spacing constraints of the sequence of medium-granularity semantically reinforced user question word granularity semantic embedding coding vectors and the feature set of the user emotion type embedding coding vector, a multidimensional feature basis unit representation method based on the inner product aggregation of the sequence of medium-granularity semantically reinforced user question word granularity semantic embedding coding vectors and the user emotion type embedding coding vector is adopted to capture the global parameter association network of the feature values of the sequence of medium-granularity semantically reinforced user question word granularity semantic embedding coding vectors and the user emotion type embedding coding vector. Therefore, by constructing a high-order spatial mapping of the latent dimensional feature intrinsics of the sequence of medium-granularity semantically reinforced user question word granularity semantic embedding coding vectors and the user emotion type embedding coding vector, the multi-dimensional feature association mapping relationship between the sequence of medium-granularity semantically reinforced user question word granularity semantic embedding coding vectors and the user emotion type embedding coding vector is reconstructed, and the coding reconstruction of the temporal distribution pattern is achieved, thereby enhancing the fusion expression effect of the sequence of medium-granularity semantically reinforced user question word granularity semantic embedding coding vectors and the user emotion type embedding coding vector, and improving the text quality of the generative response text obtained by inputting the dialogue generator based on the large language model.
[0059] In summary, the natural language processing-based intelligent dialogue system 100 based on the embodiment of the present application is explained, which obtains the natural language description of the user's question, and uses AI-based natural language processing technology and processing algorithms to perform word segmentation and semantic embedding coding on the natural language description of the user's question, and then strengthens the text semantic association of each user's question word granularity semantic embedding coding feature, and obtains the user emotion type feature based on the strengthened feature representation, so as to comprehensively consider each strengthened feature representation and user emotion type feature to intelligently generate a reply text. Through the scheme of the present application, it is possible to better understand the meaning of polysemous words in a specific context, capture the deep structure and logical relationship of the sentence, and reduce the possibility of misunderstanding the user's intention. Moreover, no longer limited to predefined rules and templates, the system can accurately perceive the user's emotional state, such as positive, negative or neutral, and adjust the tone and wording accordingly, and generate novel and contextual responses according to the specific situation, making the dialogue more vivid and interesting.
[0060] As described above, the intelligent dialogue system 100 based on natural language processing according to the embodiment of the present application can be implemented in various wireless terminals, such as a server with an intelligent dialogue algorithm based on natural language processing. In a possible implementation, the intelligent dialogue system 100 based on natural language processing according to the embodiment of the present application can be integrated into the wireless terminal as a software module and / or a hardware module. For example, the intelligent dialogue system 100 based on natural language processing can be a software module in the operating system of the wireless terminal, or can be an application developed for the wireless terminal; of course, the intelligent dialogue system 100 based on natural language processing can also be one of the many hardware modules of the wireless terminal.
[0061] Alternatively, in another example, the natural language processing-based intelligent dialogue system 100 and the wireless terminal may also be separate devices, and the natural language processing-based intelligent dialogue system 100 may be connected to the wireless terminal via a wired and / or wireless network and transmit interactive information in accordance with an agreed data format.
[0062] Figure 5 Flowchart of an intelligent dialogue method based on natural language processing according to an embodiment of the present application. Figure 5As shown, according to the embodiment of the present application, the intelligent dialogue method based on natural language processing includes: S110, obtaining a natural language description of a user's question; S120, performing word segmentation processing and semantic embedding coding on the natural language description of the user's question to obtain a sequence of user question word granularity semantic embedding coding vectors; S130, performing text feature sequence semantic association enhancement on the sequence of user question word granularity semantic embedding coding vectors to obtain a sequence of medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors, including: determining each user question in the sequence of user question word granularity semantic embedding coding vectors A medium-granularity semantic association window of a user question of a word-granularity semantic embedding coding vector; based on the medium-granularity semantic association window of each user question word-granularity semantic embedding coding vector in the sequence of user question word-granularity semantic embedding coding vectors, medium-granularity contextual semantic enhancement is performed on each user question word-granularity semantic embedding coding vector in the sequence of user question word-granularity semantic embedding coding vectors to obtain a sequence of medium-granularity semantically enhanced user question word-granularity semantic embedding coding vectors; S140, based on the sequence of medium-granularity semantically enhanced user question word-granularity semantic embedding coding vectors, a reply text is generated.
[0063] Here, those skilled in the art can understand that the specific operations of each step in the above-mentioned intelligent dialogue method based on natural language processing have been referred to above. Figures 1 to 4 The invention has been introduced in detail in the description of the intelligent dialogue system based on natural language processing, and therefore, its repeated description will be omitted.
[0064] The above descriptions of various implementations of the present disclosure are exemplary and not exhaustive. The disclosure is not limited to the disclosed implementations, and many modifications and variations are obvious to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The terms used herein are selected to best explain the principles of the implementations, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the various practical methods disclosed herein.
Claims
1. An intelligent dialogue system based on natural language processing, characterized in that: include: A natural language description acquisition module is used to acquire a natural language description of a user's question; a user question description word segmentation embedding coding module is used to perform word segmentation processing and semantic embedding coding on the natural language description of the user's question to obtain a sequence of user question word granularity semantic embedding coding vectors; a user question description word granularity semantic reinforcement module is used to perform text feature sequence semantic association reinforcement on the sequence of user question word granularity semantic embedding coding vectors to obtain a sequence of medium-granularity semantically reinforced user question word granularity semantic embedding coding vectors, wherein the user question description word granularity semantic reinforcement module includes: a medium-granularity semantic association window determination unit, which is used to determine the medium-granularity semantic association window in the sequence of user question word granularity semantic embedding coding vectors; A medium-granularity semantic association window of user questions of each user question word granularity semantic embedding coding vector; a medium-granularity user question word granularity semantic reinforcement unit, which is used to perform medium-granularity contextual semantic reinforcement on each user question word granularity semantic embedding coding vector in the sequence of user question word granularity semantic embedding coding vectors based on the user question medium-granularity semantic association window of each user question word granularity semantic embedding coding vector in the sequence of user question word granularity semantic embedding coding vectors to obtain a sequence of medium-granularity semantically reinforced user question word granularity semantic embedding coding vectors; a reply text generation module, which is used to generate a reply text based on the sequence of medium-granularity semantically reinforced user question word granularity semantic embedding coding vectors.
2. The intelligent dialogue system based on natural language processing according to claim 1, characterized in that: The user question description word segmentation embedding coding module includes: a user question word granularity splitting unit, which is used to perform word segmentation processing on the natural language description of the user question to obtain a text sequence of user question word granularity descriptions; a user question word granularity semantic encoding unit, which is used to input each user question word granularity description in the text sequence of user question word granularity descriptions into a semantic embedding encoder based on the Bert model to obtain a sequence of user question word granularity semantic embedding coding vectors.
3. The intelligent dialogue system based on natural language processing according to claim 2, characterized in that: The medium-granularity semantic association window determination unit includes: a hyperbolic space mapping subunit, which is used to map each user question word granularity semantic embedding coding vector in the sequence of user question word granularity semantic embedding coding vectors to the hyperbolic space to obtain a sequence of hyperbolic space user question word granularity semantic embedding coding vectors; a semantic association window determination subunit, which is used to determine the user question medium-granularity semantic association window of each user question word granularity semantic embedding coding vector in the sequence of user question word granularity semantic embedding coding vectors based on the sequence of hyperbolic space user question word granularity semantic embedding coding vectors.
4. The intelligent dialogue system based on natural language processing according to claim 3 is characterized in that: The semantic association window determination subunit includes: a semantic grammatical depth implicit representation value calculation subunit, which is used to calculate the grammatical depth implicit representation value of each hyperbolic space user question word granularity semantic embedding coding vector in the sequence of the hyperbolic space user question word granularity semantic embedding coding vector to obtain the sequence distribution of the user question word granularity semantic grammatical depth implicit representation value; an implicit representation value guided window size determination subunit, which is used to determine the user question medium granularity semantic association window of each user question word granularity semantic embedding coding vector in the sequence of the user question word granularity semantic embedding coding vector based on the sequence distribution of the user question word granularity semantic grammatical depth implicit representation value.
5. The intelligent dialogue system based on natural language processing according to claim 4 is characterized in that: The implicit representation value guided window size determination subunit includes: a window size determination secondary subunit, which is used to determine the starting position of the user question mid-granularity semantic association window of the first user question word granularity semantic embedding coding vector in the sequence of the user question word granularity semantic embedding coding vector and the ending position of the user question mid-granularity semantic association window; a first semantic association window determination secondary subunit, which is used to determine the user question mid-granularity semantic association window of the first user question word granularity semantic embedding coding vector from the sequence of the user question word granularity semantic embedding coding vector based on the starting position of the user question mid-granularity semantic association window and the ending position of the user question mid-granularity semantic association window.
6. The intelligent dialogue system based on natural language processing according to claim 5, characterized in that: The window size determining secondary subunit is used to: extract the user question word granularity semantic grammatical depth implicit representation value of the first user question word granularity semantic embedding coding vector in the sequence of the user question word granularity semantic embedding coding vector as the starting position of the granularity semantic association window in the user question; along the sequence distribution of the user question word granularity semantic grammatical depth implicit representation values, find the user question word granularity semantic grammatical depth implicit representation value that is closest to the user question word granularity semantic grammatical depth implicit representation value of the first user question word granularity semantic embedding coding vector as the ending position of the granularity semantic association window in the user question.
7. The intelligent dialogue system based on natural language processing according to claim 6, characterized in that: The reply text generation module includes: a user emotion type feature generation unit, which is used to obtain a user emotion type embedding coding vector based on the sequence of medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors; and an emotion type reply text unit, which is used to add the user emotion type embedding coding vector to the end of the sequence of medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors, and then input it into a dialogue generator based on a large language model to obtain the reply text.
8. The intelligent dialogue system based on natural language processing according to claim 7, characterized in that: The user emotion type feature generation unit is used to: input the sequence of medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors into a classifier-based emotion recognizer to obtain the user emotion type embedding coding vector.
9. An intelligent dialogue method based on natural language processing, characterized in that: include: Get the natural language description of the user's question; The natural language description of the user's question is subjected to word segmentation processing and semantic embedding coding to obtain a sequence of user question word granularity semantic embedding coding vectors; the sequence of user question word granularity semantic embedding coding vectors is subjected to text feature sequence semantic association enhancement to obtain a sequence of medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors, including: determining a user question medium-granularity semantic association window of each user question word granularity semantic embedding coding vector in the sequence of user question word granularity semantic embedding coding vectors; based on the user question medium-granularity semantic association window of each user question word granularity semantic embedding coding vector in the sequence of user question word granularity semantic embedding coding vectors, medium-granularity contextual semantic enhancement is performed on each user question word granularity semantic embedding coding vector in the sequence of user question word granularity semantic embedding coding vectors to obtain a sequence of medium-granularity semantically enhanced user question word granularity semantic embedding coding vectors; Based on the medium-granularity semantics, a sequence of granularity semantic embedding encoding vectors of user question words is enhanced to generate a reply text.
Citation Information
Patent Citations
Emotion dialogue generation method and device based on self-attention mechanism
CN110427490A
Digital human interaction system and method based on smart community
CN119357345A
Financial data management system based on large language model assistance
CN119398954A
Natural language processing method and device, electronic equipment and readable storage medium
CN119513247A
Intelligent dialogue generation method, device, computer apparatus and computer storage medium
WO2021072875A1
Cited By
Low-altitude flight communication network resource allocation method based on large model algorithm
CN120186791A