A case matching method, device, equipment and storage medium
Patent Information
- Application Number
- CN202611114898.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-27
- Publication Date
- 2026-08-21
AI Technical Summary
[0004]但上述传统方案均存在明显不足:基于平面向量相似度或浅层标签加权的方式,无法解析问题文本中隐含的因果、约束与期望目标等语义结构,也无法建模案例适用前提与问题现状之间的逻辑满足关系,导致匹配结果表面相关但实际不可行,精准度难以满足复杂业务场景需求
本申请通过对问题描述文本进行语义解析生成问题语义图,以及对案例库中每个案例进行语义解析生成案例语义图,将非结构化的自然语言文本转化为包含实体节点、关系边和约束信息的图结构数据,使得问题描述中隐含的因果关联、约束条件和期望目标能够显式表达,克服了现有技术中平面向量化导致语义结构丢失的缺陷;在此基础上,通过计算问题语义图与案例语义图之间的匹配度,使案例匹配过程能够利用图结构中包含的实体关联关系和约束信息进行综合度量,解决了现有技术中仅依赖平面相似度或浅层标签加权而无法判断案例前提是否符合问题约束要求的弊端,从而提高了案例匹配结果在实际业务场景中的可行性;并且,通过将匹配度由高到低排序后的前N个案例作为候选案例并向用户推荐,使得案例匹配结果能够以有序列表的形式直接呈现给用户,减少了用户从海量案例中逐一筛选比对的人工成本,提高了案例复用的效率。
Smart Images

