Method, device and medium for constructing prompt words based on domain knowledge for granular computing

By using domain knowledge in particle calculation to build prompt words and large language models to generate attribute-pair probability matrix, optimize particle correlation judgment and operation, the problem of invalid inference results in particle calculation is solved, and higher quality and correlation particle calculation results are achieved.

CN119476444BActive Publication Date: 2025-06-24SOUTH CHINA NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411755995.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-06-24
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

During the particle calculation process, the same problem may have different technical backgrounds, constraints or solution goals in different industries, resulting in a large number of invalid or incorrect solution directions for the inference results obtained by particle calculation, which increases calculation complexity and resource consumption.

Method used

By acquiring domain knowledge, building prompt words and inputting large language models, generating attribute-pair probability matrix, judging the correlation between particles to be calculated, and performing particle splitting, recombination or isomorphic operations when a specific threshold is reached, optimizing the particle calculation process.

Benefits of technology

It reduces the discovery of invalid object patterns during particle calculation, improves the correlation and quality of inference results, provides better problem solving orientation, and is suitable for particle calculation applications in different industries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476444B_ABST
    Figure CN119476444B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, and medium for constructing prompt words based on domain knowledge for granular computing. The method includes the following steps: obtaining domain knowledge and constructing prompt words according to the domain knowledge; inputting the prompt words into a large language model to obtain an attribute pair probability matrix; judging the correlation between particles to be calculated according to the attribute pair probability matrix; when the correlation between the particles to be calculated meets the requirements, performing a granular computing operation on the particles to be calculated. In the embodiments of the present invention, constraint conditions are constructed during the granular computing process through domain knowledge, which can reduce the discovery of invalid object patterns during the granular computing process and obtain object patterns with higher correlation as inference results with higher quality. The object patterns obtained in the embodiments of the present invention can better prompt the attribute information that industry personnel need to focus on, provide a better guiding role for problem-solving, and are widely applied to the granular computing solution process in different industry fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of particle computing, and particularly to a method, device and medium for constructing prompt words based on domain knowledge for particle computing. Background Art

[0002] Granular computing is a new concept and computing paradigm in the current field of intelligent information processing. It is a methodology for studying thinking modes, complex problem solving, information processing modes and their related theories, technologies and tools based on multi-level granular structures. In the process of granular computing, people decompose multi-granularity and multi-form data in social networks into particles, and explore the mutual relationships between particles from multiple perspectives and multiple levels to obtain more comprehensive and sufficient reasoning results.

[0003] However, in different industrial fields, the same problem may have different technical backgrounds, constraints or solution objectives; a large part of the reasoning results obtained by granular computing are often reasoning results that are not helpful for solving the problem. This part of the reasoning results will not only increase the complexity of the calculation and the consumption of computing resources, but may also provide a wrong solution direction for the problem, resulting in the obtained solution result not being a reasonable solution result. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a method, device and medium for constructing prompt words based on domain knowledge for particle computing.

[0005] The first aspect of the present invention provides a method for constructing prompt words based on domain knowledge for particle computing, including the following steps:

[0006] Obtain domain knowledge and construct prompt words according to the domain knowledge;

[0007] Input the prompt words into a large language model to obtain an attribute pair probability matrix;

[0008] Judge the correlation between particles to be calculated according to the attribute pair probability matrix;

[0009] When the correlation between the particles to be calculated meets the requirements, perform particle computing operations on the particles to be calculated.

[0010] Further, the domain knowledge is a data set composed of terms, definitions, concepts, tools, standards, processes, cases and statistical data used in the field.

[0011] Further, the prompt words include task content, task object, task example and task attribute;

[0012] The task content is used to describe the reasoning operation that the large language model needs to perform;

[0013] The task object is used to describe the object that the large language model plays when performing inference operations;

[0014] The task example is used to describe the format of the inference result output by the large language model;

[0015] The task attribute is used to describe the limiting conditions for the large model to perform inference operations.

[0016] Further, constructing the prompt word according to domain knowledge specifically includes the following steps:

[0017] Determine the task content and task object of the prompt word;

[0018] Use the preset two-dimensional correlation matrix example as the task example of the prompt word;

[0019] Determine the task attribute of the prompt word according to domain knowledge.

[0020] Further, the large language model is any one of a language large model and a multimodal large model; after receiving the prompt word input, the large language model completes the inference based on the task attribute in the large language model according to the task object and task content, and obtains an attribute pair probability matrix with the task example format as the output of the large language model.

