Semantic intention recognition method and device fusing context information, medium and equipment
By constructing a context model and combining the semantic intention recognition model, the understanding bias caused by traditional methods to ignore context information is solved, and more accurate and personalized semantic intention recognition is achieved, improving user experience and natural language processing capabilities.
Patent Information
- Application Number
- CN202510135627.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-07
- Publication Date
- 2025-03-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional semantic meaning recognition methods ignore the context information of the conversation, resulting in a prone to understanding deviation when dealing with complex, obscure or language phenomena such as omission and reference.
By obtaining the context information in the user's input text, a context model is constructed, the association relationship between vocabulary, the logical relationship between sentences, and the overall text theme and focus are obtained, and the semantic meaning recognition model is combined with the semantic meaning recognition model to identify the semantic meaning of the user's input text.
It improves the accuracy of semantic intention recognition, enables the system to understand user instructions and needs more intelligently, provides more personalized services, improves user experience, and provides more powerful natural language processing capabilities for intelligent applications.
Smart Images

Figure CN119557718A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of natural language understanding in human-computer dialogue systems using artificial intelligence technology, and in particular to a method, device, medium and equipment for semantic intent recognition that integrates contextual information. Background Art
[0002] In natural language processing, semantic intent recognition refers to identifying the speaker's intention or purpose from text. This is the basis for building a variety of applications such as intelligent dialogue systems, information retrieval, and sentiment analysis. However, due to the complexity and diversity of language, as well as the widespread polysemy and context dependency in text, accurately identifying the semantic intent of text has become a challenge. Traditional semantic intent recognition methods often rely on techniques such as vocabulary matching and syntactic analysis, but these methods are often not ideal when processing complex texts and have difficulty capturing the deep meaning and true intent of the text.
[0003] As artificial intelligence technology continues to evolve, users' expectations for intelligent systems are getting higher and higher. People expect the system to be able to understand and perceive the context of the conversation like a human, so as to make a more intelligent and humane response. However, in traditional semantic intent recognition methods, the system often only parses the sentence input by the current user, ignoring the contextual information of the conversation. This isolated processing method may be effective when dealing with simple and direct requests, but it is easy to have misunderstandings when facing complex, obscure conversations or conversations containing omissions, references and other language phenomena. Summary of the invention
[0004] In view of this, an object of an embodiment of the present invention is to provide a method, apparatus, medium and device for semantic intent recognition that integrates context information to solve the above-mentioned problems.
[0005] To achieve the above objectives, in a first aspect, an embodiment of the present invention provides a method for identifying semantic intent by integrating context information, comprising the following steps: Obtaining user input text, extracting and integrating context information for each word and sentence in the user input text to build a context model; Acquire the association relationship between words, the logical relationship between sentences, and the overall text theme and focus in the user input text according to the context model; Obtain a semantic intent recognition model; The semantic intent of the user input text is identified based on the association between the semantic intent recognition model and vocabulary, the logical relationship between sentences, and the theme and focus of the user input text, and the result of the semantic intent recognition is output.
[0006] In some possible implementations, the acquisition of the semantic intent recognition model specifically includes: Acquire user historical consultation data, and preprocess the user historical consultation data to obtain a training data set; Extracting features useful for semantic intent recognition of user input text from the training data set; wherein the useful features include text features of the user input, previous context intent classification information, location information of the user input text, and user historical behavior patterns; The useful features are used to perform model training, obtain a mapping relationship between context information and user input text, and construct a semantic intent recognition model based on the mapping relationship.
[0007] In some possible implementations, the obtaining of user historical consultation data and preprocessing of the user historical consultation data to obtain a training data set specifically includes: Obtain user historical consultation data; Performing a cleaning process on the user history consultation data, wherein the cleaning process includes removing irrelevant information and correcting spelling errors and introducing a noise tolerance algorithm during the cleaning process to obtain cleaned user history consultation data; According to the intent of the user input text, the cleaned user historical consultation data is annotated to generate a training data set containing intent labels.
[0008] In some possible implementations, extracting features useful for identifying the semantic intent of the user input text from the training data set specifically includes: Convert the user input text into a first numerical vector by means of word embedding representation; The context information related to the user input text is converted into a second numerical vector by context encoding, and the first numerical vector is fused with the second numerical vector to obtain features useful for the semantic intent of the user input text.
[0009] In some possible implementations, the use of the useful features to perform model training, obtain a mapping relationship between context information and user input text, and construct a semantic intent recognition model according to the mapping relationship, specifically includes: According to the useful features, sequence information of the user input text and context information is obtained through a recurrent neural network, and the sequence information is passed to a deep neural network and a convolutional neural network respectively; The convolutional neural network extracts local features of the user input text and the context information from the sequence information, and passes the local features to the deep neural network; The deep neural network extracts global features of the user input text and the context information from the sequence information, and integrates the global features with the local features to obtain a global feature vector; The context information is fused with the global feature vector to obtain a fused feature vector, a mapping relationship between the context information and the user input text is obtained according to the fused feature vector, and the semantic intent recognition model is obtained according to the mapping relationship.
[0010] In some possible implementations, the semantic intent recognition model includes: An input layer, used for receiving the user input text and the context information; A feature extraction layer, used to extract semantic features of the user input text and the context information; A context fusion layer, used to fuse the semantic features of the context information with the semantic features of the user input text, and use an attention mechanism to dynamically assign weights during the fusion process to generate a fused feature vector; The intent recognition layer is used to classify the fused feature vector according to the classification algorithm to obtain the final intent recognition result; The output layer is used to output the final intent recognition result.
[0011] In some possible implementations, the method further includes: Deploy the semantic intent recognition model in an online environment, perform intent recognition on user input text in the online environment, and obtain a semantic intent recognition result; The relevant parameters of the semantic intent recognition model are updated in real time according to the semantic intent recognition result.
[0012] In a second aspect, an embodiment of the present invention provides a semantic intent recognition device that integrates context information, the semantic intent recognition device comprising: A construction module, used to obtain user input text, extract and integrate context information of each word and sentence in the user input text, so as to construct a context model; A text information acquisition module, used to acquire the association relationship between words, the logical relationship between sentences, and the overall text theme and focus in the user input text according to the context model; Model acquisition module, used for semantic intent recognition model; The recognition result output module is used to obtain a semantic intent recognition model, identify the semantic intent of the user input text based on the association between the semantic intent recognition model and vocabulary, the logical relationship between sentences, and the theme and focus of the user input text, and output the result of the semantic intent recognition.
[0013] In a third aspect, an embodiment of the present invention provides an electronic device, including: one or more processors; A storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement a semantic intent recognition method that integrates context information as described in any one of the first aspects.
[0014] In a fourth aspect, an embodiment of the present invention provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements a method for semantic intent recognition that integrates contextual information as described in any one of the first aspects.
[0015] The above technical solution has the following beneficial effects: By introducing context information, the present invention can more comprehensively understand the semantic intention of the user, thereby improving the accuracy of recognition.
[0016] By integrating semantic intent recognition with contextual information, the present invention enables the system to more intelligently understand the user's instructions and needs, thereby providing more personalized services and support. This not only improves the user experience, but also provides more powerful natural language processing capabilities for various intelligent applications.
[0017] The present invention can recognize and understand the user's natural language input, and can get a corresponding response whether it is an instruction, an inquiry or an expression of emotion; this natural interaction method greatly improves the user's comfort and satisfaction, and promotes the development of human-computer interaction technology to a higher level.
[0018] The present invention can provide users with more personalized and accurate services by accurately identifying the semantic intentions of users. For example, on an e-commerce platform, the system can recommend products that better meet the needs of users based on their shopping history and preferences; in an intelligent customer service system, the system can quickly understand users' questions and provide accurate and timely answers. This kind of accurate service not only optimizes the user experience, but also improves service efficiency and reduces the manpower and time costs of enterprises. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. It is obvious that the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1is a flow chart of a method for semantic intent recognition integrating contextual information according to an embodiment of the present invention; Figure 2 is a flow chart of acquiring a semantic intent recognition model according to an embodiment of the present invention; Figure 3A is a deployment diagram for acquiring a semantic intent recognition model according to an embodiment of the present invention; Figure 3B This is a network structure diagram of a model training in an embodiment of the present invention; Figure 4 is a flowchart of step S31 of an embodiment of the present invention; Figure 5 is a flowchart of step S32 of an embodiment of the present invention; Figure 6 is a flowchart of step S33 of an embodiment of the present invention; Figure 7 It is a functional block diagram of a semantic intent recognition method integrating context information according to an embodiment of the present invention; Figure 8 is a functional block diagram of a model acquisition module according to an embodiment of the present invention; Fig. 9 It is a functional block diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] 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, which are instead 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.
[0022] 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.
[0023] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0024] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0025] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0026] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0027] The purpose of the present invention is to focus on improving the accuracy of semantic intent recognition. In traditional semantic intent recognition methods, the system often only parses the sentences input by the current user, ignoring the contextual information of the conversation. This isolated processing method may be effective when dealing with simple and direct requests, but when faced with complex, obscure conversations or those containing omissions, references and other language phenomena, it is easy to have misunderstandings. In order to overcome this limitation, the patent proposes a recognition method that integrates contextual information, aiming to achieve a more comprehensive and in-depth understanding of user intent by comprehensively considering multi-dimensional information such as user historical input, conversation background, and contextual context. The realization of this goal will greatly improve the accuracy of semantic intent recognition and provide users with more accurate and personalized services.
[0028] Secondly, the purpose of the present invention is also to improve the intelligence level of semantic intent recognition. With the continuous evolution of artificial intelligence technology, users' expectations for intelligent systems are getting higher and higher. They expect the system to be able to understand and perceive the context of the conversation like a human, so as to make a more intelligent and more humane response. In order to meet this demand, the patent proposes a context information fusion method based on deep learning technology. By introducing advanced neural network models, such as Long Short Term Memory (LSTM) and Graph Convolutional Network (GCN), deep mining and efficient representation of user input and context information are achieved. Not only does it improve the accuracy of recognition, but it also enables the system to capture more clues about user intent, so as to make a more intelligent and more user-friendly response.
[0029] The embodiments of the present invention also have the function of improving the practicality and generalization ability of semantic intent recognition technology. In practical applications, user input is often diverse and uncertain, which requires that semantic intent recognition technology must have good adaptability and generalization ability. The present invention proposes a training method based on supervised learning, which generates high-quality model parameters by annotating and training a large amount of user historical consultation data. Not only does it improve the recognition accuracy of the model, but it also enables the model to better adapt to user needs in different scenarios. In addition, by introducing contextual information, the generalization ability of the model is further enhanced, so that it can still maintain a high recognition accuracy rate when facing unknown or complex dialogue scenarios.
[0030] Figure 1 is a flow chart of a method for identifying semantic intent by integrating contextual information according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps: Step S1, obtaining a user input text, extracting and integrating context information of each word and sentence in the user input text to construct a context model; Specifically, we first preprocess the text using advanced natural language processing techniques, including word segmentation, part-of-speech tagging, syntactic analysis, etc., and then use a pre-trained language model (Bidirectional Encoder Representations from Transformers, BERT) to generate vector representations of words, which contain rich semantic information. We then introduce attention mechanisms and neural networks to capture the relationship between each word and sentence in the user input text and the contextual information.
[0031] Step S2, obtaining the association relationship between words, the logical relationship between sentences, and the overall text theme and focus in the user input text according to the context model; Step S3, obtaining a semantic intent recognition model; Step S4, identifying the semantic intent of the user input text based on the association relationship between the semantic intent recognition model and vocabulary, the logical relationship between sentences, and the theme and focus of the user input text, and outputting the result of the semantic intent recognition.
[0032] This embodiment uses the acquired semantic intent recognition model to recognize the intent of the user input text and outputs the recognition result. This embodiment introduces context information in both the feature extraction stage and the model training stage to more comprehensively understand the user's semantic intent, thereby improving the accuracy of recognition. Through semantic intent recognition that integrates context information, the system can more intelligently understand the user's instructions and needs, thereby providing more personalized services and support, which can not only improve the user experience, but also provide more powerful natural language processing capabilities for various intelligent applications.
[0033] Specifically, the embodiment of the present invention can comprehensively capture and integrate multi-dimensional information such as dialogues before and after user input, text background, historical behavior, etc. by constructing a complex context processing model to form a complete context map (a context map is a way to represent each user input and its related context information as a graph structure, where nodes represent different entities or events, and edges represent the relationship between these entities or events). This deep context fusion not only helps the system understand the direct meaning of the current user input text, but also provides insight into the implicit intentions and potential needs behind it, which can not only improve the user experience, but also provide more powerful natural language processing capabilities for various intelligent applications.
[0034] According to the association between the semantic intent recognition model and vocabulary, the logical relationship between sentences, and the theme and focus of the user input text, the semantic intent of the user input text is recognized, and the recognition result is output. This embodiment introduces context information to more comprehensively understand the user's semantic intent, thereby improving the accuracy of recognition. By integrating semantic intent recognition with context information, the embodiment of the present invention can also recognize and understand the user's natural language input, whether it is an instruction, an inquiry, or an expression of emotion, and can get a corresponding response, thereby providing more personalized services and support, which can not only improve the user experience, but also provide more powerful natural language processing capabilities for various intelligent applications. This natural interaction method improves the user's comfort and satisfaction, and promotes the development of human-computer interaction technology to a higher level.
[0035] Figure 2 is a flow chart of obtaining a semantic intent recognition model according to an embodiment of the present invention. Figure 3A is a deployment diagram for obtaining a semantic intent recognition model in an embodiment of the present invention, such as Figure 2 and Figure 3A As shown, obtaining the semantic intent recognition model in step S3 includes the following steps: Step S31, obtaining user historical consultation data, and preprocessing the user historical consultation data to obtain a training data set.
[0036] In this step, you need to first collect the user's historical consultation data, which can be done by extracting data from relevant data sources (such as databases, file systems, etc.). At the same time, the collected data needs to be cleaned, which includes deleting duplicate records, processing missing values, correcting data formats, and other purification of data to remove redundant and erroneous information to improve data quality and accuracy. The cleaned data is labeled, and the labeling process is performed by professional labelers based on the intent input by the user to generate a training data set containing intent labels.
[0037] Step S32, extracting features useful for semantic intent recognition of user input text from the training data set; wherein the useful features include text features of the user input (various information that helps to understand the intention of the user-provided text extracted from the user-provided text. These features may include word-level information (such as word vectors, part-of-speech tagging), sentence-level information (such as syntactic structure, sentiment analysis), previous intent classification information (in multi-round dialogues or continuous user interactions, the model classifies the intentions of previous dialogue rounds. By introducing the above intent information, the model can better understand the background and context of the current input, thereby making more reasonable predictions.), location information of the user input text (referring to the user The time, location, or other contextual information related to the input. This information can help the model better understand the user's background and needs, especially in tasks that involve geographic location or are time-sensitive. For example, when a user asks "What's the weather like today", the location information obtained will provide better understanding and feedback) and user historical behavior patterns (user's past behavior records, including previous interaction history, preferences, habits, etc. By analyzing the user's historical behavior, the model can better predict the user's intentions and provide personalized services. For example, in an e-commerce app, a user enters "I want to buy a new one". Through historical expression records and the user's purchase records, it can be further inferred that the user's intention is to buy a new mobile phone); In this step, text features useful for subsequent processing are extracted from the cleaned and annotated data training set. These features can help the model understand and predict the user's intention more accurately, including vocabulary-level features (word frequency, word embedding), sentence-level features (syntactic analysis, dependency count, etc.), and position information is recorded at the same time. This step provides key data support for subsequent analysis. Then the feature extraction process continues to deepen, and the recognition of the above intention is also included as an important part of this process to help better understand the contextual information of the data. At the same time, historical behavior is also paid attention to, providing more clues about the user or data background.
[0038] In the feature extraction stage, this embodiment also constructs a complex context processing module to comprehensively capture and integrate multi-dimensional information such as dialogues before and after user input, text background, historical behavior, etc., to form a complete context map. The context map is a way to represent each user input and its related context information as a graph structure, where nodes represent different entities or events, and edges represent the relationship between these entities or events. This deep context fusion not only helps the system understand the direct meaning of the user's current input text, but also provides insight into the implicit intentions and potential needs behind it. At the same time, a personalized interpretation mechanism is used to interpret the user's intentions in a more nuanced manner based on the user's personal preferences, historical interaction records and other information.
[0039] Step S33, use the useful features to perform model training, obtain the mapping relationship between the context information and the user input text, and build a semantic intent recognition model based on the mapping relationship.
[0040] In this step, the model needs to be trained based on the extracted useful features. Through iterative optimization, the deep learning model learns the mapping relationship between context information and the text intent entered by the user.
[0041] Figure 3B is a network structure diagram of a model training in an embodiment of the present invention, such as Figure 3B As shown in the figure, in model training, first, the input text data will be processed by the feature extraction module to extract useful features. Then, the extracted useful features will be input into the deep neural network. In the deep neural network, the fully connected layer will map the input features into a vector space of fixed dimension. In this process, the useful features extracted by the feature extraction module will be used as input to help the deep neural network learn the complex mapping relationship between context information and the text intention of the user input. In addition, in model training, other technologies can also be used to integrate context information to improve the recognition accuracy and generalization ability of the model. For example, attention mechanisms, memory networks and other technologies can be used to capture the complex relationship between input texts and other context information. These technologies will also use the useful features extracted by the feature extraction module as input to help the model better learn and understand text data; among them, memory networks are a type of deep learning model with memory function, which contains one or more memory modules for storing and retrieving information. These models can process sequence data and can continuously update and access information in memory during processing. The basic structure of a memory network includes one or more memory modules, a controller (such as a recurrent neural network or a long short-term memory network), an input interface, an output interface and an attention mechanism.
[0042] The model in this embodiment can generate different intent recognition modes according to different training data. For example, if the training data set contains personalized user's personal speaking style and preferences, the model can also generate different semantic intent recognition based on this style and preference; it can also be intelligently adjusted based on the user portrait to provide recognition results that are more in line with user expectations. For example, first collect various data about the user, including but not limited to the user's interests, preferences, behaviors, geographic locations, etc. These data can be obtained through user registration information, user behavior tracking, questionnaires, etc. Then use the collected data to build a user portrait. The user portrait can be a model containing user characteristics and attributes, which is used to describe the user's interests, preferences, behavior patterns, etc. Then, based on the user portrait and business needs, define the user's expectations for the recognition results, which may include expectations for recognition accuracy, recall rate, sorting results, etc. Use intelligent adjustment algorithms, including machine learning algorithms, deep learning algorithms, recommendation system algorithms, etc., to adjust the recognition results according to user portraits and user expectations. During the user's use, collect user feedback information, such as user satisfaction with the recognition results, click behavior, etc., and use these feedback information to adjust the algorithm and model in real time to continuously optimize the recognition results. It is also possible to combine data of multiple modalities, such as text, images, audio, etc., into user portraits and recognition algorithms to provide a more comprehensive and accurate understanding of users. Finally, based on user portraits and recognition results, provide users with personalized recommendations and suggestions, including product recommendations, content recommendations, service recommendations, etc. A / B testing and experiments can also be performed to compare different intelligent adjustment strategies and algorithms to find the method that best suits users. User interests and behaviors may change over time, so it is necessary to continuously optimize and update user portraits and recognition algorithms to maintain an accurate understanding of users and recognition results that meet user expectations. This embodiment can perform intelligent adjustments based on user portraits to provide recognition results that are more in line with user expectations, thereby improving user experience and satisfaction.
[0043] This embodiment can recognize and understand the user's natural language input, whether it is an instruction, inquiry or expression of emotion, it can get a corresponding response; this natural interaction method improves the user's comfort and satisfaction. And by accurately identifying the user's semantic intention, it can provide users with more personalized and accurate services. For example, on an e-commerce platform, the system can recommend products that better meet the user's needs based on the user's shopping history and preferences; in an intelligent customer service system, the system can quickly understand the user's questions and provide accurate and timely answers. This precise service not only optimizes the user experience, but also improves service efficiency and reduces the company's labor and time costs.
[0044] like Figure 4As shown, in some embodiments, the step S31 of obtaining the user's historical consultation data and preprocessing the user's historical consultation data to obtain a training data set specifically includes the following steps: S311, obtaining user historical consultation data; S312, performing a cleaning process on the user historical consultation data, wherein the cleaning process includes removing irrelevant information and correcting spelling errors and introducing a noise tolerance algorithm during the cleaning process to obtain cleaned user historical consultation data; S313: annotate the cleaned user historical consultation data according to the intent of the user input text to generate a training data set containing intent labels.
[0045] This embodiment enhances the robustness of the system by introducing noise tolerance and error correction mechanisms during the data cleaning process. The noise tolerance mechanism allows the system to be tolerant to a certain degree of spelling errors, grammatical errors, etc. when processing user input, so as not to affect the recognition of the overall intent. Based on the self-attention mechanism of the deep learning model, weights can be dynamically allocated when processing input, focusing on the most important part, ignoring certain vocabulary or grammatical errors, forming a strong generalization ability for noise data, and the auxiliary inference function of context information. By introducing context dialogue information, context-dependent spelling correction and grammatical correction and other technologies, the system can better understand the fuzzy or wrong parts in the user input. This embodiment further improves the accuracy of the system by using the error correction mechanism, and can automatically identify and correct errors in user input, such as replacing common spelling errors with correct words, converting colloquial expressions into standard written language, etc. This correction not only improves the accuracy of recognition, but also enhances the readability and ease of use of the system; by introducing context dialogue information, context-dependent spelling correction and grammatical correction and other technologies, the system can better understand the fuzzy or wrong parts in the user input.
[0046] like Figure 5 As shown, in some embodiments, the step S32 of extracting features useful for identifying the semantic intent of the user input text from the training data set specifically includes: S321, converting the user input text into a first numerical vector by means of word embedding representation; S322, converting context information related to the user input text into a second numerical vector by means of context encoding, and fusing the first numerical vector with the second numerical vector to obtain features useful for the semantic intent of the user input text.
[0047] In this step, features useful for identifying intent need to be extracted from the user input text and context information. These features include but are not limited to text features of the user input, the above intent classification information, location information, user historical behavior patterns, etc. In order to capture these features, this embodiment adopts a variety of technical means, such as text vectorization, word embedding representation, context encoding, etc. Word embedding is a way to achieve text vectorization. It refers to a representation method that maps words in the vocabulary to a low-dimensional real number vector space. The purpose is to capture the semantic relationship between words so that semantically similar words are closer in the vector space. Word embedding is usually achieved through a neural network model, such as a convolutional neural network (CNN) or a recurrent neural network. Neural networks (Recurrent Neural Network, RNN) are learned from large amounts of text data. The purpose of text vectorization is to convert text into a numerical form that can be processed by computers for subsequent analysis and processing, such as text classification, sentiment analysis, machine translation, etc. Context encoding is a method of representing text in combination with the contextual information of user input text. It aims to capture the contextual relationship of words in the text to provide a richer semantic representation. Context encoding can expand the word embedding representation, combining not only the semantics of a single word, but also the influence of its context. By introducing context information, context encoding can provide a more accurate and comprehensive text representation. For example, in a text classification task, word embedding representation can be used to convert user input text into a vector, and then context encoding can be combined to further enhance the representation ability of the vector to improve the performance and accuracy of the classification model.
[0048] like Figure 6 As shown, in some embodiments, the step S33 uses the useful features to perform model training, obtains a mapping relationship between context information and user input text, and constructs a semantic intent recognition model according to the mapping relationship, specifically including: S331, obtaining sequence information of the user input text and context information through a recurrent neural network according to the useful features, and passing the sequence information to a deep neural network and a convolutional neural network respectively; S332, the convolutional neural network extracts local features of the user input text and the context information from the sequence information, and passes the local features to the deep neural network; S333, the deep neural network extracts global features of the user input text and the context information from the sequence information, and integrates the global features with the local features to obtain a global feature vector; S334, fusing the context information with the global feature vector to obtain a fused feature vector, obtaining a mapping relationship between the context information and the user input text according to the fused feature vector, and obtaining the semantic intent recognition model according to the mapping relationship.
[0049] In this embodiment, advanced supervised learning algorithms, such as deep neural networks (DNN), convolutional neural networks (CNN), and recurrent neural networks (RNN), are used to obtain the global feature vector of the user input text. Then, in order to fuse the context information, attention mechanisms, memory networks and other technologies are introduced. The current text and context are taken as input, and a multi-head self-attention mechanism is used to capture the complex relationship between the user input text and the context information, and generate a fused feature vector to improve the recognition accuracy and generalization ability of the model.
[0050] Specifically, the deep neural network has a strong feature extraction and representation learning capability, and can capture complex patterns in the input data. It maps the input word embedding or syntactic information to a vector space of fixed dimension through a fully connected layer, thereby providing effective feature representation for subsequent classification tasks; the convolutional neural network is good at processing grid data such as images and texts, and can extract local features. When used in combination with the deep neural network DNN, the local features are first extracted through the convolutional neural network CNN, and then these features are passed to the deep neural network DNN for global feature integration; the recurrent neural network can process sequence data and capture temporal dependencies. When processing longer text sequences, it can capture the grammatical structure and semantic dependencies in the sentence. RNN is used in combination with DNN or CNN, firstly capturing sequence information through the recurrent neural network RNN, and then passing the sequence information to the deep neural network DNN or the convolutional neural network CNN for further feature extraction and classification. At the same time, in order to fuse context information, this embodiment also introduces technologies such as attention mechanism and memory network, takes the current text and context information as input, uses a multi-head self-attention mechanism, captures the complex relationship between them, and generates a fused feature vector to improve the recognition accuracy and generalization ability of the model.
[0051] This embodiment uses a deep learning model to automatically learn and extract features that are critical to the recognition task from a large amount of data. These features include but are not limited to the semantic information of vocabulary, syntactic structure, contextual association, etc. Through the processing of multi-layer neural networks, the model can capture the complex relationship between these features, thereby achieving accurate modeling of user intentions. At the same time, feature fusion technology further enhances the recognition ability of the model. This technology integrates feature information of different dimensions from different sources (speech to text, text chat, written text, etc.) to obtain a unified feature vector for comprehensive analysis by the model. This cross-modal feature fusion in this embodiment not only enriches the recognition basis, but also improves the model's adaptability to complex scenarios.
[0052] In some embodiments, the semantic intent recognition model includes an input layer, a feature extraction layer, a context fusion layer, an intent recognition layer and an output layer; wherein the input layer is used to receive user input text and context information; the feature extraction layer is used to extract semantic features of user input text and context information; the context fusion layer is used to fuse the context information with the semantic features of the current input text, and use the attention mechanism to dynamically assign weights during the fusion process to generate a fused feature vector; the intent recognition layer is used to use a classification algorithm to perform intent classification on the fused feature vector to obtain a final intent recognition result; the output layer is used to output the final intent recognition result.
[0053] In a specific embodiment, a semantic intent recognition model based on deep learning and fusion of context information is adopted. The model consists of an input layer, a feature extraction layer, a context fusion layer, an intent recognition layer, and an output layer. Among them, the input layer is responsible for receiving user input and context information; the feature extraction layer uses deep neural network and other technologies to extract the features of the input data; the context fusion layer is responsible for fusing the context information with the current input, and uses the attention mechanism to dynamically assign weights during the fusion process to generate a fused feature vector; the intent recognition layer uses a classification algorithm to classify the fused feature vector; and the output layer outputs the final intent recognition result.
[0054] In the implementation process of this embodiment, in the feature extraction stage, technologies such as word embedding representation and context encoding are introduced to capture more semantic information; in the context fusion stage, an attention mechanism is used to dynamically adjust the weight between context information and current input. By calculating the similarity or correlation between the current input text and the context information, the model can dynamically assign weights and focus on the most important parts. The specific process is as follows: Input representation: A vector q of the current input text is obtained through word embedding or context encoding; the context information is represented as a set of vectors {k1, k2, …, kn}, where each ki represents a piece of historical information in the context.
[0055] Calculate similarity: For each context vector ki, use the weighted sum to calculate its similarity s(q,ki) with the current input vector q Calculate attention weights: Use the softmax function to convert similarity into a probability distribution, indicating the importance of each context vector. The softmax calculation formula is: , In this way, each context vector ki will have a corresponding attention weight αi, indicating its importance in the current input. The softmax function converts each element in the input vector into a probability value between [0,1] and ensures that the sum of the probabilities of all elements is 1.
[0056] Weighted summation: According to the attention weight αi, the context vector {v1, v2, …, vn} is weighted summed to obtain the final context representation c: .
[0057] Fusion of context information: The current input vector q and the weighted sum of the context representation c are concatenated and fused to obtain the intent recognition result h.
[0058] For example, in multi-round conversations, the attention mechanism allows the model to pay more attention to contextual information related to the current input and ignore irrelevant historical information; in the model training stage, regularization, dropout, and early stopping techniques are used to prevent overfitting.
[0059] In some embodiments, obtaining the semantic intent recognition model also includes: deploying the semantic intent recognition model in an online environment, performing intent recognition on user input text in the online environment to obtain a semantic intent recognition result, and updating relevant parameters of the semantic intent recognition model in real time according to the semantic intent recognition result.
[0060] In this embodiment, the trained semantic intent recognition model is deployed to an online server or cloud platform for estimation to ensure that the model can operate normally in an online environment and can receive text input by the user. In an online environment, the text data input by the user and the corresponding semantic intent labels are collected, and these data can be used to update the parameters of the model in real time. When the user enters text, it is sent to the deployed semantic intent recognition model for intent recognition. The model will output the corresponding semantic intent recognition results, and use an appropriate update strategy to update the parameters of the model based on the user input text and the corresponding semantic intent labels obtained in real time.
[0061] This embodiment can use online learning, incremental learning or other related technologies to ensure that the model can continuously adapt to new data. The performance and accuracy of the model can also be continuously monitored, and the effect of the model can be measured by evaluating indicators such as accuracy and recall. According to the monitoring results, the parameters and update strategies of the model are adjusted in time to improve the performance of the model. And establish an effective data storage and management mechanism to save the collected user data and related information of the model update to ensure the security and integrity of the data. Optimize the online system, including improving the response speed of the model, reducing resource consumption, etc., to meet real-time and performance requirements.
[0062] This embodiment evaluates and optimizes the intent recognition model according to specific application scenarios and needs through model deployment, online learning, data collection and processing, system monitoring, etc. Embodiment 2
[0063] Figure 7 is a semantic intent recognition device integrating context information according to an embodiment of the present invention, such as Figure 7 As shown, the semantic intent recognition device 100 includes: A construction module 110 is used to obtain a user input text, extract and integrate context information of each word and sentence in the user input text, so as to construct a context model; A text information acquisition module 120, for acquiring the association relationship between words, the logical relationship between sentences, and the overall text theme and focus in the user input text according to the context model; A model acquisition module 130 is used to acquire a semantic intent recognition model; The recognition result output module 140 is used to obtain a semantic intent recognition model, identify the semantic intent of the user input text based on the association between the semantic intent recognition model and vocabulary, the logical relationship between sentences, and the theme and focus of the user input text, and output the result of the semantic intent recognition.
[0064] Specifically, the embodiment of the present invention constructs a complex context processing model through the construction module 110, which can comprehensively capture and integrate multi-dimensional information such as dialogues before and after user input, text background, historical behavior, etc., to form a complete context map (a context map is a way to represent each user input and its related context information as a graph structure, where nodes represent different entities or events, and edges represent the relationship between these entities or events). This deep context fusion not only helps the system understand the direct meaning of the current user input text, but also provides insight into the implicit intentions and potential needs behind it, which can not only improve the user experience, but also provide more powerful natural language processing capabilities for various intelligent applications.
[0065] According to the semantic intent recognition model obtained by the model acquisition module 130 and the association relationship between words, the logical relationship between sentences, and the theme and focus of the user input text obtained by the text information acquisition module 120, the semantic intent of the user input text is recognized, and the recognition result is output. By introducing context information, this embodiment can more comprehensively understand the user's semantic intent, thereby improving the accuracy of recognition. By integrating the semantic intent recognition of context information, the embodiment of the present invention can also recognize and understand the user's natural language input, whether it is an instruction, an inquiry, or an expression of emotion, it can get a corresponding response, thereby providing more personalized services and support, which can not only improve the user experience, but also provide more powerful natural language processing capabilities for various intelligent applications. This natural interaction method improves the user's comfort and satisfaction, and promotes the development of human-computer interaction technology to a higher level.
[0066] like Figure 8 As shown, in some embodiments, the model acquisition module 130 specifically includes the following submodules: The data preprocessing submodule 131 is used to obtain user historical consultation data and preprocess the user historical consultation data to obtain a training data set.
[0067] The data preprocessing submodule 131 first collects the user's historical consultation data, which can be done by extracting data from relevant data sources (such as databases, file systems, etc.). At the same time, the collected data needs to be cleaned, which includes deleting duplicate records, processing missing values, correcting data formats, etc. to purify the data and remove redundant and erroneous information to improve the quality and accuracy of the data. The cleaned data is annotated, and the annotation process is performed by professional annotators based on the intentions input by the user to generate a training data set containing intention labels.
[0068] A feature extraction submodule 132 is used to extract features useful for semantic intent recognition of user input text from the training data set; wherein the useful features include text features of the user input, contextual intent classification information, location information of the user input text, and user historical behavior patterns; The feature extraction submodule 132 extracts text features useful for subsequent processing from the cleaned and annotated data training set. These features can help the model more accurately understand and predict the user's intentions, vocabulary-level features (word frequency, word embedding), sentence-level features (syntactic analysis, dependency number, etc.), and record location information at the same time. This step provides key data support for subsequent analysis. Then the feature extraction process continues to deepen, and the recognition of the above intention is also included as an important part of this process to help better understand the contextual information of the data. At the same time, historical behavior is also paid attention to, providing more clues about the user or data background.
[0069] The feature extraction submodule 132 of this embodiment comprehensively captures and integrates multi-dimensional information such as dialogue, text background, historical behavior, etc. before and after the user input through a complex context processing module, forming a complete context map. The context map is a way to represent each user input and its related context information as a graph structure, where nodes represent different entities or events, and edges represent the relationship between these entities or events. This deep context fusion not only helps the system understand the direct meaning of the user's current input text, but also provides insight into the implicit intentions and potential needs behind it. At the same time, a personalized interpretation mechanism is used to interpret the user's intentions in a more nuanced manner based on the user's personal preferences, historical interaction records and other information.
[0070] The model training submodule 133 is used to use the useful features to perform model training, obtain the mapping relationship between the context information and the user input text, and build a semantic intent recognition model according to the mapping relationship.
[0071] The model training submodule 133 performs model training based on the extracted useful features. Through iterative optimization, the deep learning model learns the mapping relationship between the context information and the text intention input by the user.
[0072] In model training, first, the input text data will be processed by the feature extraction module to extract useful features. Then, the extracted useful features will be input into the deep neural network. In the deep neural network, the fully connected layer will map the input features into a vector space of fixed dimension. In this process, the useful features extracted by the feature extraction module will be used as input to help the deep neural network learn the complex mapping relationship between context information and the text intent of the user input. In addition, in model training, other technologies can also be used to integrate context information to improve the recognition accuracy and generalization ability of the model. For example, attention mechanisms, memory networks and other technologies can be used to capture the complex relationship between texts. These technologies also use the useful features extracted by the feature extraction module as input to help the model better learn and understand text data; among them, memory networks are a type of deep learning model with memory function, which contains one or more memory modules for storing and retrieving information. These models can process sequence data and can continuously update and access information in memory during processing. The basic structure of a memory network includes one or more memory modules, a controller (such as a recurrent neural network or a long short-term memory network), an input interface, an output interface and an attention mechanism.
[0073] The model in this embodiment can generate different intent recognition modes based on different training data. For example, if the training data set includes personalized user speaking styles and preferences, the model can also generate different semantic intent recognitions based on such styles and preferences. It can also make intelligent adjustments based on user portraits to provide recognition results that are more in line with user expectations. For example, various data about the user is first collected, including but not limited to the user's interests, preferences, behaviors, geographic locations, etc. These data can be obtained through user registration information, user behavior tracking, questionnaires, etc.
[0074] This embodiment can recognize and understand the user's natural language input, whether it is an instruction, inquiry or expression of emotion, it can get a corresponding response; this natural interaction method greatly improves the user's comfort and satisfaction, and promotes the development of human-computer interaction technology to a higher level. And by accurately identifying the user's semantic intention, it can provide users with more personalized and accurate services. For example, on an e-commerce platform, the system can recommend products that better meet the user's needs based on the user's shopping history and preferences; in an intelligent customer service system, the system can quickly understand the user's questions and provide accurate and timely answers. This precise service not only optimizes the user experience, but also improves service efficiency and reduces the company's labor and time costs.
[0075] In some embodiments, the data preprocessing submodule 131 includes the following units: A data acquisition unit, used to acquire user historical consultation data; A data cleaning unit, used for cleaning the user historical consultation data, wherein the cleaning process includes removing irrelevant information and correcting spelling errors and introducing a noise tolerance algorithm during the cleaning process to obtain the cleaned user historical consultation data; The data annotation unit is used to annotate the cleaned user historical consultation data according to the intention of the user input text, and generate a training data set containing intention labels.
[0076] This embodiment enhances the robustness of the system by introducing noise tolerance and error correction mechanisms during the data cleaning process. The noise tolerance mechanism allows the system to be tolerant to a certain degree of spelling errors, grammatical errors, etc. when processing user input, so as not to affect the recognition of the overall intent. Based on the self-attention mechanism of the deep learning model, weights can be dynamically allocated when processing input, focusing on the most important part, ignoring certain vocabulary or grammatical errors, forming a strong generalization ability for noise data, and the auxiliary inference function of context information. By introducing context dialogue information, context-dependent spelling correction and grammatical correction and other technologies, the system can better understand the fuzzy or wrong parts in the user input. This embodiment further improves the accuracy of the system by using the error correction mechanism, and can automatically identify and correct errors in user input, such as replacing common spelling errors with correct words, converting colloquial expressions into standard written language, etc. This correction not only improves the accuracy of recognition, but also enhances the readability and ease of use of the system; by introducing context dialogue information, context-dependent spelling correction and grammatical correction and other technologies, the system can better understand the fuzzy or wrong parts in the user input.
[0077] In some embodiments, the feature extraction submodule 132 includes the following units: A first conversion unit converts the user input text into a first numerical vector by means of word embedding representation; The second conversion unit converts the context information related to the user input text into a second numerical vector by context encoding, and fuses the first numerical vector with the second numerical vector to obtain features useful for the semantic intent of the user input text.
[0078] In this step, the first conversion unit and the second conversion unit need to extract features useful for identifying intent from the user input text and context information. These features include but are not limited to the text features of the user input, the above intention classification information, location information, user historical behavior patterns, etc. In order to capture these features, this embodiment adopts a variety of technical means, such as text vectorization, word embedding representation, context encoding, etc. Word embedding is a way to achieve text vectorization, which refers to a representation method that maps words in the vocabulary to a low-dimensional real vector space, with the purpose of capturing the semantic relationship between words so that semantically similar words are closer in the vector space. Word embedding is usually learned from a large amount of text data through a neural network model, such as a convolutional neural network (CNN) or a recurrent neural network (RNN). The purpose of text vectorization is to convert text into a numerical form that can be processed by a computer for subsequent analysis and processing, such as text classification, sentiment analysis, machine translation, etc. Context encoding is a method of representing the text in combination with the context information of the user input text. It aims to capture the contextual relationship of words in the text to provide a richer semantic representation. Context encoding can expand word embedding representation, combining not only the semantics of a single word but also the influence of its context. By introducing context information, context encoding can provide a more accurate and comprehensive text representation. For example, in a text classification task, word embedding representation can be used to convert user input text into a vector, and then context encoding can be combined to further enhance the representation ability of the vector to improve the performance and accuracy of the classification model.
[0079] In some embodiments, the model training submodule 133 specifically includes the following units: An acquisition and transmission unit, configured to obtain sequence information of user input text and context information through a recurrent neural network according to the useful features, and transmit the sequence information to a deep neural network and a convolutional neural network respectively; A local feature acquisition and transmission unit, used for the convolutional neural network to extract local features of the user input text and the context information from the sequence information, and transmit the local features to the deep neural network; A global feature extraction and integration unit, used for the deep neural network to extract the global features of the user input text and the context information from the sequence information, and integrate the global features with the local features to obtain a global feature vector; A fusion and acquisition unit is used to fuse the context information with the global feature vector to obtain a fused feature vector, obtain a mapping relationship between the context information and the user input text according to the fused feature vector, and obtain the semantic intent recognition model according to the mapping relationship.
[0080] In this embodiment, advanced supervised learning algorithms, such as deep neural networks (DNN), convolutional neural networks (CNN), and recurrent neural networks (RNN), are used to obtain the global feature vector of the user input text. Then, in order to fuse the context information, attention mechanisms, memory networks and other technologies are introduced. The current text and context are taken as input, and a multi-head self-attention mechanism is used to capture the complex relationship between the user input text and the context information, and generate a fused feature vector to improve the recognition accuracy and generalization ability of the model.
[0081] Specifically, the deep neural network has a strong feature extraction and representation learning capability, and can capture complex patterns in the input data. It maps the input word embedding or syntactic information to a vector space of fixed dimension through a fully connected layer, thereby providing effective feature representation for subsequent classification tasks; the convolutional neural network is good at processing grid data such as images and texts, and can extract local features. When used in combination with the deep neural network DNN, the local features are first extracted through the convolutional neural network CNN, and then these features are passed to the deep neural network DNN for global feature integration; the recurrent neural network can process sequence data and capture temporal dependencies. When processing longer text sequences, it can capture the grammatical structure and semantic dependencies in the sentence. RNN is used in combination with DNN or CNN, firstly capturing sequence information through the recurrent neural network RNN, and then passing the sequence information to the deep neural network DNN or the convolutional neural network CNN for further feature extraction and classification. At the same time, in order to fuse context information, this embodiment also introduces technologies such as attention mechanism and memory network, takes the current text and context information as input, uses a multi-head self-attention mechanism, captures the complex relationship between them, and generates a fused feature vector to improve the recognition accuracy and generalization ability of the model.
[0082] This embodiment uses a deep learning model to automatically learn and extract features that are critical to the recognition task from a large amount of data. These features include but are not limited to the semantic information of vocabulary, syntactic structure, contextual association, etc. Through the processing of multi-layer neural networks, the model can capture the complex relationship between these features, thereby achieving accurate modeling of user intentions. At the same time, feature fusion technology further enhances the recognition ability of the model. This technology integrates feature information of different dimensions from different sources (speech to text, text chat, written text, etc.) to obtain a unified feature vector for comprehensive analysis by the model. This cross-modal feature fusion in this embodiment not only enriches the recognition basis, but also improves the model's adaptability to complex scenarios.
[0083] In some embodiments, the semantic intent recognition model includes: Input layer, used to receive user input text and context information; Feature extraction layer, used to extract semantic features of user input text and context information; The context fusion layer is used to fuse the context information with the semantic features of the current input text, and use the attention mechanism to dynamically assign weights during the fusion process to generate a fused feature vector; The intent recognition layer is used to classify the fused feature vectors using a classification algorithm to obtain the final intent recognition result. The output layer is used to output the final intent recognition result.
[0084] The model in this embodiment is a semantic intent recognition model based on deep learning and fusion context information. The model consists of an input layer, a feature extraction layer, a context fusion layer, an intent recognition layer, and an output layer. Among them, the input layer is responsible for receiving user input and context information; the feature extraction layer uses deep neural network and other technologies to extract the features of the input data; the context fusion layer is responsible for fusing the context information with the current input, and uses the attention mechanism to dynamically assign weights during the fusion process to generate a fused feature vector; the intent recognition layer uses a classification algorithm to classify the fused feature vector; the output layer outputs the final intent recognition result.
[0085] In the specific implementation process of this embodiment, in the feature extraction stage, technologies such as word embedding representation and context encoding are introduced to capture more semantic information; in the context fusion stage, the attention mechanism is used to dynamically adjust the weight between the context information and the current input. By calculating the similarity or correlation between the current input text and the context information, the model can dynamically assign weights and focus on the most important parts. For example, in a multi-round conversation, the attention mechanism can allow the model to pay more attention to the context information related to the current input and ignore irrelevant historical information; in the model training stage, regularization, dropout, and early stopping of training are used to prevent overfitting.
[0086] In some embodiments, the model acquisition module 130 also includes: an online estimation module, which is used to deploy the semantic intent recognition model into an online environment, perform intent recognition on user input text in the online environment, obtain semantic intent recognition results, and update relevant parameters of the semantic intent recognition model in real time according to the semantic intent recognition results.
[0087] In this embodiment, the trained semantic intent recognition model is deployed to an online server or cloud platform for estimation to ensure that the model can operate normally in an online environment and can receive text input by the user. In an online environment, the text data input by the user and the corresponding semantic intent labels are collected, and these data can be used to update the parameters of the model in real time. When the user enters text, it is sent to the deployed semantic intent recognition model for intent recognition. The model will output the corresponding semantic intent recognition results, and use an appropriate update strategy to update the parameters of the model based on the user input text and the corresponding semantic intent labels obtained in real time.
[0088] This embodiment can use online learning, incremental learning or other related technologies to ensure that the model can continuously adapt to new data. The performance and accuracy of the model can also be continuously monitored, and the effect of the model can be measured by evaluating indicators such as accuracy and recall. According to the monitoring results, the parameters and update strategies of the model are adjusted in time to improve the performance of the model. And establish an effective data storage and management mechanism to save the collected user data and related information of the model update to ensure the security and integrity of the data. Optimize the online system, including improving the response speed of the model, reducing resource consumption, etc., to meet real-time and performance requirements.
[0089] This embodiment evaluates and optimizes the intent recognition model according to specific application scenarios and needs through model deployment, online learning, data collection and processing, system monitoring, etc. In addition, it is also possible to cooperate with professional development teams or technical experts to better realize semantic intent recognition and model updates in online environments.
[0090] The embodiments of the present invention have the following beneficial technical effects: By introducing a noise tolerance and error correction mechanism, the embodiment of the present invention enables the system to be tolerant to a certain degree of noise and errors when processing user input, thereby improving the stability and reliability of the system.
[0091] The embodiments of the present invention utilize a deep learning model to automatically learn and extract features that are critical to the recognition task, which can capture complex patterns in the input data and improve the recognition accuracy and generalization ability of the model.
[0092] The embodiment of the present invention adopts feature fusion technology to integrate feature information from different sources and dimensions, enriches the recognition basis, and improves the adaptability of the model to complex scenarios.
[0093] The embodiment of the present invention introduces technologies such as word embedding representation and context encoding in the feature extraction stage, which can capture more semantic information and improve the model's ability to understand text.
[0094] The embodiment of the present invention adopts the attention mechanism to dynamically adjust the weight between context information and current input, so that the model can pay more attention to the context information related to the current input, thereby improving the accuracy and adaptability of the model.
[0095] The embodiments of the present invention adopt regularization, dropout, early stopping and other techniques in the model training stage, which can prevent overfitting and improve the generalization ability and robustness of the model.
[0096] Reference below Fig. 9 , which shows an electronic device suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0097] like Fig. 9 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 607 into a random access memory (RAM) 603. In RAM 603, various programs and data required for the operation of the electronic device are also stored. The processing device 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0098] Typically, the following devices may be connected to the I / O interface 605: input devices 609 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 608 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 607 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 606. The communication devices 606 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0099] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 606, or installed from a storage device 607, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0100] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0101] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an adhoc network), as well as any currently known or future developed network.
[0102] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0103] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device performs the following steps: Obtaining user input text, extracting and integrating context information for each word and sentence in the user input text to build a context model; Acquire the association relationship between words, the logical relationship between sentences, and the overall text theme and focus in the user input text according to the context model; Acquire a semantic intent recognition model, identify the semantic intent of the user input text based on the association between the semantic intent recognition model and vocabulary, the logical relationship between sentences, and the theme and focus of the user input text, and output the result of the semantic intent recognition.
[0104] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk (an object-oriented programming language), C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0105] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0106] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, constitute a limitation on the unit itself.
[0107] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0108] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0109] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0110] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0111] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A semantic intent recognition method integrating context information, characterized in that: The following steps are involved: Obtaining user input text, extracting and integrating context information for each word and sentence in the user input text to build a context model; Acquire the association relationship between words, the logical relationship between sentences, and the overall text theme and focus in the user input text according to the context model; Obtain a semantic intent recognition model; The semantic intent of the user input text is identified based on the association between the semantic intent recognition model and vocabulary, the logical relationship between sentences, and the theme and focus of the user input text, and the result of the semantic intent recognition is output.
2. The semantic intent recognition method according to claim 1, characterized in that: The acquisition of the semantic intent recognition model specifically includes: Acquire user historical consultation data, and preprocess the user historical consultation data to obtain a training data set; Extracting features useful for semantic intent recognition of user input text from the training data set; wherein the useful features include text features of the user input, previous context intent classification information, location information of the user input text, and user historical behavior patterns; The useful features are used to perform model training, obtain a mapping relationship between context information and user input text, and construct a semantic intent recognition model based on the mapping relationship.
3. The semantic intent recognition method according to claim 2, characterized in that: The obtaining of user historical consultation data and preprocessing of the user historical consultation data to obtain a training data set specifically includes: Obtain user historical consultation data; Performing a cleaning process on the user history consultation data, wherein the cleaning process includes removing irrelevant information and correcting spelling errors and introducing a noise tolerance algorithm during the cleaning process to obtain cleaned user history consultation data; According to the intent of the user input text, the cleaned user historical consultation data is annotated to generate a training data set containing intent labels.
4. The semantic intent recognition method according to claim 3, characterized in that: The extracting of features useful for identifying the semantic intent of the user input text from the training data set specifically includes: Convert the user input text into a first numerical vector by means of word embedding representation; The context information related to the user input text is converted into a second numerical vector by context encoding, and the first numerical vector is fused with the second numerical vector to obtain features useful for the semantic intent of the user input text.
5. The method for semantic intent recognition according to claim 3, characterized in that: The method of using the useful features to perform model training, obtaining a mapping relationship between context information and user input text, and constructing a semantic intent recognition model according to the mapping relationship specifically includes: According to the useful features, sequence information of the user input text and context information is obtained through a recurrent neural network, and the sequence information is passed to a deep neural network and a convolutional neural network respectively; The convolutional neural network extracts local features of the user input text and the context information from the sequence information, and passes the local features to the deep neural network; The deep neural network extracts global features of the user input text and the context information from the sequence information, and integrates the global features with the local features to obtain a global feature vector; The context information is fused with the global feature vector to obtain a fused feature vector, a mapping relationship between the context information and the user input text is obtained according to the fused feature vector, and the semantic intent recognition model is obtained according to the mapping relationship.
6. The semantic intent recognition method according to claim 5, characterized in that: The semantic intent recognition model includes: An input layer, used for receiving the user input text and the context information; A feature extraction layer, used to extract semantic features of the user input text and the context information; A context fusion layer, used to fuse the semantic features of the context information with the semantic features of the user input text, and use an attention mechanism to dynamically assign weights during the fusion process to generate a fused feature vector; The intent recognition layer is used to classify the fused feature vector according to the classification algorithm to obtain the final intent recognition result; The output layer is used to output the final intent recognition result.
7. The semantic intent recognition method according to claim 1, characterized in that: The method further comprises: Deploy the semantic intent recognition model in an online environment, perform intent recognition on user input text in the online environment, and obtain a semantic intent recognition result; The relevant parameters of the semantic intent recognition model are updated in real time according to the semantic intent recognition result.
8. A semantic intention recognition device integrating context information, characterized in that: The semantic intention recognition device comprises: A context model building module, used to obtain user input text, extract and integrate context information for each word and sentence in the user input text, so as to build a context model; A text information acquisition module, used to acquire the association relationship between words, the logical relationship between sentences, and the overall text theme and focus in the user input text according to the context model; A model acquisition module is used to acquire a semantic intent recognition model; The recognition result output module is used to obtain a semantic intent recognition model, identify the semantic intent of the user input text based on the association between the semantic intent recognition model and vocabulary, the logical relationship between sentences, and the theme and focus of the user input text, and output the result of the semantic intent recognition.
9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement a semantic intent recognition method that integrates context information as described in any one of claims 1-7.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements a semantic intent recognition method that integrates contextual information as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Training method and device of intention recognition model and intention recognition method and device
CA3180493A1
Intention classification model training method, classification method and system
CN109492104A
Emotion classification method and system based on neural network and attention mechanism
CN112328797A
Natural language processing method and system based on machine learning
CN117493491A
Text sentiment classification method based on syntactic dependency relationship and attention mechanism
CN117951304A