Figure CN122615033A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of case matching technology, and in particular to a case matching method, apparatus, device and storage medium. Background Technology
[0002] In the field of enterprise management consulting and digital solutions, service providers have accumulated a vast number of case studies, often in unstructured text format. When facing operational challenges, companies often describe their predicaments in natural language, hoping to quickly find reusable past success stories. However, these problem descriptions are often vague, intertwined, and contain multiple layers of constraints, such as improving inventory turnover without increasing logistics costs. Meanwhile, existing case studies describe the specific scenarios, preconditions, and implementation paths of past services. Automatically capturing these deep-seated compatibility relationships from a massive database of cases has become a bottleneck in improving case reuse efficiency.
[0003] Traditionally, case matching relies primarily on manual screening by experts based on experience, or recommendations based on keyword searches and document similarity calculations. A typical approach involves vectorizing the company's problem description and the case text separately, calculating cosine similarity, and then ranking and outputting the results. Some improved solutions incorporate structured tags such as industry and size for weighted scoring.
[0004] However, the above traditional solutions all have obvious shortcomings: based on planar vector similarity or shallow label weighting, they cannot parse the semantic structure of cause and effect, constraints and expected goals hidden in the problem text, nor can they model the logical satisfaction relationship between the applicable premise of the case and the current situation of the problem, resulting in matching results that are superficially relevant but actually infeasible, and the accuracy is difficult to meet the needs of complex business scenarios. Summary of the Invention
[0005] This application provides a case matching method, apparatus, device, and storage medium that can accurately match historical cases that are suitable for the user's problem description.
[0006] To achieve the above objectives, this application adopts the following technical solution: Firstly, this application provides a case matching method, including: Obtain the user's question description text; Semantic parsing is performed on the problem description text to obtain a problem semantic graph; semantic parsing is performed on each case in the case library to obtain a case semantic graph for each case; Calculate the matching degree between the problem semantic graph and the case semantic graph; The top N cases, sorted by matching degree from high to low, are selected as candidate cases. Recommend candidate cases to the user.
[0007] Optionally, the calculation of the matching degree between the problem semantic graph and the case semantic graph includes: Calculate the node semantic sub-matching degree between the problem semantic graph and the case semantic graph in the node dimension; calculate the relation semantic sub-matching degree between the problem semantic graph and the case semantic graph in the relation dimension; calculate the constraint semantic sub-matching degree between the problem semantic graph and the case semantic graph in the constraint dimension; calculate the target semantic sub-matching degree between the problem semantic graph and the case semantic graph in the target dimension. The matching degree between the problem semantic graph and the case semantic graph is obtained by weighted summing of the node semantic sub-matching degree, the relation semantic sub-matching degree, the constraint semantic sub-matching degree, and the target semantic sub-matching degree.
[0008] Optionally, the calculation of the node semantic sub-matching degree between the problem semantic graph and the case semantic graph at the node dimension includes: Determine the encoding of problem entities in the problem semantic graph and the encoding of case entities in the case semantic graph; Calculate the cosine similarity between the code of each question entity and the code of each case entity; The semantic sub-matching degree of a node is determined based on the cosine similarity between the encoding of each question entity and the encoding of each case entity.
[0009] Optionally, the calculation of the relational semantic sub-matching degree between the problem semantic graph and the case semantic graph in the relational dimension includes: Determine the encoding and type of problem edges in the problem semantic graph and the encoding and type of case edges in the case semantic graph; The semantic sub-matching degree of the relation is determined based on the cosine similarity between the encoding of the problem edge and the encoding of the case edge, as well as the consistency between the types of the problem edge and the types of the case edge.
[0010] Optionally, the calculation of the constraint semantic sub-matching degree between the problem semantic graph and the case semantic graph in the constraint dimension includes: Determine the problem constraints in the problem semantic graph and the case constraints in the case semantic graph; The semantic sub-matching degree of the constraints is determined based on the ratio of satisfaction between the problem constraints and the case constraints.
[0011] Optionally, the calculation of the target semantic sub-matching degree between the problem semantic graph and the case semantic graph in the target dimension includes: Determine the encoding of problem targets in the problem semantic map and the encoding of case targets in the case semantic map; The target semantic sub-matching degree is determined based on the cosine similarity between the encoding of the problem target and the encoding of the case target.
[0012] Optionally, the method further includes: Determine the reasons for recommending each candidate case; The reasons for recommending each candidate case are presented.
[0013] Secondly, this application provides a case matching device, comprising: The acquisition module is used to acquire the question description text input by the user; The processing module is used to perform semantic parsing on the problem description text to obtain a problem semantic graph; perform semantic parsing on each case in the case library to obtain a case semantic graph for each case; calculate the matching degree between the problem semantic graph and the case semantic graph; and select the top N cases with matching degrees sorted from high to low as candidate cases. The recommendation module is used to recommend candidate cases to the user.
[0014] Thirdly, this application provides a computing device, including a memory and a processor; The memory stores one or more computer programs, the one or more computer programs including instructions; when the instructions are executed by the processor, the computing device performs the method as described in any one of the first aspects.
[0015] Fourthly, this application provides a computer-readable storage medium for storing a computer program for performing the method as described in any one of the first aspects.
[0016] As can be seen from the above technical solution, this application has at least the following beneficial effects: This application generates a problem semantic graph by semantically parsing the problem description text and a case semantic graph by semantically parsing each case in the case library. This transforms unstructured natural language text into graph-structured data containing entity nodes, relational edges, and constraint information, enabling explicit expression of the causal relationships, constraints, and expected goals implicit in the problem description. This overcomes the defect of semantic structure loss caused by planar vectorization in existing technologies. Furthermore, by calculating the matching degree between the problem semantic graph and the case semantic graph, the case matching process can utilize the entity relationships and constraint information contained in the graph structure for comprehensive measurement. This solves the drawback of existing technologies that rely solely on planar similarity or shallow label weighting, which cannot determine whether the case premise meets the problem constraints, thus improving the feasibility of case matching results in real-world business scenarios. Moreover, by recommending the top N cases (ranked from highest to lowest matching degree) as candidate cases to the user, the case matching results can be directly presented to the user in an ordered list, reducing the manual cost of manually comparing massive amounts of cases and improving the efficiency of case reuse.
[0017] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description
[0018] Figure 1 A schematic diagram illustrating an application scenario provided in an embodiment of this application; Figure 2 A flowchart illustrating a case matching method provided in this application embodiment; Figure 3 A schematic diagram of a case matching device provided in an embodiment of this application; Figure 4 This is a schematic diagram of a computing device provided in an embodiment of this application. Detailed Implementation
[0019] The terms "first," "second," and "third," etc., used in this application specification and accompanying drawings are used to distinguish different objects, not to limit a specific order.
[0020] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0021] To ensure clarity and conciseness in the description of the following embodiments, a brief introduction to the related technologies is given first: In the field of enterprise management consulting and digital solutions, descriptions of the operational challenges faced by enterprises often exhibit highly natural language characteristics. Their expressions are diverse and their semantic structures complex, frequently weaving together current situations, constraints, expected goals, and causal relationships within a single text. Simultaneously, historical case studies in case libraries also exist in unstructured text form, recording the specific business scenarios, implementation prerequisites, action paths, and actual results of past services. During case matching, it is necessary not only to identify whether the problem description and case text are conceptually related, but also to determine whether the implementation prerequisites of the case meet the constraints of the current problem situation and whether the implementation path of the case can achieve the expected goals of the problem.
[0022] However, existing case matching methods, whether based on keyword retrieval, document vector similarity calculation, or weighted scoring by integrating structured tags, all treat problem descriptions and case texts as flat bags of words or vectors. This approach can only capture surface-level co-occurrence information between texts, making it difficult to analyze the causal chains, constraint boundaries, and target orientations implicit in the problem descriptions from a semantic level. It also lacks the ability to model the logical implications between case preconditions and problem constraints, resulting in matching results that often remain at the level of conceptual relevance but logical inconsistency, failing to guarantee the feasibility of cases in real-world application scenarios.
[0023] In view of this, embodiments of this application provide a case matching method, which can be executed by a processing device. The processing device can be a terminal or a server. Terminals include, but are not limited to, smartphones, tablets, laptops, personal digital assistants, or smart wearable devices. The server can be a cloud server, such as a central server in a central cloud computing cluster or an edge server in an edge cloud computing cluster. Alternatively, the server can be a server in a local data center. A local data center refers to a data center directly controlled by the user.
[0024] To address the challenges of effectively expressing the multi-layered semantic structures of cause and effect, constraints, and objectives implicit in enterprise problem descriptions using traditional planar vectorization methods, and the difficulty in modeling the logical satisfaction relationship between the applicable premises of a case and the current state of the problem using conventional similarity calculations, this paper parses the problem description text and case text from unstructured form into structured semantic graphs. The graph structure carries entity nodes, relation edges, and constraint information, making the implicit semantic structures and logical relationships explicit. Then, the matching degree of the problem semantic graph and the case semantic graph is calculated, thereby transforming the problem of understanding natural language into a structured matching problem between graphs, achieving a leap from surface text relevance to deep logical adaptation.
[0025] To make the technical solution of this application clearer and easier to understand, the application scenarios of the technical solution of this application are described below with reference to the accompanying drawings. Figure 1 As shown in the figure, this figure is a schematic diagram of an application scenario provided by an embodiment of this application.
[0026] In this application scenario, the processing device acquires the problem description text input by the user through the human-computer interaction interface; performs semantic parsing on the problem description text to obtain a problem semantic graph; and performs semantic parsing on each case in the case library to obtain a case semantic graph for each case; then, it calculates the matching degree between the problem semantic graph and each case semantic graph, sorts them from high to low according to the matching degree, and recommends the top N cases as candidate cases to the user.
[0027] To further illustrate the application of the case matching method provided in this application embodiment in business scenarios, a specific example is given below.
[0028] Suppose a service provider has accumulated a large number of historical consulting cases covering multiple business areas such as supply chain optimization, cost control, and marketing growth. When multiple enterprise users input their respective problem descriptions, for example, problem description text 1 is "Inventory turnover rate is low, and we hope to improve it without increasing warehousing costs," problem description text 2 is "Online sales growth is slowing down, and we need to improve conversion rates without increasing marketing budgets," and problem description text 3 is "Supplier delivery on-time rate is insufficient, and we need to improve it but cannot change the existing supplier system," the processing device performs semantic analysis on each problem description text, generating its own problem semantic graph. Based on this, the processing device calculates the matching degree between the case semantic graphs of all cases in the case library and the semantic graphs of each problem, thereby constructing a panoramic scenario map.
[0029] In this scenario map, each problem semantic graph serves as a location node, with clearly defined business dimension boundaries and constraint boundaries. Each case semantic graph is located in its corresponding position within the map based on its matching degree with each problem semantic graph. This many-to-many correspondence manifests as follows: problem description text 1 may simultaneously match case 1, case 2, and case 3; problem description text 2 matches case 5 and case 6; and case 3 is matched by both problem description text 1 and problem description text 4. Through the construction of this panoramic map, service providers can gain a holistic understanding of the distribution of all existing cases across different problem description text scenarios, identifying which problem description text types have sufficient case support and which have case gaps, thus providing a basis for supplementing the case library and managing knowledge.
[0030] To make the technical solution of this application clearer and easier to understand, the following describes a case matching method provided by an embodiment of this application, in conjunction with the above application scenarios. For example... Figure 2As shown, this figure is a flowchart of a case matching method provided in an embodiment of this application. In this embodiment, the method includes: S201, The processing device obtains the problem description text input by the user.
[0031] Problem description text refers to a user's written description of their current business situation, challenges, constraints, and expected goals in natural language. This problem description text includes information such as the current situation statement, constraint boundaries, and expected goals.
[0032] Users enter their company's current business problems in natural language through the human-computer interaction interface (such as a web page input box or application input window) on the processing device. The entered content is the problem description text; the human-computer interaction interface sends the problem description text entered by the user to the processing device.
[0033] S202. The processing device performs semantic parsing on the problem description text to obtain a problem semantic graph; it also performs semantic parsing on each case in the case library to obtain a case semantic graph for each case.
[0034] A problem semantic graph is the semantic parsing result of a problem description text represented by a graph data structure. This graph contains nodes and edges; nodes represent entities in the problem description text, and edges represent semantic relationships between entities. For example, for the problem description text "A retail company wants to increase its inventory turnover rate while controlling logistics costs," the entities in the problem semantic graph include "inventory turnover rate" and "logistics costs," and the semantic relationships include "increase" pointing to "inventory turnover rate" and "control" pointing to "logistics costs."
[0035] A case semantic graph refers to the semantic parsing result of a single case text represented by a graph data structure. This case semantic graph contains nodes and edges; nodes represent entities in the case text, and edges represent semantic relationships between entities. For example, for the case text "By deploying an intelligent replenishment system, this retail company increased its inventory turnover rate by 15% and reduced its logistics costs by 1.2%", the entities in the case semantic graph include "intelligent replenishment system", "inventory turnover rate", and "logistics costs". The semantic relationships include "deploy" pointing to "intelligent replenishment system", "increase" pointing to "inventory turnover rate", and "decrease" pointing to "logistics costs".
[0036] The processing device uses natural language processing (NLP) technology to perform semantic analysis on the acquired problem description text, identifying the entities in the text and their semantic relationships, and constructing a problem semantic graph from the analysis results. The problem semantic graph transforms the unstructured problem description text, originally existing in natural language form, into structured graph data. Nodes in the graph correspond to entities in the problem description text, and edges correspond to the semantic relationships between entities, thus presenting the implicit causal relationships, constraints, and expected goals in the problem description text in an explicit structure.
[0037] The processing device performs semantic parsing on each case text stored in the case library, identifying the entities in each case text and the semantic relationships between them, and constructing a case semantic graph for each case based on the parsing results. The case semantic graph transforms the unstructured case text, which originally existed in the form of natural language, into structured graph data. In the graph, nodes correspond to entities in the case text, and edges correspond to the semantic relationships between entities in the case text.
[0038] S203, the degree of matching between the semantic graph of the processing device computation problem and the semantic graph of the case.
[0039] Before calculating the matching degree, the processing device first calculates the granularity of the problem semantic graph and the case semantic graph. Granularity is quantified by the number of core entities in the semantic graph. A core entity is an entity node that is directly connected to the problem target node or the case target node; a direct connection means that there is a relationship edge between the two. The fewer the number of core entities, the more focused the problem or case is, and the finer the granularity; the more core entities, the broader the coverage of the problem or case is, and the coarser the granularity. For example, the problem description text "Inventory turnover rate is low, and we hope to improve it without increasing warehousing costs" has the target node "Inventory turnover rate improvement". The entities directly connected to the target node are "Inventory turnover rate" and "warehousing cost", so the number of core entities is 2, which is fine-grained. The case text "Supply chain optimization of a large manufacturing enterprise" has the target node "Overall supply chain efficiency improvement". The entities directly connected to the target node are "Procurement cost", "Production cycle time", "Warehouse utilization rate", "Logistics delivery timeliness", "Inventory turnover rate" and "Sales forecast accuracy rate", so the number of core entities is 6, which is coarse-grained.
[0040] The acceptable range for granularity differences is set as follows: when the number of core entities in a case does not exceed 1.5 times the number of core entities in the problem, it is considered to have similar granularity and directly participates in the matching degree calculation. When the number of core entities in a case exceeds 1.5 times the number of core entities in the problem, it is considered too coarse-grained and requires decomposition of the case semantic graph before it can participate in matching. Using the above example, the number of core entities in the problem is 2, and the acceptable range is that the number of core entities in the case is less than or equal to 3. Therefore, cases with 3 or fewer core entities directly participate in the matching degree calculation. However, the end-to-end optimization case with 6 core entities exceeds the 1.5 times threshold, triggering the decomposition process.
[0041] The specific decomposition method is as follows: The processing device uses the problem target node in the problem semantic graph as a guide, locates the semantically closest case target node in the case semantic graph, and expands outward along the relational edges from this case target node. Only entities and relational edges that semantically overlap or are directly related to the core entity of the problem are retained, and a focused subgraph is extracted as a subcase. This subcase participates in the matching degree calculation. Other entities unrelated to the problem are temporarily set aside and do not participate in this matching. Taking the fine-grained problem of end-to-end optimization case matching as an example, the case semantic graph contains six entities connected to the case target node: "warehouse utilization rate," "inventory turnover rate," "logistics delivery timeliness," "procurement cost," "production cycle time," and "sales forecast accuracy." The processing device, guided by the problem target node "inventory turnover rate improvement," locates the semantically closest node, "inventory turnover rate," in the case semantic graph. Expanding along the relationship edges, it retains "warehouse utilization rate" and "logistics delivery timeliness," two entities directly related to the core problem entity "warehouse cost," and extracts a subgraph containing only the three core entities: "inventory turnover rate," "warehouse utilization rate," and "logistics delivery timeliness," as a sub-case. At this point, the sub-case has three core entities, which is 1.5 times the number of core entities in the problem (2), falling within an acceptable range. This sub-case participates in the matching degree calculation. Other entities unrelated to the problem, such as "procurement cost," "production cycle time," and "sales forecast accuracy," are temporarily shelved and do not participate in this matching.
[0042] By combining the aforementioned quantitative threshold with goal-oriented decomposition, the determination and adjustment of granularity have a clear calculation basis, avoiding the uncertainty brought about by subjective judgment, while also ensuring that local information highly relevant to the problem in coarse-grained cases can be effectively utilized.
[0043] In some embodiments, the matching degree between the problem semantic graph and the case semantic graph is obtained in the following way: The processing device calculates the node semantic sub-matching degree between the problem semantic graph and the case semantic graph in the node dimension, the relational semantic sub-matching degree between the problem semantic graph and the case semantic graph in the relation dimension, the constraint semantic sub-matching degree between the problem semantic graph and the case semantic graph in the constraint dimension, and the target semantic sub-matching degree between the problem semantic graph and the case semantic graph in the target dimension. The node semantic sub-matching degree, relational semantic sub-matching degree, constraint semantic sub-matching degree and target semantic sub-matching degree are weighted and summed to obtain the matching degree between the problem semantic graph and the case semantic graph.
[0044] Node semantic sub-matching degree refers to the numerical value that measures the semantic similarity between entity nodes in the problem semantic graph and entity nodes in the case semantic graph. Relational semantic sub-matching degree refers to the numerical value that measures the semantic similarity between semantic relations in the problem semantic graph and semantic relations in the case semantic graph. Constraint semantic sub-matching degree refers to the numerical value that measures the degree to which constraints in the problem semantic graph are satisfied by factual information in the case semantic graph. Goal semantic sub-matching degree refers to the numerical value that measures the semantic similarity between the global goal in the problem semantic graph and the result information in the case semantic graph. The matching degree is a weighted sum of the four sub-matching degrees, used to characterize the overall fit between the problem semantic graph and the case semantic graph.
[0045] The semantic sub-matching degree of a node is obtained in the following way: The processing device determines the encoding of the problem entity in the problem semantic graph and the encoding of the case entity in the case semantic graph; calculates the cosine similarity between the encoding of each problem entity and the encoding of each case entity; and determines the semantic sub-matching degree of the node based on the cosine similarity between the encoding of each problem entity and the encoding of each case entity.
[0046] Problem entities refer to nodes in the problem semantic graph that represent core concepts or business metrics. Case entities refer to nodes in the case semantic graph that represent core concepts or business metrics. Encoding refers to converting textual entities into numerical vector representations using a semantic encoding model.
[0047] The processing device inputs each problem entity in the problem semantic graph into the semantic coding model to obtain the code corresponding to each problem entity; it also inputs each case entity in the case semantic graph into the semantic coding model to obtain the code corresponding to each case entity. The processing device iterates through all combinations of problem entities and case entities, calculating the cosine similarity between the code of each problem entity and the code of each case entity. For each problem entity, the maximum value among the cosine similarities between that problem entity and all case entities is taken as the best matching similarity for that problem entity. The sum of the best matching similarities of all problem entities is divided by the number of problem entities, and the result is used as the node semantic sub-matching degree. The node semantic sub-matching degree ranges from [0,1], where a larger value indicates a higher degree of semantic overlap between the problem description and the case at the core entity level.
[0048] The expression for the semantic sub-match degree of a node is:
[0049] in, Indicates the semantic sub-matching degree of the node. This represents the set of all problem entities in the problem semantic graph. This indicates the number of problem entities in the set. The first one in the semantic graph of the problem One problem entity, The first case in the semantic graph Individual case entities, This represents the set of all case entities in the case semantic graph. Indicates the first Problem entities The encoding, Indicates the first Individual Case Entities The encoding, Represents the cosine similarity function. This indicates taking the maximum value.
[0050] The semantic sub-matching degree of the relation is obtained in the following way: The processing device determines the encoding and type of problem edges in the problem semantic graph and the encoding and type of case edges in the case semantic graph; based on the cosine similarity between the encoding of problem edges and the encoding of case edges, and the consistency between the type of problem edges and the type of case edges, it determines the semantic sub-matching degree of the relation.
[0051] A problem edge is an edge in a problem semantic graph that connects two problem entities and represents the semantic relationship between them. A case edge is an edge in a case semantic graph that connects two case entities and represents the semantic relationship between them. The type refers to the category of the semantic relationship represented by the edge, including but not limited to promotion, demotion, control, maintenance, deployment, and constraint.
[0052] The processing device inputs each problem edge in the problem semantic graph into the semantic coding model to obtain the code corresponding to each problem edge and extracts the type of each problem edge label. Similarly, it inputs each case edge in the case semantic graph into the semantic coding model to obtain the code corresponding to each case edge and extracts the type of each case edge label. The processing device iterates through all combinations of problem edges and case edges, calculating the cosine similarity between the code of each problem edge and the code of each case edge, and determining whether the type of each problem edge matches the type of each case edge. For each problem edge, the highest cosine similarity value among all case edges with the same type is taken as the best matching similarity for that problem edge. The sum of the best matching similarities of all problem edges is divided by the number of problem edges, and the result is used as the relational semantic sub-matching degree. The value range of the relational semantic sub-matching degree is [0,1], where a larger value indicates a higher degree of matching between the problem description and the case at the semantic relation level.
[0053] The expression for the semantic sub-match degree of the relation is:
[0054] in, Indicates the semantic sub-matching degree of the relation; This represents the set of all problem edges in the problem semantic graph; This indicates the number of problem edges in the set; This represents the set of all case edges in the case semantic graph; The first one in the semantic graph of the problem Problem edge; The first case in the semantic graph Case edge; Indicates the first Problem side The encoding; Indicates the first Case side The encoding; Indicates the first Problem edge Type; Indicates the first Case side Type; Indicates an indicator function, when and The value is 1 when they are the same, and 0.5 when they are different.
[0055] The constraint semantic sub-matching degree is obtained in the following way: The processing device determines the problem constraints in the problem semantic graph and the case constraints in the case semantic graph; based on the satisfaction ratio of the problem constraints and the case constraints, it determines the constraint semantic sub-matching degree.
[0056] Problem constraints refer to nodes or attributes in a problem semantic graph that represent the restrictive conditions set by users for business metrics. These restrictions include limitations on the direction of metric changes or limitations on the range of metric values. Case constraints refer to nodes or attributes in a case semantic graph that represent the preconditions, implementation actions, and final results recorded in a case. This includes the environmental settings that existed before the case was implemented, the operational path during the implementation process, and the quantitative or qualitative results finally achieved by the case.
[0057] The processing device extracts all problem constraints from the problem semantic graph and all case constraints from the case semantic graph. It then logically compares each problem constraint with each case constraint to determine if the problem constraint is satisfied by the case constraint. For example, a problem constraint of "logistics cost not higher than the current value" indicates that the user requires logistics costs to not exceed the current level. If a case constraint includes "logistics cost decreases by 1.2%", this constraint indicates that the logistics cost will be lower after implementation compared to before implementation. Since the reduced logistics cost will inevitably be lower than the current level, this constraint is considered satisfied. Similarly, a problem constraint of "spot fulfillment rate not lower than 95%" indicates that the user requires the spot fulfillment rate to be maintained at least 95%. If a case constraint includes "spot fulfillment rate remains unchanged at 98%", this constraint indicates that the spot fulfillment rate will remain at 98% after implementation. Since 98% is higher than 95%, this constraint is considered satisfied. The processing device counts the number of constraints satisfied by case constraints across all problem constraints, divides this number by the total number of problem constraints, and uses the result as the constraint semantic sub-matching degree. The range of the constraint semantic sub-match degree is [0,1]. The larger the value, the higher the degree to which the case constraint satisfies the problem constraint.
[0058] The expression for the constraint semantic sub-match degree is:
[0059] in, Indicates the degree of semantic sub-matching of constraints; This represents the set of all problem constraints in the problem semantic graph; This indicates the number of problem constraints in the set; Represents any problem constraint in the problem semantic graph; This represents the set of all case constraints in the case semantic graph; express Logically implies or satisfies the problem constraints ; This indicates the number of constraints that are satisfied by the case constraints among all problem constraints.
[0060] The target semantic sub-match degree is obtained in the following way: The processing device determines the encoding of the problem target in the problem semantic graph and the encoding of the case target in the case semantic graph; based on the cosine similarity between the encoding of the problem target and the encoding of the case target, it determines the target semantic sub-matching degree.
[0061] In a problem semantic graph, a problem goal refers to a node that represents the user's desired ultimate objective or the desired state. A case goal refers to a node in a case semantic graph that represents the final result achieved by the case or the state realized after the case is implemented.
[0062] The processing device inputs the problem target from the problem semantic graph into the semantic coding model to obtain the code of the problem target; it also inputs the case target from the case semantic graph into the semantic coding model to obtain the code of the case target. The processing device calculates the cosine similarity between the codes of the problem target and the codes of the case target, and uses the calculation result as the target semantic sub-matching degree. The target semantic sub-matching degree takes the value range of [0,1]. The larger the value, the higher the semantic matching degree between the goal expected to be achieved by the problem description and the actual result achieved by the case.
[0063] The expression for the target semantic sub-match degree is:
[0064] in, Indicates the target semantic sub-match degree; Represent the problem objective in the problem semantic graph; This represents the case objective in the case semantic graph; Indicate the problem objective The encoding; Indicate the case objective The encoding.
[0065] The processing device multiplies the four sub-matching degrees—node semantic sub-matching degree, relation semantic sub-matching degree, constraint semantic sub-matching degree, and target semantic sub-matching degree—by their respective weight coefficients, and then sums the four products. The sum is taken as the matching degree between the problem semantic graph and the case semantic graph. The matching degree reflects the comprehensive fit between the problem description and the case in the four dimensions of entities, relations, constraints, and targets.
[0066] The expression for the matching degree is:
[0067] in, Indicates the degree of matching; Indicates the semantic sub-matching degree of a node; Indicates the semantic sub-matching degree of the relation; Indicates the degree of semantic sub-matching of constraints; Indicates the target semantic sub-match degree; This represents the weight coefficient corresponding to the semantic sub-match degree of a node; This represents the weight coefficient corresponding to the semantic sub-match degree of the relation; This represents the weight coefficient corresponding to the semantic sub-match degree of the constraint; This represents the weight coefficient corresponding to the target semantic sub-match degree.
[0068] In some examples, .
[0069] S204. The processing device selects the top N cases with matching degree from high to low as candidate cases.
[0070] Candidate cases refer to cases selected from the case library that have a high degree of relevance and are prepared to be recommended to users.
[0071] After calculating the matching degree between the semantic graph of each case and the semantic graph of the problem in the case library, the processing device sorts all cases in descending order of matching degree and selects the top N cases as candidate cases. The candidate cases are the N cases in the case library that have the highest overall fit with the problem description.
[0072] S205. The processing equipment recommends candidate cases to the user.
[0073] The processing device organizes the selected candidate cases in descending order of matching degree, and generates recommendation results in readable text format, including case names and case summaries. These candidate cases are then displayed to the user in a list or card format through the device's user interface. Users can view the matching degree ranking and case summary information for each candidate case on the interface. Candidate cases are the matching results provided to the user based on the matching degree ranking determined by the processing device. By browsing the candidate cases displayed on the user interface, users can identify the historical cases that best match their problem description.
[0074] The method also includes: The processing device determines the reasons for recommending each candidate case; and displays the reasons for recommending each candidate case.
[0075] After identifying candidate cases, the processing device extracts scores for each case across four dimensions: node semantic sub-matching degree, relational semantic sub-matching degree, constraint semantic sub-matching degree, and target semantic sub-matching degree. The device compares the scores of these four sub-matching degrees, identifying the dimension corresponding to the highest-scoring sub-matching degree as the case's strength dimension and the dimension corresponding to the lowest-scoring sub-matching degree as the case's weakness dimension or dimension requiring attention. Based on the determination of the strength and weakness dimensions, the device generates descriptive text using a pre-defined text template. For example, if the constraint semantic sub-matching degree score is the highest, it generates "This case performs well in constraint satisfaction and meets all the restrictions you proposed" as part of the recommendation reason; if the node semantic sub-matching degree score is the lowest, it generates "This case has some deviation in core entity matching; it is recommended to make a judgment based on the specific content" as part of the recommendation reason. The processing device displays the recommendation reasons for each candidate case to the user through a human-computer interaction interface along with the corresponding candidate case. By reading the recommendation reasons, users can learn which dimensions each candidate case performs well and which dimensions it performs poorly on. This allows them to understand the specific reasons why a case is recommended while viewing the matching ranking, providing reference information for users to select and judge candidate cases.
[0076] Based on the above description, this application has the following beneficial effects: After obtaining the user-inputted question description text, this application performs semantic parsing on the question description text to obtain a question semantic graph, and performs semantic parsing on each case in the case library to obtain a case semantic graph. This ensures that both the question description and case text participate in the matching in a structured graph data form, avoiding the semantic information loss caused by directly vectorizing the original text as a whole in existing technologies. On this basis, by calculating the matching degree between the question semantic graph and the case semantic graph, the matching process can be measured and comprehensively evaluated at both the entity level and the relation level, overcoming the limitation of traditional keyword retrieval that can only perform literal matching and cannot understand semantic connotations. Finally, the top N cases with matching degrees sorted from high to low are recommended to the user as candidate cases, so that the matching results are arranged in an orderly manner according to their relevance to the question description, making it easier for users to quickly locate the most applicable historical cases and reducing the time cost of manual screening.
[0077] The above text combined Figures 1 to 2 The case matching method provided in the embodiments of this application has been described in detail. The apparatus and equipment provided in the embodiments of this application will be described below with reference to the accompanying drawings.
[0078] like Figure 3 As shown in the figure, this is a schematic diagram of a case matching device provided in an embodiment of this application. The device includes: Module 301 is used to acquire the problem description text input by the user; The processing module 302 is used to perform semantic parsing on the problem description text to obtain a problem semantic graph; perform semantic parsing on each case in the case library to obtain a case semantic graph for each case; calculate the matching degree between the problem semantic graph and the case semantic graph; and select the top N cases with matching degrees sorted from high to low as candidate cases. The recommendation module 303 is used to recommend candidate cases to the user.
[0079] Optionally, the processing module 302 is specifically used to calculate the node semantic sub-matching degree between the problem semantic graph and the case semantic graph in the node dimension, calculate the relation semantic sub-matching degree between the problem semantic graph and the case semantic graph in the relation dimension, calculate the constraint semantic sub-matching degree between the problem semantic graph and the case semantic graph in the constraint dimension, and calculate the target semantic sub-matching degree between the problem semantic graph and the case semantic graph in the target dimension. The matching degree between the problem semantic graph and the case semantic graph is obtained by weighted summing of the node semantic sub-matching degree, the relation semantic sub-matching degree, the constraint semantic sub-matching degree, and the target semantic sub-matching degree.
[0080] Optionally, the processing module 302 is specifically used to determine the encoding of the problem entity in the problem semantic graph and the encoding of the case entity in the case semantic graph; Calculate the cosine similarity between the code of each question entity and the code of each case entity; The semantic sub-matching degree of a node is determined based on the cosine similarity between the encoding of each question entity and the encoding of each case entity.
[0081] Optionally, the processing module 302 is specifically used to determine the encoding and type of the problem edge in the problem semantic graph and the encoding and type of the case edge in the case semantic graph; The semantic sub-matching degree of the relation is determined based on the cosine similarity between the encoding of the problem edge and the encoding of the case edge, as well as the consistency between the types of the problem edge and the types of the case edge.
[0082] Optionally, the processing module 302 is specifically used to determine the problem constraints in the problem semantic graph and the case constraints in the case semantic graph; The semantic sub-matching degree of the constraints is determined based on the ratio of satisfaction between the problem constraints and the case constraints.
[0083] Optionally, the processing module 302 is specifically used to determine the encoding of the problem target in the problem semantic graph and the encoding of the case target in the case semantic graph; The target semantic sub-matching degree is determined based on the cosine similarity between the encoding of the problem target and the encoding of the case target.
[0084] Optionally, the processing module 302 is also used to determine the reasons for recommending each candidate case; The reasons for recommending each candidate case are presented.
[0085] The case matching apparatus according to the embodiments of this application can correspond to the execution of the method described in the embodiments of this application, and the other operations and / or functions of each module / unit of the case matching apparatus are respectively for implementing Figure 2 For the sake of brevity, the corresponding processes of each method in the illustrated embodiments will not be described in detail here.
[0086] This application also provides a computing device. For example... Figure 4 As shown in the figure, this is a schematic diagram of a computing device provided in an embodiment of this application. The computing device 400 includes a bus 401, a processor 402, a communication interface 403, and a memory 404. The processor 402, the memory 404, and the communication interface 403 communicate with each other via the bus 401.
[0087] Bus 401 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0088] Processor 402 can be any one or more of the following processors: central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP), or digital signal processor (DSP).
[0089] Communication interface 403 is used for communication with external devices.
[0090] Memory 404 may include volatile memory, such as random access memory (RAM). Memory 404 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0091] The memory 404 stores executable code, which the processor 402 executes to perform the aforementioned case matching method.
[0092] Specifically, in achieving Figure 3 In the case of the illustrated embodiment, and Figure 3 When the modules or units of the case matching device described in the embodiments are implemented by software, the following steps are performed: Figure 3 The software or program code required for the functions of each module / unit can be partially or wholly stored in memory 404. Processor 402 executes the program code corresponding to each unit stored in memory 404 and performs the aforementioned case matching method.
[0093] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to perform the above-described case matching method.
[0094] This application also provides a computer program product comprising one or more computer instructions. When the computer instructions are loaded and executed on a computing device, all or part of the processes or functions described in this application are generated.
[0095] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, or data center to another website, computer, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0096] When the computer program product is executed by a computer, the computer performs any of the aforementioned case matching methods. The computer program product can be a software installation package; when any of the aforementioned case matching methods is required, the computer program product can be downloaded and executed on the computer.
[0097] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.
[0098] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be covered within the scope of protection of this application.
Claims
1. A case matching method, characterized in that, The method includes: Obtain the user's question description text; Semantic parsing is performed on the problem description text to obtain a problem semantic graph; semantic parsing is performed on each case in the case library to obtain a case semantic graph for each case; Calculate the matching degree between the problem semantic graph and the case semantic graph; The top N cases, sorted by matching degree from high to low, are selected as candidate cases. Recommend candidate cases to the user.
2. The method according to claim 1, characterized in that, The calculation of the matching degree between the problem semantic graph and the case semantic graph includes: Calculate the node semantic sub-matching degree between the problem semantic graph and the case semantic graph in the node dimension; calculate the relation semantic sub-matching degree between the problem semantic graph and the case semantic graph in the relation dimension; calculate the constraint semantic sub-matching degree between the problem semantic graph and the case semantic graph in the constraint dimension; calculate the target semantic sub-matching degree between the problem semantic graph and the case semantic graph in the target dimension. The matching degree between the problem semantic graph and the case semantic graph is obtained by weighted summing of the node semantic sub-matching degree, the relation semantic sub-matching degree, the constraint semantic sub-matching degree, and the target semantic sub-matching degree.
3. The method according to claim 2, characterized in that, The computational problem semantic graph and the case semantic graph exhibit node semantic sub-matching degree at the node dimension, including: Determine the encoding of problem entities in the problem semantic graph and the encoding of case entities in the case semantic graph; Calculate the cosine similarity between the code of each question entity and the code of each case entity; The semantic sub-matching degree of a node is determined based on the cosine similarity between the encoding of each question entity and the encoding of each case entity.
4. The method according to claim 2, characterized in that, The calculation of the relational semantic sub-matching degree between the problem semantic graph and the case semantic graph in the relational dimension includes: Determine the encoding and type of problem edges in the problem semantic graph and the encoding and type of case edges in the case semantic graph; The semantic sub-matching degree of the relation is determined based on the cosine similarity between the encoding of the problem edge and the encoding of the case edge, as well as the consistency between the types of the problem edge and the types of the case edge.
5. The method according to claim 2, characterized in that, The computational problem semantic graph and the case semantic graph exhibit constraint semantic sub-matching degree in the constraint dimension, including: Determine the problem constraints in the problem semantic graph and the case constraints in the case semantic graph; The semantic sub-matching degree of the constraints is determined based on the ratio of satisfaction between the problem constraints and the case constraints.
6. The method according to claim 2, characterized in that, The calculation of the target semantic sub-matching degree between the problem semantic graph and the case semantic graph in the target dimension includes: Determine the encoding of problem targets in the problem semantic map and the encoding of case targets in the case semantic map; The target semantic sub-matching degree is determined based on the cosine similarity between the encoding of the problem target and the encoding of the case target.
7. The method according to any one of claims 1-6, characterized in that, The method further includes: Determine the reasons for recommending each candidate case; The reasons for recommending each candidate case are presented.
8. A case matching device, characterized in that, The device includes: The acquisition module is used to acquire the question description text input by the user; The processing module is used to perform semantic parsing on the problem description text to obtain a problem semantic graph; perform semantic parsing on each case in the case library to obtain a case semantic graph for each case; calculate the matching degree between the problem semantic graph and the case semantic graph; and select the top N cases with matching degrees sorted from high to low as candidate cases. The recommendation module is used to recommend candidate cases to the user.
9. A computing device, characterized in that, Including memory and processor; The memory stores one or more computer programs, the one or more computer programs including instructions; when the instructions are executed by the processor, the computing device performs the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for performing the method as described in any one of claims 1 to 7.