Information interfacing method and system based on mall applet

CN122985986APending Publication Date: 2026-10-27GO MAINTENANCE (BEIJING) TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611163544.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-03
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0003]然而,上述常规做法存在明显缺陷,一方面,它们对用户自然语言的语义理解能力有限,难以准确识别复杂或隐式的意图表达,例如涉及多属性组合的商品筛选、模糊描述下的实体指向等

Benefits of technology

[0052]基于语义解析模型与商品知识图谱的语义匹配,能够准确提取用户咨询文本中的意图类型与重要实体,建立实体与商品属性之间的关联关系,生成针对性强的候选知识集合,有效克服传统关键词匹配带来的语义歧义与信息缺失问题。语义相似度计算从候选知识集合中快速筛选出与咨询文本高度匹配的目标答案内容,显著提升应答的精准度与响应速度,减少用户等待时间。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122985986A_ABST
    Figure CN122985986A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of information docking, and more particularly to an information docking method and system based on a mall applet. The method comprises the following steps: receiving a user consultation text, extracting an intent type and important entities through semantic analysis, matching a commodity knowledge graph to generate candidate knowledge, determining a target answer based on semantic similarity, generating personalized semantic representation by fusing a user portrait and a context state, dynamically adjusting intent recognition and candidate sorting, triggering artificial customer service and collecting a response when the confidence is insufficient, and constructing an enhanced sample by combining the consultation text, intent, user portrait, semantic representation, and response, and optimizing the analysis model through comparative learning. The method effectively improves the accuracy and personalized response capability of information docking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information integration technology, and in particular to a method and system for information integration based on e-commerce mini-programs. Background Technology

[0002] In the current technological field, information integration methods based on e-commerce mini-programs typically rely on keyword matching or rule engine-driven automated response systems. These systems predefine answer templates for frequently asked questions and trigger preset responses by detecting specific words in the user's input. Additionally, some solutions employ retrieval-based FAQ models, matching the entry with the highest surface similarity to the user's inquiry text from a standard question-and-answer database as the response. To improve efficiency, these systems also incorporate simple context management mechanisms, maintaining limited state information from the dialogue history to assist in answer generation.

[0003] However, the aforementioned conventional approaches have significant drawbacks. Firstly, their semantic understanding of users' natural language is limited, making it difficult to accurately identify complex or implicit intentions, such as product selection involving multiple attribute combinations or entity referencing vague descriptions. This leads to the system easily providing irrelevant answers or missing information when faced with non-standard expressions, failing to establish a deep connection between user questions and product attributes, thus significantly reducing the effectiveness of consultation processing. Secondly, these methods lack the ability to dynamically adapt to users' personalized characteristics. All users receiving the same question receive essentially identical answers, ignoring the intrinsic influence of user profile information such as identity, historical behavior, and preferences on answer weighting and ranking. Furthermore, when the quality of the automated response is insufficient and requires transfer to human customer service, existing feedback mechanisms typically only record the human response text itself, failing to systematically use high-quality human responses to optimize the automated response model. This results in the system relying heavily on human intervention, hindering continuous iterative improvement of automated response capabilities. Summary of the Invention

[0004] This invention provides a method and system for information integration based on e-commerce mini-programs, which can solve the problems in the prior art.

[0005] A first aspect of this invention provides an information integration method based on an e-commerce mini-program, comprising:

[0006] The system receives consultation texts sent by users through the e-commerce mini-program, performs semantic parsing on the consultation texts using a semantic parsing model, extracts intent types and important entities, and performs semantic matching between the important entities and nodes in the product knowledge graph based on a pre-built product knowledge graph, establishes the association between entities and product attributes, and generates a candidate knowledge set.

[0007] Based on the intent type and the candidate knowledge set, the target answer content matching the consultation text is determined by semantic similarity calculation.

[0008] Construct a user profile feature vector, fuse and encode the user profile feature vector with the context state information of the current dialogue to generate a personalized semantic representation, and dynamically adjust the recognition result of the intent type and the ranking weight of the candidate knowledge set based on the personalized semantic representation;

[0009] When the confidence level of the target answer content is lower than a preset confidence threshold, a human customer service intervention mechanism is triggered to collect the response content given by human customer service to the inquiry text;

[0010] The consultation text, the intent type, the user profile feature vector, the personalized semantic representation, and the response content are used to form an enhanced training sample. The semantic distance between positive and negative sample pairs is calculated through contrastive learning. The feature extraction layer and similarity calculation layer of the semantic parsing model are then jointly optimized and updated.

[0011] The consultation text is semantically parsed using a semantic parsing model to extract intent types and important entities. Based on a pre-constructed product knowledge graph, the important entities are semantically matched with nodes in the product knowledge graph to establish associations between entities and product attributes, generating a candidate knowledge set including:

[0012] Semantic analysis is performed on the consultation text to extract entity references and intent trigger words, and the entity references are converted into semantic vector representations.

[0013] The semantic vector representation is compared with the embedding vector of each node in the product knowledge graph. Nodes with similarity higher than a preset matching threshold are selected as the initial matching node set, and the adjacency relationship structure of each node in the initial matching node set in the product knowledge graph is obtained.

[0014] Based on the adjacency structure, multi-level relationship expansion is performed on each node in the initial matching node set. Path propagation is carried out along attribute relationship edges and category relationship edges to obtain attribute nodes and product nodes that are directly or indirectly associated with the initial matching nodes, and an extended knowledge subgraph is constructed.

[0015] The query constraints are determined based on the intent trigger words. The nodes in the extended knowledge subgraph are filtered and sorted using the query constraints to extract attribute nodes and product nodes that satisfy the query constraints.

[0016] The attribute information and product information in the attribute nodes and product nodes are structured and organized to establish a mapping relationship between important entities and product attributes, thereby generating a candidate knowledge set.

[0017] Based on the intent type and the candidate knowledge set, the target answer content matching the consultation text is determined through semantic similarity calculation, including:

[0018] A query semantic representation is constructed based on the intent type, and the consultation text is fused and encoded with the query semantic representation to generate an enhanced query vector;

[0019] The enhanced query vector is compared with the semantic vectors of each knowledge fragment in the candidate knowledge set. The multi-granularity similarity calculation includes word-level similarity calculation and sentence-level similarity calculation. The results of the word-level similarity calculation and the sentence-level similarity calculation are integrated through a multi-granularity fusion mechanism to obtain a comprehensive similarity score.

[0020] Based on the comprehensive similarity score, the knowledge fragments in the candidate knowledge set are sorted, and the knowledge fragments that are ranked at the top and whose comprehensive similarity score is higher than the preset screening threshold are extracted to form a selected knowledge subset. For each knowledge fragment in the selected knowledge subset, the matching degree between it and the consultation text in terms of semantic dependency relationship is analyzed, and the semantic dependency matching degree score is calculated.

[0021] A comprehensive evaluation index is constructed based on the comprehensive similarity score and the semantic dependency matching score. The knowledge fragment with the best evaluation value is selected as the target answer content according to the comprehensive evaluation index.

[0022] The comprehensive similarity score is obtained by integrating the word-level similarity calculation results with the sentence-level similarity calculation results through a multi-granularity fusion mechanism, including:

[0023] Based on the word-level similarity calculation results, keyword matching pairs between the consultation text and each knowledge fragment are extracted, the semantic contribution of each keyword matching pair is calculated, and the word-level similarity calculation results are weighted according to the semantic contribution to generate a weighted word-level similarity.

[0024] Based on the results of sentence-level similarity calculation, the alignment degree between the consultation text and each knowledge fragment at the semantic structure level is analyzed, the matching status of the core semantic components in the semantic structure is identified, and the results of sentence-level similarity calculation are structurally corrected according to the matching status of the core semantic components to generate corrected sentence-level similarity.

[0025] A multi-granularity fusion mechanism is constructed, which uses keyword matching information in the weighted word-level similarity to guide the fine-tuning of the corrected sentence-level similarity. By calculating the interaction coefficient between the weighted word-level similarity and the corrected sentence-level similarity, the weighted word-level similarity and the corrected sentence-level similarity are dynamically fused based on the interaction coefficient to generate a comprehensive similarity score.

