Semantic search method for identifying user intention based on AI and storage medium

Through a semantic search method based on AI to identify user intentions, using technologies such as Transformer model and knowledge graph, the problem of insufficient semantic understanding ability of existing search engines is solved, and more accurate and personalized search results are achieved.

CN119621954AActive Publication Date: 2025-03-14杭州亚古科技有限公司

Patent Information

Application Number
CN202510147772.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-11
Publication Date
2025-03-14
Estimated Expiration
2045-02-11

AI Technical Summary

Technical Problem

Existing search engines have shortcomings in semantic understanding capabilities, and it is difficult to accurately capture the true intentions and needs behind user queries, especially when handling complex queries, resulting in a significant reduction in the accuracy and relevance of search results.

Method used

Using a semantic search method for identifying user intentions based on AI, the query text input by preprocessing the user, the pre-trained Transformer model is used to convert the query text into an embedded vector, and the user intention is predicted through a classifier. Then, based on the knowledge graph, query text, match entities and relationships, calculate similarity scores, build user portraits, and finally obtain a personalized document list.

Benefits of technology

It achieves an accurate grasp of user needs, improves the accuracy and comprehensiveness of searches, and enhances the personalization of search results and user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621954A_ABST
    Figure CN119621954A_ABST
Patent Text Reader

Abstract

The invention provides a semantic search method for identifying user intention based on AI and a storage medium, and the method comprises the steps: receiving a query text input by a user, and carrying out the preprocessing to extract key information; the method comprises the following steps: pre-training a Transform model, and inputting a query text to obtain an embedded vector; predicting a user intention based on the embedded vector by using a classifier; the key information and the user intention are combined, the query text is expanded through the knowledge graph, and the expanded query text is generated; matching the extended text with entities and relationships in the knowledge graph to obtain a related set; calculating a similarity score of the set and the document; and constructing a user portrait, and generating a document list based on the portrait and the similarity score. According to the method, the query text is deeply understood through the Transform model, the intention is predicted by the classifier, and the user demand is accurately grasped. And furthermore, the query content is enriched through domain dictionary construction, synonym replacement and phrase expansion, and the search accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of semantic search technology, and in particular to a semantic search method and storage medium based on AI-based recognition of user intent. Background Technology

[0002] Semantic search, a crucial branch of modern information retrieval technology, aims to significantly improve the accuracy and effectiveness of retrieval systems by deeply understanding the specific meaning of user queries. With the widespread adoption of internet technology and the rapid expansion of data volume, traditional keyword-based search methods are increasingly unable to meet the ever-diversifying information needs of users. Existing search engines generally suffer from significant deficiencies in semantic understanding. They often only mechanically understand the literal meaning of user queries, failing to accurately capture the true intent and needs hidden behind the query. For example, when a user enters the query "What's the weather like today?", their actual intent might be to know the current weather conditions, but the search engine may only find relevant documents containing the keywords "today" and "weather," failing to accurately determine that the user truly wants real-time weather information. Furthermore, the inadequacy of semantic understanding is particularly evident in handling complex queries. When users enter complex queries containing multiple concepts, entities, and intricate relationships, existing search engines often struggle to fully and accurately understand their overall meaning. This directly leads to a significant reduction in the accuracy and relevance of search results, failing to meet the user's actual needs. In this context, enhancing the semantic understanding capabilities of search engines becomes particularly important in order to better cope with complex and ever-changing information retrieval scenarios. Summary of the Invention

[0003] To address the technical problem of low accuracy in search results in existing technologies, this invention provides the following technical solution: On the one hand, a semantic search method based on AI-based user intent recognition is provided, the method comprising: S1. Receive the query text input by the user and preprocess the query text to obtain key information; S2. Pre-train the Transformer model and input the query text into the trained Transformer model to obtain the embedding vector of the query text; S3. Based on the embedding vector, use a classifier to predict the user's intent; S4. Based on key information and user intent, expand the query text using the constructed knowledge graph to obtain the expanded query text; S5. Match the expanded query text with the entities and relationships in the knowledge graph to obtain a set of entities and relationships related to the query text; S6. Calculate the similarity score between the set of entities and relations related to the query text and the document; S7. Construct a user profile and obtain a document list based on the user profile and the similarity score.

