Method and device for judging similar distance by adopting paradigm based on large language model
Through the method of judging similar distances with large language models combined with examples, the problem that traditional rule engines are difficult to quantify rule definitions and strong subjectivity in complex scenarios is solved, and the flexibility and accurate judgment of rule engines are achieved, and adaptability and Generalization ability.
Patent Information
- Application Number
- CN202410977038.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-29
AI Technical Summary
Traditional rule engines are difficult to accurately quantify rule definitions in complex application scenarios, and the threshold setting is highly subjective, resulting in limited flexibility and generalization capabilities, affecting their accuracy and application scope.
Using the example method of judging similar distances based on the large language model, by obtaining sample data, combining sample rule scripts to generate natural language description results, perform similar distance judgment on the received real-time business data, dynamically adjust the similar distance threshold, and achieve flexible and accurate Rule judgment.
It improves the adaptability and accuracy of the rule engine, reduces the dependence on precise threshold setting and specific rule definitions, enhances generalization capabilities, and can more flexibly respond to complex and changeable business needs.
Smart Images

Figure CN119045922A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of rule engine decision making, and in particular to a method and device for judging similarity distances by using examples based on a large language model. Background Art
[0002] With the rapid development of big data and artificial intelligence technology, rule engines are playing an increasingly important role in automated decision-making, intelligent analysis and other fields. Traditional rule engines rely on clear and specific rule definitions, and use logical operators to connect rule conditions in order to deterministically determine whether data meets specific conditions. However, in many complex application scenarios, the definition of rules is often difficult to quantify accurately, and the threshold setting is highly subjective, which limits the flexibility and generalization ability of rule engines, affecting their accuracy and scope of application. Summary of the invention
[0003] In view of this, the present application proposes a method for determining similarity distances using examples based on a large language model to solve the problems embodied in the above-mentioned background technology.
[0004] According to one aspect of the present application, a method for determining similarity distance using examples based on a large language model is provided, comprising:
[0005] Acquiring example sample data, wherein the example sample data is generated based on an example rule script;
[0006] Combining the example rule script with the example sample data, and using a large language model, obtaining a corresponding example natural language description result;
[0007] The example natural language description result is used to perform similarity distance judgment on the received real-time business data, and whether the real-time business data conforms to the example rule script is determined based on the judgment result of the similarity distance.
[0008] As an optional implementation scheme of the present application, the obtaining of example sample data includes:
[0009] Run the example rule script to obtain example rule data;
[0010] Data that meets the example standard is extracted from the example rule data to obtain example sample data.
[0011] As an optional implementation scheme of the present application, the obtaining of example sample data further includes:
[0012] The large language model receives a sample rule script;
[0013] The example sample data is generated according to the example rule script.
[0014] As an optional implementation scheme of the present application, the using the example natural language description result to perform similarity distance judgment on the received real-time business data includes:
[0015] Inputting the example natural language description result into the embedded large language model to obtain vector data corresponding to the example natural language description result;
[0016] A similarity distance judgment is performed on the received real-time business data according to the vector data.
[0017] As an optional implementation scheme of the present application, determining that the real-time business data complies with the example rule script according to the judgment of the similarity distance includes:
[0018] Preset similarity distance standard;
[0019] Determining whether the similarity distance between the real-time business data and the vector data meets the similarity distance standard;
[0020] When the similarity distance meets the similarity distance standard, the category of the real-time business data is determined according to the category to which the example rule script belongs.
[0021] As an optional implementation scheme of the present application, judging whether the similarity distance between the real-time service data and the vector data meets the similarity distance standard includes:
[0022] Parsing the real-time business data to obtain business rules corresponding to the real-time business data;
[0023] According to the business rules, call the corresponding dependent data;
[0024] The real-time business data and the dependent data are combined and input into the embedded large language model to obtain the vector data to be determined corresponding to the real-time business data;
[0025] Performing a similarity search using the vector data to be judged to obtain the vector data;
[0026] It is determined whether the similarity distance between the vector data to be determined and the vector data meets the similarity distance standard.
[0027] As an optional implementation scheme of the present application, before obtaining the example sample data, the method further includes:
[0028] Get sample business rules;
[0029] The policy engine is used to analyze the example business rules and generate example rule scripts.
[0030] As an optional implementation scheme of the present application, after inputting the example natural language description result into the embedded large language model to obtain the vector data corresponding to the example natural language description result, it also includes:
[0031] Classifying the vector data to obtain a classification result;
[0032] The vector data and the corresponding classification results are stored in a vector database.
[0033] The present application also provides a device for determining similarity distances using examples based on a large language model, comprising:
[0034] A sample data acquisition module is used to acquire example sample data, and the example sample data is generated based on an example rule script;
[0035] Generate a natural language description module, which is used to combine the example rule script and the example sample data, and use a large language model to obtain a corresponding example natural language description result;
[0036] The judgment module is used to use the example natural language description result to perform similarity distance judgment on the received real-time business data, and determine whether the real-time business data conforms to the example rule script according to the judgment result of the similarity distance.
[0037] The present application also provides an electronic device, including:
[0038] processor;
[0039] a memory for storing processor-executable instructions;
[0040] The processor is configured to implement the above-mentioned method of determining similarity distance based on a large language model using examples when executing the executable instructions.
[0041] Beneficial effects of this application:
[0042] The present invention obtains example sample data, and the example sample data is generated based on an example rule script, the example rule script and the example sample data are combined, and a large language model is used to obtain a corresponding example natural language description result, and the example natural language description result is used to perform a similarity distance judgment on the received real-time business data, and determine whether the real-time business data complies with the example rule script based on the similarity distance judgment. The vector database is used to quickly retrieve typical examples that are most similar to the input data, and combined with a dynamically adjusted similarity distance threshold strategy, flexible and accurate judgment of rule compliance is achieved. This method solves the threshold setting problem that is difficult to handle with traditional rule engines, and improves the adaptability and accuracy of decision-making.
[0043] Other features and aspects of the present application will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the present application and, together with the description, serve to explain the principles of the present application.
[0045] Figure 1 A flowchart showing a method for determining similarity distances using examples based on a large language model according to an embodiment of the present application;
[0046] Figure 2 The cross-selling rules of the embodiment of the present application based on the large language model using examples to judge similar distances are shown;
[0047] Figure 3 The embodiment of the present application shows the cross-selling data based on the large language model using examples to judge similar distances;
[0048] Figure 4 The embodiment of the present application shows vector data of similarity distance determined by examples based on a large language model;
[0049] Figure 5 A block diagram of a device for determining similarity distances using examples based on a large language model according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0050] Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0051] Among them, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application or simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0052] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0053] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0054] In addition, in order to better illustrate the present application, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present application can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present application.
[0055] Large Language Model (LLM) is an important technology in the field of natural language processing (NLP). It uses a deep learning model trained with a large amount of text data to generate natural language text or understand the meaning of language text.
[0056] The Milvus database is an open-source, high-performance, and highly available vector database designed for large-scale machine learning and deep learning applications, and is designed to efficiently manage and retrieve high-dimensional vector data.
[0057] Example 1
[0058] Figure 1 The flowchart of the method for judging similarity distance by using examples based on a large language model according to an embodiment of the present application is shown. Different from the traditional policy engine system, this embodiment adopts another idea. In addition to defining the rules and thresholds of the rule engine, the idea of defining typical examples can also be adopted. Figure 1 As shown, the flow chart includes:
[0059] S100, obtaining example sample data, where the example sample data is generated based on an example rule script;
[0060] The purpose of this step is to define a typical example, which is suitable for rule engine scenarios where it is not easy to define rules and thresholds. In this embodiment, the scenario in which the typical example is applied is to determine whether a product is a cross-selling product in a one-item-one-code system. Before generating a typical example, it is necessary to first determine the example rule script corresponding to the cross-selling product. Finally, according to the example rule script, example sample data that conforms to the cross-selling behavior is generated as a typical example.
[0061] See also Figure 2 , is a cross-selling rule based on Drools rules, as an example rule script; see Figure 3 , is a sample data corresponding to the example rule script.
[0062] S200, combining the example rule script and the example sample data, using a large language model, to obtain a corresponding example natural language description result;
[0063] Using the generalization ability of the large language model, the example rule script of the cross-selling and the example sample data are combined as an input data, the large language model is called, and a prompt that outputs the natural language description corresponding to the input data is constructed. The large language model outputs the example natural language description result. The process of obtaining example sample data and natural language description can reduce manual participation and improve the objectivity of defining typical examples.
[0064] For example, Figure 2 and Figure 3 The content in is combined as the input data of the large language model to obtain the following sample natural language description results:
[0065] At 10:30 am on April 1, 2023, a product with the product number PRD-234567 was scanned in Anqing City (geographic coordinates are 31.2304°N, 121.4737°E). The product is sold and distributed by honest dealer A, and its officially authorized sales area is East China. It is worth noting that although the scanning location, Anqing City, belongs to the East China region in terms of administrative division, according to the detailed geographic location information provided, the scanning behavior actually occurred in Anqing City under the Central China region mark, which deviates from the clear area authorized by the dealer for sales.
[0066] S300, using the example natural language description result to perform similarity distance judgment on the received real-time business data, and determining whether the real-time business data conforms to the example rule script according to the judgment result of the similarity distance.
[0067] The example natural language description result is then input into the Embedding Large Language Model (Embedding LLM) to obtain the embedded vectorized representation of the example natural language description result. One example rule script can generate multiple example sample data, so there are multiple example natural language description results and multiple embedded vectorized representations. The embedded vectorized representation of the example natural language description result is stored in the Milvus database as the basis for processing real-time business data. The process from first determining the example rule script corresponding to the cross-selling to storing the embedded vectorized representation of the example natural language description result in the Milvus database is carried out in the offline stage. When the Milvus database contains the embedded vectorized representation of the example natural language description result, the online real-time processing flow can be entered to determine the similarity distance between the vectorized representation of the real-time business data and the embedded vectorized representation of the example natural language description result for the received real-time business data. The similarity distance can reflect the degree of similarity. The similarity distance between the two can be calculated by algorithms such as the cosine similarity algorithm, and the real-time business data is judged according to the similarity distance whether it conforms to the example rule script, that is, whether the commodity corresponding to the real-time business data is cross-selling behavior.
[0068] As an optional implementation scheme of the present application, obtaining example sample data includes: running an example rule script to obtain example rule data; and extracting data that meets the example standard from the example rule data to obtain example sample data.
[0069] In this embodiment, there are two methods to obtain example rule data for defining typical examples. One of the methods is: after defining the example rule script, directly run the example rule script on the business line, and generate example rule data based on the normal operation of the business. In this embodiment, the example standard satisfies the example rule script and the satisfaction degree reaches 80%. Specifically, for example, the two example rule data a1 and a2 generated both meet the example rule script corresponding to the cross-selling situation, but a1 has more information that can be used to judge whether the cross-selling is happening than a2. Then, when defining a typical example, selecting a1 as a typical example is more helpful for subsequent similarity distance judgment. Therefore, it can be extracted as a typical example by setting the example rule data satisfaction degree to 80%. It should be noted that the user can set the example standard according to the actual situation, extract the corresponding data from the example rule data that meets the cross-selling rules, and obtain the example sample data. In the process of extracting the example sample data, it can be extracted manually.
[0070] Another way is that the example sample data does not need to be extracted again. The example rule data all meet the cross-selling rules. The example rule data can be directly used as the example sample data as a typical example in an automated way.
[0071] As an optional implementation scheme of the present application, obtaining example sample data also includes: the large language model receives an example rule script; and generating example sample data according to the example rule script.
[0072] You can also combine the example rule script with the Prompt that outputs example sample data that conforms to the example rule script and input it into the large language model. The large language model generates and outputs example sample data that conforms to the example rule script based on its own intelligent learning ability and generalization ability. Users can use the example sample data output by the large language model as a typical example.
[0073] As an optional implementation scheme of the present application, a similarity distance judgment is performed on the received real-time business data using a sample natural language description result, including: inputting the sample natural language description result into an embedded large language model to obtain vector data corresponding to the sample natural language description result; and performing a similarity distance judgment on the received real-time business data based on the vector data.
[0074] The example natural language description result obtained by calling the large language model is input into the embedded large language model again. The embedded large language model vectorizes the example natural language description result, that is, it represents the example natural language description result in the form of vector. For example, according to the above-mentioned example natural language description result, the embedded large language model used is bge-large-zh, and the above-mentioned example natural language description result is converted into 768-dimensional vector data. The 768-dimensional vector data is as follows Figure 4 When judging whether the real-time business data is parallel trading, the similarity distance is judged based on the similarity detection of the vector data. It should be noted that the dimension of the vector data obtained by the vectorization processing is not fixed.
[0075] As an optional implementation scheme of the present application, determining whether the real-time business data meets the example rule script based on the judgment of the similarity distance includes: presetting the similarity distance standard; judging whether the similarity distance between the real-time business data and the vector data meets the similarity distance standard; when the similarity distance meets the similarity distance standard, determining the category of the real-time business data according to the category to which the example rule script belongs.
[0076] In this embodiment, the similarity distance standard is: when the vector data corresponding to the real-time business data matches similar vector data in the Milvus database, the similarity distance between the two is calculated, and if the similarity distance between the two is less than 0.9, the real-time business data is determined to correspond to the situation of parallel trading according to the rule of the example rule script belonging to the parallel trading. It should be noted that due to the different results of the example natural language description, the corresponding vector data are also different. The vector data corresponding to the real-time business data should match more than one vector data in the Milvus database to improve the accuracy of the judgment. It should also be noted that the threshold value of the similarity distance of 0.9 is not fixed, and can be debugged according to the number of sample data of the example rule and the situation of the example.
[0077] As an optional implementation scheme of the present application, determining whether the similarity distance between real-time business data and vector data meets the similarity distance standard includes: parsing the real-time business data to obtain business rules corresponding to the real-time business data; calling corresponding dependent data according to the business rules; combining the real-time business data and the dependent data, and inputting them into an embedded large language model to obtain vector data to be determined corresponding to the real-time business data; performing a similarity search using the vector data to be determined to obtain vector data; and determining whether the similarity distance between the vector data to be determined and the vector data meets the similarity distance standard.
[0078] After receiving the real-time business data, it is parsed to obtain the business rules involved, and dependent data is called according to the business rules. In this embodiment, dependent data refers to the ability to derive real-time business data based on one or more data items, and these one or more data items have a dependency relationship with the real-time business data.
[0079] The judgment of similarity distance is made at the vector level, so the real-time business data should also be vectorized, and the real-time business data and dependent data should be combined and input into the embedded large language model as a whole to obtain the corresponding vector data to be judged. At this time, the vector data to be judged can be used for similarity search in the Milvus database. When the search result of matching is vector data, it means that the vector data to be judged is similar to the vector data in the Milvus database. The similarity distance between the vector data to be judged and the matched vector data is further calculated, and whether the real-time business data is a case of parallel trading is determined based on whether the similarity distance meets the similarity distance standard.
[0080] As an optional implementation scheme of the present application, before obtaining the example sample data, it also includes: obtaining example business rules; using a policy engine to analyze the example business rules and generate example rule scripts.
[0081] Before obtaining the example sample data, it is necessary to determine the example rule script. Specifically, in this embodiment, the rules of the business line where the cross-selling is located are used as example business rules, including anti-counterfeiting rules, cross-selling rules, and marketing rules. The above rules are parsed and loaded one by one, and the Drools policy engine is used to integrate the above rules into an example rule script that generates the cross-selling example rule data, that is, a sample rule script includes the rules of the business line where the cross-selling is located.
[0082] As an optional implementation scheme of the present application, after inputting the example natural language description result into the embedded large language model to obtain the vector data corresponding to the example natural language description result, it also includes: classifying the vector data to obtain the classification result; and storing the vector data and its corresponding classification result in a vector database.
[0083] When there are a lot of vector data, they can be classified into low-dimensional vectors and high-dimensional vectors according to their dimensions. The classification results of each vector data are stored in the vector database together with the vector data, which is beneficial for the vector data corresponding to the real-time business data to quickly match similar vector data in the Milvus database according to its corresponding classification results.
[0084] Through the above methods, the dependence on precise threshold setting and specific rule definition is reduced, and the rule engine can respond to complex and changing business needs more flexibly by defining typical examples. Combining large language models with embedding technology, it can not only handle known typical example situations, but also effectively classify and make decisions on unseen examples through the semantic understanding ability of the model, thereby enhancing the generalization ability of the rule engine. In addition, a similarity distance judgment mechanism is introduced to debug the threshold by testing the sample data of the example to ensure the accuracy and robustness of the decision, so that the system can adapt to changes in different environments. In summary, this method uses the vector database to quickly retrieve the typical examples that are most similar to the input data, and combines the dynamically adjusted similarity distance threshold strategy to achieve flexible and accurate judgment of rule compliance. This method solves the threshold setting problem that is difficult for traditional rule engines to handle, and improves the adaptability and accuracy of decision-making.
[0085] Example 2
[0086] Based on the same principle as the above method, a device for judging similarity distance based on a large language model and using examples is also proposed, see Figure 5 , a device 100 for determining similarity distance based on a large language model using examples according to an embodiment of the present disclosure includes:
[0087] The sample data acquisition module 110 is used to acquire example sample data, and the example sample data is generated based on the example rule script;
[0088] A natural language description generating module 120 is used to combine the example rule script and the example sample data, and use the large language model to obtain the corresponding example natural language description result;
[0089] The judgment module 130 is used to perform similarity distance judgment on the received real-time business data using the example natural language description result, and determine whether the real-time business data conforms to the example rule script according to the judgment result of the similarity distance.
[0090] Obviously, those skilled in the art should understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned control methods. The modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Optionally, they can be implemented by program codes executable by computing devices, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules respectively, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the present invention is not limited to any specific combination of hardware and software.
[0091] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned control methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, abbreviated as: HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0092] Example 3
[0093] Furthermore, an electronic device is proposed, comprising:
[0094] processor;
[0095] a memory for storing processor-executable instructions;
[0096] The processor is configured to implement the method of using examples to determine similarity distance based on a large language model in Example 1 when executing executable instructions.
[0097] The electronic device of the embodiment of the present disclosure includes a processor and a memory for storing instructions executable by the processor, wherein the processor is configured to implement any of the above methods for determining similarity distances based on large language models and using examples when executing the executable instructions.
[0098] It should be noted that the number of processors may be one or more. At the same time, the electronic device of the embodiment of the present disclosure may also include an input device and an output device. The processor, memory, input device, and output device may be connected via a bus or in other ways, which are not specifically limited here.
[0099] The memory is a computer-readable storage medium for the method for determining similarity distances based on large language models using examples, and can be used to store software programs, computer executable programs, and various modules, such as: the program or module corresponding to the method for determining similarity distances based on large language models using examples in the embodiment of the present disclosure. The processor executes various functional applications and data processing of the electronic device by running the software programs or modules stored in the memory.
[0100] The input device can be used to receive input numbers or signals. The signal can be a key signal related to user settings and function control of the device / terminal / server. The output device can include a display device such as a display screen.
[0101] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for judging similarity distance using examples based on a large language model, characterized in that: include: Acquiring example sample data, wherein the example sample data is generated based on an example rule script; Combining the example rule script with the example sample data, and using a large language model, obtaining a corresponding example natural language description result; The example natural language description result is used to perform similarity distance judgment on the received real-time business data, and whether the real-time business data conforms to the example rule script is determined based on the judgment result of the similarity distance.
2. The method for determining similarity distances by using examples based on a large language model according to claim 1, characterized in that: The obtaining of example sample data includes: Run the example rule script to obtain example rule data; Data that meets the example standard is extracted from the example rule data to obtain example sample data.
3. The method for determining similarity distances by using examples based on a large language model according to claim 1, characterized in that: The obtaining of example sample data further includes: The large language model receives a sample rule script; The example sample data is generated according to the example rule script.
4. The method for determining similarity distance using examples based on a large language model according to claim 1, characterized in that: The using the example natural language description result to perform similarity distance judgment on the received real-time business data includes: Inputting the example natural language description result into the embedded large language model to obtain vector data corresponding to the example natural language description result; A similarity distance judgment is performed on the received real-time business data according to the vector data.
5. The method for determining similarity distance by using examples based on a large language model according to claim 4, characterized in that: Determining that the real-time business data meets the example rule script according to the judgment of the similarity distance includes: Preset similarity distance standard; Determining whether the similarity distance between the real-time business data and the vector data meets the similarity distance standard; When the similarity distance meets the similarity distance standard, the category of the real-time business data is determined according to the category to which the example rule script belongs.
6. The method for determining similarity distance using examples based on a large language model according to claim 5, characterized in that: Determining whether the similarity distance between the real-time service data and the vector data meets the similarity distance standard includes: Parsing the real-time business data to obtain business rules corresponding to the real-time business data; According to the business rules, call the corresponding dependent data; The real-time business data and the dependent data are combined and input into the embedded large language model to obtain the vector data to be determined corresponding to the real-time business data; Performing a similarity search using the vector data to be judged to obtain the vector data; It is determined whether the similarity distance between the vector data to be determined and the vector data meets the similarity distance standard.
7. The method for determining similarity distance by using examples based on a large language model according to claim 5, characterized in that: Before obtaining the sample data, it also includes: Get sample business rules; The policy engine is used to analyze the example business rules and generate example rule scripts.
8. The method for determining similarity distance using examples based on a large language model according to claim 4, characterized in that: After inputting the example natural language description result into the embedded large language model to obtain vector data corresponding to the example natural language description result, the method further includes: Classifying the vector data to obtain a classification result; The vector data and the corresponding classification results are stored in a vector database.
9. A device for judging similarity distance using examples based on a large language model, characterized in that: include: A sample data acquisition module is used to acquire example sample data, and the example sample data is generated based on an example rule script; Generate a natural language description module, which is used to combine the example rule script and the example sample data, and use a large language model to obtain a corresponding example natural language description result; The judgment module is used to use the example natural language description result to perform similarity distance judgment on the received real-time business data, and determine whether the real-time business data conforms to the example rule script according to the judgment result of the similarity distance.
10. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the method for determining similarity distance based on a large language model and using examples as described in any one of claims 1 to 8 when executing the executable instructions.