[0026] Constructing a user profile feature vector, fusing and encoding the user profile feature vector with the context state information of the current dialogue, and generating a personalized semantic representation includes:

[0027] Obtain users' historical behavior data in the e-commerce mini-program, extract users' consultation preference features, product preference features and transaction decision features from the historical behavior data, and vectorize and encode the consultation preference features, product preference features and transaction decision features to generate a multi-dimensional feature vector set;

[0028] For each dimension feature vector in the multidimensional feature vector set, calculate the representation contribution of each dimension feature vector to the user behavior pattern, and perform adaptive weighted fusion of each dimension feature vector based on the representation contribution to construct the user profile feature vector.

[0029] Extract the context state information of the current dialogue, perform temporal encoding on the context state information, and generate a context state vector;

[0030] A bidirectional attention interaction mechanism is constructed, and the semantic association matrix between the user profile feature vector and the context state vector is calculated using the bidirectional attention interaction mechanism. Based on the semantic association matrix, feature components in the user profile feature vector that are related to the current dialogue context and state components in the context state vector that are related to user preferences are identified.

[0031] The feature components and the state components are deeply fused and encoded to generate a personalized semantic representation.

[0032] Constructing a bidirectional attention interaction mechanism, and using the bidirectional attention interaction mechanism to calculate the semantic association matrix between the user profile feature vector and the context state vector, includes:

[0033] The user profile feature vector and the context state vector are mapped and transformed to generate user feature representation and context state representation respectively;

[0034] In the bidirectional attention interaction mechanism, a positive attention calculation path is constructed. The semantic association strength between each feature component in the user feature representation and each state component in the context state representation is calculated through the positive attention calculation path. The context state representation is then weighted and fused based on the semantic association strength to generate positive interaction features.

[0035] In the bidirectional attention interaction mechanism, a reverse attention calculation path is constructed. The semantic association strength between each state component in the context state representation and each feature component in the user feature representation is calculated through the reverse attention calculation path. The user feature representation is then weighted and fused based on the semantic association strength to generate reverse interaction features.

[0036] The positive interaction features and the negative interaction features are collaboratively aligned using the bidirectional attention interaction mechanism. The distribution consistency and semantic complementarity of the positive interaction features and the negative interaction features in the feature space are analyzed. The positive interaction features and the negative interaction features are jointly encoded to construct a semantic association matrix.

[0037] The consultation text, the intent type, the user profile feature vector, the personalized semantic representation, and the response content are used to construct enhanced training samples. The semantic distance between positive and negative sample pairs is calculated through contrastive learning, including:

[0038] Multimodal feature fusion is performed on the consultation text, intent type, user profile feature vector and personalized semantic representation to generate query-side semantic representation. The response content is semantically encoded to generate response-side semantic representation. The query-side semantic representation and the response-side semantic representation are paired and associated to form enhanced training samples.

[0039] For the query-side semantic representation in the enhanced training samples, other consultation texts that are the same as the consultation text in terms of intent type but different in terms of semantic content are retrieved from the historical sample library. The user profile feature vectors corresponding to the other consultation texts are fused with the personalized semantic representation to generate a comparative query-side semantic representation. The query-side semantic representation and the response-side semantic representation are used as positive sample pairs, and the comparative query-side semantic representation and the response-side semantic representation are used as negative sample pairs. A sample pair set containing the positive sample pairs and the negative sample pairs is constructed.

[0040] The query-side semantic representation and response-side semantic representation of each sample pair in the sample pair set are mapped to a unified feature space through an encoding network. The distance metric between the two vector representations of each sample pair in the unified feature space is calculated, and the semantic distance between positive and negative sample pairs is characterized by the distance metric.

[0041] A second aspect of this invention provides an information integration system based on an e-commerce mini-program, comprising:

[0042] The semantic parsing unit is used to receive the consultation text sent by the user through the e-commerce mini-program, perform semantic parsing on the consultation text through the semantic parsing model, extract the intent type and important entities, and perform semantic matching between the important entities and the nodes in the product knowledge graph based on the pre-built product knowledge graph, establish the association relationship between entities and product attributes, and generate a candidate knowledge set.

[0043] The answer matching unit is used to determine the target answer content that matches the consultation text based on the intent type and the candidate knowledge set through semantic similarity calculation;

[0044] The profile adjustment unit is used to construct a user profile feature vector, fuse and encode the user profile feature vector with the context state information of the current dialogue to generate a personalized semantic representation, and dynamically adjust the recognition result of the intent type and the ranking weight of the candidate knowledge set based on the personalized semantic representation.

[0045] The human intervention unit is used to trigger the human customer service intervention mechanism when the confidence level of the target answer content is lower than a preset confidence threshold, and to collect the response content given by the human customer service to the consultation text.

[0046] The contrastive learning unit is used to construct enhanced training samples from the consultation text, the intent type, the user profile feature vector, the personalized semantic representation, and the response content. It calculates the semantic distance between positive and negative sample pairs through contrastive learning and jointly optimizes and updates the feature extraction layer and similarity calculation layer of the semantic parsing model.

[0047] A third aspect of the present invention provides an electronic device, comprising:

[0048] processor;

[0049] Memory used to store processor-executable instructions;

[0050] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0051] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0052] Semantic matching based on semantic parsing models and product knowledge graphs can accurately extract the intent type and important entities from user inquiry texts, establish the association between entities and product attributes, and generate a highly targeted candidate knowledge set, effectively overcoming the semantic ambiguity and information loss problems caused by traditional keyword matching. Semantic similarity calculation quickly filters out target answer content that highly matches the inquiry text from the candidate knowledge set, significantly improving the accuracy and speed of responses and reducing user waiting time.

[0053] The fusion encoding of user profile feature vectors and dialogue context state information generates personalized semantic representations. This dynamically adjusts the weights of intent recognition results and candidate knowledge ranking, enabling different users of the same product to receive differentiated responses closely aligned with their preferences and historical behavior. This significantly enhances the personalization and scenario adaptability of information recommendations, improving user satisfaction and e-commerce conversion rates. When the confidence level of the target answer falls below a preset threshold, a human customer service intervention mechanism promptly takes over, ensuring that complex or ambiguous questions are handled professionally and preventing user churn due to automated response errors.

[0054] This method combines consultation text, intent type, user profile feature vectors, personalized semantic representations, and human customer service responses into enhanced training samples. Semantic distance between positive and negative sample pairs is calculated using a contrastive learning approach, jointly optimizing and updating the feature extraction and similarity calculation layers of the semantic parsing model. This iterative learning mechanism allows the model to continuously absorb human customer service response strategies, constantly narrowing the gap between automated and human responses, gradually improving the system's autonomous response capabilities and stability, and reducing long-term operational costs associated with human intervention. Attached Figure Description

[0055] Figure 1 This is a flowchart illustrating the information integration method based on a mini-program for e-commerce platforms according to an embodiment of the present invention.

[0056] Figure 2 This is a flowchart illustrating the construction of enhanced training samples and the calculation of semantic distance based on contrastive learning in an embodiment of the present invention. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0058] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0059] Figure 1 This is a flowchart illustrating the information integration method based on a mini-program for e-commerce platforms according to an embodiment of the present invention.

[0060] Information integration methods based on e-commerce mini-programs include:

[0061] The system receives consultation texts sent by users through the e-commerce mini-program, performs semantic parsing on the consultation texts using a semantic parsing model, extracts intent types and important entities, and performs semantic matching between the important entities and nodes in the product knowledge graph based on a pre-built product knowledge graph, establishes the association between entities and product attributes, and generates a candidate knowledge set.

[0062] Based on the intent type and the candidate knowledge set, the target answer content matching the consultation text is determined by semantic similarity calculation.

[0063] Construct a user profile feature vector, fuse and encode the user profile feature vector with the context state information of the current dialogue to generate a personalized semantic representation, and dynamically adjust the recognition result of the intent type and the ranking weight of the candidate knowledge set based on the personalized semantic representation;

[0064] When the confidence level of the target answer content is lower than a preset confidence threshold, a human customer service intervention mechanism is triggered to collect the response content given by human customer service to the inquiry text;