[0021] Further, judging the correlation between the particles to be calculated according to the attribute pair probability matrix specifically includes the following steps:

[0022] Obtain the core attributes of the particles to be calculated;

[0023] Search for the core attributes of the particles to be calculated in the attribute pair probability matrix, and use the intersection of the core attributes of the particles to be calculated as the correlation between the particles to be calculated.

[0024] Further, the particles to be calculated are expressed by a three-branch partial order structure diagram.

[0025] Further, when the correlation between the particles to be calculated reaches the requirement, perform a granulation calculation operation on the particles to be calculated, specifically including the following steps:

[0026] Obtain the particles to be calculated;

[0027] Judge whether the correlation between the core attributes of the particles to be calculated reaches the requirement of the preset particle splitting threshold; when the correlation between the particles to be calculated reaches the requirement of the preset particle splitting threshold, perform a particle splitting operation on the particles to be calculated, and split one particle into multiple new particles;

[0028] Determine whether the correlation between the particles to be calculated reaches the preset particle recombination threshold requirement; when the correlation between the particles to be calculated reaches the preset particle recombination threshold requirement, perform a particle recombination operation on the particles to be calculated, and combine multiple particles into a new particle;

[0029] Determine whether the correlation between the particles to be calculated reaches the preset particle isomorphism threshold requirement; when the correlation between the particles to be calculated reaches the preset particle isomorphism threshold requirement, perform a particle isomorphism operation on the particles to be calculated, and isomorphize multiple particles into new particles and generate a new object pattern;

[0030] Determine whether a new object pattern is generated during the particle isomorphism operation; when a new object pattern is generated, add the new particle to the particles to be calculated, and return to the step of performing a particle recombination operation on the particles to be calculated when the correlation between the particles to be calculated reaches the preset particle recombination threshold requirement, until no new object pattern is generated;

[0031] When no new object pattern is generated, obtain all the newly generated object patterns and summarize and output them.

[0032] The second aspect of the present invention provides an electronic device, including a processor and a memory;

[0033] The memory is used to store programs;

[0034] The processor executes the program to implement the method of performing granular computing by constructing prompt words based on domain knowledge.

[0035] The third aspect of the present invention provides a computer-readable storage medium, and the storage medium stores a program, and the program is executed by a processor to implement the method of performing granular computing by constructing prompt words based on domain knowledge.

[0036] The embodiment of the present invention also discloses a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the foregoing method.

[0037] Embodiments of the present invention have the following beneficial effects: An embodiment of the present invention is a method, device, and medium for constructing a prompt word based on domain knowledge for granular computing. By constructing constraint conditions in the granular computing process through domain knowledge, it is possible to reduce the discovery of invalid object patterns in the granular computing process and obtain a more relevant object pattern as a higher-quality reasoning result. The object pattern obtained in the embodiment of the present invention can better prompt the attribute information that industry personnel need to focus on, provide a better guiding role for problem-solving, and be widely applied to the granular computing solution process in different industry fields.

[0038] Additional aspects and advantages of the present invention will be given in the following description section, some will become obvious from the following description, or will be understood through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0040] Figure 1 is a basic flowchart of an embodiment of a method for constructing a prompt word based on domain knowledge for granular computing according to the present invention.

[0041] Figure 2 is a classification schematic diagram of a large language model.

[0042] Figure 3 is a flowchart of the process of a large language model processing a prompt word to obtain an attribute pair probability matrix.

[0043] Figure 4 is a schematic diagram of a particle to be calculated expressed by a three-way partial order structure diagram.

[0044] Figure 5 is a schematic diagram of judging the correlation between particles to be calculated according to the attribute pair probability matrix.

[0045] Figure 6 is a detailed flowchart of an embodiment of a method for constructing a prompt word based on domain knowledge for granular computing according to the present invention.

[0046] Figure 7 is a schematic diagram of the structure of an electronic device according to the present invention.

[0047] Figure 8 is a schematic diagram of the structure of a computer-readable storage medium according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0048] To make the objectives, technical solutions and advantages of this application clearer, the following further elaborates on this application in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely used to explain this application and are not used to limit this application.

[0049] To improve the effectiveness of the inference results obtained by granular computing, as Figure 1 shown, the first embodiment of the present invention provides a method for constructing prompts based on domain knowledge for granular computing, including the following steps:

[0050] S1. Obtain domain knowledge and construct prompts according to the domain knowledge;

[0051] S2. Input the prompts into a large language model to obtain an attribute pair probability matrix;

[0052] S3. Judge the correlation between the particles to be calculated according to the attribute pair probability matrix;

[0053] S4. When the correlation between the particles to be calculated meets the requirements, perform granular computing operations on the particles to be calculated.

[0054] In the embodiment of the present invention, prompts are constructed based on domain knowledge for the large model to process, and the large model obtains an attribute pair probability matrix to analyze the correlation of the particles to be calculated, realizing a granular computing process guided by domain knowledge. The embodiment of the present invention can obtain a granular computing result that is more in line with the industry field of problem-solving and has stronger pertinence, and has a better guiding effect on industry personnel.

[0055] As a preferred embodiment, the implementation processes of each step of the present invention are specifically discussed below.

[0056] S1. Obtain domain knowledge and construct prompts according to the domain knowledge.

[0057] In the embodiment of the present invention, domain knowledge refers to the professional knowledge and experience accumulated in a specific discipline or industry, including but not limited to the terms, definitions and basic concepts used in a specific field, such as disease names and treatment methods in medicine, or species classification in biology; or the standards and processes generally accepted in a specific field, such as design specifications in the engineering field and diagnosis and treatment guidelines in the medical field; or even the data sets and statistical information formed by the successful cases and lessons learned accumulated through practice and research in a specific field, such as experimental data in biological research or market data in the financial field; it may also be the special tools and technologies used in a specific field, such as medical image processing software and bioinformatics analysis tools.

[0058] Domain knowledge is crucial for improving the accuracy and applicability of granular computing, as it can help better understand and handle problems related to specific industrial domains. By integrating domain knowledge into the reasoning process of granular computing, the effectiveness and efficiency of reasoning can be enhanced, making the reasoning results more intelligent and reliable.

[0059] As an optional implementation, constructing prompting words according to domain knowledge in step S1 specifically includes the following steps:

[0060] S1-1. Determine the task content and task object of the prompting word;

[0061] S1-2. Use the preset two-dimensional correlation matrix example as the task example of the prompting word;

[0062] S1-3. Determine the task attributes of the prompting word according to domain knowledge.

[0063] Those skilled in the art can understand that a prompting word (prompt) refers to a piece of text or instruction input into a large language model to guide the large language model to generate a specific type of output or complete a specific task. In the embodiments of the present invention, the prompting words constructed based on domain knowledge include four aspects: task object (role), task content (task), task example (example), and task attributes (attributes). Among them, the task content is used to describe the reasoning operation that the large language model needs to perform; the task object is used to describe the object that the large language model plays when performing the reasoning operation; the task example is used to describe the format of the reasoning result output by the large language model; the task attributes are used to describe the limiting conditions for the large model to perform the reasoning operation. Among them, the task object and task content are determined according to the actual problem to be solved by granular computing, the task example is a preset two-dimensional correlation matrix, and the task attributes are determined by the data set constructed by the above domain knowledge.

[0064] As a specific embodiment, the two-dimensional correlation matrix structure is as follows:

[0065]

[0066] In the two-dimensional correlation matrix, the content of the first row and the first column are the attributes in the domain knowledge, and the middle numerical value represents the correlation degree between the row attribute and the column attribute, ranging from 0 to 1. 0 means that the row attribute and the column attribute are completely uncorrelated, and 1 means that the row attribute and the column attribute are completely correlated.

[0067] S2. Input the prompting word into the large language model to obtain the attribute pair probability matrix.

[0068] In the embodiments of the present invention, the large language model is any one of a natural language processing (NLP) large language model and a multimodal large language model.

[0069] Among them, a large language model refers to a type of large model in the field of Natural Language Processing (NLP), which is usually used to process text data and understand natural language. The main feature of such large models is that they are trained on large-scale corpora to learn various grammar, semantics, and context rules of natural language. For example: GPT series, Bard, Wenxin Yiyan, etc.

[0070] Multimodal large model: It refers to a large model that can process multiple different types of data, such as text, images, audio, and other multimodal data. This type of model combines the capabilities of NLP and CV to achieve comprehensive understanding and analysis of multimodal information, so as to be able to understand and process complex data more comprehensively. For example: DingoDB multimodal vector database, DALL-E, Wukong Painting, midjourney, etc.