[0004] As an optional embodiment of the present invention, obtaining key information in step S1 may include: S101. Perform word segmentation, stop word removal, and restoration on the query text; S102. Obtain the entities in the query text and determine the syntactic role of each entity in the query text; S103. The grammatical roles are labeled, and key information is obtained based on the labeled grammatical roles.

[0005] As an optional embodiment of the present invention, the pre-training of the Transformer model in step S2 may include: S201. Collect text data and perform word segmentation on the text data; S202. Construct an input sequence based on the text data after word segmentation; S203. Initialize the Transformer model by inputting the input sequence into the Transformer model and training it using the self-attention mechanism and feedforward neural network in the Transformer model. S204. Calculate the loss between the output of the Transformer model and the target using the loss function, and iteratively update the parameters of the Transformer model based on the loss using an optimization algorithm.

[0006] As an optional embodiment of the present invention, the expression of the loss function in step S204 is optionally:

[0007] in, This represents the loss of the Transformer model. This indicates the number of samples in the Transformer model. Indicates the first One sample, Indicates the first The true value of each sample Represents the logarithmic function. Represents the first... The predicted value for each sample.

[0008] As an optional embodiment of the present invention, optionally, the expression for predicting the user's intent using a classifier in step S3 is: in, Indicates the first The output of the hidden layer, where σ() represents the non-linear activation function. Indicates the first The weight matrix of the hidden layer, Indicates the first The output of the hidden layer, Indicates the first The bias of the hidden layer, This represents the original output vector of the final linear layer. Indicates the first The weight matrix of the hidden layer, Indicates the first The bias of the hidden layer, Indicates the first The predicted probabilities of each category, Indicates the first The score index for each category, Indicates the total number of categories. Indicates the first The score index for each category.

[0009] As an optional embodiment of the present invention, optionally, obtaining the expanded query text in step S4 includes: S401. Construct a domain dictionary related to the query text; S402. Based on the domain dictionary, perform synonym replacement and phrase expansion on the query text to obtain the expanded query text.

[0010] As an optional embodiment of the present invention, optionally, the expression for calculating the similarity score between the set of entities and relations related to the query text and the document in step S6 is: in, Represents the similarity score. A vector representation of the query text. Represents the dot product. A vector representation of a document. This indicates taking the modulus.

[0011] As an optional embodiment of the present invention, optionally, constructing a user profile in step S7 includes: S701. Obtain the user's historical behavior data and preprocess the historical behavior data; S702. Extract behavioral features, interest features, and attribute features based on the historical behavioral data; S703. Encode the behavioral features, interest features, and attribute features respectively to obtain behavioral feature vectors, interest feature vectors, and attribute feature vectors; S704. Concatenate the behavioral feature vector, interest feature vector, and attribute feature vector to obtain the user profile feature vector; S705. Add labels to the user profile feature vector to obtain the user profile.

[0012] As an optional embodiment of the present invention, optionally, the expression for obtaining the user profile feature vector in step S704 is:

[0013] in, The feature vector representing the user profile This represents the activation function. Indicates the number of behavioral characteristics. Indicates the first A behavioral characteristic, express Time of the first The weights of each behavioral feature, where • denotes the dot product. Indicates the first The transformation function of each behavioral feature Indicates the first The original features of each behavioral characteristic This represents the number of interest feature vectors. Indicates the first Interest feature vectors, express Time of the first The weights of each interest feature, Indicates the first The transformation function of interest features Indicates the first The original features of each interest feature This indicates the number of attribute feature vectors. Indicates the first Each attribute feature vector express Time of the first The weights of each attribute feature, Indicates the first Transformation function for each attribute feature, Indicates the first The original features of each attribute feature Represents a time-dependent global context vector.

[0014] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored therein, the at least one instruction being loaded and executed by a processor to implement any of the above-described semantic search methods based on AI-based user intent recognition.

[0015] The beneficial effects of the technical solution provided by the embodiments of this invention are as follows: This invention uses the Transformer model to perform deep semantic understanding of the query text input by the user and uses a classifier to predict the user's intent, thereby achieving a precise grasp of the user's needs. After obtaining the user's intent, this invention further expands the query text by constructing a domain dictionary and performing synonym replacement and phrase expansion, enriching the content of the query text and improving the accuracy and comprehensiveness of the search. At the same time, this invention also calculates the similarity score between the set of entities and relations related to the query text and the document, quantitatively evaluating the relevance of the document to the user's query, further improving the accuracy of the search results. In addition, this invention also constructs a user profile by acquiring and preprocessing the user's historical behavior data, extracting behavioral features, interest features, and attribute features, encoding and concatenating them to finally obtain a user profile feature vector, and adding labels to it to achieve a precise grasp of the user's personalized needs. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a flowchart of a semantic search method based on AI to identify user intent, provided by an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a semantic search device provided in an embodiment of the present invention. Detailed Implementation