[0065] The consultation text, the intent type, the user profile feature vector, the personalized semantic representation, and the response content are used to form an enhanced training sample. The semantic distance between positive and negative sample pairs is calculated through contrastive learning. The feature extraction layer and similarity calculation layer of the semantic parsing model are then jointly optimized and updated.

[0066] In one optional implementation, the consultation text is semantically parsed using a semantic parsing model to extract intent types and important entities. Based on a pre-built product knowledge graph, the important entities are semantically matched with nodes in the product knowledge graph to establish associations between entities and product attributes, generating a candidate knowledge set including:

[0067] Semantic analysis is performed on the consultation text to extract entity references and intent trigger words, and the entity references are converted into semantic vector representations.

[0068] The semantic vector representation is compared with the embedding vector of each node in the product knowledge graph. Nodes with similarity higher than a preset matching threshold are selected as the initial matching node set, and the adjacency relationship structure of each node in the initial matching node set in the product knowledge graph is obtained.

[0069] Based on the adjacency structure, multi-level relationship expansion is performed on each node in the initial matching node set. Path propagation is carried out along attribute relationship edges and category relationship edges to obtain attribute nodes and product nodes that are directly or indirectly associated with the initial matching nodes, and an extended knowledge subgraph is constructed.

[0070] The query constraints are determined based on the intent trigger words. The nodes in the extended knowledge subgraph are filtered and sorted using the query constraints to extract attribute nodes and product nodes that satisfy the query constraints.

[0071] The attribute information and product information in the attribute nodes and product nodes are structured and organized to establish a mapping relationship between important entities and product attributes, thereby generating a candidate knowledge set.

[0072] When performing semantic analysis on consultation texts, the first step is to identify two key elements carrying the core semantics: entity references and intent trigger words. Entity references refer to noun phrases in the consultation text that relate to specific products, brands, models, specifications, etc., and can be mapped to knowledge graph nodes, such as "Bluetooth headphones" and "sunscreen SPF50." Intent trigger words are verbs or verb phrases that reflect the user's query purpose, such as "recommend," "compare," and "check price." The consultation text is encoded using a pre-trained language model, extracting the contextual representation of each lexical unit. The named entity recognition layer and intent classification layer then output the sets of entity references and intent trigger words, respectively. After identifying the entity references, they are input into the mapping layer to generate corresponding semantic vector representations. These semantic vectors capture the distribution characteristics of entity references in the semantic space, ensuring that semantically similar entities are close in the vector space, laying the foundation for subsequent similarity matching with knowledge graph nodes.

[0073] Each node in the product knowledge graph has a pre-generated embedding vector generated using a graph embedding algorithm. This embedding vector not only encodes the node's own attribute information but also integrates the node's relationship information with its neighboring nodes in the graph structure. The semantic vector representation of an entity's reference is denoted as... The first in the product knowledge graph The embedding vector of each node is denoted as . The cosine similarity between the two is... The calculation method is as follows: ;

[0074] Filter all that meet the criteria The nodes constitute the initial set of matching nodes, and the threshold setting needs to strike a balance between recall and precision: if If the value is too high, nodes that are semantically related but have significantly different expressions will be missed; if... If the value is too low, it introduces a large number of irrelevant nodes, increasing the burden on subsequent processing. In practice, the matching results of historical queries can be used to adjust the value. Dynamic calibration is performed. After the initial matching node set is filtered, the adjacency structure of each node in the set in the product knowledge graph is obtained, including the edge types directly connected to it and the list of neighboring nodes, providing a graph topology basis for subsequent multi-level relationship expansion.

[0075] Based on the acquired adjacency structure, multi-level relation expansion is performed on each node in the initial matching node set. The expansion process propagates along two types of relation edges: attribute relation edges connect product nodes to their attribute nodes, and category relation edges connect product nodes to their category nodes. Let the initial matching node set be... , No. The set of nodes obtained after layer expansion is The extension rule is to... All neighboring nodes reachable from any node along attribute-related edges and category-related edges are merged into the list. Expanding the number of layers Typically, two to three layers are used to achieve a reasonable balance between graph coverage and computational cost. After layer expansion, all nodes and their associated edges obtained from all layers are aggregated to construct an extended knowledge subgraph. The extended knowledge subgraph retains complete path information between the initial matching node and its directly or indirectly associated attribute nodes and product nodes, providing a rich source of structured knowledge for subsequent intent-constrained filtering and ranking.

[0076] Determining query constraints based on intent triggers is a crucial step in transforming user intent into actionable filtering rules. Different intent triggers correspond to different types of query constraints: if the intent trigger is "recommendation," the constraints focus on the overall product rating and sales ranking; if the intent trigger is "comparison," the constraints focus on extracting parameter differences among multiple products under the same attribute dimension; if the intent trigger is "query price," the constraints limit the retention to paths related to price attribute nodes. The query constraints are represented as a set of predicate rules, applied to nodes and edges in the extended knowledge subgraph, filtering out nodes that do not meet the constraints and retaining attribute nodes and product nodes highly relevant to the current intent. After filtering, the retained nodes are sorted: the similarity score between the node and the semantic vector of the entity reference is comprehensively considered. The importance weight of nodes in the knowledge graph and the degree of matching between nodes and intent constraints are used to calculate the comprehensive ranking score of each node. The nodes are then sorted from high to low scores, and the top-ranked attribute nodes and product nodes are extracted as the filtered ranking results.

[0077] The filtered and sorted attribute nodes are integrated with the structured information stored in the product nodes to establish a mapping relationship between important entities and product attributes. Specifically, for each important entity, all associated attribute nodes are categorized and merged according to attribute type, forming a mapping structure with entities as keys and attribute information dictionaries as values. Product information from product nodes is simultaneously incorporated into the mapping structure, ensuring that the candidate knowledge set covers both attribute-level and product-level knowledge. Finally, the above mapping structure is serialized into a candidate knowledge set for subsequent semantic similarity calculation modules to determine the target answer content that best matches the consultation text. The generation process of the candidate knowledge set fully utilizes the structured semantic advantages of knowledge graphs, mapping ambiguous entity references in user natural language consultations to precise product attributes and product entities, effectively improving the accuracy and coverage of subsequent answer generation.

[0078] In one optional implementation, determining the target answer content matching the consultation text through semantic similarity calculation, based on the intent type and the candidate knowledge set, includes:

[0079] A query semantic representation is constructed based on the intent type, and the consultation text is fused and encoded with the query semantic representation to generate an enhanced query vector;

[0080] The enhanced query vector is compared with the semantic vectors of each knowledge fragment in the candidate knowledge set. The multi-granularity similarity calculation includes word-level similarity calculation and sentence-level similarity calculation. The results of the word-level similarity calculation and the sentence-level similarity calculation are integrated through a multi-granularity fusion mechanism to obtain a comprehensive similarity score.

[0081] Based on the comprehensive similarity score, the knowledge fragments in the candidate knowledge set are sorted, and the knowledge fragments that are ranked at the top and whose comprehensive similarity score is higher than the preset screening threshold are extracted to form a selected knowledge subset. For each knowledge fragment in the selected knowledge subset, the matching degree between it and the consultation text in terms of semantic dependency relationship is analyzed, and the semantic dependency matching degree score is calculated.

[0082] A comprehensive evaluation index is constructed based on the comprehensive similarity score and the semantic dependency matching score. The knowledge fragment with the best evaluation value is selected as the target answer content according to the comprehensive evaluation index.

[0083] After obtaining the intent type and candidate knowledge set, it is necessary to further determine the target answer content that best matches the consultation text. To this end, a query semantic representation is constructed based on the intent type. Specifically, for different intent types, corresponding intent semantic template vectors are maintained, and the identified intent type is mapped to the corresponding intent semantic template vector to form the initial query semantic representation. Subsequently, the text semantic vector obtained from the consultation text after encoder processing is concatenated and fused with this initial query semantic representation. The fusion method is as follows: the two are concatenated and input into a fully connected mapping layer, transformed by a non-linear activation function, and the output dimension is kept consistent with the dimension of the original semantic vector, thereby generating an enhanced query vector. Enhance query vectors It carries both the user's intent semantic information and the specific semantic information of the consultation text, which can more accurately guide the subsequent similarity calculation process compared to using the consultation text vector alone.