[0071] In some embodiments, multiple large language models can also be combined into a general large language model. The general large language model uses large computing power, uses a vast amount of open data, and deep learning algorithms with a huge number of parameters to train on large-scale unlabeled data; to find features and discover patterns, forming a powerful generalization ability to "draw inferences from one instance", and realizing the completion of multi-scenario tasks without fine-tuning or with little fine-tuning.

[0072] As Figure 3 shown, in the embodiment of the present invention, after the large language model receives the prompt input, based on the task object and task content, it completes the reasoning based on the task attributes in the large language model, and obtains an attribute pair probability matrix in the format of a task example as the output of the large language model. The attribute pair probability matrix can evaluate the correlation degree between various attributes in the industry, and has an obvious optimization effect on the granulation computing process.

[0073] S3. Judge the correlation between the particles to be calculated according to the attribute pair probability matrix.

[0074] In the embodiment of the present invention, the data source of granulation computing is the particles to be calculated formed by granulating the domain knowledge in the industry, and the solution result is the object pattern formed between the particles. Each particle to be calculated can be expressed by a triple AG = {K, O, A}. In this triple data, K represents the core attribute of the particle to be calculated, O represents the object pattern corresponding to the particle to be calculated, and A represents the set of domain knowledge attributes associated with the particle to be calculated. Each object pattern can be described by a binary data OP = (O, A); in this triple, A is the set of domain knowledge attributes corresponding to the object pattern, and O is the set of domain knowledge objects corresponding to the object pattern.

[0075] In a specific embodiment, the particles to be calculated can be in Figure 4The three-branch poset structure diagram arrangement shown can effectively express the hierarchical structure between particles, making it possible to solve problems such as mapping between different particle layers, conversion between different granularities, and property preservation. Among the Figure 4 particles to be calculated, the three particles located below the top layer (root node) can be expressed by the following triple data: AG11 = (b, 125, ab), AG12 = (c, 478, ac), AG13 = (bc, 36, abc). Each branch in the three-branch poset structure diagram constitutes an object pattern by itself, and the object patterns of each branch can be described in sequence as: OP1 = (5, abdf), OP2 = (2, abgh), OP3 = (1, abg), OP4 = (8, acdf), OP5 = (7, acde), OP6 = (4, acghi), OP7 = (6, abcdf), OP8 = (3, abcgh).

[0076] In step S3, the correlation between the particles to be calculated is judged according to the attribute pair probability matrix, which specifically includes the following steps:

[0077] S3-1. Obtain the core attributes of the particles to be calculated;

[0078] S3-2. Search for the core attributes of the particles to be calculated in the attribute pair probability matrix, and take the intersection of the core attributes of the particles to be calculated as the correlation between the particles to be calculated.

[0079] In the embodiments of the present invention, each particle to be calculated has at least one core attribute. In the attribute pair probability matrix, the core attribute of one particle is queried in the first row, and the core attribute of another particle is queried in the first column. The value in the intersection of the row and column where the core attribute is located is the correlation between the particles to be calculated. For a particle with multiple core attributes, after looking up the correlation values of each core attribute respectively, the average of the correlation values corresponding to each core attribute is used as the overall correlation of the particle.

[0080] S4. When the correlation between the particles to be calculated reaches the requirement, perform a granular calculation operation on the particles to be calculated.

[0081] In step S4, when the correlation between the particles to be calculated reaches the requirement, perform a granular calculation operation on the particles to be calculated, which specifically includes the following steps:

[0082] S4-1. Obtain the particles to be calculated.

[0083] S4-2. Judge whether the correlation between the core attributes of the particles to be calculated reaches the requirement of the preset particle splitting threshold; when the correlation between the particles to be calculated reaches the requirement of the preset particle splitting threshold, perform a particle splitting operation on the particles to be calculated, and split one particle into multiple new particles.

[0084] In the embodiments of the present invention, the purpose of the granular split (gs) operation is to split a particle into multiple particles according to the core attributes of the particle. To constrain the number of results generated during the particle split process, the embodiments of the present invention design a gs threshold. If the average correlation between particle core attributes is higher than this gs threshold, it indicates that the correlation of these attributes is very high, and the probability of these attributes being on the same object is very high. Therefore, no particle split operation is required.

[0085] As a preferred embodiment, the particle split operation is completed through the following particle split operator:

[0086] gs(AG)={AG i |AG i .K⊆2K, AG i .A=AG i .K∩AG.A, AG i .O=AG.O∪?, i<2 |K |-1} (Formula 1).