[0018] The technical solution of the present invention will now be described with reference to the accompanying drawings.

[0019] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.

[0020] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning.

[0021] In this embodiment of the invention, sometimes a subscript such as W1 may be mistakenly written as a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.

[0022] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0023] like Figure 1 As shown, this embodiment of the invention provides a semantic search method based on AI-based user intent recognition, the method comprising: S1. Receive the query text input by the user and preprocess the query text to obtain key information; It should be noted that in step S1, the preprocessing process in this embodiment includes steps such as removing irrelevant characters, word segmentation, part-of-speech tagging, and stop word filtering to ensure the accurate extraction of key information. Key information includes core words and phrases in the query text and the semantic relationships between them.

[0024] S2. Pre-train the Transformer model and input the query text into the trained Transformer model to obtain the embedding vector of the query text; It should be noted that the Transformer model is a deep learning model suitable for natural language processing tasks. In this embodiment, the Transformer model learns the linguistic patterns and semantic information of a large amount of text data through a pre-training process. When query text is input into the trained Transformer model, the model can capture the semantic features in the query text and represent them as an embedding vector. This embedding vector is a high-dimensional vector containing deep semantic information of the query text, providing a foundation for subsequent intent recognition and query expansion.

[0025] S3. Based on the embedding vector, use a classifier to predict the user's intent; It's important to note that a classifier is a machine learning model that classifies input data. In this embodiment, the classifier predicts user intent based on the embedding vector of the query text. By training the classifier, it learns the mapping relationship between different user intents and query text embedding vectors. When new query text is input, the classifier can output the corresponding user intent, providing a basis for subsequent query expansion and search result ranking.

[0026] S4. Based on key information and user intent, expand the query text using the constructed knowledge graph to obtain the expanded query text; It should be noted that a knowledge graph is a structured knowledge base containing a large number of entities, attributes, and relationships. In this embodiment, the knowledge graph is used to expand the query text. Specifically, based on key information and user intent, entities and relationships related to the query text are found in the knowledge graph, and these entities and relationships are added to the query text as expanded content. In this way, the expanded query text not only contains the information in the original query text but also includes additional information related to the query text, thereby improving the accuracy and comprehensiveness of the search.

[0027] S5. Match the expanded query text with the entities and relationships in the knowledge graph to obtain a set of entities and relationships related to the query text; It should be noted that step S5 is to further determine the specific location of the query text in the knowledge graph, as well as detailed information about the related entities and relationships. Through the matching process, a set of entities and relationships highly relevant to the query text can be obtained. These sets provide important basis for subsequent relevance calculations and search result ranking. Specific matching algorithms can employ similarity-based strategies, such as cosine similarity or Jaccard similarity, to evaluate the similarity between the expanded query text and various entities and relationships in the knowledge graph. In this way, the most relevant entities and relationships to the query text can be accurately selected, ensuring the accuracy and relevance of the search results.

[0028] S6. Calculate the similarity score between the set of entities and relations related to the query text and the document; It should be noted that in step S6, the similarity score calculation is to assess the degree of association between the set of entities and relations related to the query text and the document. Specifically, various similarity calculation methods can be used, such as cosine similarity, Jaccard similarity, and Euclidean distance, to quantify the semantic distance between the query text and the document. During the calculation, words, phrases, sentences in the document, and their semantic relationships are considered and compared with the set of entities and relations related to the query text to obtain a similarity score. This score reflects the relevance between the document and the query text, providing a crucial basis for subsequent search result ranking. By calculating the similarity score, the document that best matches the query text can be accurately found, improving the accuracy and efficiency of the search.

[0029] S7. Construct a user profile and obtain a document list based on the user profile and the similarity score.