[0084] In obtaining enhanced query vectors Next, multi-granularity similarity calculations are performed on each knowledge fragment in the candidate knowledge set. Each knowledge fragment in the candidate knowledge set is pre-encoded using an encoder shared with the semantic parsing model to obtain a corresponding sentence-level semantic vector. ,in This assigns an index number to the knowledge fragment. Sentence-level similarity calculation enhances the query vector. With knowledge fragment sentence-level semantic vectors The cosine similarity between them yields the sentence-level similarity score. The formula is Word-level similarity calculation is performed at a finer granular level: the consultation text is segmented into word sequences, and the knowledge fragments are also segmented into word sequences. The context word vectors of each word are extracted, and the attention weight between each word in the consultation text and each word in the knowledge fragment is calculated using a cross-attention mechanism. These are then aggregated to obtain a word-level aligned representation, and the word-level similarity score is calculated. Word-level similarity calculation can capture precise matching information between local keywords, while sentence-level similarity calculation focuses on the macroscopic alignment of overall semantics. The two complement each other and together cover semantic matching needs at different granularities.

[0085] Multi-granularity fusion mechanism integrates word-level similarity scores Sentence-level similarity score Weighted integration is performed to obtain a comprehensive similarity score. The calculation method is as follows ,in The fusion weighting coefficient has a range of values. It can be dynamically adjusted according to different intent types. For example, for intents related to product parameter inquiries, word-level matching is often more crucial. The values ​​are relatively large; for inquiries about after-sales policies, sentence-level semantic understanding is more important. The value is relatively small. Through intention-adaptive weight allocation, the overall similarity score is improved. It can better reflect the actual matching degree between knowledge fragments and consultation texts in different scenarios.

[0086] Based on comprehensive similarity score Sort all knowledge fragments in the candidate knowledge set in descending order and extract those ranked first. Position and Higher than the preset screening threshold These knowledge fragments constitute a carefully selected subset of knowledge. The preset maximum number of retentions. Both similarity-based thresholds and other parameters constrain the size of the selected knowledge subset, preventing the introduction of too many low-quality candidate fragments that could interfere with subsequent refined evaluation. In practical deployment, It is usually set between 5 and 10. The calibration is performed based on the distribution of historical data to ensure that the selected knowledge subset achieves a balance between coverage and accuracy.

[0087] For each knowledge fragment in the selected knowledge subset, the semantic dependency matching degree between it and the consultation text is further analyzed. Semantic dependency analysis involves performing dependency parsing on both the consultation text and the knowledge fragments to extract their respective dependency triples. Then, the dependency triples from the consultation text and the knowledge fragments are aligned and compared. The proportion of triples that form effective semantic correspondences is calculated and used as the semantic dependency matching score. The calculation basis. Specifically, the set of dependency triples extracted from the consultation text is denoted as... , will the The set of dependency triples extracted from each knowledge fragment is denoted as . Through calculation and The weighted F1 matching score between them is obtained Semantic dependency matching scores can effectively identify knowledge fragments that are similar to the consultation text on the surface vocabulary but have deviations in deep semantic structure, thereby improving the accuracy of answer selection.

[0088] Comprehensive evaluation indicators Based on comprehensive similarity score semantic dependency matching score Jointly constructed, the calculation method is as follows ,in This is the fusion ratio coefficient between the two types of scores, and its value ranges from [value range missing]. . The value can be dynamically adjusted based on the intent type and the text length of the knowledge fragment: for short text knowledge fragments, dependency structure information is relatively sparse. Appropriately increase the weight of multi-granularity similarity; for long text knowledge fragments, the dependency structure information is rich. Appropriately reduce the size to fully utilize the fine-grained discriminative power of semantic dependency matching. According to The knowledge fragments in the selected knowledge subset are finally sorted and selected. The largest knowledge fragment is used as the target answer content and output to the subsequent answer generation and confidence assessment stages. This multi-layered answer determination mechanism, through gradual screening and refinement from coarse to fine granular, effectively ensures the overall quality of the target answer content in terms of semantic matching accuracy and structural consistency.

[0089] In one optional implementation, the comprehensive similarity score is obtained by integrating the word-level similarity calculation result with the sentence-level similarity calculation result through a multi-granularity fusion mechanism, including:

[0090] Based on the word-level similarity calculation results, keyword matching pairs between the consultation text and each knowledge fragment are extracted, the semantic contribution of each keyword matching pair is calculated, and the word-level similarity calculation results are weighted according to the semantic contribution to generate a weighted word-level similarity.

[0091] Based on the results of sentence-level similarity calculation, the alignment degree between the consultation text and each knowledge fragment at the semantic structure level is analyzed, the matching status of the core semantic components in the semantic structure is identified, and the results of sentence-level similarity calculation are structurally corrected according to the matching status of the core semantic components to generate corrected sentence-level similarity.

[0092] A multi-granularity fusion mechanism is constructed, which uses keyword matching information in the weighted word-level similarity to guide the fine-tuning of the corrected sentence-level similarity. By calculating the interaction coefficient between the weighted word-level similarity and the corrected sentence-level similarity, the weighted word-level similarity and the corrected sentence-level similarity are dynamically fused based on the interaction coefficient to generate a comprehensive similarity score.

[0093] In the process of calculating the similarity between the consultation text and each knowledge fragment, the word-level similarity calculation results and the sentence-level similarity calculation results describe the semantic relationship between the texts from different granularities. Each has its own emphasis and needs to be integrated through a multi-granularity fusion mechanism to obtain a more accurate comprehensive similarity score.

[0094] Based on the word-level similarity calculation results, keyword matching pairs between the consultation text and each knowledge fragment are first extracted. Specifically, keywords are extracted from both the consultation text and the knowledge fragments, using TF-IDF combined with part-of-speech filtering to retain words with substantial semantic carrying capacity, such as nouns, verbs, and adjectives, forming their respective keyword sets. Subsequently, the cosine similarity of word vectors is calculated pairwise for each word in the two keyword sets, and word combinations with similarity exceeding a set word pair matching threshold are confirmed as valid keyword matching pairs. For each valid keyword matching pair, its semantic contribution is calculated. The calculation of semantic contribution comprehensively considers two dimensions: first, the importance weight of the keyword in the consultation text, i.e., the amount of information the word contains in the current consultation scenario, which can be obtained by normalizing the word's TF-IDF score in the consultation text; second, the word vector similarity of the matching pair itself, with higher similarity indicating more accurate semantic correspondence.

[0095] Let the first The semantic contribution of each keyword matching pair is ,but The word vector similarity of the matched pair and the importance weight of keywords in the consultation text are used to determine the relationship between the word vector similarity and the importance weight of the keywords. The product determines that, i.e. ,in For the first The cosine similarity of word vectors for each matching pair. This assigns a normalized importance weight to the corresponding keywords in the consultation text. Based on the semantic contribution of each matching pair, the word-level similarity calculation results are weighted by importance to generate a weighted word-level similarity score. The calculation method is to normalize the weighted sum of the semantic contributions of all valid keyword matching pairs, so that at the word granular level, words with stronger semantic relevance and greater information content are given higher weights, avoiding interference from low-information stop words or general words on word-level similarity results.

[0096] Based on the results of sentence-level similarity calculation, we further analyze the alignment degree between the consultation text and each knowledge fragment at the semantic structure level. Sentence-level similarity is usually obtained by mapping the entire text into dense vectors using an encoder and then calculating cosine similarity. This method can capture global semantics, but its ability to perceive the alignment status of core semantic components within a sentence is weak. Therefore, we identify the core semantic components in the semantic structure of the consultation text and knowledge fragments, including core syntactic components such as subject, predicate, and object, as well as modifying and limiting components. By comparing the core semantic components one by one, we determine whether the knowledge fragments effectively correspond to the consultation text in key semantic dimensions.