[0087] As shown in Formula 1, for each new particle AG generated by the particle split gs i , its core attribute set AG i .K and the concept intension AG i .A are respectively subsets of the target particle K and A; while its concept extension AGi.O has a certain degree of uncertainty, and the uncertain part {?} is exactly what needs to be filled in the entire knowledge reasoning process.

[0088] For a particle AG in a given attribute partial order structure, if the particle AG has the ability to split into new particles, then through the particle split operator gs, all newly generated particles gs(AG) must be in the same layer as AG in the corresponding particle structure; at the same time, gs(AG) and AG have the same parent particle.

[0089] S4-3. Determine whether the correlation between the particles to be calculated reaches the requirements of the preset particle recombination threshold; when the correlation between the particles to be calculated reaches the requirements of the preset particle recombination threshold, perform a particle recombination operation on the particles to be calculated, and combine multiple particles into a new particle.

[0090] In the embodiments of the present invention, the purpose of the granular combination (gc) operation is to combine two compliant particles into one. Based on this, a gc threshold is defined in the embodiments of the present invention. If the average correlation between the core attributes of the two particles used for granular combination is lower than this threshold, it indicates that the correlation of the core attributes of the two particles is insufficient, that is, these attributes are unlikely to appear in the same object, so the gc operation does not need to be performed.

[0091] As a preferred embodiment, the granular combination operation is completed by the following granular combination operator:

[0092] gc(AG1,AG2)={AG i |AG i .K = AG1.K ∪ AG2.K, AG i .A = AG1.A ∪ AG2.A, AG i .O =?, i = 1} (Formula 2).

[0093] As shown in Formula 2, the granular combination operator gc satisfies the commutative law: gc(AG1,AG2) = gc(AG2,AG1); for each new particle AG i generated by gc, its core attribute set AG i .K and the conceptual intension AG i .A are respectively the union of the K and A of the two original particles; while its conceptual extension AG i .O is completely uncertain and needs to be filled in the process of knowledge reasoning.

[0094] For two particles AG1 and AG2 in a given attribute partial order structure, if they can be combined to form a new particle, then through the granular combination operator, the newly generated particle gc(AG1,AG2) must be on the same layer as the original particles AG1 and AG2 and have the same parent particle.

[0095] S4-4. Determine whether the correlation between the particles to be calculated reaches the requirement of the preset particle isomorphism threshold; when the correlation between the particles to be calculated reaches the requirement of the preset particle isomorphism threshold, perform the particle isomorphism operation on the particles to be calculated, and isomorphism multiple particles into a new particle and generate a new object pattern;

[0096] In the embodiments of the present invention, the purpose of the granular isomorphism (gi) operation is to isomorphic the child particles of a granule into another compliant particle as a child particle. Therefore, a gi threshold is designed in the embodiments of the present invention. If the average correlation between the child particles is lower than this threshold, it indicates that the correlation between the core attributes of this child particle and the attributes of another child particle is insufficient, so the gi operation does not need to be performed.

[0097] As a preferred embodiment, the particle isomorphism operation is completed by the following particle isomorphism operator:

[0098] (Formula 3).

[0099] As shown in Formula 3, the particle isomorphism operator gi does not satisfy the commutative law: gi(AG1, AG2) ≠ gi(AG2, AG1); for each new particle AG generated by gi(AG1, AG2) i , its core attribute set AG i .K must be the same as one of the child node particles of AG2 and not appear in the original child nodes of AG1; at the same time, its conceptual connotation AG i .A is the union of AG i .K and AG2.A; and its conceptual extension AG i .O is completely uncertain and needs to be filled in the process of knowledge reasoning. The situation is similar for each new particle AG generated by gi(AG2, AG1) i .

[0100] For two particles AG1 and AG2 in a given attribute partial order structure, if they can be isomorphic to form new particles, then through the particle isomorphism operator, the newly generated particles gi(AG1, AG2) and gi(AG2, AG1) must be respectively located in the next layer of the original particles AG1 and AG2 and are respectively the sub-particles of AG1 and AG2. In addition, for AG i ∈{gi(AG1, AG2) ∪ gi(AG2, AG1)}, if AG i .K = Ø, then AGi is a possible object pattern and can be described as: OP = (AG i .O, AG i .A).