[0030] It's important to note that a user profile is a user model constructed based on a user's historical behavior, preferences, and personal attributes. In this embodiment, the user profile is combined with a similarity score to determine the final document list. Specifically, a user interest preference model is constructed based on information such as the user's historical search records, click behavior, and browsing time. Then, the documents are sorted using the similarity score. Documents that highly match the user profile and have a high similarity score are ranked first and displayed to the user preferentially. This not only improves the personalization of search results but also enhances the user's search experience and satisfaction. Finally, the ranked document list is displayed to the user, completing the entire semantic search process.

[0031] In summary, this embodiment first receives the query text input by the user and preprocesses it to extract key information. Then, a pre-trained Transformer model is used to convert the query text into an embedding vector, which is rich in deep semantic information. Next, a classifier predicts the user's intent, and based on the key information and user intent, the query text is expanded using a knowledge graph to obtain richer and more comprehensive query content. Subsequently, the expanded query text is matched with entities and relationships in the knowledge graph to determine highly relevant sets of entities and relationships. Next, similarity scores between these sets and documents are calculated to assess the degree of association between them. Finally, combining user profiles and similarity scores, the documents are ranked, and the ranked document list is displayed to the user. This entire process not only improves the accuracy and comprehensiveness of the search but also enhances the personalization of search results and user satisfaction.

[0032] As an optional embodiment of the present invention, obtaining key information in step S1 may include: S101. Tokenize, remove stop words, and restore the query text; It should be noted that tokenization is to split the query text into individual lexical units, removing stop words is to remove common words that are not helpful for identifying the query intention, such as "de" (的), "le" (了), etc., and restoration processing is to restore the words to their basic forms, such as restoring "running" to "run", to improve the accuracy of subsequent processing. By performing these preprocessing operations on the query text, more precise and useful key information can be further extracted, providing more reliable data support for the subsequent steps.

[0033] S102. Obtain the entities in the query text and determine the syntactic roles of each entity in the query text; It should be noted that entities are words or phrases with clear meanings and independence in the query text, which carry the core information of the query text. Determining the syntactic roles of entities in the query text can help this embodiment better understand the semantic structure of the query text, thereby more accurately identifying the user's query intention. For example, in a text about movie queries, "movie" is an entity, and its syntactic role in the text is the subject or object, which helps to understand whether the user is asking for information about a certain movie or discussing related content about a certain movie. By identifying the entities and their syntactic roles, the semantic information of the query text can be further enriched, providing a more precise data basis for subsequent classifier prediction and user intention recognition.

[0034] S103. Annotate the syntactic roles and obtain key information based on the annotated syntactic roles.

[0035] It should be noted that Annotating the syntactic roles is to clarify the specific functions of each entity in the query text, which helps to more deeply understand the semantic content of the query text. The annotated syntactic roles can clearly show the association and hierarchical relationships between entities, thereby extracting more key and useful information. For example, in a text about travel queries, by annotating the syntactic roles of entities such as "scenic spots", "prices", and "transportation", their respective positions and functions in the query text can be clarified, and then it can be determined that the user's query intention is to want to know the detailed information of a certain scenic spot or compare the prices and transportation of different scenic spots. Based on these annotated syntactic roles, this embodiment can more accurately extract key information, providing more precise and comprehensive data support for subsequent classifier prediction and user intention recognition. In this way, not only can the efficiency and accuracy of query text processing be improved, but also more personalized and satisfactory search results can be provided for users.

[0036] As an optional embodiment of the present invention, the pre-training of the Transformer model in step S2 may include: S201. Collect text data and perform word segmentation on the text data; S202. Construct an input sequence based on the text data after word segmentation; It should be noted that the input sequence is constructed to convert text data into a format that the model can process. In this embodiment, the construction of the input sequence considers the vocabulary, phrases, and contextual relationships between them in the text data to ensure that the model can fully capture the semantic information of the text data. By arranging the segmented text data in an ordered manner to form the input sequence, a foundational data is provided for subsequent model training. Thus, after receiving the input sequence, the Transformer model can utilize its attention mechanism to assign weights to each element in the sequence, thereby learning the deep semantic features of the text data and providing strong support for query text embedding vector transformation in subsequent steps.