[0097] If the knowledge fragment highly matches the consultation text in terms of core semantic components, then the sentence-level similarity is positively corrected; if there are missing core semantic components or semantic shifts, then a certain penalty coefficient is applied to the sentence-level similarity to appropriately reduce its score. Let the matching state correction factor of the core semantic components be... Indicates positive correction. If negative penalty is indicated, then sentence-level similarity is corrected. From the original sentence-level similarity score and The product of these values ​​is then truncated and normalized to ensure that the correction result remains within a reasonable similarity range. This structured correction operation makes sentence-level similarity more sensitive to the alignment of core semantic components while preserving global semantic awareness, thus improving the accuracy of sentence-level similarity in judging semantic matching quality.

[0098] After completing the weighted word-level similarity Similarity with corrected sentence level After calculating the two separately, a multi-granularity fusion mechanism is constructed to achieve dynamic integration. The core of multi-granularity fusion lies in using word-level matching information to guide the fine-tuning of sentence-level similarity, and dynamically allocating fusion weights by calculating the interaction coefficient between the two. Specifically, the interaction coefficient... The calculation is based on the consistency between weighted word-level similarity and corrected sentence-level similarity: when the two values ​​are close, it indicates that the semantic judgments at the word and sentence levels are consistent, and the interaction coefficient takes the median value, with the scores of the two levels participating in the fusion with relatively balanced weights; when the two values ​​differ significantly, it indicates that there is a discrepancy in the semantic perception of the two levels, and the weights need to be dynamically adjusted according to the direction of the difference—if the weighted word-level similarity is significantly higher than the corrected sentence-level similarity, it indicates that there are a large number of precise keyword matches at the word level, and the fusion weight of word-level similarity should be appropriately increased; conversely, if the corrected sentence-level similarity is significantly higher than the weighted word-level similarity, it indicates that the overall semantic structure is highly consistent but the local keyword coverage is insufficient, and the fusion weight of sentence-level similarity should be appropriately increased. Interaction Coefficient The calculation can be expressed as ,in The Sigmoid function maps the difference to... The interval is used to adaptively determine the dynamic weight of word-level similarity in the fusion process, while the weight corresponding to sentence-level similarity is... .

[0099] Based on the interaction coefficient The weighted word-level similarity and the corrected sentence-level similarity are dynamically fused to generate a comprehensive similarity score. The calculation method is as follows The advantage of this dynamic fusion method lies in the fact that the semantic association patterns between different consultation texts and knowledge fragments vary. Some matching relationships rely more on the precise correspondence of keywords, while others depend more on the consistency of the overall semantic structure. Fixed-weight fusion methods are ill-suited to this diversity. By introducing an interaction influence coefficient, the fusion weights adaptively adjust according to the word-level and sentence-level similarity differences of specific sample pairs, enabling the comprehensive similarity score to more accurately reflect the true semantic matching degree between the consultation text and the knowledge fragment. The final generated comprehensive similarity score... This will serve as the core basis for subsequent knowledge fragment sorting and filtering, supporting the accurate determination of the target answer content.

[0100] In real-world applications, user inquiries often contain colloquial expressions, abbreviations, or domain-specific terminology, making single-granularity similarity calculations prone to semantic misjudgments. For example, when a user inquires about a product's "after-sales guarantee," multiple knowledge fragments containing the words "guarantee" or "after-sales" might be matched at the word level, but at the sentence level, it's possible to distinguish between knowledge content with different semantic structures, such as "return and exchange policy" and "quality assurance certificate." Through dynamic integration using a multi-granularity fusion mechanism, the comprehensive similarity score can simultaneously consider both precise word matching and overall semantic structure matching, effectively improving the accuracy of knowledge retrieval and providing high-quality knowledge support for subsequent personalized answer generation.

[0101] In one optional implementation, a user profile feature vector is constructed, and the user profile feature vector is fused and encoded with the context state information of the current dialogue to generate a personalized semantic representation, including:

[0102] Obtain users' historical behavior data in the e-commerce mini-program, extract users' consultation preference features, product preference features and transaction decision features from the historical behavior data, and vectorize and encode the consultation preference features, product preference features and transaction decision features to generate a multi-dimensional feature vector set;

[0103] For each dimension feature vector in the multidimensional feature vector set, calculate the representation contribution of each dimension feature vector to the user behavior pattern, and perform adaptive weighted fusion of each dimension feature vector based on the representation contribution to construct the user profile feature vector.

[0104] Extract the context state information of the current dialogue, perform temporal encoding on the context state information, and generate a context state vector;

[0105] A bidirectional attention interaction mechanism is constructed, and the semantic association matrix between the user profile feature vector and the context state vector is calculated using the bidirectional attention interaction mechanism. Based on the semantic association matrix, feature components in the user profile feature vector that are related to the current dialogue context and state components in the context state vector that are related to user preferences are identified.

[0106] The feature components and the state components are deeply fused and encoded to generate a personalized semantic representation.

[0107] We acquire historical user behavior data within the e-commerce mini-program, encompassing various interaction logs such as historical consultation records, product browsing history, favorites and add-to-cart behavior, order completion records, and after-sales feedback. From this historical behavior data, we extract three core features: consultation preference features, reflecting the product categories, question types, and consultation frequency distributions that users tend to consult; product preference features, reflecting the distribution of user preferences for product price ranges, brands, and functional attributes during browsing, favorites, and add-to-cart processes; and transaction decision features, characterizing the user's decision-making path from browsing to placing an order, including decision duration, price comparison frequency, and discount sensitivity. These three types of features are then vectorized and encoded. Consultation preference features are mapped to dense vectors using a bag-of-words model and TF-IDF weighting; product preference features are represented by a product attribute embedding matrix; and transaction decision features are statistically normalized and concatenated into numerical vectors, ultimately forming a multi-dimensional feature vector set.

[0108] For each dimension of the multidimensional feature vector set, the contribution of each dimension to the representation of user behavior patterns is calculated. Specifically, each dimension's feature vector is input into a lightweight evaluation network, which outputs the contribution weights of each dimension through fully connected layers and Softmax normalization. ,in Indexed by feature dimensions, It satisfies the normalization constraint that the sum of the weights of all dimensions is 1. Contribution The calculation comprehensively considers the information entropy of the feature vector in this dimension and its activation frequency in historical dialogues: higher information entropy indicates a more uniform distribution and lower discriminative power of the feature vector in this dimension, resulting in a lower weight; higher activation frequency indicates that the feature vector in this dimension is frequently invoked in actual dialogues, resulting in a higher weight. The resulting contribution weights are then calculated. The feature vectors of each dimension are adaptively weighted and fused. The weighted vectors are then concatenated and compressed to a unified dimension through a linear projection layer to construct the user profile feature vector. .

[0109] The contextual state information of the current dialogue is extracted, including the sequence of intents expressed by the user in the current round, the semantic summary of historical question-answer pairs, and the round number of the current session. When performing temporal encoding of the contextual state information, a gated recurrent unit (GRU) is used to encode the historical question-answer pair sequence round by round. The semantic vector of each round of dialogue is sequentially input into the GRU, and its hidden state captures the semantic evolution trend during the dialogue progression. Simultaneously, a positional encoding mechanism is introduced, assigning temporal positional weights to dialogues in different rounds, so that dialogues closer to the current round have a higher influence in the encoding. After temporal encoding, a contextual state vector is generated. Its dimensions are similar to user profile feature vectors. To maintain consistency, so as to facilitate subsequent fusion calculations.

[0110] Construct a bidirectional attention interaction mechanism to capture user profile feature vectors. With context state vector The two-way semantic association between them. The two-way attention interaction mechanism includes attention computation paths in two directions: the first direction... For query, with For key-value pairs, calculate the attention weight matrix of the user profile feature vector to each component of the context state vector. The second direction is For query, with For key-value pairs, calculate the attention weight matrix of the context state vector to each component of the user profile feature vector. Semantic association matrix and The scaling factor is calculated using a scaling dot product attention mechanism. The scaling factor is the square root of the feature dimension to prevent the inner product from becoming too large and causing the gradient to vanish.