[0101] Figure 5 Shown is a specific process for judging the correlation between particles. Figure 5The particle splitting threshold, particle recombination threshold, and particle isomorphism threshold designed in it are 0.85, 0.15, and 0.15 respectively. In the particle splitting step, for the two particles a, b and a, c, the average correlation of (a, b) is 0.8, which is less than the particle splitting threshold of 0.85, so the particle separation operation can be performed; the average correlation of (a, c) is 0.8, which is greater than the particle splitting threshold of 0.85, so the particle splitting operation is not required. In the particle recombination step, for the two particles a, d and a, e, the particle correlation of (a, d) is 0.2, which is greater than the particle recombination threshold of 0.15, so the particle recombination operation can be performed; the particle correlation of (a, e) is 0.1, which is less than the particle recombination threshold of 0.15, so the particle recombination operation is not required. In the particle isomorphism step, for the sub-particle d of ab and the sub-particles c, e of a, the particle correlation (average) of (fab, d) is 0.4, which is greater than the particle isomorphism threshold of 0.15, so the particle isomorphism operation can be performed; the particle correlation (average) of (fa, c) is 0.5, which is greater than the particle isomorphism threshold of 0.15, so the particle isomorphism operation can be performed; the particle correlation (average) of (fa, e) is 0.1, which is less than the particle isomorphism threshold of 0.15, so the particle isomorphism operation is not required.

[0102] S4-5. Determine whether a new object pattern is generated in the particle isomorphism operation; when a new object pattern is generated, add the new particle to the particles to be calculated, and return to the step of performing the particle recombination operation on the particles to be calculated when the correlation between the particles to be calculated reaches the preset particle recombination threshold requirement, until no new object pattern is generated.

[0103] S4-6. When no new object pattern is generated, obtain all the newly generated object patterns and summarize and output them.

[0104] After completing all the particle calculation processes, in the embodiments of the present invention, all the newly generated object patterns are output as the inference results of the particle calculation.

[0105] The detailed implementation process of the method of the present invention is as Figure 6 shown. As a specific embodiment, the Tuberculosis dataset is a relationship graph between tuberculosis symptoms and tuberculosis patients, as shown in the following table:

[0106]

[0107] Among them, the columns represent 12 possible symptoms of tuberculosis: persistent cough, sputum production, the sputum produced is mucopurulent, blood in the sputum, clear sputum, weight loss, severe night sweats, loss of appetite, chest pain, shortness of breath, tuberculosis contact, fatigue; the rows represent 23 tuberculosis patients. The goal of this embodiment is to infer the symptom combinations that tuberculosis may cause, that is, the object pattern, based on the symptom combinations of certain tuberculosis patients. In this embodiment, a three-way partial order granular structure is constructed based on the first 14 patients, and then the granular computing method and the method proposed by the present invention are respectively used to compare the object patterns and the results and quantities of the particles generated by the inference. The results are shown in the following table:

[0108]

[0109] For the inference results, since only the first 14 patients are selected in this embodiment, it is necessary to determine whether the symptom combinations of the last 9 patients can be deduced. Using Python to analyze the detailed domain knowledge and the object pattern results (not shown), for the conventional granular computing method, the symptom combinations of all 9 patients can be deduced, while using the granular computing method based on domain knowledge of the present invention, except that the symptom combination of patient No. 20 cannot be deduced, the symptom combinations of the remaining 8 patients can all be deduced. Based on this, when making a judgment, more attention needs to be paid to symptom e: clear sputum, which can be achieved by increasing the correlation between symptom e and other symptoms, or adjusting the threshold, or inviting experts to design a perfect correlation two-dimensional matrix.

[0110] For the inference quantity, as can be seen from the above table, using simple granular computing, excluding the known symptom combinations, 2315 possible symptom combinations of tuberculosis patients will be deduced through calculation. However, if the method proposed by the present invention is used, the result of the inference calculation is only 1214, which is approximately half of the quantity reduced.

[0111] Combining the above content, it is found that the method of constructing prompts based on domain knowledge for granular computing in the embodiment of the present invention not only greatly reduces the quantity of tuberculosis symptom combinations, but also guides doctors to pay more attention to the symptom of clear sputum, which prompts doctors that clear sputum may also be a phenomenon of tuberculosis patients, helping doctors avoid misdiagnosis and missed diagnosis during the diagnosis of tuberculosis.