[0037] S203. Initialize the Transformer model by inputting the input sequence into the Transformer model and training it using the self-attention mechanism and feedforward neural network in the Transformer model. It's important to note that the initialization of the Transformer model is to ensure it's in a suitable state before training begins. Subsequently, the constructed input sequence is fed into the Transformer model, which utilizes its self-attention mechanism and feedforward neural network to learn and train on the input sequence. The self-attention mechanism allows the model to focus on each element in the input sequence and assign weights based on the correlation between elements, thereby capturing key semantic information in the text data. The feedforward neural network is responsible for further processing and transforming the captured semantic information to generate embedding vectors rich in deep semantic information. Through continuous training and optimization, the Transformer model can learn deep semantic features in the text data, providing more accurate and comprehensive data support for query text embedding vector transformation in subsequent steps. Thus, when receiving query text input from the user, this embodiment can quickly convert it into an embedding vector, providing a strong data foundation for subsequent classifier prediction and user intent recognition.

[0038] S204. Calculate the loss between the output of the Transformer model and the target using the loss function, and iteratively update the parameters of the Transformer model based on the loss using an optimization algorithm.

[0039] It's important to note that the loss function is used to evaluate the difference between the Transformer model's output and the target. It helps the model understand its prediction error and guides the direction of model parameter updates. In this embodiment, the loss function is used to calculate the loss value between the model's output and the target. Subsequently, based on the calculated loss value, optimization algorithms, such as the Adam optimization algorithm, are used to iteratively update the Transformer model's parameters. The optimization algorithm continuously adjusts the model's parameters, gradually bringing the model's output closer to the target, thereby reducing the loss value. Through continuous iterative training, the Transformer model can gradually learn the deep semantic features in the text data and improve its prediction accuracy and generalization ability. Thus, once the Transformer model is trained, it can effectively convert user-input query text into embedding vectors rich in deep semantic information, providing more accurate and reliable data support for subsequent classifier prediction and user intent recognition.

[0040] As an optional embodiment of the present invention, the expression of the loss function in step S204 is optionally: in, This represents the loss of the Transformer model; Indicates the number of samples in the Transformer model; Indicates the first One sample; Indicates the first The true value of each sample; Represents a logarithmic function; Represents the first... The predicted value for each sample.

[0041] As an optional embodiment of the present invention, optionally, the expression for predicting the user's intent using a classifier in step S3 is: in, Indicates the first The output of the hidden layer; σ() represents a nonlinear activation function; Indicates the first The weight matrix of the hidden layer; Indicates the first The output of the hidden layer; Indicates the first The bias of the hidden layer; This represents the original output vector of the final linear layer; Indicates the first The weight matrix of the hidden layer; Indicates the first The bias of the hidden layer; Indicates the first The predicted probabilities of each category; Indicates the first The score index for each category; Indicates the total number of categories; Indicates the first The score index for each category.

[0042] It's important to note that the classifier in the above expression employs a multi-layer neural network structure. Through a combination of non-linear activation functions and linear layers, it maps the embedding vector output by the Transformer model to the predicted probability of the user's intent. Specifically, each hidden layer performs a non-linear transformation on the input and then linearly combines the weight matrix and bias to obtain the input for the next hidden layer. Finally, the original output vector is obtained through the linear layers and normalized using a softmax function to obtain the predicted probability for each category. In this way, the classifier can predict the user's intent regarding the query text based on the embedding vector output by the Transformer model.

[0043] As an optional embodiment of the present invention, optionally, obtaining the expanded query text in step S4 includes: S401. Construct a domain dictionary related to the query text; It's important to note that this domain dictionary contains specialized terms and common vocabulary related to the query text, helping the model better understand the semantic information of the query. Introducing a domain dictionary improves the model's ability to recognize query texts within a specific domain, thereby further enhancing the accuracy and relevance of search results. Specific methods for constructing a domain dictionary include, but are not limited to, collecting specialized terms and common vocabulary from relevant literature, books, and online resources, and then filtering and organizing them. These terms can be weighted according to their importance or frequency to receive different levels of attention in subsequent processing.

[0044] S402. Based on the domain dictionary, perform synonym replacement and phrase expansion on the query text to obtain the expanded query text.

[0045] It's important to note that synonym replacement refers to replacing certain words in the query text with their synonyms or near-synonyms, thereby increasing the diversity of the query text and improving the coverage of search results. Phrase expansion, on the other hand, refers to expanding individual words in the query text into related phrases or word groups to more accurately express the user's query intent. Through synonym replacement and phrase expansion, the semantic information of the query text can be further enriched, improving the model's ability to understand the user's query intent. In practice, rule-based methods or machine learning-based methods can be used for synonym replacement and phrase expansion. Rule-based methods rely on the synonym and phrase relationships in the domain dictionary, while machine learning-based methods can learn the semantic similarity and association between words by training the model.