[0111] Based on semantic association matrix Identify user profile feature vectors Feature components related to the current dialogue context :Will The row normalized weights are used as the basis for The selection coefficients of each component are obtained by weighted summation. This component concentrates the most distinctive personal preference information in the user profile within the current dialogue context. Based on the semantic association matrix... Identify context state vector State components related to user preferences :Will The row normalized weights are used as the basis for The selection coefficients of each component are obtained by weighted summation. This component centrally embodies the semantic state information in the current dialogue context that aligns with the user's historical preference patterns. Through the aforementioned bidirectional attention mechanism, the semantic relationship between the two vectors is fully explored, avoiding the information asymmetry problem inherent in unidirectional attention computation.

[0112] eigencomponents With state components Perform deep fusion encoding to generate personalized semantic representations Deep fusion coding employs a multi-layer nonlinear transformation structure: and After concatenation, the input is fed into the first fully connected layer, undergoes a nonlinear transformation using the ReLU activation function, and outputs an intermediate fused vector; subsequently, the intermediate fused vector is combined with... and The element-wise products are summed to retain the original semantic information and prevent information loss during deep fusion. After further compression and integration by the second fully connected layer, the final personalized semantic representation is output. Personalized semantic representation Simultaneously, it encodes the user's personal preference patterns and the real-time contextual information of the current dialogue, which can provide a more accurate semantic basis for the dynamic adjustment of subsequent intent type recognition results and the personalized correction of the ranking weight of candidate knowledge sets. This ensures that the final generated answer content not only meets the user's objective consultation needs but also fully matches the user's personalized preferences and the current dialogue context.

[0113] In one optional implementation, a bidirectional attention interaction mechanism is constructed, and the semantic association matrix between the user profile feature vector and the context state vector is calculated using the bidirectional attention interaction mechanism, including:

[0114] The user profile feature vector and the context state vector are mapped and transformed to generate user feature representation and context state representation respectively;

[0115] In the bidirectional attention interaction mechanism, a positive attention calculation path is constructed. The semantic association strength between each feature component in the user feature representation and each state component in the context state representation is calculated through the positive attention calculation path. The context state representation is then weighted and fused based on the semantic association strength to generate positive interaction features.

[0116] In the bidirectional attention interaction mechanism, a reverse attention calculation path is constructed. The semantic association strength between each state component in the context state representation and each feature component in the user feature representation is calculated through the reverse attention calculation path. The user feature representation is then weighted and fused based on the semantic association strength to generate reverse interaction features.

[0117] The positive interaction features and the negative interaction features are collaboratively aligned using the bidirectional attention interaction mechanism. The distribution consistency and semantic complementarity of the positive interaction features and the negative interaction features in the feature space are analyzed. The positive interaction features and the negative interaction features are jointly encoded to construct a semantic association matrix.

[0118] like Figure 2 As shown, the method includes:

[0119] When constructing a bidirectional attention interaction mechanism, it is necessary to first perform a linear mapping transformation on the user profile feature vector and the context state vector, projecting them into a unified semantic space to eliminate the differences in dimensionality and distribution range of the original feature representations. Specifically, a learnable linear transformation matrix is ​​applied to the user profile feature vector. To obtain user feature representation Apply another set of independent linear transformation matrices to the context state vector. , obtain the context state representation ,in and These are the corresponding bias terms. Through the above mapping transformation, the user feature representation... Representation of context state They are uniformly embedded into a feature space of the same dimension, laying the foundation for subsequent attention interaction computation. Layer normalization operations can be introduced during the mapping transformation process to stabilize gradient propagation during training and avoid attention weight shifts caused by differences in feature scale.

[0120] The positive attention computation path is represented by user features. The source of the query is represented by the context state. As the source of key-value pairs, calculate the semantic association strength between each feature component in the user feature representation and each state component in the context state representation. After querying the projection matrix Transformation yields the forward query matrix ,Will Each through the bond projection matrix AND-value projection matrix Transformation yields the positive bond matrix With positive value matrix Positive attention weight matrix It is calculated using the scaled dot product attention mechanism, and the calculation formula is as follows: ,in is the dimension of the key vector, used to scale the dot product result to prevent gradient vanishing. Based on the positive attention weight matrix. For positive value matrix Perform weighted fusion to generate positive interaction features. Positive interaction features Each row corresponds to the semantic projection of a certain feature component in the user feature representation in the context state space, reflecting the degree of correlation between the user feature component and the current dialogue state, and can effectively capture the direction of the influence of user personalized preferences on the current dialogue context.

[0121] The reverse attention computation path forms a symmetrical structure with the forward path, represented by context states. The source of the query is represented by user characteristics. As the source of key-value pairs, calculate the semantic association strength between each state component in the context state representation and each feature component in the user feature representation. After querying the projection matrix Transformation yields the reverse lookup matrix ,Will Each through the bond projection matrix AND-value projection matrix Transformation yields the inverse bond matrix With the inverse value matrix Reverse attention weight matrix Similarly, it is calculated using the scaled dot product attention mechanism, with the following formula: Based on the reverse attention weight matrix For the inverse value matrix Perform weighted fusion to generate reverse interaction features Reverse interaction features Each row in the model corresponds to the semantic projection of the context state component in the user feature space, reflecting the activation and modulation of user preference features by the current dialogue state, enabling the model to dynamically perceive the user's current needs from the perspective of dialogue history.

[0122] In obtaining positive interaction features With reverse interaction features Subsequently, the bidirectional attention interaction mechanism analyzes the distribution consistency and semantic complementarity of the two in the feature space through collaborative alignment operations. Distribution consistency analysis is performed by calculating... and Feature correlation coefficient matrix in each dimension This is used to quantify and identify semantically highly overlapping dimensional intervals between two sets of interaction features. These intervals represent the semantic consensus between the user profile and the dialogue state. Semantic complementarity analysis then calculates the residual representations of the two sets of features. This is used to capture the differences between the two, reflecting complementary semantic components between user features and contextual state that have not yet been fully integrated. Positive interaction features... Reverse interaction features Residual representation After concatenation, the matrix undergoes a nonlinear transformation via a joint encoding network (composed of multiple feedforward neural networks) to generate the final semantic association matrix. Residual connections and layer normalization are introduced into the joint encoding network to preserve the integrity of the original feature information and accelerate model convergence. Semantic association matrix. It also carries consistent correlation information and complementary difference information between user profile and context state, which can provide a more comprehensive and accurate cross-modal semantic basis for subsequent personalized semantic representation generation.

[0123] In multi-turn dialogue scenarios, the context state vector is continuously updated as the dialogue progresses, causing the semantic relationship between user feature representation and context state representation to exhibit dynamic changes. To address this, a bidirectional attention interaction mechanism re-executes forward and reverse attention calculations in each round of dialogue to ensure the semantic relationship matrix remains intact. It can reflect the interaction between the latest dialogue status and user preferences in real time. Furthermore, in the multi-head attention extension scheme, both forward and backward attention calculation paths can be extended to a multi-head form by setting... Several parallel attention heads are used, each independently capturing the local semantic relationships between user features and contextual states in a different subspace. Finally, the outputs of all heads are concatenated and processed through an output projection matrix. The transformation yields the multi-head fused interaction feature representation. The multi-head mechanism can significantly improve the ability of bidirectional attention interaction to model complex semantic association patterns, especially in scenarios where user intent is relatively ambiguous or dialogue context information is relatively rich, effectively improving the expression accuracy and generalization ability of the semantic association matrix.

[0124] In one optional implementation, the consultation text, the intent type, the user profile feature vector, the personalized semantic representation, and the response content are used to construct enhanced training samples. The semantic distance between positive and negative sample pairs is calculated using a contrastive learning approach, including:

[0125] Multimodal feature fusion is performed on the consultation text, intent type, user profile feature vector and personalized semantic representation to generate query-side semantic representation. The response content is semantically encoded to generate response-side semantic representation. The query-side semantic representation and the response-side semantic representation are paired and associated to form enhanced training samples.

[0126] For the query-side semantic representation in the enhanced training samples, other consultation texts that are the same as the consultation text in terms of intent type but different in terms of semantic content are retrieved from the historical sample library. The user profile feature vectors corresponding to the other consultation texts are fused with the personalized semantic representation to generate a comparative query-side semantic representation. The query-side semantic representation and the response-side semantic representation are used as positive sample pairs, and the comparative query-side semantic representation and the response-side semantic representation are used as negative sample pairs. A sample pair set containing the positive sample pairs and the negative sample pairs is constructed.