[0112] Figure 7It is a schematic structural diagram of the electronic device proposed in the second embodiment of the present invention. In this embodiment, the memory stores program instructions for implementing the method of performing granular computing by constructing prompt words based on domain knowledge in any of the above embodiments. The processor is used to execute the program instructions stored in the memory to perform granular computing by constructing prompt words based on domain knowledge. Among them, the processor can also be referred to as the CPU (Central Processing Unit, central processing unit). The processor may be an integrated circuit chip with signal processing capabilities. The processor can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0113] The content of the method in the first embodiment of the present invention is applicable to this embodiment of the electronic device. The functions specifically implemented in this embodiment of the electronic device are the same as those in the above method embodiment, and the beneficial effects achieved are also the same as those achieved by the above method.

[0114] Figure 8 It is a schematic structural diagram of the computer-readable storage medium according to the third embodiment of the present invention. The computer-readable storage medium according to the fourth embodiment of the present invention stores program instructions capable of implementing the method of performing granular computing by constructing prompt words based on domain knowledge. Among them, the program instructions can be stored in the above storage medium in the form of a software product, including several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods in various embodiments of the present invention. The aforementioned computer-readable storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read - Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes, or terminal devices such as computers, servers, mobile phones, and tablets.

[0115] The content of the method in the first embodiment of the present invention is applicable to this embodiment of the computer-readable storage medium. The functions specifically implemented in this embodiment of the computer-readable storage medium are the same as those in the above method embodiment, and the beneficial effects achieved are also the same as those achieved by the above method.

[0116] This embodiment also provides a computer program product. When the computer program product runs on a computer, it causes the computer to execute the above-related steps to implement the method of performing granular computing by constructing prompt words based on domain knowledge provided in the above embodiments.

[0117] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the embodiments of the present invention are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or reject.

[0118] Those skilled in the art can understand that the modules in the devices in the embodiments of the present invention can be adaptively changed and arranged in one or more devices different from this embodiment. The modules or units or components in the embodiments of the present invention can be combined into one module or unit or component, and in addition, they can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all the features disclosed in this specification (including the corresponding claims, abstract, and drawings) and all the processes or units of any method or device so disclosed. Unless otherwise explicitly stated, each feature disclosed in this specification (including the corresponding claims, abstract, and drawings) can be replaced by an alternative feature that provides the same, equivalent, or similar purpose.

[0119] Through the description of the above embodiments, those skilled in the art can understand that for the convenience and conciseness of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0120] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in combination with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in combination with an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion having one or more wirings (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or otherwise processing as appropriate, and then storing it in a computer memory.

[0121] Moreover, each embodiment in this specification is described in a progressive manner, and the same or similar parts among the embodiments can be referred to each other. In particular, for embodiments of devices, equipment, etc., since they are basically similar to the method embodiments, the relevant parts can be referred to the descriptions of the method embodiments. The embodiments of the devices, equipment, etc. described above are merely illustrative. The modules, units, etc. described as separate components may or may not be physically separated, that is, they can be located in one place, or they can be distributed to multiple places, such as the nodes of a system network. Specifically, some or all of the modules, units can be selected according to actual needs to achieve the purpose of the above embodiment solutions. Those skilled in the art can understand and implement them without creative efforts.

[0122] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits with logic gate circuits for implementing logical functions on data signals, application specific integrated circuits with appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.

[0123] In the description of this specification, the descriptions referring to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0124] In addition, in the embodiments of the present invention, the terms "first", "second", etc. are used only for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly indicating the quantity of the technical features indicated in this embodiment. Thus, the features defined with the terms "first", "second", etc. in the embodiments of the present invention may explicitly or implicitly indicate that at least one such feature is included in this embodiment. In the description of the present invention, the meaning of the word "plurality" is at least two or more than two, such as two, three, four, etc., unless otherwise specifically defined in the embodiment.

[0125] In the embodiments of the present invention, the term "comprising", "including", or any other variant thereof is intended to cover a non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article, or device. Without further limitation, the element defined by the statement "comprising one..." does not exclude the existence of additional identical elements in the process, method, article, or device comprising that element. In addition, components, features, and elements with the same name in different embodiments of the present invention may have the same meaning or may have different meanings, and their specific meanings need to be determined based on their interpretations in the specific embodiments or further in combination with the context of the specific embodiments.

