Rule generation method and device, computer equipment, readable storage medium and program product
By using a rule generation model to perform semantic analysis and knowledge base combination on target intent, the problem of insufficient accuracy of customer segmentation rules in traditional technologies is solved, and more accurate rule generation is achieved.
Patent Information
- Application Number
- CN202511534907.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-24
- Publication Date
- 2026-01-20
AI Technical Summary
In traditional technologies, the generation of customer segmentation rules relies on a single keyword, resulting in poor accuracy.
The target instruction is semantically analyzed by a rule generation model to determine the target intent. The target knowledge base combination is then selected from multiple candidate knowledge bases, including a tag knowledge base, a customer group knowledge base, a relationship graph knowledge base, and a tag threshold knowledge base. The rules are then corrected to generate accurate customer group selection rules.
It improves the accuracy of rule generation, enabling dynamic adaptation to business scenarios and generating rules that meet the requirements of target instructions.
Smart Images

Figure CN121365129A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, in particular to a rule generation method and device, computer equipment, computer readable storage medium and computer program product. BACKGROUND
[0002] With the development of artificial intelligence technology, in the rule construction of customer group selection, customer group selection rules can be automatically generated based on a machine learning model to improve rule generation efficiency.
[0003] In the traditional technology, a user can input customer group selection conditions in natural language form into an NLP (Natural Language Processing) model, and map keywords in the natural language input by the user through the NLP model to generate target rules for customer group selection.
[0004] However, in the current traditional technology, the dimension of the keywords on which the target rules depend is relatively single, resulting in poor accuracy of the target rules. SUMMARY
[0005] Therefore, it is necessary to provide a rule generation method, device, computer equipment, computer readable storage medium and computer program product to solve the above technical problems.
[0006] In a first aspect, the present application provides a rule generation method, comprising:
[0007] obtaining a target instruction;
[0008] performing semantic analysis on the target instruction according to a rule generation model, determining a target intent corresponding to the target instruction, and filtering a target knowledge base combination corresponding to the target instruction from a plurality of candidate knowledge bases according to the target intent;
[0009] determining a first target rule corresponding to the target instruction based on the rule generation model and the target knowledge base combination.
[0010] In one embodiment, the performing semantic analysis on the target instruction according to the rule generation model, and determining the target intent corresponding to the target instruction comprises:
[0011] performing element analysis on the target instruction according to the rule generation model, and determining target elements contained in the target instruction;
[0012] performing requirement scenario analysis based on the target elements, and determining the target intent corresponding to the target instruction based on the requirement scenario analysis result.
[0013] In one of the embodiments, the filtering, according to the target intention, of the target knowledge base combination corresponding to the target instruction comprises:
[0014] The description text of each candidate knowledge base is obtained based on a preset system prompt word;
[0015] The association analysis of each description text and the target intention is performed according to the rule generation model, the target knowledge base that matches the target instruction is determined, and the target knowledge base combination is determined according to the target knowledge base.
[0016] In one of the embodiments, the target knowledge base combination comprises a label knowledge base, a customer group knowledge base, a relationship graph knowledge base, and a label threshold knowledge base; and the determination, based on the rule generation model and the target knowledge base combination, of the first target rule corresponding to the target instruction comprises:
[0017] The matching of each target element in the target instruction is performed based on the rule generation model and the label knowledge base, and the initial rule corresponding to each target element is determined;
[0018] The initial rule is respectively corrected according to the rule generation model, the customer group knowledge base, the relationship graph knowledge base, and the label threshold knowledge base, and the first target rule is obtained.
[0019] In one of the embodiments, the initial rule comprises a first screening condition corresponding to each label; and the correction, according to the rule generation model, the customer group knowledge base, the relationship graph knowledge base, and the label threshold knowledge base, of the initial rule to obtain the first target rule comprises:
[0020] In the customer group knowledge base, the similarity matching of the target instruction is performed based on the rule generation model, the candidate customer group corresponding to the target instruction is determined, and the second screening condition is obtained by correcting the first screening condition based on the candidate customer group;
[0021] The conditional enhancement and conflict detection of the association relationship between each label are performed based on the rule generation model and the relationship graph knowledge base, the third screening condition is obtained by correcting the second screening condition;
[0022] The label threshold corresponding to the third screening condition is determined based on the rule generation model and the label threshold knowledge base;
[0023] The first target rule corresponding to the target instruction is generated according to the rule generation model, the third screening condition, and the label threshold.
[0024] In one embodiment, after determining the first target rule corresponding to the target instruction based on the combination of the rule generation model and the target knowledge base, the method further includes:
[0025] Get supplementary instructions;
[0026] The supplementary instruction is semantically analyzed according to the rule generation model to determine the supplementary rule corresponding to the supplementary instruction, and the first target rule is locally modified according to the supplementary rule to obtain the second target rule.
[0027] Secondly, this application also provides a rule generation apparatus, comprising:
[0028] The first acquisition module is used to acquire the target instruction;
[0029] The filtering module is used to perform semantic analysis on the target instruction according to the rule generation model, determine the target intent corresponding to the target instruction, and filter the target knowledge base combination corresponding to the target instruction from multiple candidate knowledge bases according to the target intent;
[0030] The determination module is used to determine the first target rule corresponding to the target instruction based on the combination of the rule generation model and the target knowledge base.
[0031] In one embodiment, the filtering module is specifically used to parse the target instruction according to the rule generation model to determine the target elements contained in the target instruction;
[0032] Based on the target elements, a demand scenario analysis is performed, and based on the results of the demand scenario analysis, the target intent corresponding to the target instruction is determined.
[0033] In one embodiment, the filtering module is specifically used to obtain the descriptive text of each candidate knowledge base based on preset system prompt words;
[0034] The model generates a correlation analysis of each description text and the target intent based on the rules, determines the target knowledge base that matches the target instruction, and determines the target knowledge base combination based on the target knowledge base.
[0035] In one embodiment, the target knowledge base combination includes a tag knowledge base, a customer group knowledge base, a relationship graph knowledge base, and a tag threshold knowledge base; the determining module is specifically used to match each target element in the target instruction based on the rule generation model and the tag knowledge base to determine the initial rule corresponding to each target element;
[0036] The initial rule is corrected according to the rule generation model, the customer group knowledge base, the relationship graph knowledge base and the label threshold knowledge base, and a first target rule is obtained.
[0037] In one of the embodiments, the initial rule includes a first screening condition corresponding to each label; the determination module is specifically configured to perform similarity matching on the target instruction based on the rule generation model in the customer group knowledge base, determine a candidate customer group corresponding to the target instruction, and correct the first screening condition based on the candidate customer group to obtain a second screening condition;
[0038] The association relationship between each label is conditionally enhanced and conflict detected based on the rule generation model and the relationship graph knowledge base, and the second screening condition is corrected to obtain a third screening condition;
[0039] The third screening condition corresponds to a label threshold value, which is determined based on the rule generation model and the label threshold knowledge base;
[0040] The first target rule corresponding to the target instruction is generated according to the rule generation model, the third screening condition and the label threshold value.
[0041] In one of the embodiments, the device further includes:
[0042] The second acquisition module is configured to acquire a supplementary instruction;
[0043] The multi-round dialogue generation module is configured to perform semantic analysis on the supplementary instruction based on the rule generation model, determine a supplementary rule corresponding to the supplementary instruction, and locally correct the first target rule based on the supplementary rule to obtain a second target rule.
[0044] In a third aspect, the present application further provides a computer device including a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0045] Acquire a target instruction;
[0046] Perform semantic analysis on the target instruction based on a rule generation model, determine a target intention corresponding to the target instruction, and filter a target knowledge base combination corresponding to the target instruction from a plurality of candidate knowledge bases based on the target intention;
[0047] Determine a first target rule corresponding to the target instruction based on the rule generation model and the target knowledge base combination.
[0048] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0049] Obtain the target instruction;
[0050] The target instruction is semantically analyzed according to the rule generation model to determine the target intent corresponding to the target instruction, and the target knowledge base combination corresponding to the target instruction is selected from multiple candidate knowledge bases according to the target intent.
[0051] The first target rule corresponding to the target instruction is determined based on the combination of the rule generation model and the target knowledge base.
[0052] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0053] Obtain the target instruction;
[0054] The target instruction is semantically analyzed according to the rule generation model to determine the target intent corresponding to the target instruction, and the target knowledge base combination corresponding to the target instruction is selected from multiple candidate knowledge bases according to the target intent.
[0055] The first target rule corresponding to the target instruction is determined based on the combination of the rule generation model and the target knowledge base.
[0056] The aforementioned rule generation method, apparatus, computer equipment, computer-readable storage medium, and computer program product acquire the target instruction from user prompts; perform semantic analysis on the target instruction based on a rule generation model to determine the target intent corresponding to the target instruction; and filter the target knowledge base combination corresponding to the target instruction from multiple candidate knowledge bases based on the target intent; finally, determine the first target rule corresponding to the target instruction based on the rule generation model and the target knowledge base combination. This method, by performing semantic analysis on the target instruction to determine the target intent and using it as a condition for filtering the target knowledge base, obtains a target knowledge base combination from the candidate knowledge bases. This allows for dynamic adaptation to the business scenario of the target instruction, enriches the analytical dimensions for generating the first target rule for customer segmentation, and enables the rule generation model to determine the first target rule that accurately reflects the needs of the target instruction based on the target knowledge base combination, thereby improving the accuracy of the first target rule. Attached Figure Description
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application or the related art. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained on the basis of these drawings without creative labor.
[0058] Figure 1 A flowchart of a rule generation method in an embodiment;
[0059] Figure 2 A model architecture diagram of a rule generation model in an embodiment;
[0060] Figure 3 A flowchart of determining a target intent in an embodiment;
[0061] Figure 4 A flowchart of determining a target knowledge base combination in another embodiment;
[0062] Figure 5 A flowchart of generating a first target rule by modifying an initial rule in an embodiment;
[0063] Figure 6 A flowchart of modifying a first screening condition by a relation graph knowledge base and a label threshold knowledge base respectively in an embodiment;
[0064] Figure 7 A flowchart of generating a second target rule corresponding to a supplementary instruction in multi-round dialogue processing in an embodiment;
[0065] Figure 8 A diagram of a system prompt word in a rule generation model in an embodiment;
[0066] Figure 9 A structural block diagram of a rule generation apparatus in an embodiment;
[0067] Figure 10 An internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0068] In order to make the purposes, technical solutions and advantages of the present application clearer, the following will further describe the present application in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0069] It should be noted that the terms "first", "second", etc. used in the present application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "include" and "have" and any variations thereof used in the present application are intended to cover non-exclusive inclusion. The term "multiple" used in the present application refers to two or more. The term "and / or" used in the present application refers to one of the options or any combination of multiple options.
[0070] In one embodiment, as shown in Figure 1 A rule generation method is provided. In this embodiment, the method is applied to a terminal. It should be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and can be implemented through the interaction of the terminal and the server. In this embodiment, the method includes the following steps:
[0071] Step 102, obtaining a target instruction.
[0072] In the present embodiment, the user inputs a target instruction in the front-end page of the terminal. The user prompt word is a prompt word constructed by the user based on the business demand of the customer group selection, which is input into the rule generation model as the original demand of the user to generate the customer group selection rule. The target instruction contains the core demand of the user for the rule generation model to generate a task, for example, the target instruction can be "high net worth single female customer group" or "payroll customer group".
[0073] Step 104, performing semantic analysis on the target instruction according to the rule generation model, determining a target intent corresponding to the target instruction, and filtering a target knowledge base combination corresponding to the target instruction from multiple candidate knowledge bases according to the target intent.
[0074] In the present embodiment, the system architecture of the rule generation model is as shown in Figure 2 The knowledge processing engine of the rule generation model includes an Embedding model, an LLM (Large Language Model) inference large model, and has RAG (Retrieval-Augmented Generation) capability. Therefore, the intelligent processing capability of the rule generation model includes intent analysis, knowledge retrieval, rule translation, and bitmap operation expression conversion of the Bitmap calculation engine. The RAG retrieval augmented generation capability is introduced into the natural language analysis process, the label definition (for example, label name, value type, threshold list) in the label knowledge base is retrieved in real time, the generation range of the large language model (LLM model) is constrained, and it is ensured that the output label and value strictly match the knowledge base content.
[0075] Firstly, the terminal encodes the target instruction in the user dialogue into a vector form through the Embedding model, and then the terminal calls the LLM model to perform semantic analysis and intent analysis on the target instruction input by the user to determine the target intent corresponding to the target instruction. The target intent is used to filter the target knowledge base corresponding to the target instruction in the candidate knowledge base to form a target knowledge base combination. The target intent can include operation types, filtering conditions, and business scenarios, etc. For example, the LLM model analyzes to obtain that the operation type in the target intent includes generating circle selection rules, business data query, etc. If the operation type is generating circle selection rules, the rule generation model can generate customer circle selection rules, but if the operation type is business data analysis, business data query, etc. Non-circle selection rule generation operation type, the terminal feeds back instruction mismatching prompt information to the front-end page, prompting the user that the current rule generation model supports the ability of generating customer circle selection rules. The filtering condition can be a keyword representing the user circle selection rule, that is, the filtering condition can be "high net worth", "payroll customer", etc. The business scenario can be a business scenario of customer circle selection such as user stratification, holiday marketing customer filtering, etc.
[0076] The rule generation model analyzes the customer circle selection rules of the current target instruction based on the target intent, filters the target knowledge base related to the logical reasoning of the current rule analysis in the candidate knowledge base, obtains a target knowledge base combination, for example, the candidate knowledge base can include a tag knowledge base, a customer knowledge base, a relationship graph knowledge base, and a tag threshold knowledge base, and the terminal filters one or more target knowledge bases in the candidate knowledge base to form a target knowledge base combination. Specifically, if the operation type in the target intent is to generate circle selection rules, and the target instruction reflected by the target intent contains keywords that have definitions of corresponding label calculation methods in the tag knowledge base, the terminal can determine that the tag knowledge base is a target knowledge base through the analysis of the LLM model; for the business scenario in the target intent, if the customer knowledge base has a customer condition corresponding to or similar to the current business scenario, the terminal determines that the customer knowledge base is also a target knowledge base through the analysis of the LLM model; if the relationship graph knowledge base also has an association relationship between the keywords corresponding to the filtering conditions in the target intent, the relationship graph knowledge base is also determined as a target knowledge base; if the label calculation method determined based on the tag knowledge base has a label threshold corresponding to the label calculation method in the label threshold knowledge base, the label threshold knowledge base is also determined as a target knowledge base.
[0077] Step 106, determining a first target rule corresponding to the target instruction based on the rule generation model and the target knowledge base combination.
[0078] In the embodiments of the present application, the terminal performs information enhancement on the target instruction according to the target knowledge data corresponding to the target knowledge base combination, obtains a target prompt word (target prompt), and inputs the target prompt word into the LLM model in the rule generation model. The first target rule is obtained through inference analysis of the LLM model according to the target prompt word.
[0079] The target prompt word is generated by the rule generation model according to the target knowledge base combination, searching for target knowledge data in the target knowledge base, and combining the target knowledge data with the target instruction into the prompt word template. Specifically, after obtaining the target intent, the terminal compares and analyzes each candidate knowledge base according to each keyword contained in the target intent, determines whether the knowledge data corresponding to each keyword is contained in each candidate knowledge base, and further determines the target knowledge base combination.
[0080] After determining the target knowledge base, the terminal searches for the target knowledge data corresponding to each keyword in each target knowledge base in the target knowledge base combination through the LLM model, constructs the target prompt word according to the target knowledge data, the target instruction and the prompt word template, finally inputs the target prompt word into the LLM model, and further performs rule translation according to the LLM model in the rule generation model, generates a JSON (JavaScript Object Notation, JavaScript Object Notation) rule string, and further converts the JSON rule into a bitmap operation expression according to the Bitmap calculation engine, to obtain the first target rule corresponding to the target instruction. The system prompt word of the LLM model is generated based on the structured prompt word template, which requires the LLM model to output a compressed JSON rule string and contains format constraints and content constraints. The format constraint is to constrain the LLM model to use json{...} wrapping, and prohibit formatting (such as line breaks and indentation). The content constraint is that each rule / rule group must contain id, type (rule group identifier), condition (logical operator), tag (tag name) and other fields, and the value must be exactly the same as the threshold name in the knowledge base. For example, the value field must use the definition of the "threshold name" column in the knowledge base (for example, the "threshold name" is "high", not the specific numerical definition "> 1 million") in the system prompt word, to avoid rule failure caused by expression differences.
[0081] Therefore, business personnel only need to describe their needs in natural language to obtain executable selection rules, lowering the technical threshold. For example, business personnel only need to input the target instruction "payroll payroll customer group" into the rule generation model. The rule generation model retrieves the target knowledge data corresponding to "payroll payroll customer group" from the target knowledge base combination, and then infers based on the target instruction data to obtain the first target rule: "Age greater than or equal to 22, age less than or equal to 60, average daily deposit balance greater than 5000 this year, and accident insurance policy coverage greater than 0." Based on this, the user can click "confirm selection," and the terminal will then input the JSON rule corresponding to the first target rule into the Bitmap calculation engine and return the customer group results that meet the conditions.
[0082] In the above rule generation method, semantic analysis of the target instruction is performed to determine the target intent, which is then used as a condition for filtering the target knowledge base. This process filters from the candidate knowledge base to obtain a combination of target knowledge bases. This method can dynamically adapt to the business scenario of the target instruction, enriching the analytical dimensions for generating the first target rule for customer segmentation. As a result, the rule generation model can determine the first target rule that accurately reflects the needs of the target instruction based on the combination of target knowledge bases, thereby improving the accuracy of the first target rule.
[0083] In one exemplary embodiment, such as Figure 3 As shown, step 104 includes steps 302 to 304. Wherein:
[0084] Step 302: Based on the rule-based model, the target instruction is parsed to determine the target elements contained in the target instruction.
[0085] In this embodiment, the terminal encodes the target instruction according to the Embedding model in the rule generation model, obtaining the target instruction in vector form. Then, the terminal analyzes the vector-form target instruction using the LLM model in the rule generation model, parsing the target elements contained within the target instruction. For example, the pre-trained Embedding model can be a BERT (Bidirectional Encoder Representations from Transformers) model, which converts the user-input natural language target instruction into a high-dimensional vector representation, capturing the semantic, syntactic, and contextual information in the target instruction, such as the vector features of keywords like "high net worth" and "holiday marketing." Furthermore, the terminal performs fine-grained analysis of the vectorized target instruction using the LLM model, extracting the target elements contained within the target instruction. Specifically, the terminal uses the LLM model to break down the target instruction into phrases, obtaining structured target elements such as "high net worth," "last three months," and "holiday marketing."
[0086] At step 304, a demand scenario analysis is performed based on each target element, and a target intent corresponding to the target instruction is determined based on the demand scenario analysis result.
[0087] In the embodiment of the present application, the terminal performs demand scenario analysis on each target element through the LLM model, determines the demand scenario analysis result of the operation type, filtering condition and business scenario dimensions of each target element, and then determines the target intent corresponding to the target instruction according to the demand scenario analysis result. The LLM model maps the parsed target element by dimension and classifies the intent, first obtains the demand scenario analysis result, which can be a set of types corresponding to each target element. Specifically, the demand scenario analysis result includes the operation type, business scenario and filtering condition of the target instruction. Among them, the business scenario can represent the type of target knowledge base required by the current target instruction. For example, if the guest group knowledge base stores the business scenario and filtering rule corresponding to the preset guest group, if the target element has a matching business scenario, it means that the LLM model can determine whether to take the guest group knowledge base as the target knowledge base based on the business scenario.
[0088] For the filtering condition, the terminal can determine whether the label knowledge base contains the label information corresponding to each target element through the LLM model. The label information includes the detailed calculation rule corresponding to the target element and other target elements involved, and then the terminal can determine the filtering rule corresponding to each target element in the current target instruction.
[0089] The operation type can reflect whether the current target instruction conforms to the capability range of the rule generation model. Then the LLM model identifies the operation type of the user intent through the target element to determine whether the user demand corresponding to the current target instruction conforms to the capability range supported by the rule generation model. Specifically, the terminal can determine whether the current target instruction meets the capability range supported by the rule generation model through the pre-defined "supported intent white list" and "unsupported scene black list". For example, if the operation type of the target instruction is "generate rule", the terminal triggers the subsequent rule generation process; if the operation type of the target instruction is "query real-time data", "generate analysis report" and the like, the terminal directly determines that the target intent of the target instruction is an unsupported intent.
[0090] Finally, the terminal can summarize the operation type, business scenario and filtering condition in the demand scenario analysis result as the target intent, and the operation type, filtering condition, business scenario and other elements in the target intent are used to assist the LLM model to determine the combination method of the target knowledge base.
[0091] In this embodiment, through joint element analysis of the Embedding model and the LLM model in the rule generation model, deep semantic understanding and structured disassembly of the target instruction are realized, the key words and context association of the target instruction can be accurately captured through vectorization coding, and unstructured instructions are parsed and converted into standardized target elements. Further, based on the target elements, demand scenario analysis is performed to determine the operation type, business scenario and intent classification of the filtering conditions corresponding to the target instruction, and finally the target intent is obtained, which provides a basis for subsequent division of the target knowledge base combination based on the target intent, improves the matching degree of the target knowledge base combination and the target instruction, and improves the accuracy of enhancing the target instruction.
[0092] In one exemplary embodiment, as shown in FIG. 4, step 104 includes steps 402 to 404. Among them: Figure 4
[0093] Step 402, based on the preset system prompt word, obtaining the description text of each candidate knowledge base.
[0094] In the embodiment of the application, the terminal actively obtains the description text of each candidate knowledge base through the pre-constructed preset system prompt word. The preset prompt word can be a detailed description of the metadata (for example, storage content, applicable scenario, data logic, etc.) of different knowledge bases.
[0095] In a preferred embodiment, the terminal can take “{{tool 1 name}}:{{tool 1 description}}” “{{tool 2 name}}:{{tool 2 description}}” as the content of the preset system prompt word, and tool 1 can be a label knowledge base, and “tool 1 description” is the text description of the label knowledge base. Similarly, tool 2 can be a customer group knowledge base, and then “tool 2 description” can be the text description of the customer group knowledge base. The label knowledge base is used to store basic label definitions and calculation logic (for example, the source of age, the calculation method of XX rate), the customer group knowledge base is used to list preset customer group classification rules (for example, the combination label of “risk of loss user”), the relationship graph knowledge base is used to explain entity types (for example, user-goods-device) and association relationships (for example, purchase path, social link), and the label threshold knowledge base is used to list dynamic threshold rules (for example, “high consumption” is defined as “the consumption amount in the last 3 months is greater than 1.5 times the average value”).
[0096] Optionally, the terminal can also obtain the metadata description text of all candidate knowledge bases in the description text library through the behavior instruction in the preset system prompt word. The preset system prompt word is a pre-designed standardized query instruction, for example, "please return the storage content and application scenario description of the customer group knowledge base" "query the entity type and association logic of the relationship graph knowledge base", to quickly and accurately locate the definition document or description text of each knowledge base in the description text library. The terminal matches the target intent (for example, operation type "rule generation", business scenario "holiday marketing customer group selection") parsed by the rule generation model with the template in the preset prompt word library to generate a query instruction conforming to the structure.
[0097] Step 404, according to the rule generation model, the description text and the target intent are associated and analyzed, the target knowledge base matched with the target instruction is determined, and the target knowledge base combination is determined according to the target knowledge base.
[0098] In the embodiment of the application, the rule generation model (including Embedding coding and LLM model) is used to perform deep semantic association analysis on the key elements (including operation type, business scenario, and filtering condition) of the target intent and the description text of each knowledge base, and finally determine the most matched target knowledge base combination.
[0099] Specifically, the terminal vectorizes the target intent and extracts keywords. For example, the target intent can be "generate promotion rules for holiday high net worth customers". The keywords include operation type, business scenario, and filtering condition dimensions, for example, the operation type can be "generate rules", the business scenario is "holiday marketing", and the filtering condition includes "high net worth" and "consumption amount".
[0100] Further, the terminal vectorizes the description text of each knowledge base using the preset Embedding model to generate a high-dimensional feature vector. Then, the terminal performs association analysis on the high-dimensional feature vector and the target intent according to the system prompt word indicated rule generation model, determines the target knowledge base matched with the target instruction, for example, the system prompt word can be "please return the storage content and application scenario description of the customer group knowledge base" "query the entity type and association logic of the relationship graph knowledge base". <thinking>Analyze user needs, think about what {{knowledge base 1}} and {{knowledge base 2}} are needed...< / thinking>". Further, the terminal matches the association through the LLM model, including business scenario matching, operation type matching, and filtering condition matching, determines the target knowledge base matched with the target instruction, and determines the target knowledge base combination according to the target knowledge base. For example, for business scenario matching, if the business scenario of the target intention is "holiday marketing", the terminal will match the customer group knowledge base (preset holiday promotion customer group rule) and the tag threshold base (for example, "holiday consumption amount threshold") as the target knowledge base; for operation type matching, if the operation type is "generate rule", it is necessary to ensure that at least the tag knowledge base (basic tag definition) and the tag threshold base (threshold calculation) are included as the target knowledge base; for filtering condition matching, if the target element contains "social association analysis", the relationship graph knowledge base (used for mining user network) must be included as the target knowledge base; if the "high net worth user" standard needs to be reused, the customer group knowledge base is called as the target knowledge base. Finally, the terminal generates a structured target knowledge base combination scheme through the LLM model, and obtains the target knowledge base combination, for example, the target knowledge base combination can be a tag knowledge base (consumption amount tag), a tag threshold base ("high net worth" consumption amount threshold), a customer group knowledge base (prestored "high net worth user" tag combination), and a relationship graph base (user and social relationship chain). Alternatively, the target knowledge base combination can be one or more of the tag knowledge base, the tag threshold base, the customer group knowledge base, and the relationship graph base.
[0101] In an optional embodiment, the target knowledge base combination can be basic tag filtering, that is, the target knowledge base combination is composed of the tag knowledge base and the tag threshold base. Taking the target instruction "circle out the users under the age of 30 and with consumption amount exceeding 5000 yuan in the past 3 months" as an example, since the demand in the target instruction is a non-preset customer group, it needs to be defined and combined, therefore, the rule generation model can determine through the LLM model that the corresponding tag combination of the customer group cannot be obtained from the customer group knowledge base, and only individual attribute analysis is required, so the rule generation model excludes the customer group knowledge base and the relationship graph base from the target knowledge base combination through the LLM model; at the same time, the rule generation model can determine that the tag knowledge base is required to obtain the definition and field source of "age" and "consumption amount", and call the tag threshold base to determine the specific calculation method of "under the age of 30" and "consumption amount exceeding 5000 yuan in the past 3 months", for example, "age ≤ 30" and "time window is current date-90 days, and amount threshold ≥ 5000 yuan", and further, the terminal determines the target knowledge base combination as the tag knowledge base and the tag threshold base through the rule generation model.
[0102] In an optional embodiment, the target knowledge base combination can be a tag knowledge base and a customer group knowledge base. Taking the target instruction "generate a circle selection rule according to the definition of high net worth customers of the system" as an example, first, the rule generation model accesses the customer group knowledge base through the LLM model to extract the corresponding tag combination rule of "high net worth customers", for example, the tag combination rule corresponding to "high net worth customers" is "cumulative consumption in the past year ≥ 100,000 yuan" and "age ≥ 25 years old", and then the data field and calculation logic of each tag are confirmed through the tag knowledge base, for example, the calculation method of the consumption amount, the age field acquisition path, and the like, so that the rule generation model can confirm that the first target rule can be generated through the query in the tag knowledge base and the customer group knowledge base, and therefore the tag knowledge base and the customer group knowledge base are taken as the target knowledge base combination.
[0103] In the embodiment, the rule generation model performs reasoning analysis on the description text of the candidate knowledge base and the target intent corresponding to the target instruction to determine the target knowledge base combination matched with the current target instruction, thereby realizing flexible matching of the target instruction and the candidate knowledge base, and enabling the rule generation model to generate rules according to the target knowledge base combination, which can improve the accuracy of the first target rule.
[0104] In an exemplary embodiment, the target knowledge base combination that can be divided by the rule generation model includes a tag knowledge base, a customer group knowledge base, a relationship graph knowledge base, and a tag threshold knowledge base. Taking the target knowledge base combination as an example, as shown in Figure 5 The step 502 includes steps 502 to 504. Wherein:
[0105] The step 502 matches each target element in the target instruction based on the rule generation model and the tag knowledge base to determine the initial rule corresponding to each target element.
[0106] In the embodiment, the rule generation model first performs in-depth analysis on the target instruction to identify the target elements in the target instruction, for example, the target elements include business scenario keywords, operation types, filtering conditions, and the like. In a specific embodiment, if the target instruction is "filter 'holiday high net worth users' and push coupons", the rule generation model will extract keywords such as "holiday marketing", "high net worth", and "consumption amount" as target elements. Then, the rule generation model and the tag knowledge base generate an initial rule through semantic matching and rule mapping. Since defining tags from zero will lead to a redundant reasoning process, the terminal converts the target instruction (for example, high net worth customers) of the user's fuzzy demand into an executable initial rule through the tag knowledge base.
[0107] Specifically, the rule generation model associates the target elements with the predefined labels in the label knowledge base, for example, the target element "high net worth" in the target instruction is matched to the "consumption amount ≥ 50000 yuan / month" defined in the label library, and "holiday marketing" is associated with the "recent three months transaction record" label. Based on the basic screening conditions in the label knowledge base, including field definition, calculation logic, the rule generation model can output the initial screening rule. For example, the target element "high net worth user" is converted into the first screening condition of "consumption amount ≥ 50000 yuan / month", forming the initial rule of "SELECT users WHERE consumption amount ≥ 50000". Optionally, after the terminal determines the initial rule corresponding to each target element, it can also verify the feasibility and integrity of the initial rule, for example, check whether the label exists, whether the field is consistent with the database, and exclude explicit conflicts, such as excluding mutually exclusive labels, etc.
[0108] Step 504, according to the rule generation model, the customer group knowledge base, the relationship graph knowledge base and the label threshold knowledge base, the initial rule is corrected respectively to obtain the first target rule.
[0109] In the embodiment of the application, the rule generation model may not be able to adapt to dynamic scenarios, association contradictions between labels or dynamic changes of thresholds only by relying on the static label library. Therefore, by accessing the customer group knowledge base, the relationship graph knowledge base and the label threshold knowledge base, the rule generation model can enhance the scene adaptability, detect association contradictions and finely adjust parameters based on the historical experience stored in the customer group knowledge base, the logical relationship in the relationship graph knowledge base and the dynamic parameters in the label and knowledge base, on the basis of the initial rule, and finally generate the first target rule which meets the intention demand of the target instruction and does not exist logical error and logical conflict.
[0110] The terminal corrects the generated initial rule through a rule generation model, and iteratively optimizes the initial rule in stages in combination with a customer group knowledge base, a relationship graph knowledge base and a label threshold knowledge base, and finally obtains a first target rule with business adaptability and logical rigor. The rule generation model can correct the initial rule according to at least one of the customer group knowledge base, the relationship graph knowledge base and the label threshold knowledge base. The embodiments of the present application take the case of simultaneous correction of the customer group knowledge base, the relationship graph knowledge base and the label threshold knowledge base as an example. Specifically, for the correction of the initial rule by the customer group knowledge base, the rule generation model searches for a pre-defined customer group rule similar to the semantic of the target instruction in the customer group knowledge base. For example, the pre-defined customer group rule can be a historical "holiday high-value user group" definition. Then, the rule generation model adjusts the screening condition of the initial rule through similarity matching or rule migration. For example, if the historical customer group emphasizes "consumption frequency ≥ 3 times in the past half year", the rule generation model combines the "consumption amount" condition with the "transaction frequency" in the initial rule to generate a second screening condition of "consumption amount ≥ 80,000 AND transaction ≥ 2 times in the past 3 months".
[0111] For the correction of the initial rule by the relationship graph knowledge base, the rule generation model analyzes the dependency or contradiction between labels. If there is a contradiction, the initial rule is corrected. For example, if the target instruction needs to screen "high net worth users" and their "high active social friends" at the same time, the rule logic is extended and the "social friend relationship chain depth ≤ 2 layers" condition is added. If a conflict between "high net worth" and "low frequency user" is detected, a correction suggestion is triggered, for example, "low frequency user" is replaced by "recently active user", and a second screening condition without conflict is generated.
[0112] For the correction of the initial rule by the label threshold knowledge base, based on the label threshold library, the rule generation model quantifies dynamic threshold parameters, such as "high consumption" and "recently", in real time. For example, the consumption threshold of "holiday high net worth" may be dynamically adjusted to "single month consumption exceeding 1.5 times of the average value in the past 3 months" due to current industry data, and "recently" is converted to a specific time window of "from 2023-10-01 to now". Finally, the rule generation model combines the corrected screening condition (e.g., a third screening condition), dynamic threshold parameters and associated relationship logic to generate an executable first target rule.
[0113] At this time, when a new label (e.g., "consumption frequency") is added, only an entry needs to be added in the label knowledge base (without retraining the model), so that the rule generation model can automatically retrieve the new label through RAG and integrate it into rule generation.
[0114] In this embodiment, the rule generation model respectively enhances the initial rule through the historical experience of the customer group knowledge base, identifies the association or contradiction between the labels through the relationship graph knowledge base, and dynamically adjusts the parameter threshold through the label threshold knowledge base, so that the first target rule can more accurately meet the demand of the target instruction, improve the accuracy of the first target rule, and further improve the accuracy of the circle selection result.
[0115] In an exemplary embodiment, the initial rule includes a first screening condition corresponding to each label, and the customer group knowledge base, the relationship graph knowledge base, and the label threshold knowledge base are respectively used to modify the first screening condition in the initial rule. For example, as shown in Figure 6 Step 504 includes steps 602 to 608. Among them:
[0116] Step 602, in the customer group knowledge base, the rule generation model is used to perform similarity matching on the target instruction, to determine a candidate customer group corresponding to the target instruction, and the first screening condition is modified based on the candidate customer group to obtain a second screening condition.
[0117] In the embodiment of the application, the terminal first analyzes the target instruction through text similarity in the customer group knowledge base by using the LLM model of the rule generation model, for example, the matching degree of "screening holiday high net worth users" and the existing customer group definition, and retrieves a similar historical customer group "holiday promotion active users". Further, the LLM model can align the screening conditions of the historical customer group with the first screening condition in the initial rule, generate a new second screening condition through logical fusion or weight adjustment, and if the target instruction emphasizes "in the past three months", the LLM model of the rule generation model will modify the time range of the historical customer group to avoid interference of outdated data.
[0118] Step 604, based on the rule generation model and the relationship graph knowledge base, the association relationship between each label is enhanced and conflict detection is performed, and the second screening condition is modified to obtain a third screening condition.
[0119] In the embodiment of the application, after accessing the relationship graph knowledge base, the rule generation model analyzes the relationship between each label, such as "user, social friend, and consumption behavior", and then strengthens or detects conflicts in the second screening condition. For example, if the target instruction needs to circle "high net worth users and their social networks", the rule generation model extends the screening logic by adding "the number of associated friends is greater than or equal to 5" as an additional condition through the relationship base; at the same time, the contradiction between the labels is detected, for example, "high net worth" and "low frequency user" cannot coexist, so it is suggested to adjust the threshold or eliminate the conflict condition, and finally the third screening condition without logical conflict is formed.
[0120] Step 606, based on the rule generation model and the label threshold knowledge base, a label threshold corresponding to the third screening condition is determined.
[0121] In the embodiments of the present application, the rule generation model corrects the fuzzy expressions in the third screening condition through the label threshold knowledge base. In a specific embodiment, the rule generation model calls dynamic rules from the threshold base, and the definition of "high net worth" in the current period can be "consumption amount > industry average + standard deviation x 1.2"; "the last three months" needs to be converted into a fixed time window, for example, "2023-07-01 to 2023-09-30", and data missing items are excluded. Further, the rule generation model corrects the dynamic threshold to ensure that the screening condition meets the current business scenario and avoids excessive dependence on static rules, and obtains the label threshold corresponding to the third screening condition.
[0122] In step 608, a first target rule corresponding to the target instruction is generated according to the rule generation model, the third screening condition and the label threshold.
[0123] In the embodiments of the present application, the terminal inputs the third screening condition, the corrected label threshold and the relationship logic into the rule generation model, and finally generates an executable first target rule. For example, the label threshold can be "consumption amount ≥ 80,000 yuan" and "number of social friends ≥ 5", and the relationship logic is "user level is 1 and friend level ≤ 2", and the generated first target rule can be "SELECT users WHERE (consumption amount ≥ 80,000 yuan AND transaction frequency in the last 3 months ≥ 3) OR (number of associated friends ≥ 5 AND total consumption of close friends ≥ 500,000 yuan)".
[0124] In the embodiments, the first screening condition in the initial rule is gradually corrected through the customer knowledge base, the relationship graph knowledge base and the label threshold knowledge base, so that the first target rule strictly meets the professional and compliance constraints of the label knowledge base, the customer knowledge base, the relationship graph knowledge base and the label threshold knowledge base, ensures that the first target rule meets the compliance requirements, and improves the accuracy of the first target rule.
[0125] In an exemplary embodiment, as shown in Figure 7 After step 106, the method further includes steps 702 to 704. Among them:
[0126] In step 702, a supplementary instruction is obtained.
[0127] In the embodiments of the present application, the terminal captures the new supplementary instruction of the user through the persistent conversation interface, for example, the supplementary instruction can be "add another'single' feature", and then the terminal associates the supplementary instruction with the context of the historical conversation. Specifically, when the user inputs the supplementary instruction, the terminal stores it as part of the conversation history and labels its supplementary instruction identifier to avoid confusion with new instructions.
[0128] At step 704, the supplementary instruction is semantically analyzed according to the rule generation model, the corresponding supplementary rule of the supplementary instruction is determined, and the first target rule is locally revised according to the supplementary rule to obtain a second target rule.
[0129] In the embodiments of the present application, the rule generation model performs deep understanding based on historical context and user demand to intelligently determine whether iteration optimization should be performed on the basis of existing rules or a brand-new rule system should be generated. When the model parameter scale is limited, the semantic understanding ability is insufficient, or the context window is limited, the reasoning and generation effects can be synergistically strengthened and compensated by means of an intent recognition and prompt word semantic enhancement mechanism.
[0130] Firstly, the terminal performs semantic analysis on the supplementary instruction by the rule generation model, identifies the core change point, for example, the keywords "single" and "marital status" in "add a'single' feature", and marks the change type, which can be adding a condition, modifying a threshold, etc. For example, the rule generation model can determine that the user's intention is "append a marital status screening in the original rule" according to the supplementary instruction "add a'single' feature".
[0131] Further, the rule generation model matches the key elements in the user instruction by calling the label knowledge base, for example, "single" corresponds to the value "unmarried" of the marital status label. If there is a definition in the label library, that is, marital status: enumeration value [unmarried, married, divorced], it is directly mapped to the condition expression of marital status = unmarried, for example, the condition expression can be "marital status = unmarried". Then, the rule generation model performs rule local revision and conflict detection, directly appends the supplementary rule to the original screening condition to form a new logical constraint, and obtains a second target rule. Optionally, the rule generation model can also call the relationship graph knowledge base to verify the association logic of the added condition and other labels, for example, "whether a single user may have a specific consumption behavior label", or if the original rule already contains "family consumption ratio > 50%", the rule generation model may detect a contradiction and prompt the user to confirm, for example, "single users usually have no family consumption, do you need to adjust this condition?".
[0132] After the revision is completed, the rule generation model outputs the structured second target rule (also in JSON format) and returns a natural language summary. For example, the output JSON can be:
[0133] {"condition":"and","rules":[{"id":A,"tag":"VIP customer level","operator":"equal to","value":"diamond","valueType":"enum"},{"id":B,"tag":"total assets","operator":"greater than","value":5000000,"valueType":"number"}]}.
[0134] In this embodiment, the incremental input from multiple rounds of user interaction is mapped in real time to the precise addition, deletion and logical adaptation of the rule structure through a dynamic rule evolution mechanism. This avoids rule deviations caused by incomplete information. Furthermore, by using local updates instead of global reasoning, the resource consumption of the rule generation model in multiple rounds of interaction can be reduced, enhancing the user experience and the flexibility of rule generation. This makes the construction of complex rules more in line with actual scenarios and the operation more lightweight, thereby improving the accuracy of the second target rule.
[0135] In one exemplary embodiment, the system prompts for generating large models using rules are as follows: Figure 8 As shown, the rule generation model first understands the requirements, carefully analyzing the scenario requirements corresponding to the user's input target instruction, that is, determining the target intent of the target instruction. Then, in the " <thinking>Logical reasoning is performed within the "{{Knowledge Base 1}…{Knowledge Base N}}" sequence to determine the target knowledge base combination, and then... <action>The operation to be performed is stated in the "knowledge base 1" and the corresponding tool (which is the candidate knowledge base) is then called. Finally, the result is stored in the "knowledge base 2" in the form of a new knowledge base. <final>The complete solution is given in the tag, and the first target rule is output as the final answer.
[0136] It should be understood that, although each step in the flowchart involved in the above-described embodiments is shown in sequence according to the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in the above-described embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be alternately executed with at least part of other steps or steps or stages in other steps. It can be understood that the steps in different embodiments can be freely combined as needed, and various non-contradictory schemes formed by the combination are within the scope of protection of the present application.
[0137] Based on the same inventive concept, the embodiments of the present application also provide a rule generation device for implementing the above-mentioned rule generation method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more rule generation device embodiments provided below can refer to the limitations of the rule generation method in the above text, which will not be repeated here.
[0138] In one exemplary embodiment, as shown in Figure 9 A rule generation device 900 is provided, comprising: a first acquisition module 901, a screening module 902, and a determination module 903, wherein:
[0139] The first acquisition module 901 is configured to acquire a target instruction.
[0140] The screening module 902 is configured to perform semantic analysis on the target instruction according to a rule generation model, determine a target intent corresponding to the target instruction, and screen a target knowledge base combination corresponding to the target instruction from a plurality of candidate knowledge bases according to the target intent.
[0141] The determination module 903 is configured to determine a first target rule corresponding to the target instruction based on the rule generation model and the target knowledge base combination.
[0142] In one embodiment, the screening module 902 is specifically configured to perform element analysis on the target instruction according to the rule generation model, and determine target elements contained in the target instruction.
[0143] Based on the target elements, a demand scenario analysis is performed, and a target intent corresponding to the target instruction is determined based on the demand scenario analysis result.
[0144] In one of the embodiments, the screening module 902 is specifically configured to acquire the description text of each candidate knowledge base based on a preset system prompt word;
[0145] According to the rule generation model, the description text and the target intent are associated and analyzed, the target knowledge base matched with the target instruction is determined, and the target knowledge base combination is determined according to the target knowledge base.
[0146] In one of the embodiments, the target knowledge base combination includes a label knowledge base, a customer group knowledge base, a relationship graph knowledge base, and a label threshold knowledge base; the determination module 903 is specifically configured to match each target element in the target instruction based on the rule generation model and the label knowledge base, and determine the initial rule corresponding to each target element;
[0147] According to the rule generation model, the customer group knowledge base, the relationship graph knowledge base, and the label threshold knowledge base, the initial rule is respectively corrected to obtain the first target rule.
[0148] In one of the embodiments, the initial rule includes a first screening condition corresponding to each label; the determination module 903 is specifically configured to perform similarity matching on the target instruction based on the rule generation model in the customer group knowledge base, determine the candidate customer group corresponding to the target instruction, and correct the first screening condition based on the candidate customer group to obtain a second screening condition;
[0149] Based on the rule generation model and the relationship graph knowledge base, the association relationship between each label is conditionally enhanced and conflict detected, and the second screening condition is corrected to obtain a third screening condition;
[0150] Based on the rule generation model and the label threshold knowledge base, a label threshold corresponding to the third screening condition is determined;
[0151] According to the rule generation model, the third screening condition, and the label threshold, the first target rule corresponding to the target instruction is generated.
[0152] In one of the embodiments, the device 900 further includes:
[0153] The second acquisition module is configured to acquire a supplementary instruction;
[0154] The multi-round dialogue generation module is configured to perform semantic analysis on the supplementary instruction based on the rule generation model, determine a supplementary rule corresponding to the supplementary instruction, and perform local correction on the first target rule based on the supplementary rule to obtain a second target rule.
[0155] Each of the modules in the rule generation apparatus can be implemented by software, hardware, and combinations thereof, in whole or in part. The modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in the computer device in software form, so as to be invoked by the processor to perform the operations corresponding to the modules.
[0156] In an exemplary embodiment, a computer device, which can be a server, is provided, and an internal structure diagram of the computer device can be as shown in Figure 10 The computer device includes a processor, a memory, an input / output interface, and a communication interface. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store candidate knowledge base data. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with terminals outside through a network connection. The computer program is executed by the processor to implement a rule generation method.
[0157] Those skilled in the art can understand that Figure 10 The structure shown in the above description is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0158] In an exemplary embodiment, a computer device is provided, which includes a memory and a processor. The memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0159] Obtaining a target instruction;
[0160] Performing semantic analysis on the target instruction according to a rule generation model, determining a target intent corresponding to the target instruction, and filtering a target knowledge base combination corresponding to the target instruction from a plurality of candidate knowledge bases according to the target intent;
[0161] Determining a first target rule corresponding to the target instruction based on the rule generation model and the target knowledge base combination.
[0162] In an embodiment, the processor further implements the following steps when executing the computer program:
[0163] According to the rule generation model, element analysis is performed on the target instruction to determine a target element contained in the target instruction;
[0164] Based on each target element, demand scenario analysis is performed, and a target intent corresponding to the target instruction is determined based on the demand scenario analysis result.
[0165] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0166] Based on the preset system prompt word, description text of each candidate knowledge base is obtained;
[0167] According to the rule generation model, association analysis is performed on each description text and the target intent, a target knowledge base matched with the target instruction is determined, and a target knowledge base combination is determined according to the target knowledge base.
[0168] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0169] Based on the rule generation model and the label knowledge base, each target element in the target instruction is matched to determine an initial rule corresponding to each target element;
[0170] According to the rule generation model, the customer group knowledge base, the relationship graph knowledge base and the label threshold knowledge base, the initial rule is respectively corrected to obtain a first target rule.
[0171] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0172] In the customer group knowledge base, based on the rule generation model, similarity matching is performed on the target instruction to determine a candidate customer group corresponding to the target instruction, and the first screening condition is corrected based on the candidate customer group to obtain a second screening condition;
[0173] Based on the rule generation model and the relationship graph knowledge base, the association relationship between labels is conditionally enhanced and conflict detected, and the second screening condition is corrected to obtain a third screening condition;
[0174] Based on the rule generation model and the label threshold knowledge base, a label threshold corresponding to the third screening condition is determined;
[0175] According to the rule generation model, the third screening condition and the label threshold, a first target rule corresponding to the target instruction is generated.
[0176] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0177] A supplementary instruction is obtained;
[0178] The supplementary instruction is subjected to semantic analysis according to the rule generation model, a supplementary rule corresponding to the supplementary instruction is determined, and the first target rule is locally revised according to the supplementary rule to obtain a second target rule.
[0179] In an embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.
[0180] In an embodiment, a computer program product is provided, and the computer program product includes a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.
[0181] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of the related data need to comply with relevant regulations.
[0182] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0183] The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combinations of the technical features do not exist contradictory, they should be considered as the scope of the present application.
[0184] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.< / final> < / action> < / thinking>
Claims
1. A rule generation method characterized by, The method comprises: acquiring a target instruction; performing semantic analysis on the target instruction according to a rule generation model, determining a target intent corresponding to the target instruction, and screening a target knowledge base combination corresponding to the target instruction from multiple candidate knowledge bases according to the target intent; determining a first target rule corresponding to the target instruction based on the rule generation model and the target knowledge base combination.
2. The method of claim 1, wherein, The semantic analysis on the target instruction according to the rule generation model to determine the target intent corresponding to the target instruction comprises: performing element analysis on the target instruction according to the rule generation model to determine target elements contained in the target instruction; performing demand scenario analysis based on each target element, and determining the target intent corresponding to the target instruction based on the demand scenario analysis result.
3. The method of claim 1, wherein, The screening of the target knowledge base combination corresponding to the target instruction from the multiple candidate knowledge bases according to the target intent comprises: acquiring description texts of each candidate knowledge base based on preset system prompt words; performing correlation analysis on each description text and the target intent according to the rule generation model to determine a target knowledge base matched with the target instruction, and determining a target knowledge base combination according to the target knowledge base.
4. The method of claim 1, wherein, The target knowledge base combination comprises a label knowledge base, a customer group knowledge base, a relationship graph knowledge base and a label threshold knowledge base; the determination of the first target rule corresponding to the target instruction based on the rule generation model and the target knowledge base combination comprises: matching each target element in the target instruction based on the rule generation model and the label knowledge base to determine an initial rule corresponding to each target element; correcting the initial rule respectively according to the rule generation model, the customer group knowledge base, the relationship graph knowledge base and the label threshold knowledge base to obtain the first target rule.
5. The method of claim 4, wherein, The initial rule comprises a first screening condition corresponding to each label; the correction of the initial rule respectively according to the rule generation model, the customer group knowledge base, the relationship graph knowledge base and the label threshold knowledge base to obtain the first target rule comprises: in the customer group knowledge base, performing similarity matching on the target instruction based on the rule generation model to determine a candidate customer group corresponding to the target instruction, and correcting the first screening condition based on the candidate customer group to obtain a second screening condition; performing condition enhancement and conflict detection on the association relationship between each label based on the rule generation model and the relationship graph knowledge base, and correcting the second screening condition to obtain a third screening condition; determining a label threshold corresponding to the third screening condition based on the rule generation model and the label threshold knowledge base; generating the first target rule corresponding to the target instruction according to the rule generation model, the third screening condition and the label threshold.
6. The method of claim 1, wherein, After the determination of the first target rule corresponding to the target instruction based on the rule generation model and the target knowledge base combination, the method further comprises: acquiring a supplementary instruction; According to the rule generation model, the supplementary instruction is subjected to semantic analysis, a supplementary rule corresponding to the supplementary instruction is determined, and the first target rule is locally revised according to the supplementary rule to obtain a second target rule.
7. A rule generating apparatus characterized by comprising: The apparatus comprises: A first obtaining module is configured to obtain a target instruction. A screening module is configured to subject the target instruction to semantic analysis according to a rule generation model, determine a target intent corresponding to the target instruction, and screen a target knowledge base combination corresponding to the target instruction from a plurality of candidate knowledge bases according to the target intent. A determining module is configured to determine a first target rule corresponding to the target instruction based on the rule generation model and the target knowledge base combination.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 6.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Rule generation method and device, computer device and storage medium
CN109445842A
Database query instruction generation method and device, computer equipment and storage medium
CN117909355A
Customer group screening method and device, equipment and medium
CN118797134A
Information processing method, apparatus, electronic device and computer readable storage medium
WO2020214011A1
Cited By
Business rule generation method and system, electronic equipment, medium and program product
CN121880423A