Retail Industry Search System and Method Based on Large Language Model
By adopting a method based on a large language model in the retail industry search system, search intention expansion and semantic coding are performed, and feature query interaction with the description information of alternative products is solved, and the problem that keyword matching technology in the prior art cannot accurately understand user intentions is achieved, and more efficient and relevant product search results are achieved.
Patent Information
- Application Number
- CN202411735440.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2044-11-29
AI Technical Summary
The existing product search system relies on keyword matching technology, cannot accurately understand the user's query intention, is difficult to process synonyms or synonyms, and cannot identify the user's potential purchasing intention, resulting in low relevance of search results.
The retail industry search method based on the large language model is adopted, and the target product query statement input by the user is obtained, the search intention expansion and semantic encoding are performed, the target product query intention semantic encoding vector is generated, and the feature query interaction is conducted based on external knowledge with the description information of the alternative products, and the fine-grained semantic interaction feature vector is generated to determine whether to return the relevant product link.
It significantly improves the user's shopping experience and search efficiency, can more accurately understand the user's query intentions, and provides highly relevant product information.
Smart Images

Figure CN119669564B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of retail industry search, and more specifically, to a retail industry search system and method based on a large language model. Background Art
[0002] In recent years, with the rapid development of the e-commerce market, more and more consumers have begun to prefer shopping through online platforms. However, facing a dazzling array of goods, finding the products they truly like and are satisfied with has gradually become a major problem for consumers. To solve this problem, many retail enterprises have actively developed and optimized their online product search systems, hoping to help consumers find the goods they want faster and more accurately.
[0003] However, most of the existing product search systems adopt keyword matching technology. Keyword matching technology mainly relies on the keywords input by users for search. Although it can quickly respond to users' query requests, it also has obvious limitations. For example, since keyword matching technology mainly focuses on the character matching of vocabulary and ignores the deep semantic association between product descriptions and users' query content, there may be problems such as being unable to accurately understand users' actual needs, difficult to handle synonyms or near-synonyms, and unable to recognize users' potential purchase intentions. Especially when users' descriptions of products are not specific enough or use vague vocabulary, it often leads to low relevance of search results.
[0004] Therefore, in order to improve search accuracy and user experience, a retail industry search system and method based on a large language model are expected. Summary of the Invention
[0005] The present application provides a retail industry search system and method based on a large language model, which can more accurately understand users' query intentions and provide highly relevant product information, thus significantly improving users' shopping experience and search efficiency.
[0006] In the first aspect, a retail industry search method based on a large language model is provided, including:
[0007] Obtaining a target product query statement input by a user;
[0008] Performing retrieval intention extended description on the target product query statement and then performing semantic encoding to obtain a target product query intention semantic encoding vector;
[0009] Extracting the description information of the first alternative product from the product library;
[0010] Performing semantic encoding on the description information of the first alternative product to obtain a first alternative product description information semantic encoding vector;
[0011] Perform a feature query interaction guided by external knowledge on the semantic encoding vector of the target commodity query intention and the semantic encoding vector of the first alternative commodity description information to obtain a query intention-alternative commodity fine-grained semantic interaction feature vector;
[0012] Based on the query intention-alternative commodity fine-grained semantic interaction feature vector, determine whether to return the link of the first alternative commodity as the retrieval result.
[0013] A retail industry search system and method based on a large language model provided by this application, after obtaining the target commodity query statement input by the user, uses deep learning-based natural language processing technology to expand the retrieval intention thereof, generate a richer query content description, and after the user confirms it is correct, perform context semantic feature extraction and fine-grained semantic query interaction with the description information of the alternative commodity, so as to intelligently identify whether the alternative commodity meets the user's retrieval requirements. In this way, the query intention of the user can be understood more accurately, and highly relevant commodity information can be provided, thereby significantly improving the user's shopping experience and search efficiency. Brief Description of the Drawings
[0014] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings of the embodiments of this application will be briefly introduced below. Obviously, the drawings in the following description only relate to some embodiments of this application and do not limit this application.
[0015] Figure 1 It is a schematic flowchart of the retail industry search method based on a large language model for the embodiments of this application.
[0016] Figure 2 It is a schematic diagram of the data flow of the retail industry search method based on a large language model for the embodiments of this application.
[0017] Figure 3 It is a schematic flowchart of semantic encoding after expanding the retrieval intention description of the target commodity query statement to obtain the semantic encoding vector of the target commodity query intention in the retail industry search method based on a large language model for the embodiments of this application.
[0018] Figure 4 It is a schematic flowchart of performing a feature query interaction guided by external knowledge on the semantic encoding vector of the target commodity query intention and the semantic encoding vector of the first alternative commodity description information to obtain a query intention-alternative commodity fine-grained semantic interaction feature vector in the retail industry search method based on a large language model for the embodiments of this application.
[0019] Figure 5In the retail industry search method based on a large language model according to an embodiment of the present application, it is a schematic flowchart for determining whether to return a link to the first alternative product as a retrieval result based on a query intention-alternative product fine-grained semantic interaction feature vector.
[0020] Figure 6 It is a schematic block diagram of a retail industry search system based on a large language model according to an embodiment of the present application. Detailed implementation manners
[0021] Next, the technical solutions in the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts also belong to the scope of protection of the present application.
[0022] In response to the above technical problems, the technical concept of the present application is as follows: after obtaining a target product query statement input by a user, a natural language processing technology based on deep learning is used to expand the retrieval intention thereof to generate a richer query content description. After the user confirms that it is correct, context semantic feature extraction and fine-grained semantic query interaction are performed with the description information of the alternative products, so as to intelligently identify whether the alternative product meets the user's retrieval requirements. In this way, the user's query intention can be understood more accurately, and product information highly relevant thereto can be provided, thereby significantly improving the user's shopping experience and search efficiency.
[0023] As Figure 1 and Figure 2 shown, the retail industry search method based on a large language model is characterized by including: S1, obtaining a target product query statement input by a user; S2, performing retrieval intention expansion description on the target product query statement and then performing semantic encoding to obtain a target product query intention semantic encoding vector; S3, extracting description information of a first alternative product from a product library; S4, performing semantic encoding on the description information of the first alternative product to obtain a first alternative product description information semantic encoding vector; S5, performing feature query interaction based on external knowledge guidance on the target product query intention semantic encoding vector and the first alternative product description information semantic encoding vector to obtain a query intention-alternative product fine-grained semantic interaction feature vector; S6, based on the query intention-alternative product fine-grained semantic interaction feature vector, determining whether to return a link to the first alternative product as a retrieval result.
[0024] Exemplarily, in step S1, obtain the target commodity query statement input by the user. It should be understood that the target commodity query statement input by the user is the most direct information source reflecting the user's current needs and provides the basic data source for commodity search. By analyzing the query statement input by the user, the system can start a series of processing flows, including retrieval intention expansion, semantic encoding, and matching with alternative commodity description information, etc., so as to provide more accurate commodity search results for the user. Compared with traditional keyword matching techniques, this method can better understand the actual needs of users. Especially when users use fuzzy words or insufficiently specific descriptions, by generating richer query content descriptions and using deep learning techniques for semantic-level understanding and matching, the relevance of the search and the user experience are significantly improved.
[0025] In one embodiment, obtaining the target commodity query statement input by the user includes: designing an easy-to-use search bar that allows users to directly type in the name, features, or other relevant information of the commodity they want to find. Front-end technology captures the text entered by the user in the search box and passes it as the original query statement to the back-end system. In other embodiments, the system may also guide users to refine their queries through a conversational interface (such as a chatbot), or confirm whether the system's understanding conforms to the user's intention to increase the accuracy of the query. Subsequently, the user's query statement is securely sent from the client to the server side so that the subsequent data processing module can analyze and process it. In this way, the system can effectively obtain the user's query statement and carry out subsequent search services based on this, ensuring that users can obtain more accurate and relevant search results.
[0026] Exemplarily, in step S2, after performing retrieval intention expansion description on the target commodity query statement, perform semantic encoding to obtain the target commodity query intention semantic encoding vector. It should be understood that the query statement input by the user may usually be just a simple combination of keywords, lacking context information, and may even be ambiguous or fuzzy. Through retrieval intention expansion description, richer and more detailed target commodity query enhancement content can be generated, thus better reflecting the actual needs of users. By converting the target commodity query enhancement content into a semantic encoding vector, the system can understand and process the user's query at the semantic level rather than just the lexical level. Using a model such as Bert for semantic encoding can capture the deep associations and context meanings between words, thus generating a vector representation containing rich semantic information.
[0027] In one embodiment, as Figure 3As shown, after performing retrieval intent extension description on the target commodity query statement and then performing semantic encoding, a target commodity query intent semantic encoding vector is obtained, including: S21, inputting the target commodity query statement into a retrieval intent extension description module based on a large language model to obtain enhanced content for the target commodity query; S22, displaying the enhanced content for the target commodity query and having the customer confirm whether there is a description deviation; S23, after receiving confirmation from the user that there is no description deviation, performing semantic encoding on the enhanced content for the target commodity query to obtain the target commodity query intent semantic encoding vector.
[0028] Exemplarily, in step S21, the target commodity query statement is input into a retrieval intent extension description module based on a large language model to obtain enhanced content for the target commodity query. It should be understood that considering that the query statements input by users are usually just simple combinations of keywords, lacking context information and even being ambiguous or vague, which may further lead to the system's inability to fully understand the actual needs of users. Therefore, this application uses a retrieval intent extension description module based on a large language model to perform semantic extension on the target commodity query statement to generate richer and more detailed enhanced content for the target commodity query. In a specific example of this application, the large language model is the GPT-3 (Generative Pre-trained Transformer 3) model, which is trained using a self-supervised learning algorithm and has powerful language generation and understanding capabilities. It can, based on the short statements input by users, combine context information and a wide knowledge base to identify and supplement potential query intents and generate more comprehensive query descriptions. For example, when the user inputs "coffee machine", the GPT-3 model may generate "fully automatic household coffee machine, supporting multiple coffee-making modes, easy to clean and maintain".
[0029] Exemplarily, in step S22, the enhanced content for the target commodity query is displayed and the customer is asked to confirm whether there is a description deviation. It should be understood that although the query content extended by the large language model is more detailed, there may still be misunderstandings or deviations from the actual needs of users. Therefore, this application further displays the enhanced content for the target commodity query on the application interface for users to check and confirm. If the user believes that the description is accurate, they can confirm and continue to the next step; if there is a deviation, the user is allowed to modify it based on the enhanced content for the target commodity query or re-enter the query statement. In this way, the accuracy of commodity queries can be effectively ensured.
[0030] Exemplarily, in step S23, after receiving the user's confirmation that there is no description deviation, semantic encoding is performed on the enhanced content of the target commodity query to obtain the semantic encoding vector of the target commodity query intention. It should be understood that after receiving the user's confirmation that there is no description deviation, in order to fully understand the context semantic meaning of the enhanced content of the target commodity query, the present application further performs semantic encoding on the enhanced content of the target commodity query, converting the text data into a vector representation containing semantic information, so as to provide a basis for subsequent semantic query interaction.
[0031] In one embodiment, performing semantic encoding on the enhanced content of the target commodity query to obtain the semantic encoding vector of the target commodity query intention includes: using a semantic encoder based on the Bert model to perform semantic encoding on the enhanced content of the target commodity query to obtain the semantic encoding vector of the target commodity query intention. It should be understood that the process of using a semantic encoder based on the Bert model to perform semantic encoding on the enhanced content of the target commodity query to obtain the semantic encoding vector of the target commodity query intention is to utilize the powerful pre-trained deep learning model of Bert. The Bert model simultaneously considers the context information on both sides of a word through a bidirectional Transformer architecture, thereby more accurately capturing the meaning of the word in a specific context. It first performs unsupervised pre-training on a large-scale text dataset to learn general language features; then, according to specific task requirements, it performs supervised fine-tuning on a smaller-scale dataset to adapt to specific downstream tasks.
[0032] The Bert model adopts two main techniques in the pre-training stage: Masked Language Model (MLM) and Next Sentence Prediction (NSP). MLM trains the model's ability to understand the context by randomly masking a part of the words in the input sentence and requiring the model to predict these masked words. NSP helps the model understand the relationship between sentences, which is very important for tasks such as question answering and natural language inference.
[0033] When applying the Bert model for semantic encoding, first, the target product query enhanced content needs to be converted into a form suitable for Bert processing. This usually involves steps such as word segmentation, adding special tokens (such as [CLS] and [SEP]), and constructing the input sequence. Then, the prepared input sequence is fed into the Bert model, and the model will generate the hidden states of each word. These hidden states can be regarded as a deep semantic representation of the input text. For the semantic encoding vector of the entire sentence or paragraph, usually, the hidden state corresponding to the [CLS] token is used as a representative because after being processed by the model, the hidden state of the [CLS] token already contains the information of the entire input sequence and is suitable as the semantic encoding vector of the entire input text. In this way, the Bert model can convert the target product query enhanced content into a vector representation rich in semantic information. This representation not only retains the semantic features of the original text but also enhances the system's ability to understand the user's query intention, making the subsequent matching with the alternative product description information more accurate and effective. This method overcomes the limitations of traditional keyword matching techniques and improves the relevance of search results and the user experience.
[0034] Exemplarily, in step S3, the description information of the first alternative product is extracted from the product library. It should be understood that in order to determine the product that matches the user's query intention, the description information of the first alternative product, including key elements such as product name, brand, specification, price, and functional features, is further extracted from the product library. For the sake of simplicity in description, in the technical solution of this application, only the semantic matching analysis process between the description information of a single alternative product and the target product query enhanced content is elaborated in detail. However, it should be understood that in actual applications, this method can be applied to any alternative product in the product library, so as to achieve a traversal query of the product library.
[0035] Exemplarily, in step S4, the description information of the first alternative product is semantically encoded to obtain the semantic encoding vector of the first alternative product description information. It should be understood that the description information of the first alternative product is semantically encoded to capture the semantic associations and context meanings between the words in the description information, and it is also converted into a vector representation containing semantic information to generate the semantic encoding vector of the first alternative product description information. In a specific example of this application, the semantic encoder based on the Bert model is also used to semantically encode the description information of the first alternative product. In this way, by using the same network model to process the target product query enhanced content and the description information of the first alternative product, it can be ensured that the two are comparable at the semantic level, thereby improving the accuracy of subsequent semantic query matching.
[0036] Exemplarily, in step S5, the query intention semantic coding vector of the target product and the semantic coding vector of the first candidate product description information are subjected to feature query interaction guided by external knowledge to obtain a query intention-alternative product fine-grained semantic interaction feature vector. It should be understood that the query intention semantic coding vector of the target product and the semantic coding vector of the first candidate product description information are further subjected to semantic interaction coding to mine the potential semantic association between the two and achieve deep matching at the semantic level. In particular, in order to further improve the accuracy and relevance of semantic matching, the present application introduces external knowledge in the process of semantic interaction coding to strengthen the interaction between the query intention semantic coding vector of the target product and the semantic coding vector of the first candidate product description information, thereby enhancing the depth and breadth of semantic matching.
[0037] In one embodiment, Figure 4 As shown, the target product query intention semantic coding vector and the first candidate product description information semantic coding vector are subjected to feature query interaction guided by external knowledge to obtain a query intention-alternative product fine-grained semantic interaction feature vector, including: S51, based on external knowledge, the target product query intention semantic coding vector and the first candidate product description information semantic coding vector are subjected to fine-grained feature interaction optimization to obtain an external knowledge optimized query intention-alternative product fine-grained feature interaction matrix; S52, based on the external knowledge optimized query intention-alternative product fine-grained feature interaction matrix, the target product query intention semantic coding vector and the first candidate product description information semantic coding vector are subjected to feature modulation optimization respectively to obtain an optimized target product query intention semantic coding vector and an optimized first candidate product description information semantic coding vector; S53, the optimized target product query intention semantic coding vector and the optimized first candidate product description information semantic coding vector are subjected to position-by-position semantic response encoding to obtain the query intention Figure 1 Fine-grained semantic interaction feature vector of product alternatives.
[0038] Exemplarily, in step S51, based on external knowledge, the semantic encoding vector of the target product query intent and the semantic encoding vector of the first candidate product description information are subjected to fine-grained feature interactive optimization to obtain an external knowledge optimized query intent vector. Figure 1 The fine-grained feature interaction matrix of candidate products includes: inputting the semantic encoding vector of the query intention of the target product and the semantic encoding vector of the description information of the first candidate product into a fine-grained feature interaction network to obtain the query intention Figure 1 Fine-grained feature interaction matrix of candidate products; Figure 1 The fine-grained feature interaction matrix of candidate products is input into the attention unit based on external knowledge to obtain the external knowledge to optimize the query intention Figure 1Alternative product fine-grained feature interaction matrix. Specifically, this process can be expressed by the formula:
[0039]
[0040] Wherein, V1 represents the semantic encoding vector of the target product query intention, V2 represents the semantic encoding vector of the first alternative product description information, (·) T represents the transpose of the vector, represents matrix multiplication operation, M q represents the query meaning Figure 1 Alternative product fine-grained feature interaction matrix, M k and M v represent the learnable memory parameter matrices of the attention unit based on external knowledge, norm(·) represents the normalization function, M y represents the external knowledge optimized query meaning Figure 1 Alternative product fine-grained feature interaction matrix.
[0041] That is, input the semantic encoding vector of the target product query intention and the semantic encoding vector of the first alternative product description information into the fine-grained feature interaction network, understand the relevance between the two from the micro level, capture the fine-grained interaction information between the two, and generate the query meaning Figure 1 Alternative product fine-grained feature interaction matrix. Subsequently, the generated query meaning Figure 1 Alternative product fine-grained feature interaction matrix is fed into the attention unit based on external knowledge, and external knowledge is used to further optimize the query intention-alternative product fine-grained feature interaction matrix, enhancing the model's understanding ability of specific domain knowledge. It should be understood that the external knowledge is domain-specific knowledge related to the target product obtained from sources such as knowledge graphs. For example, for a query of "coffee machine", the external knowledge may include the types of coffee machines, usage methods, basic functions, common uses, well-known brands in the industry, cleaning and maintenance knowledge, etc. By integrating external knowledge into the attention mechanism, it can help the model more accurately understand the specific attributes of the product and the specific needs of users, capture the potential connections between the two within a larger range, thereby effectively identifying and strengthening the potential relevance between the query content and the alternative product description, and realizing the optimization of the associated interaction information between the two.
[0042] Exemplarily, in step S52, the query meaning is optimized based on the external knowledge Figure 1Alternative product fine-grained feature interaction matrix, respectively perform feature modulation optimization on the semantic encoding vector of the target product query intention and the semantic encoding vector of the first alternative product description information to obtain the optimized semantic encoding vector of the target product query intention and the optimized semantic encoding vector of the first alternative product description information, including: performing a linear transformation on the semantic encoding vector of the target product query intention to obtain a first query feature vector and a first value feature vector and optimizing the query intention with the external knowledge Figure 1 Using the alternative product fine-grained feature interaction matrix as the key matrix, input the first query feature vector, the first value feature vector, and the key matrix into the fine-grained modulation module based on the Transformer structure to obtain the optimized semantic encoding vector of the target product query intention; perform a linear transformation on the semantic encoding vector of the first alternative product description information to obtain a second query feature vector and a second value feature vector and use the external knowledge-optimized fine-grained feature interaction matrix as the key matrix, input the second query feature vector, the second value feature vector, and the key matrix into the fine-grained modulation module based on the Transformer structure to obtain the optimized semantic encoding vector of the first alternative product description information. Specifically, this process can be expressed by the formula as follows:
[0043]
[0044] Among them, V1 represents the semantic encoding vector of the target product query intention, V2 represents the semantic encoding vector of the first alternative product description information, M y represents the external knowledge-optimized query intention Figure 1 alternative product fine-grained feature interaction matrix, W 1q and W 1v respectively represent the first query embedding matrix and the first value embedding matrix, V 1q and V 1v respectively represent the first query feature vector and the first value feature vector, W 2q and W 2v respectively represent the second query embedding matrix and the second value embedding matrix, V 2q and V 2v respectively represent the second query feature vector and the second value feature vector, b 1q 、b 1v 、b 2q and b 2v respectively represent different bias terms, softmax(·) represents the normalized exponential function, d represents the feature scale value of the external knowledge-optimized fine-grained feature interaction matrix, and V′1 and V′2 respectively represent the optimized semantic encoding vector of the target product query intention and the optimized semantic encoding vector of the first alternative product description information.
[0045] That is, the query intention Figure 1 The fine-grained feature interaction matrix of alternative products is used as the key matrix. At the same time, a first query feature vector and a first value feature vector are constructed based on the semantic encoding vector of the query intention of the target product, and a second query feature vector and a second value feature vector are constructed based on the semantic encoding vector of the first alternative product description information. The self-attention mechanism of the Transformer structure is used to realize the information exchange and integration between internal features and external knowledge, so as to ensure that the semantic encoding vector of the query intention of the target product and the semantic encoding vector of the first alternative product description information can benefit from external knowledge and improve the quality of their feature expressions.
[0046] Exemplarily, in step S53, the optimized semantic encoding vector of the query intention of the target product and the optimized semantic encoding vector of the first alternative product description information are subjected to per-position semantic response encoding to obtain the query intention-alternative product fine-grained semantic interaction feature vector, including: calculating the per-position division between the optimized semantic encoding vector of the query intention of the target product and the optimized semantic encoding vector of the first alternative product description information to obtain the query intention-alternative product fine-grained semantic interaction feature vector. Specifically, this process can be expressed by the formula:
[0047]
[0048] where V'1 and V'2 respectively represent the optimized semantic encoding vector of the query intention of the target product and the optimized semantic encoding vector of the first alternative product description information, and V i represents the query intention-alternative product fine-grained semantic interaction feature vector.
[0049] That is, by dividing the optimized semantic encoding vector of the query intention of the target product and the optimized semantic encoding vector of the first alternative product description information by position, a semantic response calculation is performed to obtain the query intention-alternative product fine-grained semantic interaction feature vector, thereby realizing a quantitative evaluation of the semantic matching between the query intention of the target product and the description of the alternative product.
[0050] Exemplarily, in step S6, based on the query intention-alternative product fine-grained semantic interaction feature vector, it is determined whether to return the link of the first alternative product as the retrieval result. In one embodiment, such as Figure 5As shown, determining whether to return the link of the first alternative product as the retrieval result based on the query intent-alternative product fine-grained semantic interaction feature vector includes: S61, inputting the query intent-alternative product fine-grained semantic interaction feature vector into a retrieval result generator based on a classifier to obtain a retrieval result, where the retrieval result is used to indicate whether to return the first alternative product as the query result; S62, in response to the retrieval result being to return the first alternative product as the query result, returning the link of the first alternative product as the retrieval result. That is, inputting the query intent-alternative product fine-grained semantic interaction feature vector into a retrieval result generator based on a classifier for classification processing to determine whether the alternative product meets the user's query intent. The classifier performs multi-level feature learning on the query intent-alternative product fine-grained semantic interaction feature vector to calculate probabilities according to the semantic association features between the user query content and the first alternative product contained therein, determine whether the first alternative product meets the user's query requirements, and generate corresponding retrieval results according to the query results. For example, if the first alternative product meets the user's query requirements, the link of the first alternative product is returned as the retrieval result; if not, the next alternative product is automatically selected from the product library, and the above semantic encoding and matching process is repeated until a product that meets the user's query intent is found.
[0051] Specifically, in the technical solution of this application, the target product query intent semantic encoding vector and the first alternative product description information semantic encoding vector respectively represent the text semantic encoding features of the target product query enhancement content and the description information of the first alternative product. When performing fine-grained interaction of features based on external knowledge modulation, the semantic density difference between the target product query intent semantic encoding vector and the first alternative product description information semantic encoding vector will cause the fine-grained interaction of features to be unbalanced, and semantic interference noise may be introduced during the process of inputting the target product query statement into the retrieval intent expansion description module based on a large language model. This makes the overall feature manifold of the query intent-alternative product fine-grained semantic interaction feature vector in the high-dimensional feature space have fine-grained feature structure holes. The existence of fine-grained feature structure holes will not only cause insufficient semantic coverage of the features of the query intent-alternative product fine-grained semantic interaction feature vector corresponding to the class probability label, but also cause the off-target of the outlier class regression inference mapping, affecting the accuracy of the retrieval result obtained by inputting the query intent-alternative product fine-grained semantic interaction feature vector into a retrieval result generator based on a classifier.
[0052] In the technical solution of this application, inputting the query intent-alternative product fine-grained semantic interaction feature vector into a retrieval result generator based on a classifier to obtain a retrieval result includes:
[0053] Input the query intention - alternative product fine - grained semantic interaction feature vector into a pre - classifier based on the Softmax function to obtain a query intention - alternative product semantic interaction fine - grained class probability label vector;
[0054] Calculate the product between the query intention - alternative product semantic interaction fine - grained class probability label vector and its transposed vector to obtain a query intention - alternative product semantic interaction fine - grained full - label domain modulation matrix;
[0055] Divide the eigenvalue at each position in the query intention - alternative product semantic interaction fine - grained full - label domain modulation matrix by the square root of the scale value of the query intention - alternative product fine - grained semantic interaction feature vector to obtain a query intention - alternative product semantic interaction fine - grained full - label domain scale modulation matrix;
[0056] The query intention Figure 1 Input the alternative product semantic interaction fine - grained full - label domain scale modulation matrix into a class probability domain attention sparse module based on a multi - level gating function to obtain a sparsified query intention Figure 1 Alternative product semantic interaction fine - grained full - label domain scale modulation matrix;
[0057] Using the query intention Figure 1 Alternative product fine - grained semantic interaction feature vector as the query feature vector, multiply the sparsified query intention Figure 1 Alternative product semantic interaction fine - grained full - label domain scale modulation matrix with the query intention Figure 1 Alternative product fine - grained semantic interaction feature vector in matrix multiplication to obtain an optimized query intention Figure 1 Alternative product fine - grained semantic interaction feature vector;
[0058] Input the optimized query intention Figure 1 Alternative product fine - grained semantic interaction feature vector into the retrieval result generator based on the classifier to obtain the retrieval result.
[0059] The query intention Figure 1 The optimization process of the alternative product fine - grained semantic interaction feature vector of the query intention is expressed by the formula:
[0060]
[0061]
[0062]
[0063] λ≥1
[0064]
[0065] where, vi Represents the query intention Figure 1 The eigenvalue at the i-th position of the fine-grained semantic interaction feature vector of the alternative commodity, L represents the query intention Figure 1 The scale value of the fine-grained semantic interaction feature vector of the alternative commodity Represents the query intention Figure 1 The eigenvalue at the i-th position of the fine-grained class probability label vector of the alternative commodity semantic interaction, V p Represents the query intention Figure 1 The fine-grained class probability label vector of the alternative commodity semantic interaction Represents matrix multiplication operation, (·) T Represents the transpose of a vector, M p Represents the query intention Figure 1 The fine-grained full label domain scale modulation matrix of the alternative commodity semantic interaction, θ represents a predetermined threshold Represents the query intention Figure 1 The eigenvalue at the i-th position of the fine-grained full label domain scale modulation matrix of the alternative commodity semantic interaction, λ represents a predetermined hyperparameter, mask represents a masking function Represents the sparsified query intention Figure 1 The eigenvalue at the i-th position of the fine-grained full label domain scale modulation matrix of the alternative commodity semantic interaction, M p ’ Represents the sparsified query intention Figure 1 The fine-grained full label domain scale modulation matrix of the alternative commodity semantic interaction, V′ represents the optimized query intention-alternative commodity fine-grained semantic interaction feature vector.
[0066] Thus, by adding class probability domain-level optimizable perturbations to the original feature vector to strengthen the entanglement of the dependencies based on label domain modulation among different variables in the original feature vector, the scale modulation optimization of the source domain feature vector based on class probability query is realized. In this way, it is possible to more effectively retain the significant inherent modal information in the source domain features and effectively mask the interfering components in the feature distribution, thereby improving the adversarial robustness of the manifold expression of the feature vector. In this way, the accuracy of the retrieval result obtained by its input to the retrieval result generator based on the classifier is improved.
[0067] In summary, the retail industry search method based on a large language model according to an embodiment of the present application is elucidated. After obtaining the target commodity query statement input by the user, it uses natural language processing technology based on deep learning to perform retrieval intent expansion on it, generates a richer query content description, and after the user confirms that it is correct, performs context semantic feature extraction and fine-grained semantic query interaction with the description information of the alternative commodities, so as to intelligently identify whether the alternative commodity meets the user's retrieval requirements. In this way, the user's query intent can be more accurately understood, and highly relevant commodity information can be provided, thus significantly improving the user's shopping experience and search efficiency.
[0068] Figure 6 FIG. is a schematic block diagram of a retail industry search system based on a large language model according to an embodiment of the present application. As Figure 6 shown, the retail industry search system 100 based on a large language model includes: a target commodity query statement acquisition module 110 for acquiring a target commodity query statement input by a user; a target commodity query intent semantic encoding module 120 for performing retrieval intent expansion description on the target commodity query statement and then performing semantic encoding to obtain a target commodity query intent semantic encoding vector; an alternative commodity description information extraction module 130 for extracting description information of a first alternative commodity from a commodity library; an alternative commodity description information semantic encoding module 140 for performing semantic encoding on the description information of the first alternative commodity to obtain a first alternative commodity description information semantic encoding vector; a feature query interaction processing module 150 for performing feature query interaction guided by external knowledge on the target commodity query intent semantic encoding vector and the first alternative commodity description information semantic encoding vector to obtain a query intent-alternative commodity fine-grained semantic interaction feature vector; and a retrieval result determination module 160 for determining whether to return a link to the first alternative commodity as a retrieval result based on the query intent-alternative commodity fine-grained semantic interaction feature vector.
[0069] In one embodiment, the target commodity query intent semantic encoding module is configured to: input the target commodity query statement into a retrieval intent expansion description module based on a large language model to obtain enhanced content of the target commodity query; display the enhanced content of the target commodity query and have the customer confirm whether there is a description deviation; and after receiving the user's confirmation that there is no description deviation, perform semantic encoding on the enhanced content of the target commodity query to obtain the target commodity query intent semantic encoding vector.
[0070] Here, those skilled in the art can understand that the specific operations of each module and unit in the above-mentioned retail industry search system based on a large language model have been introduced in detail in the description of the retail industry search method based on a large language model above, and therefore, the repeated description thereof will be omitted. Figures 1 to 5 of the retail industry search method based on a large language model, and thus, the repeated description thereof will be omitted.
[0071] The embodiments of the present application also provide a computer program product, which includes computer program code. When the computer program code runs on a computer, the computer is enabled to implement the methods in the above various embodiments of the present application.
[0072] The embodiments of the present application also provide a computer-readable storage medium, which stores computer instructions. When the computer instructions run on a computer, the computer is enabled to implement the methods in the above various embodiments of the present application.
[0073] The embodiments of the present application also provide a chip, including a circuit for executing the methods in the above various embodiments of the present application.
[0074] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.
[0075] In the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B may represent A or B. The "and / or" herein is an association relationship describing associated objects, indicating that there can be three relationships. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In the present application, "at least one" means one or more, and "a plurality" means two or more. "At least one (item)" or its similar expression refers to any combination of these items, including any combination of single (item) or plural items. For example, at least one (item) of a, b, or c may represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, c may be single or multiple.
[0076] In the embodiments of the present application, prefix words such as "first" and "second" are only used to distinguish different described objects, and have no restrictive effect on the position, order, priority, quantity, or content of the described objects. The use of ordinal numbers and other prefix words for distinguishing described objects in the embodiments of the present application does not constitute a restriction on the described objects. The description of the described objects refers to the description in the context of the claims or embodiments, and should not constitute an unnecessary restriction due to the use of such prefix words.
[0077] In several embodiments provided by this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the devices or units can be in electrical, mechanical, or other forms.
[0078] In each embodiment of this application, if there is no special description and logical conflict, the terms and / or descriptions between the embodiments are consistent and can be referred to each other. The technical features in different embodiments can be combined to form new embodiments according to their internal logical relationships.
[0079] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0080] In addition, in each embodiment of this application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0081] As described above, this is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of changes or substitutions, which should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims
1. A retail industry search method based on a large language model, characterized in that: include: Obtaining a target product query statement input by a user; After performing a search intent expansion description on the target product query sentence, semantic encoding is performed to obtain a target product query intent semantic encoding vector; Extracting description information of the first candidate product from the product library; Performing semantic coding on the description information of the first candidate product to obtain a semantic coding vector of the description information of the first candidate product; Performing feature query interaction based on external knowledge guidance on the semantic encoding vector of the query intention of the target product and the semantic encoding vector of the description information of the first candidate product to obtain a query intention-candidate product fine-grained semantic interaction feature vector; Based on the query intention-candidate product fine-grained semantic interaction feature vector, determining whether to return the link of the first candidate product as a search result; The step of performing feature query interaction based on external knowledge guidance on the semantic encoding vector of the query intention of the target product and the semantic encoding vector of the description information of the first candidate product to obtain a query intention-candidate product fine-grained semantic interaction feature vector includes: Based on external knowledge, fine-grained feature interaction optimization is performed on the semantic encoding vector of the query intention of the target product and the semantic encoding vector of the description information of the first candidate product to obtain an external knowledge optimized query intention-candidate product fine-grained feature interaction matrix; Optimizing the query intention-candidate product fine-grained feature interaction matrix based on the external knowledge, performing feature modulation optimization on the target product query intention semantic coding vector and the first candidate product description information semantic coding vector respectively to obtain an optimized target product query intention semantic coding vector and an optimized first candidate product description information semantic coding vector; The optimized target product query intention semantic coding vector and the optimized first candidate product description information semantic coding vector are subjected to position-by-position semantic response coding to obtain the query intention-candidate product fine-grained semantic interaction feature vector.
2. The retail industry search method based on a large language model according to claim 1, characterized in that: After performing a search intent extension description on the target product query statement, semantic encoding is performed to obtain a target product query intent semantic encoding vector, including: Inputting the target product query statement into a retrieval intention extension description module based on a large language model to obtain target product query enhanced content; Display the target product query enhancement content, and ask the customer to confirm whether there is any description deviation; After receiving confirmation from the user that there is no description deviation, semantic encoding is performed on the target product query enhancement content to obtain a semantic encoding vector of the target product query intention.
3. The retail industry search method based on a large language model according to claim 2, characterized in that: Semantically encoding the target product query enhancement content to obtain a semantic encoding vector of the target product query intention includes: The target product query enhancement content is semantically encoded using a semantic encoder based on the Bert model to obtain a semantic encoding vector of the target product query intention.
4. The retail industry search method based on a large language model according to claim 3, characterized in that: Based on external knowledge, fine-grained feature interaction optimization is performed on the semantic encoding vector of the query intention of the target product and the semantic encoding vector of the description information of the first candidate product to obtain an external knowledge optimized query intention-candidate product fine-grained feature interaction matrix, including: Inputting the target product query intention semantic encoding vector and the first candidate product description information semantic encoding vector into a fine-grained feature interaction network to obtain a query intention-candidate product fine-grained feature interaction matrix; The query intent-alternative product fine-grained feature interaction matrix is input into an attention unit based on external knowledge to obtain the external knowledge optimized query intent-alternative product fine-grained feature interaction matrix.
5. The retail industry search method based on a large language model according to claim 4, characterized in that: The method optimizes the query intention-candidate product fine-grained feature interaction matrix based on the external knowledge, and performs feature modulation optimization on the target product query intention semantic coding vector and the first candidate product description information semantic coding vector to obtain an optimized target product query intention semantic coding vector and an optimized first candidate product description information semantic coding vector, including: Performing a linear transformation on the target product query intention semantic encoding vector to obtain a first query feature vector and a first value feature vector, and using the external knowledge optimized query intention-alternative product fine-grained feature interaction matrix as a key matrix, inputting the first query feature vector, the first value feature vector and the key matrix into a fine-grained modulation module based on a Transformer structure to obtain the optimized target product query intention semantic encoding vector; The first candidate product description information semantic encoding vector is linearly transformed to obtain a second query feature vector and a second value feature vector, and the external knowledge optimized fine-grained feature interaction matrix is used as a key matrix. The second query feature vector, the second value feature vector and the key matrix are input into the Transformer-based fine-grained modulation module to obtain the optimized semantic encoding vector of the first candidate product description information.
6. The retail industry search method based on a large language model according to claim 5, characterized in that: Performing position-by-position semantic response encoding on the optimized target product query intention semantic encoding vector and the optimized first candidate product description information semantic encoding vector to obtain the query intention-candidate product fine-grained semantic interaction feature vector, including: The query intention-alternative product fine-grained semantic interaction feature vector is obtained by calculating the point-by-point division between the optimized target product query intention semantic coding vector and the optimized first candidate product description information semantic coding vector.
7. The retail industry search method based on a large language model according to claim 6, characterized in that: Determining whether to return the link of the first candidate product as a search result based on the query intention-candidate product fine-grained semantic interaction feature vector includes: Inputting the query intention-candidate product fine-grained semantic interaction feature vector into a classifier-based retrieval result generator to obtain a retrieval result, wherein the retrieval result is used to indicate whether to return the first candidate product as a query result; In response to the search result returning the first candidate product as a query result, a link to the first candidate product is returned as a search result.
8. A retail industry search system based on a large language model, characterized in that: include: A target product query statement acquisition module is used to acquire a target product query statement input by a user; A target product query intention semantic coding module, used for performing semantic coding on the target product query sentence after performing retrieval intention extension description to obtain a target product query intention semantic coding vector; A candidate product description information extraction module is used to extract the description information of the first candidate product from the product library; A semantic coding module for description information of candidate products, configured to semantically code the description information of the first candidate product to obtain a semantic coding vector of the description information of the first candidate product; A feature query interaction processing module, configured to perform feature query interaction based on external knowledge guidance on the semantic encoding vector of the query intention of the target product and the semantic encoding vector of the description information of the first candidate product to obtain a fine-grained semantic interaction feature vector of the query intention-candidate product; A search result determination module, used to determine whether to return the link of the first candidate product as a search result based on the query intention-candidate product fine-grained semantic interaction feature vector; The step of performing feature query interaction based on external knowledge guidance on the semantic encoding vector of the query intention of the target product and the semantic encoding vector of the description information of the first candidate product to obtain a query intention-candidate product fine-grained semantic interaction feature vector includes: Based on external knowledge, fine-grained feature interaction optimization is performed on the semantic encoding vector of the query intention of the target product and the semantic encoding vector of the description information of the first candidate product to obtain an external knowledge optimized query intention-candidate product fine-grained feature interaction matrix; Optimizing the query intention-candidate product fine-grained feature interaction matrix based on the external knowledge, performing feature modulation optimization on the target product query intention semantic coding vector and the first candidate product description information semantic coding vector respectively to obtain an optimized target product query intention semantic coding vector and an optimized first candidate product description information semantic coding vector; The optimized target product query intention semantic coding vector and the optimized first candidate product description information semantic coding vector are subjected to position-by-position semantic response coding to obtain the query intention-candidate product fine-grained semantic interaction feature vector.
9. The retail industry search system based on a large language model according to claim 8, characterized in that: The target product query intention semantic encoding module is used to: Inputting the target product query statement into a retrieval intention extension description module based on a large language model to obtain target product query enhanced content; Display the target product query enhancement content, and ask the customer to confirm whether there is any description deviation; After receiving confirmation from the user that there is no description deviation, semantic encoding is performed on the target product query enhancement content to obtain a semantic encoding vector of the target product query intention.
Citation Information
Patent Citations
Commodity shopping guide method and device, equipment and medium
CN116976920A
Method and system for realizing e-commerce commodity information interaction by using large language model
CN117592489A