[0127] The query-side semantic representation and response-side semantic representation of each sample pair in the sample pair set are mapped to a unified feature space through an encoding network. The distance metric between the two vector representations of each sample pair in the unified feature space is calculated, and the semantic distance between positive and negative sample pairs is characterized by the distance metric.

[0128] In constructing enhanced training samples, it is necessary to perform multimodal feature fusion of four types of information: consultation text, intent type, user profile feature vector, and personalized semantic representation, to generate a query-side semantic representation that can comprehensively characterize the semantics of user queries. Specifically, the consultation text is semantically encoded to obtain a text semantic vector, the intent type is mapped to an intent embedding vector through a type embedding layer, and the user profile feature vector and personalized semantic representation are directly used as user-side feature inputs. After concatenating the above four types of feature vectors, a multilayer perceptron is used for nonlinear transformation and dimensionality compression to output a fixed-dimensional query-side semantic representation. For the response content, an encoder with the same architecture as the query side but independent parameters is used to semantically encode the response text. The encoded output is then passed through a linear mapping layer to obtain the semantic representation of the response. .Will and Perform pairing associations, each pair This constitutes a complete augmented training sample unit, providing basic data support for subsequent comparative learning.

[0129] In the construction of positive and negative sample pairs, based on the query-side semantic representation in the current enhanced training samples, other historical consultation texts that are identical to the current consultation text in terms of intent type label but significantly different in semantic content are retrieved from the historical sample library. Identical intent types mean that the two consultation texts belong to the same type of user need, while semantic content differences are filtered by calculating the cosine similarity between the text semantic vectors of the historical consultation text and the current consultation text, retaining only those with similarity below a preset difference threshold. Historical consultation texts were used as comparison candidates.

[0130] For the selected candidate consultation texts for comparison, extract their corresponding user profile feature vectors and personalized semantic representations, and generate a comparative query-side semantic representation using the same multimodal fusion method as the query-side semantic representation. The query-side semantic representation of the current sample. Semantic representation of the response side Forming positive sample pairs The semantic representation of the comparison query side will be compared. Same response-side semantic representation Forming negative sample pairs This constructs a complete set of sample pairs containing both positive and negative samples. The core of this construction strategy lies in the fact that in positive sample pairs, the query and response are highly semantically matched, while in negative sample pairs, although the comparison query and response belong to the same intent type, they do not match due to differences in semantic content. This forces the model to learn to distinguish fine-grained differences between queries with the same intent type but different semantic details during the comparative learning process, avoiding the model relying solely on intent type labels for coarse-grained matching.

[0131] An encoding network maps the query-side semantic representation and the response-side semantic representation of each sample pair in the sample pair set to a unified feature space. The encoding network consists of projection layers with shared parameters, uniformly projecting semantic representations from different sources onto a dimensionless space. The feature space is used to obtain the query-side projection vector in the unified feature space. Response side projection vector And compare the projection vectors of the query side The design using a shared projection layer ensures that the semantic representations of different modalities are comparable in the same metric space, avoiding distance metric distortion caused by inconsistencies in feature spaces.

[0132] In a unified feature space, the distance metric between the two vector representations of each sample pair is calculated. For positive sample pairs, the distance metric is calculated. and Euclidean distance between Specifically, it is expressed as For negative sample pairs, calculate and Euclidean distance between Specifically, it is expressed as By using a contrastive learning loss function to constrain the semantic distance between positive and negative sample pairs, the goal is to minimize the distance between positive sample pairs. Minimize the distance between negative sample pairs while ensuring the distance between them is minimized. The larger the value, the better. The contrastive learning loss function uses the margin loss form, and the margin hyperparameter is denoted as... Then the loss value Satisfy: When Greater than When the loss is zero, it means that the positive and negative sample pairs have been effectively distinguished; when Less than When the loss is positive, it drives model parameter updates to widen the distance difference between positive and negative sample pairs. This is achieved by minimizing... The feature extraction layer and similarity calculation layer of the encoding network and semantic parsing model are jointly optimized, which makes the model more discriminative when faced with fine-grained semantic differences.

[0133] In practical engineering implementation, the historical sample database is maintained using a rolling window approach, periodically adding newly added enhanced training samples and discarding expired samples to ensure the diversity and timeliness of comparison candidates. The candidate selection process incorporates a dual filtering mechanism of precise intent type matching and semantic difference measurement, ensuring that negative sample pairs are sufficiently challenging while avoiding the introduction of invalid negative samples with excessive semantic noise. For each positive sample pair, multiple comparison candidates can be retrieved from the historical sample database, forming a multi-negative sample training mode. This further enriches the supervision signal for contrastive learning and improves the model's generalization ability in diverse consultation scenarios.

[0134] A second aspect of this invention provides an information integration system based on an e-commerce mini-program, comprising:

[0135] The semantic parsing unit is used to receive the consultation text sent by the user through the e-commerce mini-program, perform semantic parsing on the consultation text through the semantic parsing model, extract the intent type and important entities, and perform semantic matching between the important entities and the nodes in the product knowledge graph based on the pre-built product knowledge graph, establish the association relationship between entities and product attributes, and generate a candidate knowledge set.

[0136] The answer matching unit is used to determine the target answer content that matches the consultation text based on the intent type and the candidate knowledge set through semantic similarity calculation;

[0137] The profile adjustment unit is used to construct a user profile feature vector, fuse and encode the user profile feature vector with the context state information of the current dialogue to generate a personalized semantic representation, and dynamically adjust the recognition result of the intent type and the ranking weight of the candidate knowledge set based on the personalized semantic representation.

[0138] The human intervention unit is used to trigger the human customer service intervention mechanism when the confidence level of the target answer content is lower than a preset confidence threshold, and to collect the response content given by the human customer service to the consultation text.

[0139] The contrastive learning unit is used to construct enhanced training samples from the consultation text, the intent type, the user profile feature vector, the personalized semantic representation, and the response content. It calculates the semantic distance between positive and negative sample pairs through contrastive learning and jointly optimizes and updates the feature extraction layer and similarity calculation layer of the semantic parsing model.

[0140] A third aspect of the present invention provides an electronic device, comprising:

[0141] processor;

[0142] Memory used to store processor-executable instructions;

[0143] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0144] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0145] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.

[0146] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for information integration based on e-commerce mini-programs, characterized in that: include: The system receives consultation texts sent by users through the e-commerce mini-program, performs semantic parsing on the consultation texts using a semantic parsing model, extracts intent types and important entities, and performs semantic matching between the important entities and nodes in the product knowledge graph based on a pre-built product knowledge graph, establishes the association between entities and product attributes, and generates a candidate knowledge set. Based on the intent type and the candidate knowledge set, the target answer content matching the consultation text is determined by semantic similarity calculation. Construct a user profile feature vector, fuse and encode the user profile feature vector with the context state information of the current dialogue to generate a personalized semantic representation, and dynamically adjust the recognition result of the intent type and the ranking weight of the candidate knowledge set based on the personalized semantic representation; When the confidence level of the target answer content is lower than a preset confidence threshold, a human customer service intervention mechanism is triggered to collect the response content given by human customer service to the inquiry text; The consultation text, the intent type, the user profile feature vector, the personalized semantic representation, and the response content are used to form an enhanced training sample. The semantic distance between positive and negative sample pairs is calculated through contrastive learning. The feature extraction layer and similarity calculation layer of the semantic parsing model are then jointly optimized and updated.

