Data processing method and device, electronic equipment and storage medium
The knowledge matrix and prompt word template matrix are constructed through preset classification methods, and combined with large language models to generate age-appropriate knowledge data, which solves the problem of low accuracy in the construction of knowledge systems in the existing technology, and achieves more efficient age-appropriate knowledge content.
Patent Information
- Application Number
- CN202411783989.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-04-18
AI Technical Summary
The existing data processing methods are not very accurate in building a knowledge system, especially because they cannot effectively adapt to the knowledge expression needs of different age groups.
The knowledge data is classified and processed through the preset classification method, a knowledge matrix is constructed, and an age-appropriate prompt word template matrix is constructed based on this, and a more age-appropriate target knowledge data is generated based on the large language model.
It improves the accuracy and age-appropriateness of knowledge system construction, and can provide knowledge content suitable for users of different age groups more effectively.
Smart Images

Figure CN119848266A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a data processing method, device, electronic device and storage medium. Background Art
[0002] In current knowledge construction technology, many systems rely on preset content databases or classification dictionaries to construct popular science knowledge systems. The databases constructed usually include encyclopedias, popular science websites, and children's knowledge applications, which provide users with basic information queries on things by organizing and displaying existing knowledge points. Although the above method can cover a large amount of information content, its limitation is that databases based on fixed classifications often express knowledge content in a neutral or academic style and are not suitable for all age groups. The existing data processing methods are not accurate in constructing knowledge systems. Therefore, how to provide a data processing method that can improve the accuracy of knowledge system construction has become an urgent problem to be solved. Summary of the invention
[0003] The embodiment of the present invention provides a data processing method, which aims to solve the problem that the accuracy of knowledge system construction in existing data processing methods is not high. By classifying the knowledge data through a preset classification method, a more unified knowledge matrix can be constructed, so that a more age-appropriate prompt word template matrix can be constructed based on the knowledge matrix, and then based on the prompt word template matrix and the preset large language model, more age-appropriate target knowledge data can be generated to improve the accuracy of knowledge system construction.
[0004] In a first aspect, an embodiment of the present invention provides a data processing method, the method comprising the following steps:
[0005] Acquire multiple knowledge data;
[0006] Based on the plurality of the knowledge data and the preset classification method, a knowledge matrix is constructed, wherein the knowledge matrix includes knowledge data of different dimensions in the vertical direction and knowledge data of hierarchical progressiveness in the corresponding dimensions in the horizontal direction;
[0007] Based on the knowledge matrix, construct a corresponding prompt word template matrix, wherein the prompt word template matrix includes prompt word templates corresponding to the knowledge data;
[0008] Based on the prompt word template matrix and the preset large language model, target knowledge data is generated.
[0009] Optionally, the preset classification method includes Nice classification and biological classification, and the knowledge matrix constructed based on the plurality of the knowledge data and the preset classification method includes:
[0010] Based on the plurality of the knowledge data and the Nice classification, construct a first classification tree;
[0011] Based on the plurality of the knowledge data and the biological taxonomy, construct a second classification tree;
[0012] The knowledge matrix is constructed based on the first classification tree and the second classification tree.
[0013] Optionally, constructing the knowledge matrix based on the first classification tree and the second classification tree includes:
[0014] Based on the first classification tree and the second classification tree, determining unclassified knowledge data from the plurality of knowledge data;
[0015] Performing labeling processing based on the unclassified knowledge data to obtain a label set;
[0016] The knowledge matrix is constructed based on the first classification tree, the second classification tree and the label set.
[0017] Optionally, constructing a corresponding prompt word template matrix based on the knowledge matrix includes:
[0018] Constructing a prompt word template for each knowledge data in the knowledge matrix;
[0019] The prompt word template matrix is constructed based on the matrix relationship of each of the knowledge data in the knowledge matrix and the corresponding prompt word template.
[0020] Optionally, constructing a prompt word template for each knowledge data in the knowledge matrix includes:
[0021] Acquire the object-oriented age group corresponding to the target knowledge data;
[0022] Based on the age group, constructing style and tone prompt words for the knowledge data of each dimension in the knowledge matrix;
[0023] Based on the style and tone prompt words, the prompt word template is constructed.
[0024] Optionally, constructing the prompt word template based on the style and tone prompt word includes:
[0025] Perform conversion processing based on the style and tone prompt words to obtain style and tone variables;
[0026] Constructing a relationship variable and a name variable of the knowledge data for each of the knowledge data;
[0027] The prompt word template is constructed based on the style and mood variables, the relationship variables and the name variables.
[0028] Optionally, generating target knowledge data based on the prompt word template matrix and a preset large language model includes:
[0029] Get the name of the knowledge to be constructed;
[0030] Based on the knowledge name, determining a target prompt word template in the prompt word template matrix;
[0031] The target prompt word template is provided to the preset large language model for generation processing to obtain the target knowledge data.
[0032] In a second aspect, an embodiment of the present invention further provides a data processing device, the data processing device comprising:
[0033] A first acquisition module is used to acquire multiple knowledge data;
[0034] A first construction module is used to construct a knowledge matrix based on the plurality of the knowledge data and a preset classification method, wherein the knowledge matrix includes knowledge data of different dimensions in the vertical direction and hierarchical progressive knowledge data in the corresponding dimensions in the horizontal direction;
[0035] A second construction module is used to construct a corresponding prompt word template matrix based on the knowledge matrix, wherein the prompt word template matrix includes prompt word templates corresponding to the knowledge data;
[0036] The first generating module is used to generate target knowledge data based on the prompt word template matrix and a preset large language model.
[0037] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the data processing method provided in the embodiment of the present invention when executing the computer program.
[0038] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the data processing method provided in the embodiment of the invention are implemented.
[0039] In an embodiment of the present invention, a plurality of knowledge data are obtained; based on the plurality of the knowledge data and a preset classification method, a knowledge matrix is constructed, wherein the knowledge matrix includes knowledge data of different dimensions vertically and hierarchical knowledge data in corresponding dimensions horizontally; based on the knowledge matrix, a corresponding prompt word template matrix is constructed, wherein the prompt word template matrix includes prompt word templates corresponding to the knowledge data; based on the prompt word template matrix and a preset large language model, target knowledge data is generated. By classifying the knowledge data using a preset classification method, a unified knowledge matrix can be constructed, so that a more age-appropriate prompt word template matrix can be constructed based on the knowledge matrix, and then more age-appropriate target knowledge data can be generated based on the prompt word template matrix and a preset large language model, so as to improve the accuracy of knowledge system construction. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 is a flow chart of a data processing method provided by an embodiment of the present invention;
[0042] Figure 2 is a schematic diagram of the structure of a knowledge matrix provided by an embodiment of the present invention;
[0043] Figure 3 is a structural schematic diagram of a data processing device provided in an embodiment of the present invention;
[0044] Figure 4 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] like Figure 1 As shown, Figure 1 is a flow chart of a data processing method provided by an embodiment of the present invention, comprising:
[0047] 101. Obtain multiple knowledge data.
[0048] In an embodiment of the present invention, the above-mentioned data processing method can be applied to a data management platform, and the above-mentioned data management platform can be constructed by a server or a server cluster. The above-mentioned server or server cluster can be any electronic device with functions such as data processing, data analysis, data storage, and data transmission.
[0049] The above-mentioned knowledge data can be obtained from sources such as Wikipedia, encyclopedias, popular science websites, children's knowledge applications, academic publications, research papers, etc. Specifically, the above-mentioned knowledge data can be obtained by the above-mentioned data management platform through the above-mentioned data transmission function. It can be understood that there are multiple knowledge data, and the specific number can be obtained based on historical data processing experience or a limited number of experiments. The breadth and depth of the acquired knowledge data can be set according to the age group of the target knowledge data. For example, when the age group is children, because children do not have much knowledge reserves and can accept knowledge at a low depth, the breadth of the acquired knowledge data can be increased accordingly, and the depth of the acquired knowledge data can be reduced accordingly. Alternatively, when the age group is young and middle-aged, the object-oriented occupation or major can be obtained, and the depth of the knowledge data in the corresponding field can be increased accordingly according to its occupation or major.
[0050] 102. Based on multiple knowledge data and preset classification methods, a knowledge matrix is constructed.
[0051] In the embodiment of the present invention, the knowledge matrix includes knowledge data of different dimensions in the vertical direction and knowledge data of corresponding dimensions in the horizontal direction. The preset classification method may include Nice classification and biological classification.
[0052] Specifically, the plurality of the above-mentioned knowledge data may be classified according to the Nice classification to obtain a first classification tree. The plurality of the above-mentioned knowledge data may be classified according to the biological classification to obtain a second classification tree. The knowledge matrix may be constructed based on the structures of the first classification tree and the second classification tree.
[0053] Alternatively, in addition to the above biological classification and the Nice classification, any one or more classification combinations may be used to construct a corresponding data structure (such as the above classification tree), and the above knowledge matrix may be constructed based on the above data structure. Any of the above classifications may be Dewey Decimal Classification (DDC), Universal Decimal Classification (UDC), International Patent Classification (IPC), industry classification (such as Standard Industry Classification SIC and North American Industry Classification NAICS), and the like.
[0054] 103. Based on the knowledge matrix, construct a corresponding prompt word template matrix.
[0055] In the embodiment of the present invention, the prompt word template matrix includes prompt word templates corresponding to the knowledge data. Specifically, a prompt word template can be constructed for each knowledge data in the knowledge matrix. The prompt word template matrix is constructed by using the position relationship of the knowledge data in the knowledge matrix and the corresponding relationship between the prompt word template and the knowledge data.
[0056] Specifically, the generation tasks of the corresponding dimensions can be clarified according to the dimensions (or understood as classification) in the above knowledge matrix, and the corresponding prompt word templates can be constructed for the knowledge data of each dimension according to the above generation tasks. For example, if a certain dimension is biology, the generation task can be to generate species knowledge, and the generation goal can be to provide species classification information, habitat, eating habits, etc. Through the above generation tasks and the above generation goals, the corresponding prompt word templates can be constructed.
[0057] 104. Generate target knowledge data based on the prompt word template matrix and the preset large language model.
[0058] In an embodiment of the present invention, the preset large language model (i.e., Large Language Model, LLM for short) can be any artificial intelligence model based on deep learning, which is used to process and generate natural language text. It learns the laws, structure, grammar and context of language by training a large amount of text data, so that it can understand and generate text related to a given input (i.e., target knowledge data). For example, the preset large language model can be a large language model of the GPT series, a large language model of the BERT series, a Wenxinyiyan large model, a Pangu large model, a Hunyuan large model, etc. Specifically, the name of the knowledge to be constructed can be obtained. The name of the knowledge to be constructed can be obtained by uploading by the user or by random generation. For example, when the user needs to obtain the knowledge of a certain species, the name of the species can be uploaded as the name of the knowledge to be constructed, and the target prompt word template can be matched with the name of the knowledge to be constructed in the prompt word template matrix, and the name of the knowledge to be constructed and the target prompt word template are provided to the preset large language model at the same time. The preset large language model can output the knowledge data corresponding to the knowledge name to be constructed (i.e., the target knowledge data) according to the prompt in the target prompt word template.
[0059] Alternatively, you can also generate the target knowledge data corresponding to each knowledge data in the knowledge matrix one by one from top to bottom and from left to right in the order of the matrix, and add it to the database. After all the target knowledge data are generated, you can get a target database. If you need to obtain the knowledge data of any species later, you can upload the above-mentioned knowledge name to be constructed, and retrieve more age-appropriate target knowledge data in the above-mentioned target database through the above-mentioned knowledge name to be constructed, thereby improving the accuracy of knowledge system construction.
[0060] In an embodiment of the present invention, a plurality of knowledge data are obtained; based on the plurality of the knowledge data and a preset classification method, a knowledge matrix is constructed, wherein the knowledge matrix includes knowledge data of different dimensions vertically and hierarchical knowledge data in corresponding dimensions horizontally; based on the knowledge matrix, a corresponding prompt word template matrix is constructed, wherein the prompt word template matrix includes prompt word templates corresponding to the knowledge data; based on the prompt word template matrix and a preset large language model, target knowledge data is generated. By classifying the knowledge data using a preset classification method, a unified knowledge matrix can be constructed, so that a more age-appropriate prompt word template matrix can be constructed based on the knowledge matrix, and then more age-appropriate target knowledge data can be generated based on the prompt word template matrix and a preset large language model, so as to improve the accuracy of knowledge system construction.
[0061] It is understandable that in the specific implementation of this application, it involves knowledge data, age groups, knowledge names and other related data. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data and the construction, training and use of preset large language models, preset classification methods, and other related models or tools need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0062] It should be noted that the data processing method provided in the embodiment of the present invention can be applied to devices such as computers and servers that can perform data processing.
[0063] Optionally, in the step of constructing a knowledge matrix based on multiple knowledge data and a preset classification method, a first classification tree can be constructed based on multiple knowledge data and the Nice classification method; a second classification tree can be constructed based on multiple knowledge data and the biological classification method; and a knowledge matrix can be constructed based on the first classification tree and the second classification tree.
[0064] In the embodiment of the present invention, the preset classifications include the Nice Classification and the Biological Classification. The four-layer structure of the Nice Classification tree corresponding to the Nice Classification divides goods and services into 45 main categories, including 34 commodity categories and 11 service categories. Under these main categories, there are about 498 subcategories, and under the subcategories, there are about 14,121 small categories, and under the small categories are specific goods and services.
[0065] The above biological classification can be divided into seven main levels: kingdom, phylum, class, order, family, genus, and species, forming a tree structure to organize the relationship between biological species. Domain: Organisms are divided into several largest kingdoms, such as Animalia, Plantae, Fungi, etc. Phylum: Kingdoms are divided into phyla, such as Chordata, Arthropoda, etc. Class: Each phylum is further divided into multiple classes, such as Mammalia, Aves, Insecta, etc. Order: Each class is further divided into multiple orders, such as Primates and Carnivora; Family: Order is divided into families, such as Pinaceae, Felidae, etc. Genus: A more detailed level under the family, such as Pseudotsuga and Panthera; Species: The most basic unit, such as maize and cattle.
[0066] Specifically, the Nice classification method can be used to select knowledge data related to goods and services from multiple knowledge data, and the Nice classification tree (i.e., the first classification tree) can be constructed based on the knowledge data related to goods and services. At the same time, the biological classification method can be used to select biological-related knowledge data from multiple knowledge data, and a biological classification tree (i.e., the second classification tree) can be constructed based on the biological-related knowledge data.
[0067] After obtaining the first classification tree and the second classification tree, each dimension and the knowledge data in each dimension can be divided according to the positional relationship between the knowledge data in the first classification tree and the second classification tree, and a corresponding knowledge matrix can be constructed for the knowledge data according to the dimensions.
[0068] Optionally, in the step of constructing a knowledge matrix based on the first classification tree and the second classification tree, unclassified knowledge data can be determined from multiple knowledge data based on the first classification tree and the second classification tree; labeling processing can be performed based on the unclassified knowledge data to obtain a label set; and a knowledge matrix can be constructed based on the first classification tree, the second classification tree and the label set.
[0069] In the embodiment of the present invention, the plurality of the above-mentioned knowledge data may include other knowledge data in addition to the knowledge related to goods and services and biology, for example, knowledge data related to meteorology, knowledge data related to geography, etc. Therefore, in the process of constructing the knowledge matrix according to the first classification tree and the second classification tree, the unclassified knowledge data may be further determined and annotated to obtain a label set, and finally the above-mentioned knowledge matrix may be constructed through the label set, the first classification tree and the second classification tree to improve the construction accuracy of the knowledge matrix.
[0070] For example, when the above unclassified knowledge data is "tornado", the labels can be defined as "meteorological phenomenon", "atmospheric dynamic phenomenon", "wind phenomenon", "extreme wind", etc.; or, when the above unclassified knowledge data is "aurora", the labels can be defined as "meteorological phenomenon", "atmospheric optical phenomenon", "electro-optical phenomenon", etc.
[0071] More specifically, the above knowledge matrix can be Figure 2 The structural diagram of a knowledge matrix shown is further explained. Figure 2 The knowledge matrix (or animal knowledge matrix) is constructed through animal-related knowledge data. The vertical direction includes knowledge data of different dimensions, and the horizontal direction includes knowledge data of progressive levels in the same dimension. For example, "Chinese and English names" and "Interesting knowledge about names" are knowledge data of progressive levels in the same dimension, while "Chinese and English names", "Brief popular science", "Appearance characteristics", "Domestic habitat distribution", "Living habits", "Survival status" and other knowledge data are knowledge data of different dimensions.
[0072] The above-mentioned hierarchical progression can be based on the depth, complexity or learning process of knowledge. For example, under the theme of "species" in biology, all knowledge points related to species belong to the same dimension. The "hierarchical progression" means that these knowledge points gradually deepen according to a certain level, starting from the most basic knowledge (such as definitions and concepts) and gradually introducing more complex knowledge (such as specific characteristics, principles, applications, etc.).
[0073] Optionally, in the step of constructing a corresponding prompt word template matrix based on the knowledge matrix, a prompt word template can also be constructed for each knowledge data in the knowledge matrix; based on the matrix relationship of each knowledge data in the knowledge matrix and the corresponding prompt word template, a prompt word template matrix is constructed.
[0074] In the embodiment of the present invention, the matrix relationship of a certain knowledge data in the knowledge matrix can be understood as the position relationship of a certain knowledge data in the knowledge matrix, that is, the position relationship between the certain knowledge data and other knowledge data.
[0075] Specifically, the positional relationship between the prompt word templates corresponding to the knowledge data can be arranged in accordance with the positional relationship between the knowledge data and other knowledge data to obtain the above prompt word template matrix. For example, assuming that the knowledge data is arranged in the order of A1-A2-A3 from left to right, the prompt word templates can also be arranged in the order of B1-B2-B3 from left to right, where B1 is the prompt word template corresponding to A1, B2 is the prompt word template corresponding to A2, and B3 is the prompt word template corresponding to A3. After the prompt word templates are arranged according to the above positional relationship, the above prompt word template matrix can be obtained.
[0076] Optionally, in the step of constructing a prompt word template for each knowledge data in the knowledge matrix, the object-oriented age group corresponding to the target knowledge data can also be obtained; based on the age group, style and tone prompt words are constructed for the knowledge data of each dimension in the knowledge matrix; based on the style and tone prompt words, a prompt word template is constructed.
[0077] In the embodiment of the present invention, the above-mentioned object-oriented can be simply understood as which users the above-mentioned knowledge data ultimately needs to be provided to for learning. For example, the age group of the above-mentioned object-oriented can be children, adults, the elderly, etc.
[0078] For example, assuming that the above knowledge data is knowledge data in the animal kingdom dimension, and the age group of the above object-oriented is children, the following prompt words can be constructed:
[0079]
[0080]
[0081] The above “Dolphin” can be simply understood as the name of the knowledge to be constructed, and the above “200” can be understood as the word limit. Points 1 to 5 are the above style and tone prompts, and the constructed style and tone prompts are all for children's age groups. It is expected that the preset language model can output target knowledge data (i.e., the above Answer) that is more interesting and more suitable for children to understand (i.e., age-appropriate).
[0082] It is understandable that the above example is only an example of one dimension of the animal kingdom. Corresponding style and tone prompt words can also be constructed for dimensions such as the plant kingdom and the microbial kingdom, and the above prompt word template can be constructed for the knowledge data corresponding to each dimension based on the above style and tone prompt words.
[0083] Optionally, in the step of constructing a prompt word template based on style and tone prompt words, conversion processing can also be performed based on the style and tone prompt words to obtain style and tone variables; relationship variables and name variables of the knowledge data can be constructed for each knowledge data; and a prompt word template can be constructed based on the style and tone variables, the relationship variables and the name variables.
[0084] In an embodiment of the present invention, the above-mentioned style and tone prompt words can be converted into a variable data form (which can be simply understood as parameterization). When the style and tone prompt words are needed, the above-mentioned style and tone prompt words can be extracted from the corresponding storage medium through the above-mentioned variables, which can reduce the data volume of the above-mentioned prompt word template, and further reduce the data volume when storing the above-mentioned prompt word template matrix.
[0085] For example, the style and tone variable can be defined as style_param. In addition, the specific category name in the prompt word template can be converted into a specific category name variable, which is defined as category_name, and the object name under the specific category can be converted into an object name variable (that is, the above-mentioned name variable), which is defined as object_name.
[0086] For example, taking the prompt words of the animal kingdom as an example, according to the above name variables and the above style and tone variables, the following prompt word template can be constructed:
[0087]
[0088] The above-mentioned relationship variables can be understood as the relationship between knowledge data and other elements. After setting the above-mentioned relationship variables, corresponding word count variables can also be set according to the above-mentioned relationship variables. The above-mentioned word count variables can be simply understood as the number of words used to limit the output results of the large language model (that is, the target knowledge data). For example, the above-mentioned relationship variable can be defined as import_relation=. Assuming that the above-mentioned knowledge data is the dimension of the animal kingdom, its relationship variable can be import_relation="relationship with humans", common animal categories word_num=200 (that is, word count variable, the word count limit can be set to 200 words), and uncommon animal categories word_num=300 (that is, word count variable, the word count limit can be set to 300 words). Assuming that the above knowledge data is the dimension of the plant kingdom, the relationship variable can be import_relation = "relationship with the environment", common plant categories word_num = 200 (that is, the word count variable, the word count limit can be set to 200 words), uncommon plant categories word_num = 300 (that is, the word count variable, the word count limit can be set to 300 words); assuming that the above knowledge data is the dimension of the virus kingdom, the relationship variable can be import_relation = "relationship with disease", word_num = 100 (that is, the word count variable, the word count limit can be set to 100 words), etc.
[0089] After determining the above relationship variables, name variables and the above style and tone variables, further optimization is performed using the example of the prompt word template of the animal kingdom as an example. The optimized prompt word template may be:
[0090]
[0091] Among them, the above style_param is the above style and tone variable, the above import_relation is the above relationship variable, the above object_name is the above name variable, and the above word_num is the word limit (ie, the word variable).
[0092] By templating and parameterizing the prompt word template (ie, converting it into a variable), it is possible to extract prompt word templates with higher generality, reduce the amount of data of the prompt word templates in the prompt word template matrix, and reduce the difficulty of management and maintenance.
[0093] Optionally, in the step of generating target knowledge data based on the prompt word template matrix and a preset large language model, the name of the knowledge to be constructed can also be obtained; based on the knowledge name, a target prompt word template is determined in the prompt word template matrix; the target prompt word template is provided to the preset large language model for generation processing to obtain the target knowledge data.
[0094] In an embodiment of the present invention, the above-mentioned knowledge name to be constructed can be obtained by object-oriented uploading (for example, when a child needs to learn the knowledge of a certain species, the name of the above-mentioned species can be uploaded to the above-mentioned data management platform as the above-mentioned knowledge name to be constructed), or it can also be obtained by random generation by the above-mentioned data management platform.
[0095] Specifically, assume that the name of the knowledge to be constructed is "Chinese white dolphin" (i.e., target knowledge data related to Chinese white dolphin is required). Through "Chinese white dolphin", it can be known that it belongs to the animal kingdom, chordate phylum, mammal class, cetacean order, dolphin family, white dolphin genus, and then obtain the prompt word template matrix under the classification from bottom to top, and you can get the prompt word template matrix of "animal kingdom", and then obtain the prompt word template corresponding to each knowledge data in the prompt word template matrix from top to bottom and from left to right, for example, it can be further explained by the template of the prompt word template of the above-mentioned "brief popular science":
[0096]
[0097] In the above template, substitute the style and tone variable style_param, then substitute the relationship variable corresponding to the dimension of the animal kingdom, and substitute the above knowledge name to be constructed into the above name variable object_name to obtain the target prompt word template:
[0098]
[0099]
[0100] After obtaining the target prompt word template, the target prompt word template can be provided to the preset large language model for generation processing to obtain target knowledge data. Then, all target knowledge data related to the "Chinese white dolphin" can be generated based on all the prompt word template matrices corresponding to the "Chinese white dolphin", and the knowledge system construction of the "Chinese white dolphin" can be completed (that is, a database related to the Chinese white dolphin can be constructed).
[0101] like Figure 3 As shown, an embodiment of the present invention further provides a data processing device, including:
[0102] A first acquisition module 301 is used to acquire a plurality of knowledge data;
[0103] A first construction module 302 is used to construct a knowledge matrix based on the plurality of the knowledge data and a preset classification method, wherein the knowledge matrix includes knowledge data of different dimensions in the vertical direction and hierarchical progressive knowledge data in the corresponding dimensions in the horizontal direction;
[0104] A second construction module 303 is used to construct a corresponding prompt word template matrix based on the knowledge matrix, wherein the prompt word template matrix includes prompt word templates corresponding to the knowledge data;
[0105] The first generating module 304 is used to generate target knowledge data based on the prompt word template matrix and the preset large language model.
[0106] Optionally, the preset classification system includes Nice classification system and biological classification system, and the first building module 302 includes:
[0107] A first construction submodule, configured to construct a first classification tree based on the plurality of the knowledge data and the Nice classification;
[0108] A second construction submodule is used to construct a second classification tree based on the plurality of the knowledge data and the biological classification method;
[0109] The third construction submodule is used to construct the knowledge matrix based on the first classification tree and the second classification tree.
[0110] Optionally, the third building submodule includes:
[0111] A first determining unit, configured to determine unclassified knowledge data from the plurality of knowledge data based on the first classification tree and the second classification tree;
[0112] A first labeling unit, configured to perform labeling processing based on the unclassified knowledge data to obtain a label set;
[0113] The first construction unit is used to construct the knowledge matrix based on the first classification tree, the second classification tree and the label set.
[0114] Optionally, the second building module 303 includes:
[0115] The fourth construction submodule is used to construct a prompt word template for each knowledge data in the knowledge matrix;
[0116] The fifth construction submodule is used to construct the prompt word template matrix based on the matrix relationship of each knowledge data in the knowledge matrix and the corresponding prompt word template.
[0117] Optionally, the fourth construction submodule includes:
[0118] A first acquisition unit, used for acquiring the object-oriented age group corresponding to the target knowledge data;
[0119] A second construction unit is used to construct style and tone prompt words for the knowledge data of each dimension in the knowledge matrix based on the age group;
[0120] The third construction unit is used to construct the prompt word template based on the style and tone prompt words.
[0121] Optionally, the third building block comprises:
[0122] A first conversion subunit, configured to perform conversion processing based on the style and mood prompt words to obtain style and mood variables;
[0123] A first construction subunit is used to construct a relationship variable and a name variable of the knowledge data for each of the knowledge data;
[0124] The second construction subunit is used to construct the prompt word template based on the style and mood variables, the relationship variables and the name variables.
[0125] Optionally, the first generating module 304 includes:
[0126] The first acquisition submodule is used to obtain the name of the knowledge to be constructed;
[0127] A first determination submodule, configured to determine a target prompt word template in the prompt word template matrix based on the knowledge name;
[0128] The first generation submodule is used to provide the target prompt word template to the preset large language model for generation processing to obtain the target knowledge data.
[0129] like Figure 4 As shown, an embodiment of the present invention further provides an electronic device, characterized in that it includes a processor, and the processor can execute any one of the above data processing methods.
[0130] Specifically, it includes a processor 401 and a memory 402, and a computer program for executing the data processing method which is stored in the memory 402 and can be run on the processor 401, wherein:
[0131] The processor 401 runs the computer program of the data processing method stored in the memory 402 to perform the following steps:
[0132] Acquire multiple knowledge data;
[0133] Based on the plurality of the knowledge data and the preset classification method, a knowledge matrix is constructed, wherein the knowledge matrix includes knowledge data of different dimensions in the vertical direction and knowledge data of hierarchical progressiveness in the corresponding dimensions in the horizontal direction;
[0134] Based on the knowledge matrix, construct a corresponding prompt word template matrix, wherein the prompt word template matrix includes prompt word templates corresponding to the knowledge data;
[0135] Based on the prompt word template matrix and the preset large language model, target knowledge data is generated.
[0136] Optionally, the preset classification method includes Nice classification and biological classification, and the processor 401 executes the construction of the knowledge matrix based on the plurality of knowledge data and the preset classification method, including:
[0137] Based on the plurality of the knowledge data and the Nice classification, construct a first classification tree;
[0138] Based on the plurality of the knowledge data and the biological taxonomy, construct a second classification tree;
[0139] The knowledge matrix is constructed based on the first classification tree and the second classification tree.
[0140] Optionally, the step of constructing the knowledge matrix based on the first classification tree and the second classification tree performed by the processor 401 includes:
[0141] Based on the first classification tree and the second classification tree, determining unclassified knowledge data from the plurality of knowledge data;
[0142] Performing labeling processing based on the unclassified knowledge data to obtain a label set;
[0143] The knowledge matrix is constructed based on the first classification tree, the second classification tree and the label set.
[0144] Optionally, the step of constructing a corresponding prompt word template matrix based on the knowledge matrix performed by the processor 401 includes:
[0145] Constructing a prompt word template for each knowledge data in the knowledge matrix;
[0146] The prompt word template matrix is constructed based on the matrix relationship of each of the knowledge data in the knowledge matrix and the corresponding prompt word template.
[0147] Optionally, the step of constructing a prompt word template for each knowledge data in the knowledge matrix executed by the processor 401 includes:
[0148] Acquire the object-oriented age group corresponding to the target knowledge data;
[0149] Based on the age group, constructing style and tone prompt words for the knowledge data of each dimension in the knowledge matrix;
[0150] Based on the style and tone prompt words, the prompt word template is constructed.
[0151] Optionally, the step of constructing the prompt word template based on the style and tone prompt word executed by the processor 401 includes:
[0152] Perform conversion processing based on the style and tone prompt words to obtain style and tone variables;
[0153] Constructing a relationship variable and a name variable of the knowledge data for each of the knowledge data;
[0154] The prompt word template is constructed based on the style and mood variables, the relationship variables and the name variables.
[0155] Optionally, the processor 401 generates target knowledge data based on the prompt word template matrix and a preset large language model, including:
[0156] Get the name of the knowledge to be constructed;
[0157] Based on the knowledge name, determining a target prompt word template in the prompt word template matrix;
[0158] The target prompt word template is provided to the preset large language model for generation processing to obtain the target knowledge data.
[0159] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the computer program implements the various processes of the data processing method or the application-side data processing method provided by the embodiment of the present invention, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0160] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the above-mentioned computer program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the above-mentioned computer-readable storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0161] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A data processing method, characterized in that: The method comprises the following steps: Acquire multiple knowledge data; Based on the plurality of the knowledge data and the preset classification method, a knowledge matrix is constructed, wherein the knowledge matrix includes knowledge data of different dimensions in the vertical direction and knowledge data of hierarchical progressiveness in the corresponding dimensions in the horizontal direction; Based on the knowledge matrix, construct a corresponding prompt word template matrix, wherein the prompt word template matrix includes prompt word templates corresponding to the knowledge data; Based on the prompt word template matrix and the preset large language model, target knowledge data is generated.
2. The data processing method according to claim 1, characterized in that: The preset classification method includes Nice classification and biological classification. The knowledge matrix constructed based on the plurality of knowledge data and the preset classification method includes: Based on the plurality of the knowledge data and the Nice classification, construct a first classification tree; Based on the plurality of the knowledge data and the biological taxonomy, construct a second classification tree; The knowledge matrix is constructed based on the first classification tree and the second classification tree.
3. The data processing method according to claim 2, characterized in that: The step of constructing the knowledge matrix based on the first classification tree and the second classification tree includes: Based on the first classification tree and the second classification tree, determining unclassified knowledge data from the plurality of knowledge data; Performing labeling processing based on the unclassified knowledge data to obtain a label set; The knowledge matrix is constructed based on the first classification tree, the second classification tree and the label set.
4. The data processing method according to any one of claims 1 to 3, characterized in that: The step of constructing a corresponding prompt word template matrix based on the knowledge matrix includes: Constructing a prompt word template for each knowledge data in the knowledge matrix; The prompt word template matrix is constructed based on the matrix relationship of each of the knowledge data in the knowledge matrix and the corresponding prompt word template.
5. The data processing method according to claim 4, characterized in that: The step of constructing a prompt word template for each knowledge data in the knowledge matrix includes: Acquire the object-oriented age group corresponding to the target knowledge data; Based on the age group, constructing style and tone prompt words for the knowledge data of each dimension in the knowledge matrix; Based on the style and tone prompt words, the prompt word template is constructed.
6. The data processing method according to claim 5, characterized in that: The step of constructing the prompt word template based on the style and tone prompt word includes: Perform conversion processing based on the style and tone prompt words to obtain style and tone variables; Constructing a relationship variable and a name variable of the knowledge data for each of the knowledge data; The prompt word template is constructed based on the style and mood variables, the relationship variables and the name variables.
7. The data processing method according to claim 1, characterized in that: The generating target knowledge data based on the prompt word template matrix and the preset large language model includes: Get the name of the knowledge to be constructed; Based on the knowledge name, determining a target prompt word template in the prompt word template matrix; The target prompt word template is provided to the preset large language model for generation processing to obtain the target knowledge data.
8. A data processing device, characterized in that: The data processing device comprises: A first acquisition module is used to acquire multiple knowledge data; A first construction module is used to construct a knowledge matrix based on the plurality of the knowledge data and a preset classification method, wherein the knowledge matrix includes knowledge data of different dimensions in the vertical direction and hierarchical progressive knowledge data in the corresponding dimensions in the horizontal direction; A second construction module is used to construct a corresponding prompt word template matrix based on the knowledge matrix, wherein the prompt word template matrix includes prompt word templates corresponding to the knowledge data; The first generating module is used to generate target knowledge data based on the prompt word template matrix and a preset large language model.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the data processing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the data processing method according to any one of claims 1 to 7 are implemented.