[0126] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention. After considering the specification and practicing the present invention, those skilled in the art will readily conceive of other embodiments of the present invention. This application is intended to cover any variations, uses, or adaptations of the present invention, which follow the general principles of the present invention and include known common general knowledge or conventional technical means in the technical field not disclosed in the present invention. The specification and embodiments are only to be considered as exemplary, and the true scope and spirit of the present invention are pointed out by the following claims.

Claims

1. A method for granular computing based on domain knowledge to construct prompt words, characterized in that: The following steps are involved: Acquire domain knowledge and construct prompt words based on the domain knowledge; Input the prompt word into a large language model to obtain an attribute pair probability matrix; The attribute pair probability matrix is ​​used to evaluate the correlation between various attributes in the industry; Determine the correlation between the particles to be calculated based on the attribute probability matrix; The particles to be calculated are formed by data granulation based on the domain knowledge in the industry; When the correlation between the particles to be calculated meets the requirement, a particle calculation operation is performed on the particles to be calculated; The prompt words include task content, task object, task example and task attribute; The task content is used to describe the reasoning operation that the large language model needs to perform; The task object is used to describe the object played by the large language model when performing reasoning operations; The task example is used to describe the format of the inference result output by the large language model; The task attributes are used to describe the limiting conditions for the large model to perform reasoning operations; The large language model is any one of a language large model and a multimodal large model; after receiving the prompt word input, the large language model completes reasoning based on task attributes in the large language model according to the task object and task content, and obtains an attribute pair probability matrix in a task example format as the output of the large language model.

2. The method for granular computing based on domain knowledge-based prompt words according to claim 1, characterized in that: The domain knowledge is a data set consisting of terms, definitions, concepts, tools, standards, processes, cases and statistical data used in the domain.

3. The method for granular computing based on domain knowledge-based prompt words according to claim 1, characterized in that: The step of constructing prompt words based on domain knowledge specifically includes the following steps: Determine the task content and task object of the prompt word; Using a preset two-dimensional correlation matrix example as a task example of the prompt word; The task attribute of the prompt word is determined according to domain knowledge.

4. The method for granular computing based on domain knowledge-based prompt words according to claim 1, characterized in that: The method of determining the correlation between the particles to be calculated according to the attribute pair probability matrix specifically includes the following steps: Obtain the core properties of the particles to be calculated; The core attributes of the particles to be calculated are searched in the attribute pair probability matrix, and the intersection of the core attributes of the particles to be calculated is used as the correlation between the particles to be calculated.

5. The method for granular computing based on domain knowledge-based prompt words according to claim 1, characterized in that: The particles to be calculated are expressed by a three-branch partial order structure graph.

6. The method for granular computing based on domain knowledge-based prompt words according to claim 1, characterized in that: When the correlation between the particles to be calculated meets the requirement, the particle calculation operation is performed on the example to be calculated, which specifically includes the following steps: Get the particles to be calculated; Determine whether the correlation between the core attributes of the particles to be calculated reaches a preset particle splitting threshold requirement; when the correlation between the particles to be calculated reaches the preset particle splitting threshold requirement, perform a particle splitting operation on the particles to be calculated, splitting one particle into multiple new particles; Determine whether the correlation between the particles to be calculated reaches a preset particle reorganization threshold requirement; when the correlation between the particles to be calculated reaches the preset particle reorganization threshold requirement, perform a particle reorganization operation on the particles to be calculated, and combine multiple particles into a new particle; Determine whether the correlation between the particles to be calculated reaches a preset particle isomorphism threshold requirement; when the correlation between the particles to be calculated reaches the preset particle isomorphism threshold requirement, perform a particle isomorphism operation on the particles to be calculated, isomorphize multiple particles into new particles and generate a new object mode; Determine whether a new object pattern is generated in the particle isomorphism operation; when a new object pattern is generated, add the new particle to the particles to be calculated, and return to the step of performing a particle reorganization operation on the particles to be calculated when the correlation between the particles to be calculated reaches a preset particle reorganization threshold requirement until no new object pattern is generated; When no new object schema is generated, all newly generated object schemas are obtained and summarized for output.

7. An electronic device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor executes the program to implement a method for granular computing based on domain knowledge-based prompt words as described in any one of claims 1-6.

8. A computer-readable storage medium, characterized in that: The storage medium stores a program, and the program is executed by a processor to implement a method for granular computing based on domain knowledge-based prompt words as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Storage method for intelligent monitoring of video data

    CN106878676A

  • Ontology-based multi-granularity urban rainstorm waterlogging knowledge graph construction method

    CN115114455A