2. The method according to claim 1, characterized in that, The consultation text is semantically parsed using a semantic parsing model to extract intent types and important entities. Based on a pre-constructed product knowledge graph, the important entities are semantically matched with nodes in the product knowledge graph to establish associations between entities and product attributes, generating a candidate knowledge set including: Semantic analysis is performed on the consultation text to extract entity references and intent trigger words, and the entity references are converted into semantic vector representations. The semantic vector representation is compared with the embedding vector of each node in the product knowledge graph. Nodes with similarity higher than a preset matching threshold are selected as the initial matching node set, and the adjacency relationship structure of each node in the initial matching node set in the product knowledge graph is obtained. Based on the adjacency structure, multi-level relationship expansion is performed on each node in the initial matching node set. Path propagation is carried out along attribute relationship edges and category relationship edges to obtain attribute nodes and product nodes that are directly or indirectly associated with the initial matching nodes, and an extended knowledge subgraph is constructed. The query constraints are determined based on the intent trigger words. The nodes in the extended knowledge subgraph are filtered and sorted using the query constraints to extract attribute nodes and product nodes that satisfy the query constraints. The attribute information and product information in the attribute nodes and product nodes are structured and organized to establish a mapping relationship between important entities and product attributes, thereby generating a candidate knowledge set.

3. The method according to claim 1, characterized in that, Based on the intent type and the candidate knowledge set, the target answer content matching the consultation text is determined through semantic similarity calculation, including: A query semantic representation is constructed based on the intent type, and the consultation text is fused and encoded with the query semantic representation to generate an enhanced query vector; The enhanced query vector is compared with the semantic vectors of each knowledge fragment in the candidate knowledge set. The multi-granularity similarity calculation includes word-level similarity calculation and sentence-level similarity calculation. The results of the word-level similarity calculation and the sentence-level similarity calculation are integrated through a multi-granularity fusion mechanism to obtain a comprehensive similarity score. Based on the comprehensive similarity score, the knowledge fragments in the candidate knowledge set are sorted, and the knowledge fragments that are ranked at the top and whose comprehensive similarity score is higher than the preset screening threshold are extracted to form a selected knowledge subset. For each knowledge fragment in the selected knowledge subset, the matching degree between it and the consultation text in terms of semantic dependency relationship is analyzed, and the semantic dependency matching degree score is calculated. A comprehensive evaluation index is constructed based on the comprehensive similarity score and the semantic dependency matching score. The knowledge fragment with the best evaluation value is selected as the target answer content according to the comprehensive evaluation index.

4. The method according to claim 3, characterized in that, The comprehensive similarity score is obtained by integrating the word-level similarity calculation results with the sentence-level similarity calculation results through a multi-granularity fusion mechanism, including: Based on the word-level similarity calculation results, keyword matching pairs between the consultation text and each knowledge fragment are extracted, the semantic contribution of each keyword matching pair is calculated, and the word-level similarity calculation results are weighted according to the semantic contribution to generate a weighted word-level similarity. Based on the results of sentence-level similarity calculation, the alignment degree between the consultation text and each knowledge fragment at the semantic structure level is analyzed, the matching status of the core semantic components in the semantic structure is identified, and the results of sentence-level similarity calculation are structurally corrected according to the matching status of the core semantic components to generate corrected sentence-level similarity. A multi-granularity fusion mechanism is constructed, which uses keyword matching information in the weighted word-level similarity to guide the fine-tuning of the corrected sentence-level similarity. By calculating the interaction coefficient between the weighted word-level similarity and the corrected sentence-level similarity, the weighted word-level similarity and the corrected sentence-level similarity are dynamically fused based on the interaction coefficient to generate a comprehensive similarity score.

5. The method according to claim 1, characterized in that, Constructing a user profile feature vector, fusing and encoding the user profile feature vector with the context state information of the current dialogue, and generating a personalized semantic representation includes: Obtain users' historical behavior data in the e-commerce mini-program, extract users' consultation preference features, product preference features and transaction decision features from the historical behavior data, and vectorize and encode the consultation preference features, product preference features and transaction decision features to generate a multi-dimensional feature vector set; For each dimension feature vector in the multidimensional feature vector set, calculate the representation contribution of each dimension feature vector to the user behavior pattern, and perform adaptive weighted fusion of each dimension feature vector based on the representation contribution to construct the user profile feature vector. Extract the context state information of the current dialogue, perform temporal encoding on the context state information, and generate a context state vector; A bidirectional attention interaction mechanism is constructed, and the semantic association matrix between the user profile feature vector and the context state vector is calculated using the bidirectional attention interaction mechanism. Based on the semantic association matrix, feature components in the user profile feature vector that are related to the current dialogue context and state components in the context state vector that are related to user preferences are identified. The feature components and the state components are deeply fused and encoded to generate a personalized semantic representation.

6. The method according to claim 5, characterized in that, Constructing a bidirectional attention interaction mechanism, and using the bidirectional attention interaction mechanism to calculate the semantic association matrix between the user profile feature vector and the context state vector, includes: The user profile feature vector and the context state vector are mapped and transformed to generate user feature representation and context state representation respectively; In the bidirectional attention interaction mechanism, a positive attention calculation path is constructed. The semantic association strength between each feature component in the user feature representation and each state component in the context state representation is calculated through the positive attention calculation path. The context state representation is then weighted and fused based on the semantic association strength to generate positive interaction features. In the bidirectional attention interaction mechanism, a reverse attention calculation path is constructed. The semantic association strength between each state component in the context state representation and each feature component in the user feature representation is calculated through the reverse attention calculation path. The user feature representation is then weighted and fused based on the semantic association strength to generate reverse interaction features. The positive interaction features and the negative interaction features are collaboratively aligned using the bidirectional attention interaction mechanism. The distribution consistency and semantic complementarity of the positive interaction features and the negative interaction features in the feature space are analyzed. The positive interaction features and the negative interaction features are jointly encoded to construct a semantic association matrix.

7. The method according to claim 1, characterized in that, The consultation text, the intent type, the user profile feature vector, the personalized semantic representation, and the response content are used to construct enhanced training samples. The semantic distance between positive and negative sample pairs is calculated through contrastive learning, including: Multimodal feature fusion is performed on the consultation text, intent type, user profile feature vector and personalized semantic representation to generate query-side semantic representation. The response content is semantically encoded to generate response-side semantic representation. The query-side semantic representation and the response-side semantic representation are paired and associated to form enhanced training samples. For the query-side semantic representation in the enhanced training samples, other consultation texts that are the same as the consultation text in terms of intent type but different in terms of semantic content are retrieved from the historical sample library. The user profile feature vectors corresponding to the other consultation texts are fused with the personalized semantic representation to generate a comparative query-side semantic representation. The query-side semantic representation and the response-side semantic representation are used as positive sample pairs, and the comparative query-side semantic representation and the response-side semantic representation are used as negative sample pairs. A sample pair set containing the positive sample pairs and the negative sample pairs is constructed. The query-side semantic representation and response-side semantic representation of each sample pair in the sample pair set are mapped to a unified feature space through an encoding network. The distance metric between the two vector representations of each sample pair in the unified feature space is calculated, and the semantic distance between positive and negative sample pairs is characterized by the distance metric.

8. An information integration system based on an e-commerce mini-program, used to implement the method as described in any one of claims 1-7, characterized in that, include: The semantic parsing unit is used to receive the consultation text sent by the user through the e-commerce mini-program, perform semantic parsing on the consultation text through the semantic parsing model, extract the intent type and important entities, and perform semantic matching between the important entities and the nodes in the product knowledge graph based on the pre-built product knowledge graph, establish the association relationship between entities and product attributes, and generate a candidate knowledge set. The answer matching unit is used to determine the target answer content that matches the consultation text based on the intent type and the candidate knowledge set through semantic similarity calculation; The profile adjustment unit is used to construct a user profile feature vector, fuse and encode the user profile feature vector with the context state information of the current dialogue to generate a personalized semantic representation, and dynamically adjust the recognition result of the intent type and the ranking weight of the candidate knowledge set based on the personalized semantic representation. The human intervention unit is used to trigger the human customer service intervention mechanism when the confidence level of the target answer content is lower than a preset confidence threshold, and to collect the response content given by the human customer service to the consultation text. The contrastive learning unit is used to construct enhanced training samples from the consultation text, the intent type, the user profile feature vector, the personalized semantic representation, and the response content. It calculates the semantic distance between positive and negative sample pairs through contrastive learning and jointly optimizes and updates the feature extraction layer and similarity calculation layer of the semantic parsing model.

9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 7.