[0046] As an optional embodiment of the present invention, optionally, the expression for calculating the similarity score between the set of entities and relations related to the query text and the document in step S6 is: in, Represents the similarity score; A vector representation of the query text; Represents the dot product; A vector representation of a document; This indicates taking the modulus.

[0047] As an optional embodiment of the present invention, optionally, constructing a user profile in step S7 includes: S701. Obtain the user's historical behavior data and preprocess the historical behavior data; It should be noted that historical behavioral data includes, but is not limited to, a user's previous search history, click history, and browsing history. This data can reflect a user's interests and preferences. By preprocessing historical behavioral data, useful information can be extracted, providing a foundation for subsequent user profiling. Specific preprocessing methods include, but are not limited to, data cleaning, deduplication, and formatting steps to ensure data accuracy and consistency.

[0048] S702. Extract behavioral features, interest features, and attribute features based on the historical behavioral data; It's important to note that behavioral characteristics refer to the patterns of behavior exhibited by users when performing actions such as searching, clicking, and browsing, including search frequency, click-through rate, and dwell time. Interest characteristics refer to the degree of interest users have in different fields or topics, which can be extracted by analyzing users' search history and click records. Attribute characteristics refer to users' personal attribute information, such as age, gender, and occupation, which can be obtained through user registration information or third-party data sources. By extracting these characteristics, a more comprehensive understanding of user preferences and needs can be achieved, thereby providing users with more personalized search results and services.

[0049] S703. Encode the behavioral features, interest features, and attribute features respectively to obtain behavioral feature vectors, interest feature vectors, and attribute feature vectors; It's important to note that the encoding process can employ methods such as one-hot encoding and word embedding to convert discrete features into continuous vector representations for subsequent calculations and analysis. By combining and fusing these feature vectors, a vector representation of the user profile can be obtained, enabling a comprehensive description and characterization of user interests and preferences. In this way, during subsequent search processes, search results and services that better match the user's interests and needs can be recommended based on the vector representation of the user profile, improving search accuracy and satisfaction.

[0050] S704. Concatenate the behavioral feature vector, interest feature vector, and attribute feature vector to obtain the user profile feature vector; It's important to note that concatenating behavioral feature vectors, interest feature vectors, and attribute feature vectors can comprehensively reflect multiple dimensions of user information, thus providing a more accurate user profile. In practice, a vector concatenation method can be used to combine these three feature vectors in a specific order to obtain the user profile feature vector. This allows for the recommendation of search results and services that better match the user's personalized needs during subsequent searches, improving search accuracy and user satisfaction. Furthermore, storing and updating the user profile feature vector enables continuous tracking and analysis of user interests and preferences, providing a more dynamic and personalized search experience.

[0051] S705. Add labels to the user profile feature vector to obtain the user profile.

[0052] It's important to note that tags are a further description and classification of user profile feature vectors, helping models to more quickly understand and identify user interests and needs. The specific content of tags can be designed and defined according to actual application scenarios and requirements, such as the user's age group, gender, occupation, and hobbies. By adding tags, a more detailed and accurate description of the user profile can be achieved, thereby providing users with more personalized search results and services. In practice, either rule-based or machine learning-based methods can be used for tag addition and classification. Rule-based methods rely on a pre-set tag library and rule set, while machine learning-based methods can learn the correlation and similarity between tags and user profile feature vectors through model training.

[0053] As an optional embodiment of the present invention, optionally, the expression for obtaining the user profile feature vector in step S704 is:

[0054] in, The feature vector representing the user profile This represents the activation function. Indicates the number of behavioral characteristics. Indicates the first A behavioral characteristic, express Time of the first The weights of each behavioral feature, where • denotes the dot product. Indicates the first The transformation function of each behavioral feature Indicates the first The original features of each behavioral characteristic This represents the number of interest feature vectors. Indicates the first Interest feature vectors, express Time of the first The weights of each interest feature, Indicates the first The transformation function of interest features Indicates the first The original features of each interest feature This indicates the number of attribute feature vectors. Indicates the first Each attribute feature vector express Time of the first The weights of each attribute feature, Indicates the first Transformation function for each attribute feature, Indicates the first The original features of each attribute feature Represents a time-dependent global context vector.

