Intent classification method, device and medium based on vector retrieval and context perception
By generating standardized service description documents and encoding them into high-dimensional semantic vectors, and combining user context features for intelligent service matching, the dynamic adaptability and response efficiency problems of the intelligent service system are solved, and efficient intent recognition and service recommendation are achieved.
Patent Information
- Application Number
- CN202510941585.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-07-09
AI Technical Summary
Existing technologies in intelligent service systems have problems such as insufficient dynamic adaptability, low response efficiency and lack of scenario awareness. In particular, it is difficult to distinguish user intentions when multiple services share similar keywords. Traditional solutions cannot effectively integrate dynamic contextual features such as user identity, device type and historical behavior, resulting in misjudgment of intentions and high maintenance costs.
By extracting business metadata, a standardized service description document is generated and encoded into a high-dimensional semantic vector. A neighbor search index is constructed, and a dynamic query vector is generated by combining user identity and current question text. Similarity retrieval and multi-dimensional decision-making are performed, and service descriptions and question examples are automatically updated to improve matching accuracy.
It realizes hot-swappable management of intelligent services, reduces maintenance costs, adapts to high-frequency business iteration requirements, improves the depth of intent recognition and the accuracy of recommended services, reduces response delays, and enhances user experience.
Smart Images

Figure CN120448929B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to an intent classification method, device, and medium based on vector retrieval and context perception. Background Art
[0002] In the field of intelligent service systems, intent classification technology, as a core link in service distribution, directly affects user interaction efficiency and system scalability. Current mainstream solutions generally face three technical bottlenecks: insufficient dynamic adaptability, low response efficiency, and lack of scenario awareness. The accuracy of rule-based or keyword matching methods drops significantly in semantic conflict scenarios, especially when multiple services share similar keywords, making it difficult to effectively distinguish user intent. Although dedicated intent classification models can improve the depth of semantic understanding, dynamic service updates require triggering full model retraining, resulting in an exponential increase in maintenance costs and delayed real-time response, making it impossible to adapt to high-frequency iterative business needs.
[0003] In recent years, solutions based on large language models have attempted to implement service selection by splicing prompt words. However, this approach of concatenating the full service description with the user question input has led to serious performance drawbacks: processing long contexts leads to a sharp increase in computing resource consumption, response latency exceeds the threshold for real-time interaction, and system throughput deteriorates sharply as the number of concurrent requests increases. More importantly, existing technologies fail to effectively integrate dynamic contextual features such as user identity, device type, and historical behavior, resulting in the misclassification of the same semantics in different business scenarios. The root cause lies in the lack of a mechanism to correlate and map user intent with business metadata.
[0004] Furthermore, traditional service description optimization solutions rely on manual maintenance, making it difficult to capture semantic drift in real-world scenarios. The discrepancy between service descriptions and actual user needs accumulates over time, further amplifying the risk of misjudgment of intent. Existing search-based architectures also suffer from logical disjunctures in business rule filtering and personalized ranking. A single similarity matching mechanism cannot collaboratively address multiple decision-making factors, including semantic relevance, business compliance, and service priority. Summary of the Invention
[0005] The embodiments of the present application provide an intent classification method, device, and medium based on vector retrieval and context perception to solve the above-mentioned technical problems.
[0006] On the one hand, embodiments of the present application provide an intent classification method based on vector retrieval and context awareness, including:
[0007] Extracting business metadata from the original description document of the intelligent service, and associating the business metadata with corresponding typical problem examples to generate a standardized service description document;
[0008] Encoding the standardized service description document into a high-dimensional semantic vector through a pre-trained language model, and constructing a neighbor search index to store the high-dimensional semantic vector;
[0009] The user identity information obtained in real time and the current question text are concatenated into an enhanced query statement, and the enhanced query statement is encoded into a context-aware dynamic query vector through a semantic model;
[0010] Based on the dynamic query vector, similarity retrieval is performed in the neighbor search index to obtain candidate intelligent services, and the candidate intelligent services are filtered by business domains, context-weighted sorted, and dynamically prioritized to output the final matching target recommended services;
[0011] By collecting the interactive behavior data of the target recommended service, the service description and problem examples are scored based on preset evaluation rules, and the service descriptions and problem examples with quality scores below the quality threshold are automatically updated.
[0012] In one implementation of the present application, by collecting the interactive behavior data of the target recommended service, the service description and problem examples are scored based on preset evaluation rules, and the service descriptions and problem examples with quality scores below the quality threshold are automatically updated, specifically including:
[0013] Real-time collection of user interaction behavior data for the target recommended service; the interaction behavior data includes: service selection behavior, service call results, call response time, and user stay time;
[0014] Based on the interaction behavior data, calculating a first weighted sum of semantic similarity between the service description and the user question, semantic consistency between examples, and other correlation indicators, and calculating a second weighted sum of semantic similarity between examples, example diversity, and user click preference;
[0015] Based on the first weighted sum and the second weighted sum, a quality score between the service description and the problem example is determined, and when the quality score is lower than a quality threshold, the function label in the service description and the new problem example are updated based on the interaction behavior data.
[0016] In one implementation of the present application, the user identity information obtained in real time and the current question text are concatenated into an enhanced query statement, and the enhanced query statement is encoded into a context-aware dynamic query vector through a semantic model, specifically including:
[0017] Collect user identity information, device type, and historical interaction behaviors in real time, and use the user identity information, device type, and historical interaction behaviors as context features;
[0018] Converting the context feature into an identification prefix, and concatenating the identification prefix with the current question text to generate an enhanced query statement with the context identification;
[0019] The enhanced query statement is input into a pre-trained semantic model to perform joint semantic encoding on the enhanced query statement, and a dynamic query vector integrating context features is output.
[0020] In one implementation of the present application, business metadata is extracted from the original description document of the intelligent service, and the business metadata is associated with corresponding typical problem examples to generate a standardized service description document, specifically including:
[0021] Receive an original description document of the intelligent service, and use named entity recognition technology to extract the function name, domain label, and applicable role of the intelligent service from the original description document;
[0022] Based on dependency syntax analysis, logical relationships between business metadata are established, and the business metadata, the logical relationships and typical problem examples are combined into a JSON format document to generate a standardized service description document.
[0023] In one implementation of the present application, the function name, domain label, and applicable role of the intelligent service are extracted from the original description document, specifically including:
[0024] The original service description in the original description document is parsed through a prompt word project driven by a large language model to generate structured metadata including function labels, applicable roles, and business rules;
[0025] Based on a prompt template, the large language model is guided to output typical question examples in JSON format; the prompt template is a prompt template with zero samples or a small number of samples less than a specified number.
[0026] In one implementation of the present application, candidate intelligent services are filtered by business domain, context-weighted sorted, and dynamically prioritized to output the final matching target recommended service, specifically including:
[0027] Based on the cosine similarity of the business domain, candidate intelligent services with similarity higher than a preset threshold are screened from the semantic vector library, and the matching scores of the candidate intelligent services are weighted and adjusted according to the user's job role;
[0028] Combined with the dynamic indicators of the candidate intelligent services, the weighted candidate intelligent services are finally sorted to determine the final matching target recommended service; the dynamic indicators include historical call frequency and timeliness indicators.
[0029] In one implementation of the present application, based on the cosine similarity of the business domain, candidate intelligent services with similarity higher than a preset threshold are screened from the semantic vector library, specifically including:
[0030] Calculate the cosine similarity between the user question and each business domain, and determine the business domain corresponding to the user question based on the cosine similarity;
[0031] The semantic vector library is divided into multiple sub-indexes according to the business domain, and according to the business domain corresponding to the user question, a search is performed in the sub-index corresponding to the business domain to determine the candidate intelligent service corresponding to the user question.
[0032] In one implementation of the present application, the standardized service description document is encoded into a high-dimensional semantic vector through a pre-trained language model, and a neighbor search index is constructed to store the high-dimensional semantic vector, specifically including:
[0033] Using a pre-trained language model, the standardized service description document is encoded into a 384-dimensional semantic vector, and a hierarchical index structure is constructed based on the FAISS framework;
[0034] The 384-dimensional semantic vector is stored in the hierarchical index structure, and the index slices are divided according to the service business domain.
[0035] On the other hand, an embodiment of the present application further provides an intent classification device based on vector retrieval and context awareness, the device comprising:
[0036] at least one processor;
[0037] and, a memory communicatively coupled to the at least one processor;
[0038] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned intent classification method based on vector retrieval and context perception.
[0039] On the other hand, an embodiment of the present application also provides a non-volatile computer storage medium storing computer-executable instructions. When the computer-executable instructions are executed, the above-mentioned intent classification method based on vector retrieval and context perception is implemented.
[0040] The embodiments of the present application provide a method, device, and medium for intent classification based on vector retrieval and context awareness, which have at least the following beneficial effects:
[0041] By building a structured service representation system, business metadata is linked to typical question examples to generate standardized description documents, enabling hot-swappable management of intelligent services. Adding or removing services requires only updating the description document, eliminating model retraining, significantly reducing maintenance costs, and adapting to frequent business iterations. A pre-trained language model is used to encode service descriptions and build a nearest neighbor search index, transforming the intent matching process into a vector space similarity calculation. Compared to traditional large-model concatenation solutions, this approach avoids the overhead of long context processing and reduces search latency to milliseconds, effectively supporting real-time interactions in high-concurrency scenarios. Enhanced query statements are generated by concatenating user identity information with question text and encoded into dynamic query vectors, enabling intent recognition to deeply integrate business scenario characteristics. This breaks through the static limitations of traditional text classification and enables accurate intent differentiation across different scenarios with the same semantics. Hybrid search and re-ranking are performed based on dynamic query vectors. Through a multi-level decision-making mechanism that combines business domain filtering, contextual weighting, and dynamic priority adjustment, semantic relevance, business compliance, and service priority are collaboratively optimized. This approach addresses the lack of adaptability caused by single-similarity ranking, improving the alignment of recommended services with actual user needs. Automatically evaluate and update service descriptions and examples based on user interaction data, forming a feedback-driven closed-loop optimization system. This continuously corrects deviations between service representations and actual intent, dynamically improving classification accuracy based on usage scenarios and overcoming the lag and high costs of manual maintenance. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0043] Figure 1 A flowchart of the intent classification method based on vector retrieval and context awareness provided in an embodiment of the present application;
[0044] Figure 2 Schematic diagram of the internal structure of the intent classification device based on vector retrieval and context perception provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0046] The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0047] Figure 1 A flowchart of the intent classification method based on vector retrieval and context awareness provided in an embodiment of the present application.
[0048] The analysis method involved in the embodiments of the present application can be implemented by a terminal device or a server, and the present application does not impose any special restrictions on this. For ease of understanding and description, the following embodiments are described in detail using a server as an example.
[0049] It should be noted that the server can be a single device or a system composed of multiple devices, that is, a distributed server, and this application does not make any specific restrictions on this.
[0050] like Figure 1 As shown, the intent classification method based on vector retrieval and context awareness provided in the embodiment of the present application includes:
[0051] Step 101: extract business metadata from the original description document of the intelligent service, and associate the business metadata with corresponding typical problem examples to generate a standardized service description document.
[0052] In one embodiment of the present application, in order to solve the problem that service descriptions in traditional intent classification and intelligent service matching solutions are usually in plain text form and lack structured modeling of business characteristics, the present application extracts key business entities and their semantic relationships in the service description to construct a standardized and scalable service semantic model, thereby improving the accuracy of service understanding and matching. First, basic information of each intelligent service is collected from the system, such as natural language text such as service name, function description, and instructions for use, as input for subsequent semantic analysis.
[0053] Then, natural language processing technologies such as named entity recognition (NER) are used to extract key business entities and their semantic relationships, such as function names, domain labels, and applicable roles, from the original intelligent service description text.
[0054] Example: In the service description of the employee leave approval service, extract the entity: Leave Approval, which is the function name, and extract Manager, which is the applicable role. Then, through dependency syntax analysis, establish logical associations between the entities, such as Manager is responsible for leave approval.
[0055] In addition, the extracted structured metadata such as function labels, applicable roles, and business rules are combined with the original text and typical problem examples to generate a standardized service description document in a unified format, which not only retains the semantic integrity of natural language but also has structured features to facilitate subsequent semantic matching and dynamic expansion.
[0056] In this embodiment, the business metadata includes core business attributes such as function name, domain label and applicable role, and the extraction process of business metadata relies on natural language processing technology. Specifically, the original description document submitted by the service provider is received, such as the employee attendance inquiry service, which supports department heads to view the team attendance records, and the key entities, namely the function name, domain label and applicable role, are located through named entity recognition technology. The function name is such as attendance inquiry, the domain label is such as human resources, and the applicable role is such as supervisor. It can be understood that this process further uses dependency syntax analysis to establish logical associations, such as the supervisor performs attendance inquiry. For example, for the equipment repair service, the metadata function name: repair, and the applicable role: IT administrator are extracted, and the warranty and IT administrator are associated with example problems, such as the conference room projector cannot be turned on, please handle it.
[0057] It's important to note that metadata extraction is enabled by using a large language model-driven prompt word project. Specifically, a prompt template is designed, such as "You are an IT systems expert." From the list of office equipment troubleshooting reports that employees can submit, the function name and applicable roles are extracted. Three typical problem examples are generated and output in JSON format. The model returns structured data: {"Function Name": "Equipment Repair," "Applicable Roles": ["Employee"], "Example": ["How to Report a Computer Blue Screen Repair"]}. This ultimately generates a standardized JSON document structured with the fields service_name, tags, roles, and examples, forming a machine-parseable business semantic representation system.
[0058] Step 102: Encode the standardized service description document into a high-dimensional semantic vector through a pre-trained language model, and build a neighbor search index to store the high-dimensional semantic vector.
[0059] In this embodiment, the encoding process uses the semantic understanding capabilities of a pre-trained language model, such as Sentence-BERT. Specifically, the generated JSON document is input into the pre-trained language model, and a 384-dimensional semantic vector is output through the Transformer encoding layer within the pre-trained language model. For example, the distance between the vector of the attendance query service and the attendance statistics in the semantic space is much smaller than that of the equipment maintenance. It should be noted that the high-dimensional semantic vector captures the business essence of the service description. For example, the vector similarity between reimbursement approval and expense approval is higher than the similarity between reimbursement approval and salary accounting.
[0060] Based on the FAISS framework, a hierarchical structure for index construction is implemented. Specifically, vector data subsets are first divided according to business domains, such as HR / IT / Finance, and then a hierarchical navigable small world (HNSW) index shard is constructed for each subset. It is understandable that when user questions involve specific areas such as salary, the system gives priority to the human resources shard to perform retrieval, significantly narrowing the search scope. For example, the vector of IT equipment repair service is stored in the IT support shard, while the travel reimbursement service is stored in the financial management shard, which can ensure the isolation of business domains.
[0061] Step 103: Concatenate the user identity information obtained in real time and the current question text into an enhanced query statement, and encode the enhanced query statement into a context-aware dynamic query vector through a semantic model.
[0062] In one embodiment of the present application, in order to solve the problem that traditional intent recognition and query understanding methods are usually based only on classification and analysis of text input by the user, and do not fully integrate the user's contextual information, such as job responsibilities, operating permissions, device type, historical behavior, etc., resulting in misjudgment of intent in situations with similar semantics but different scenarios, affecting the accuracy of service matching, the present application proposes a context-aware dynamic query generation mechanism, which achieves semantic enhancement and personalized expression of the original query by introducing multi-dimensional user context features, thereby improving the accuracy of intent recognition and the relevance of service matching.
[0063] First, context information collection and query enhancement are performed. Specifically, user context features such as user identity information, device type used, and historical interaction behaviors are collected and integrated in real time. Among them, user identity information such as position, department, and authority level, device type used such as PC / mobile, and historical interaction behaviors such as frequently accessed services and recent operation records are collected and integrated in real time. Based on the integrated context features, the original natural language query is semantically expanded to generate an enhanced query statement with context identification. For example, the original query is to approve Zhang San's leave application, and the enhanced query is [Financial Director][HCM System][Mobile Terminal][Approve Zhang San's Leave Application].
[0064] Then, the enhanced query text is input into a semantic model, such as a pre-trained language model like BERT, so that the contextual features and the original semantic information are fused in the vector space to generate a dynamic query vector with context-aware capabilities for subsequent intent recognition and service matching.
[0065] In this embodiment, user identity information includes multi-dimensional features such as job role, permission level, device type, and historical interaction behavior. Specifically, real-time user login information is collected, such as job title: Finance Specialist, device identifier (e.g., Mobile-iOS), and behavior logs (e.g., frequently used expense services). It is understood that these multi-dimensional features are converted into an identifier prefix format, for example, encoding a Finance Specialist + mobile device + frequently used expense user as [Finance_Specialist][Mobile][Expense_Frequent].
[0066] The identifier prefix is concatenated with the original question text to form an enhanced query statement. For example, when the user inputs "processing travel reimbursement", a complete query "processing travel reimbursement" is generated, that is, the enhanced query statement [Finance_Specialist][Mobile][Expense_Frequent] with context identifier after encoding. Subsequently, joint encoding is performed through a pre-trained semantic model, such as BERT. The self-attention mechanism of the pre-trained semantic model dynamically weights the association strength between the context identifier and the question text. For example, [Expense_Frequent] makes the model pay more attention to the semantics of reimbursement. The final output dynamic query vector will carry scenario features. The same text review and approval generates a vector biased towards human resources process in the context of [HR_Manager], while a vector biased towards financial audit is generated in the context of [Finance_Auditor].
[0067] Step 104: Based on the dynamic query vector, similarity search is performed in the neighbor search index to obtain candidate intelligent services, and the candidate intelligent services are filtered by business domain, context-weighted sorted, and dynamically prioritized to output the final matching target recommended service.
[0068] In one embodiment of the present application, in order to solve the problem that traditional intelligent service matching methods usually use a single semantic similarity for sorting, lack comprehensive consideration of business rules, user context and dynamic usage behavior, resulting in insufficient adaptability of recommendation results in actual scenarios, affecting user experience and service call efficiency, the present application proposes a hybrid matching mechanism based on the combination of semantic retrieval and multi-dimensional weighted sorting to achieve full process optimization from preliminary matching to fine sorting.
[0069] First, a preliminary search and matching based on semantic vectors is performed. Using the generated dynamic query vector, a semantic similarity search is performed within the constructed service vector library, which incorporates business semantics, to obtain a list of candidate intelligent services that are initially matched. This stage primarily relies on semantic model calculations for cosine similarity and acceleration tools such as FAISS to screen for semantically similar services.
[0070] Next, a multi-layer filtering and weighted ranking mechanism is implemented. Based on the initial matching, a multi-level filtering and re-ranking strategy is employed, combining business rules and user context information. This evaluates the matching degree between the retrieved services and current needs from multiple business feature dimensions, further improving matching accuracy and personalization.
[0071] In the multi-layer filtering and re-ranking mechanism, a rough screening of the business domain is performed, i.e., preliminary filtering. Specifically, the first round of screening is based on the semantic similarity of the business domain, such as cosine similarity. Only services with a similarity above a set threshold, such as 0.7, are retained, and obviously irrelevant items are eliminated.
[0072] Afterward, context-weighted ranking is performed, i.e., personalized adjustment. Contextual factors are introduced to weight the matching score. For example, different weight coefficients can be assigned based on the user's job role, such as a Manager role weight multiplier of 1.2, to increase the score of services that are more closely aligned with the current user's role.
[0073] Furthermore, dynamic priority rearrangement, or comprehensive ranking, is required. Based on weighted rankings, the candidate intelligent services are further combined with dynamic indicators such as the service's historical call frequency and timeliness to perform a final ranking, prioritizing high-frequency, highly adaptable services.
[0074] In this embodiment, the search process first performs similarity matching using the constructed nearest neighbor search index. Specifically, the system calculates the cosine similarity between the dynamic query vector and the representative vectors of each business domain. For example, if a travel expense query has a higher similarity with the financial management domain than with the IT support domain, the target business domain sub-index is selected for in-depth search based on this similarity.
[0075] It should be noted that the preliminary candidate services need to undergo three levels of optimization. First, business domain filtering is performed to eliminate services whose similarity with the query vector is lower than the preset threshold. For example, equipment maintenance services are filtered out because of their large semantic differences with travel reimbursement. After that, context-weighted sorting is performed, and the scores are adjusted based on user roles. For example, the role of financial specialist increases the weight of expense reimbursement services, while the role of HR specialist increases the weight of attendance query services. In addition, dynamic priority re-arrangement is required to integrate real-time indicators, such as increasing the sorting priority when the frequency of service calls increases. For example, if the number of calls to the international travel reimbursement service has surged recently, even if its original similarity with the query is lower than that of domestic travel reimbursement, it can still be output at the top after dynamic weighting.
[0076] Step 105: By collecting the interactive behavior data of the target recommended service, the service description and the problem example are scored based on the preset evaluation rules, and the service description and the problem example whose quality score is lower than the quality threshold are automatically updated.
[0077] In one embodiment of the present application, in order to solve the problem that in traditional intelligent service systems, the update of service descriptions and examples mainly relies on manual maintenance, has long response cycles, high update costs, is difficult to adapt to actual usage scenarios, and lacks effective use of user behavior feedback, resulting in a deviation between service representation and actual user intentions, affecting the intelligence level of the system and user experience, the present application proposes an automatic optimization mechanism based on user behavior feedback, which dynamically evaluates the quality of service descriptions and problem examples by collecting user interaction data in real time, and thereby realizes adaptive optimization of intelligent service descriptions and examples.
[0078] Real-time collection and analysis of user behavior data. This data includes multi-dimensional user interaction behavior data, such as service selection behavior, service call results, call response time, user dwell time, and other performance indicators. Service selection behavior includes users clicking on non-top recommended services, and service call results, such as success / failure. This feedback information is used for subsequent service quality assessment and optimization decisions.
[0079] Define a feedback value function to quantitatively evaluate the quality of service descriptions and examples. Based on the collected user feedback data, build a comprehensive evaluation model to score based on the accuracy of service descriptions and the matching degree of service examples. Specifically, define two evaluation functions:
[0080] Service description accuracy = semantic similarity × weight coefficient + semantic consistency between examples × weight coefficient + other relevance indicators × weight coefficient. For example, intelligent service description accuracy = semantic similarity × 0.5 + semantic consistency between examples × 0.3 + other relevance indicators × 0.2.
[0081] It should be noted that semantic similarity refers to the similarity between the service description and the user's actual problem.
[0082] The matching degree of a question example = the similarity between the example and the user's question × weight coefficient + example diversity × weight coefficient + user click preference × weight coefficient. For example, the matching degree of a service example = semantic similarity between examples × 0.5 + example dimension diversity × 0.2 + user click preference × 0.2 + other relevance indicators × 0.1.
[0083] Finally, we implement automated optimization and updating of service descriptions and problem examples. Based on the evaluation results, service descriptions and examples with scores below the threshold are automatically optimized. This includes updating structural attributes such as service keywords, function labels, or applicable roles, replacing or supplementing example sentences with more representative ones, and generating new, high-quality service descriptions and problem examples based on semantic models.
[0084] For example, when the description accuracy of the travel reimbursement service consistently falls below a threshold due to frequent user inquiries about international reimbursements, automatic optimization is triggered. Specifically, new terms, such as "cross-border reimbursement," are extracted from high-frequency queries to replace old labels. Successful user questions are added as new question examples, such as "processing overseas conference reimbursement forms." Language models are then used to integrate new business features to generate descriptions, such as expanding the original travel reimbursement service to support reimbursement approval services for international travel.
[0085] The above is an embodiment of the method proposed in this application. Based on the same inventive concept, the embodiment of this application also provides an intention classification device based on vector retrieval and context perception, whose structure is as follows Figure 2 shown.
[0086] Figure 2 Schematic diagram of the internal structure of the intent classification device based on vector retrieval and context perception provided in the embodiment of the present application. Figure 2 As shown, the equipment includes:
[0087] at least one processor;
[0088] and, a memory communicatively coupled to the at least one processor;
[0089] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
[0090] Extract business metadata from the original description document of the intelligent service, associate the business metadata with corresponding typical problem examples, and generate a standardized service description document;
[0091] Encode the standardized service description document into a high-dimensional semantic vector using a pre-trained language model, and build a nearest neighbor search index to store the high-dimensional semantic vector.
[0092] The user identity information obtained in real time and the current question text are concatenated into an enhanced query statement, and the enhanced query statement is encoded into a context-aware dynamic query vector through a semantic model;
[0093] Based on the dynamic query vector, similarity retrieval is performed in the neighbor search index to obtain candidate intelligent services. The candidate intelligent services are then filtered by business domain, context-weighted sorted, and dynamically prioritized to output the final matching target recommended services.
[0094] By collecting the interactive behavior data of the target recommended service, the service description and problem examples are scored based on the preset evaluation rules, and the service descriptions and problem examples whose quality scores are lower than the quality threshold are automatically updated.
[0095] The present application also provides a non-volatile computer storage medium storing computer-executable instructions. When the computer-executable instructions are executed, they can:
[0096] Extract business metadata from the original description document of the intelligent service, associate the business metadata with corresponding typical problem examples, and generate a standardized service description document;
[0097] Encode the standardized service description document into a high-dimensional semantic vector using a pre-trained language model, and build a nearest neighbor search index to store the high-dimensional semantic vector.
[0098] The user identity information obtained in real time and the current question text are concatenated into an enhanced query statement, and the enhanced query statement is encoded into a context-aware dynamic query vector through a semantic model;
[0099] Based on the dynamic query vector, similarity retrieval is performed in the neighbor search index to obtain candidate intelligent services. The candidate intelligent services are then filtered by business domain, context-weighted sorted, and dynamically prioritized to output the final matching target recommended services.
[0100] By collecting the interactive behavior data of the target recommended service, the service description and problem examples are scored based on the preset evaluation rules, and the service descriptions and problem examples whose quality scores are lower than the quality threshold are automatically updated.
[0101] The various embodiments in this application are described in a progressive manner. Similar portions between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the device and medium embodiments are generally similar to the method embodiments, so their descriptions are relatively simple. For relevant portions, refer to the descriptions of the method embodiments.
[0102] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects to their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0103] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0104] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0105] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0106] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0107] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0108] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0109] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can be implemented using any method or technology for information storage. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change RAM (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.
[0110] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0111] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. The intent classification method based on vector retrieval and context awareness is characterized by: The method comprises: Extracting business metadata from the original description document of the intelligent service, and associating the business metadata with corresponding typical problem examples to generate a standardized service description document; Encoding the standardized service description document into a high-dimensional semantic vector through a pre-trained language model, and constructing a neighbor search index to store the high-dimensional semantic vector; The user identity information obtained in real time and the current question text are concatenated into an enhanced query statement, and the enhanced query statement is encoded into a context-aware dynamic query vector through a semantic model; Based on the dynamic query vector, similarity retrieval is performed in the neighbor search index to obtain candidate intelligent services, and the candidate intelligent services are filtered by business domains, context-weighted sorted, and dynamically prioritized to output the final matching target recommended services; By collecting the interactive behavior data of the target recommended service, the service description and problem examples are scored based on the preset evaluation rules, and the service description and problem examples whose quality scores are lower than the quality threshold are automatically updated; By collecting the interactive behavior data of the target recommended service, the service description and problem examples are scored based on the preset evaluation rules, and the service description and problem examples whose quality scores are below the quality threshold are automatically updated, specifically including: Real-time collection of user interaction behavior data for the target recommended service; the interaction behavior data includes: service selection behavior, service call results, call response time, and user stay time; Based on the interaction behavior data, calculating a first weighted sum of semantic similarity between the service description and the user question, semantic consistency between examples, and other correlation indicators, and calculating a second weighted sum of semantic similarity between examples, example diversity, and user click preference; Determining a quality score between the service description and the problem example based on the first weighted sum and the second weighted sum, and updating a function label in the service description and a new problem example based on the interaction behavior data if the quality score is lower than a quality threshold; The user identity information acquired in real time and the current question text are concatenated into an enhanced query statement, and the enhanced query statement is encoded into a context-aware dynamic query vector through a semantic model, specifically including: Collect user identity information, device type, and historical interaction behaviors in real time, and use the user identity information, device type, and historical interaction behaviors as context features; Converting the context feature into an identification prefix, and concatenating the identification prefix with the current question text to generate an enhanced query statement with the context identification; Inputting the enhanced query statement into a pre-trained semantic model to perform joint semantic encoding on the enhanced query statement and output a dynamic query vector that integrates context features; The candidate intelligent services are filtered by business domain, context-weighted sorted, and dynamically prioritized to output the final matching target recommended services, including: Based on the cosine similarity of the business domain, candidate intelligent services with similarity higher than a preset threshold are screened from the semantic vector library, and the matching scores of the candidate intelligent services are weighted and adjusted according to the user's job role; Combined with the dynamic indicators of the candidate intelligent services, the weighted candidate intelligent services are finally sorted to determine the final matching target recommended service; the dynamic indicators include historical call frequency and timeliness indicators.
2. The intent classification method based on vector retrieval and context awareness according to claim 1 is characterized in that: Extract business metadata from the original description document of the intelligent service and associate the business metadata with corresponding typical problem examples to generate a standardized service description document, including: Receive an original description document of the intelligent service, and use named entity recognition technology to extract the function name, domain label, and applicable role of the intelligent service from the original description document; Based on dependency syntax analysis, logical relationships between business metadata are established, and the business metadata, the logical relationships and typical problem examples are combined into a JSON format document to generate a standardized service description document.
3. The intent classification method based on vector retrieval and context awareness according to claim 2 is characterized in that: Extract the function name, domain label, and applicable role of the intelligent service from the original description document, specifically including: The original service description in the original description document is parsed through a prompt word project driven by a large language model to generate structured metadata including function labels, applicable roles, and business rules; Based on a prompt template, the large language model is guided to output typical question examples in JSON format; the prompt template is a prompt template with zero samples or a small number of samples less than a specified number.
4. The intent classification method based on vector retrieval and context awareness according to claim 1 is characterized in that: Based on the cosine similarity of the business domain, candidate intelligent services with similarity higher than a preset threshold are screened from the semantic vector library, including: Calculate the cosine similarity between the user question and each business domain, and determine the business domain corresponding to the user question based on the cosine similarity; The semantic vector library is divided into multiple sub-indexes according to the business domain, and according to the business domain corresponding to the user question, a search is performed in the sub-index corresponding to the business domain to determine the candidate intelligent service corresponding to the user question.
5. The intent classification method based on vector retrieval and context awareness according to claim 1 is characterized in that: Encoding the standardized service description document into a high-dimensional semantic vector using a pre-trained language model and constructing a neighbor search index to store the high-dimensional semantic vector, specifically including: Using a pre-trained language model, the standardized service description document is encoded into a 384-dimensional semantic vector, and a hierarchical index structure is constructed based on the FAISS framework; The 384-dimensional semantic vector is stored in the hierarchical index structure, and the index slices are divided according to the service business domain.
6. Intent classification device based on vector retrieval and context awareness, characterized by: The device comprises: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the intent classification method based on vector retrieval and context perception as described in any one of claims 1-5.
7. A non-volatile computer storage medium storing computer-executable instructions, characterized in that: When the computer-executable instructions are executed, the intent classification method based on vector retrieval and context perception as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method, system and equipment for generating SQL (Structured Query Language) statement based on large model
CN119127913A
Archive information resource intelligent sharing method and system based on AI
CN119149704A
Enterprise knowledge base query method based on large language model
CN119719345A
Knowledge base generation and retrieval method based on RAG technology and intelligent question answering system
CN120045653A