[0055] It's important to note that this expression comprehensively considers user behavioral, interest, and attribute features, and introduces a time-dependent global context vector to capture changes in user behavior and interest shifts at different points in time. Through activation and transformation functions, the original features are converted into more expressive feature vectors, thus better describing the user profile. Furthermore, by adjusting the weights of different features at different time points, a more dynamic and accurate capture of user interests and needs can be achieved. In subsequent search processes, based on the expression of the user profile feature vector, search results and services that better match the user's personalized needs and interests can be recommended, further improving search accuracy and user satisfaction.

[0056] Figure 2 This is a schematic diagram of the structure of a semantic search device provided in an embodiment of the present invention, such as... Figure 2 As shown, the semantic search device 410 may include a first processor 2001.

[0057] Optionally, the semantic search device 410 may also include a memory 2002 and a transceiver 2003.

[0058] The first processor 2001, memory 2002, and transceiver 2003 can be connected via a communication bus.

[0059] The following is combined Figure 2 A detailed description of each component of the semantic search device 410 is provided below: The first processor 2001 is the control center of the semantic search device 410. It can be a single processor or a collective term for multiple processing elements. For example, the first processor 2001 can be one or more central processing units (CPUs), application-specific integrated circuits (ASICs), or one or more integrated circuits configured to implement embodiments of the present invention, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).

[0060] Optionally, the first processor 2001 can perform various functions of the semantic search device 410 by running or executing software programs stored in the memory 2002 and calling data stored in the memory 2002.

[0061] In a specific implementation, as one example, the first processor 2001 may include one or more CPUs, for example... Figure 2 CPU0 and CPU1 are shown in the diagram.

[0062] In a specific implementation, as one example, the semantic search device 410 may also include multiple processors, for example... Figure 2 The first processor 2001 and the second processor 2004 are shown in the diagram. Each of these processors can be a single-core processor or a multi-core processor. Here, a processor can refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).

[0063] The memory 2002 is used to store the software program that executes the present invention, and is controlled by the first processor 2001 to execute it. The specific implementation method can be referred to the above method embodiment, and will not be repeated here.

[0064] Optionally, the memory 2002 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory 2002 may be integrated with the first processor 2001 or may exist independently, and may be accessed through the interface circuit of the semantic search device 410. Figure 2 (Not shown in the image) is coupled to the first processor 2001, and this embodiment of the invention does not specifically limit this.

[0065] The transceiver 2003 is used to communicate with network devices or with terminal devices.

[0066] Alternatively, transceiver 2003 may include a receiver and a transmitter. Figure 2 (Not shown separately). The receiver is used to implement the receiving function, and the transmitter is used to implement the transmitting function.

[0067] Optionally, the transceiver 2003 can be integrated with the first processor 2001, or it can exist independently and be connected to the interface circuit of the semantic search device 410. Figure 2 (Not shown in the image) is coupled to the first processor 2001, and this embodiment of the invention does not specifically limit this.

[0068] It should be noted that, Figure 2 The structure of the semantic search device 410 shown does not constitute a limitation on the router. Actual knowledge structure identification devices may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0069] Furthermore, the technical effect of the semantic search device 410 can be referred to the technical effect of the semantic search method based on AI to identify user intent described in the above method embodiments, and will not be repeated here.

[0070] It should be understood that the first processor 2001 in the embodiments of the present invention may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0071] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A semantic search method based on AI to identify user intent, characterized in that: The method comprises: S1. receiving a query text input by a user, and preprocessing the query text to obtain key information; S2, pre-training the Transformer model, and inputting the query text into the trained Transformer model to obtain an embedding vector of the query text; S3, predicting user intention using a classifier based on the embedding vector; S4, expanding the query text using the constructed knowledge graph based on the key information and user intention to obtain an expanded query text; S5, matching the expanded query text with the entities and relationships in the knowledge graph to obtain a set of entities and relationships related to the query text; S6, calculating the similarity score between the set of entities and relations related to the query text and the document; S7: Build a user portrait, and obtain a document list based on the user portrait and the similarity score.

2. The semantic search method based on AI recognition of user intention according to claim 1, characterized in that: The key information obtained in step S1 includes: S101, performing word segmentation, stop word removal and restoration processing on the query text; S102, obtaining entities in the query text, and determining a grammatical role of each entity in the query text in the query text; S103: Annotate the grammatical roles, and obtain key information based on the annotated grammatical roles.

3. The semantic search method based on AI recognition of user intention according to claim 1, characterized in that: Pre-training the Transformer model in step S2 includes: S201, collecting text data, and performing word segmentation processing on the text data; S202, constructing an input sequence based on the text data after the word segmentation processing; S203, initializing the Transformer model, inputting the input sequence into the Transformer model, and training using the self-attention mechanism and feedforward neural network in the Transformer model; S204: Calculate the loss between the output of the Transformer model and the target using a loss function, and iteratively update the parameters of the Transformer model using an optimization algorithm based on the loss.

4. The semantic search method based on AI recognition of user intention according to claim 3 is characterized in that: In step S204, the loss function is expressed as: in, represents the loss of the Transformer model, Represents the number of samples of the Transformer model, Indicates samples, Indicates The true value of the samples, represents the logarithmic function, Represents the first The predicted value of a sample.

5. The semantic search method based on AI recognition of user intention according to claim 1, characterized in that: The expression for predicting user intention using the classifier in step S3 is: in, Indicates The output of the hidden layer, σ() represents the nonlinear activation function, and Indicates The weight matrix of the hidden layer, Indicates The output of the hidden layer, Indicates The bias of the hidden layer, represents the raw output vector of the final linear layer, Indicates The weight matrix of the hidden layer, Indicates The bias of the hidden layer, Indicates The predicted probability of each category, Indicates The score index of each category, represents the total number of categories, Indicates The score index of each category.

6. The semantic search method based on AI recognition of user intention according to claim 1, characterized in that: The expanded query text obtained in step S4 includes: S401, constructing a domain dictionary related to the query text; S402: Perform synonym replacement and phrase expansion on the query text based on the domain dictionary to obtain an expanded query text.

7. The semantic search method based on AI recognition of user intention according to claim 1, characterized in that: In step S6, the expression for calculating the similarity score between the set of entities and relations related to the query text and the document is: in, represents the similarity score, represents the vector representation of the query text, • represents the dot product, represents the vector representation of the document, Indicates modulo.

8. The semantic search method based on AI recognition of user intention according to claim 1, characterized in that: Constructing the user portrait in step S7 includes: S701, obtaining historical behavior data of a user, and preprocessing the historical behavior data; S702, extracting behavior features, interest features and attribute features based on the historical behavior data; S703, respectively encode the behavior feature, interest feature and attribute feature to obtain a behavior feature vector, an interest feature vector and an attribute feature vector; S704, concatenating the behavior feature vector, the interest feature vector and the attribute feature vector to obtain a user portrait feature vector; S705: Add a label to the user portrait feature vector to obtain a user portrait.

9. The semantic search method based on AI recognition of user intention according to claim 8, characterized in that: The expression for obtaining the user portrait feature vector in step S704 is: in, The feature vector representing the user portrait, represents the activation function, Indicates the number of behavioral features, Indicates behavioral characteristics, express Moment The weight of the behavior feature, • represents the dot product, Indicates The conversion function of the behavioral characteristics is Indicates The original characteristics of the behavioral characteristics, represents the number of interesting feature vectors, Indicates Interest feature vectors, express Moment The weight of the feature of interest, Indicates The conversion function of the feature of interest, Indicates The original features of the features of interest, represents the number of attribute feature vectors, Indicates attribute feature vector, express Moment The weight of the attribute features, Indicates The conversion function of attribute features, Indicates The original features of the attribute features, A global context vector representing temporal dependencies.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, which can be called by a processor to execute the semantic search method based on AI to identify user intent as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Text-enhanced knowledge graph joint representation learning method and device

    CN112347268A

  • Advanced search method based on semantic understanding

    CN117851444A

  • Query statement generation method and device based on large language model, equipment and medium

    CN118964560A

  • Information retrieval query method for legal data service platform

    CN118981512A

  • Smart Search Engine

    US20160041986A1

Cited By

  • Knowledge graph-based traffic engineering large model intelligent question-answering system and method

    CN120407752A

  • Financial data retrieval method and system based on artificial intelligence

    CN120653766A

  • An artificial intelligence-based financial data retrieval method and system thereof

    CN120653766B

  • Intention recognition model training method for retrieval, retrieval method and electronic equipment

    CN120849573A

  • Rail transit index question answering method and system based on large model

    CN120929561A