Graph document generation method and device, program product and electronic equipment
By entering the graph requirement information and prompt information into the language model, graph generation without the participation of domain experts is achieved, solving the problems of high cost of graph construction and quality dependence on expert knowledge in the existing technology, and improving the efficiency and quality of graph construction.
Patent Information
- Application Number
- CN202410978644.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-12
AI Technical Summary
In the prior art, the construction of maps requires in-depth participation of experts in the field, which leads to high labor and time costs, and the quality of maps is highly dependent on the expert's knowledge level, making it difficult to effectively evaluate and test.
The language model is used to input map requirements and prompt information to achieve end-to-end generation from map requirements information to map documents, reducing dependence on field experts, reducing labor and time costs, and shortening the map construction cycle.
Through the processing capabilities of the language model, graph construction without the participation of domain experts is realized, which reduces dependence on existing data, shortens the graph construction cycle, and improves the efficiency and quality of graph generation.
Smart Images

Figure CN118940758A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of graph and natural language processing, and in particular to a graph document generation method, a graph document generation device, a computer program product and an electronic device. Background Art
[0002] Graphs are a way to display entities and the relationships between them, and are widely used in search, recommendation, question-and-answer, and other scenarios. In related technologies, the construction of graphs requires the in-depth participation of domain experts, and the labor and time costs are high. Summary of the invention
[0003] The present disclosure provides a graph document generation method, a graph document generation device, a computer program product and an electronic device, so as to at least to some extent solve the problem of high labor and time costs in constructing graphs in related technologies.
[0004] According to a first aspect of the present disclosure, a method for generating a graph document is provided, the method comprising: obtaining graph requirement information; obtaining first prompt information for generating a graph document; inputting the graph requirement information and the first prompt information into a first language model to obtain a first graph document.
[0005] According to a second aspect of the present disclosure, a graph document generation device is provided, the device comprising: a graph requirement information acquisition module, configured to acquire graph requirement information; a prompt information acquisition module, configured to acquire first prompt information for generating a graph document; and a graph document processing module, configured to input the graph requirement information and the first prompt information into a first language model to obtain a first graph document.
[0006] According to a third aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method of the first aspect and possible implementations thereof are implemented.
[0007] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the graph document generation method of the above-mentioned first aspect and its possible implementation method by executing the executable instructions.
[0008] The technical solution disclosed in this disclosure has the following beneficial effects:
[0009] By leveraging the processing power of the language model, an end-to-end solution from graph demand information to the first graph document is implemented. This does not require the in-depth involvement of domain experts, nor does it require the use of a visual interface to design the solution. This reduces labor and time costs, reduces dependence on existing data, and shortens the graph construction cycle. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 A flowchart of a method for generating a graph document in this exemplary embodiment is shown.
[0011] Figure 2 A schematic diagram showing a method of outputting a first graph document in this exemplary embodiment.
[0012] Figure 3 A schematic diagram showing a type of output evaluation information in this exemplary embodiment.
[0013] Figure 4 A schematic diagram of outputting a target graph document and a target knowledge graph with simulation data in this exemplary embodiment is shown.
[0014] Figure 5 A flowchart showing another method for generating a graph document in this exemplary embodiment.
[0015] Figure 6 A schematic structural diagram of a graph document generating device in this exemplary embodiment is shown.
[0016] Figure 7 A schematic structural diagram of an electronic device in this exemplary embodiment is shown. DETAILED DESCRIPTION
[0017] Exemplary embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings.
[0018] The accompanying drawings are schematic diagrams of the present disclosure and are not necessarily drawn to scale. Some of the block diagrams shown in the accompanying drawings may be functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in hardware modules or integrated circuits, or in networks, processors or microcontrollers. The embodiments can be implemented in various forms and should not be construed as being limited to the examples set forth herein. The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the description below, many specific details are provided to provide a full description of the embodiments of the present disclosure. However, those skilled in the art should appreciate that one or more specific details may be omitted when implementing the technical solution of the present disclosure, or one or more specific details may be replaced by other methods, components, devices, steps, etc.
[0019] In related technologies, the main way to construct a graph is for domain experts to participate deeply, sort out entities or concepts in related fields, and the relationships between these entities or concepts, add nodes corresponding to entities or concepts in the visual interface, and perform operations such as dragging and connecting to determine the relationships between nodes, thereby realizing the design of knowledge graph ontology, etc. Since this method requires the deep participation of domain experts, the labor and time costs are high. In addition, the quality of the graph is highly dependent on the knowledge level of domain experts, and it is difficult to effectively evaluate, analyze or test the graph, resulting in its quality cannot be guaranteed.
[0020] In view of one or more of the above problems, an exemplary embodiment of the present disclosure provides a method for generating a graph document. Figure 1 The exemplary process of the method for generating a graph document is shown, which may include the following steps S110 to S130:
[0021] Step S110, obtaining graph requirement information;
[0022] Step S120, obtaining first prompt information for generating a graph document;
[0023] Step S130, inputting the graph requirement information and the first prompt information into the first language model to obtain a first graph document.
[0024] based on Figure 1 The method uses the processing power of the language model to achieve an end-to-end solution from graph demand information to the first graph document, without the deep involvement of domain experts, reducing labor and time costs, reducing dependence on existing data, and shortening the graph construction cycle.
[0025] Below Figure 1 Provide detailed instructions for each step.
[0026] refer to Figure 1 , in step S110, graph requirement information is obtained.
[0027] In this exemplary embodiment, the graph to be constructed can be a knowledge graph or an ontology of a knowledge graph. A knowledge graph is usually composed of nodes and edges, where nodes represent entities in related fields and edges represent the relationships between these entities. Each node and edge can be accompanied by attribute information, such as name, definition, description, attribute value, etc. In this way, the knowledge graph can capture the relevance and semantic relationships between various entities. The ontology of the knowledge graph is used to describe the concepts to which entities belong and the relationships between concepts. Compared with the knowledge graph, the difference between the ontology is that the nodes in the ontology are more abstract and general concepts, and the nodes in the knowledge graph are specific entities under the concepts in the ontology.
[0028] A graph document is a document used to describe the nodes, edges and other related information in a graph. It is a character or text form of the graph. A graph document can be in any document form. For example, a graph document can be in JSON (JavaScript Object Notation) format.
[0029] The graph requirement information is used to describe what kind of graph the demander needs. It can be written in natural language or programming language. The graph requirement information can be written by the designer. For example, the graph requirement information can be as follows:
[0030] I need to design a knowledge graph, the entities include: "Sales Products", "Voice", "Traffic", "SMS"; Relationships: The relationship between "Sales Products" and "Voice" is "Includes Voice", the relationship between "Sales Products" and "SMS" is "Includes SMS", and the relationship between "Sales Products" and "Traffic" is "Includes Traffic"; Attributes: The attributes of "Sales Products" are "Name", "Effective Time", "Expiration Time", and "Region", the attributes of "Voice" are "Business Volume", the attributes of "SMS" are "Business Volume", and the attributes of "Traffic" are "Business Volume" and "Unit".
[0031] Continue to refer Figure 1 In step S120, first prompt information for generating a graph document is obtained.
[0032] The first prompt information may be prompt information (prompt) matching the first language model, and may have a specific prompt information template. The prompt information template may be written in advance by a designer, and the first prompt information may be generated according to specific circumstances.
[0033] Exemplarily, the first prompt information is as follows:
[0034] You are a knowledge graph ontology designer and need to design an ontology design in JSON format that includes "entity-relationship", "entity: attribute" and "relationship: attribute" according to the requirements;
[0035] The input format is: {entity: {"entity1": {"attribute1":}}, "relationship": {"relationship1": {"sourceentity":,"targetentity":}}}
[0036] need:{}
[0037] Continue to refer Figure 1 In step S130, the graph requirement information and the first prompt information are input into the first language model to obtain a first graph document.
[0038] The first language model may be a generative model. Exemplarily, the first language model may be a large language model (LLM). In addition, the following also relates to a second language model and a third language model. In this exemplary embodiment, the first language model, the second language model, and the third language model may be three different language models, or any two of the first language model, the second language model, and the third language model may be the same model, or the first language model, the second language model, and the third language model may be the same model.
[0039] In one implementation, the first language model has two input channels, and the graph requirement information and the first prompt information can be input into the two input channels respectively for processing.
[0040] In one embodiment, the graph requirement information and the first prompt information may be combined and then input into the first language model. For example, the graph requirement information and the first prompt information may be spliced, such as the graph requirement information shown above may be filled into the "requirement: {}" in the first prompt information to obtain the combined information. The graph requirement information and the first prompt information may also be spliced and repeated information may be removed therein to obtain the combined information. The combined information is input into the first language model, and after processing, the model outputs the first graph document.
[0041] refer to Figure 2 As shown, the above-mentioned graph requirement information and the first prompt information are spliced and input into the large model, and the output can be Figure 2 The first graph document shown in , which can be in JSON format.
[0042] The first atlas document can be used as a preliminary atlas document for subsequent modification and improvement. Alternatively, in some cases, the first atlas document itself has a relatively high quality and can be used as a final atlas document.
[0043] In one embodiment, the method for generating a graph document may further include the following steps:
[0044] By parsing the first graph document, a first graph corresponding to the first graph document is generated.
[0045] For example, the first graph document in JSON format can be transferred to the knowledge graph platform through an interface, and the knowledge graph platform can parse it to create a visual first graph containing "entity-relationship-entity", "entity: attribute" and "relationship: attribute". Compared with the first graph document, users can more intuitively see the information such as entities and relationships reflected in the graph.
[0046] In one embodiment, the method for generating a graph document may further include the following steps:
[0047] In response to the modification of the first map, obtaining a second map formed by modifying the first map;
[0048] The second graph is converted into a corresponding second graph document.
[0049] Exemplarily, when the user sees the first graph, he can manually modify the content in the first graph, such as changing the connection relationship between entities, adding entities, deleting entities, etc. After modifying the first graph, a second graph is formed, which is a graph that has been manually improved on the basis of the first graph. The second graph can be converted into a corresponding second graph document, such as a document in JSON format, for easy storage or subsequent processing.
[0050] In one embodiment, the method for generating a graph document may further include the following steps:
[0051] Obtaining a graph document to be evaluated; the graph document to be evaluated includes a first graph document, or a second graph document formed by modifying the first graph document;
[0052] Obtaining second prompt information for evaluating the graph document;
[0053] The graph document to be evaluated and the second prompt information are input into the second language model to obtain evaluation information of the graph document to be evaluated.
[0054] Among them, the graph document to be evaluated can be the initially generated first graph document, or it can be the manually improved second graph document. It should be noted that based on the first graph document, it can be converted into a first graph, manually modified to form a second graph, and then converted back to a second graph document. It is also possible to directly modify the content of the first graph document to form a second graph document. The present disclosure does not limit the modification method.
[0055] The second prompt information may be prompt information matching the second language model, and may have a specific prompt information template. The prompt information template may be written in advance by a designer, and the second prompt information may be generated according to specific circumstances.
[0056] The second language model may be a generative model, and may be the same model as the first language model or may be a different model.
[0057] In this exemplary embodiment, the evaluation of the graph document to be evaluated can be performed according to specific needs, and the evaluation items or indicators can be determined by the second prompt information, including but not limited to evaluation of structure, semantics, etc.
[0058] In one embodiment, the second language model has two or more input channels, and the graph document to be evaluated and the second prompt information can be respectively input into two of the input channels for processing.
[0059] In one embodiment, the graph document to be evaluated and the second prompt information may be combined and then input into the second language model. For example, the graph document to be evaluated and the second prompt information may be concatenated to obtain combined information, which is then input into the second language model. After processing, the model outputs evaluation information of the graph document to be evaluated.
[0060] In one embodiment, the step of inputting the graph document to be evaluated and the second prompt information into the second language model to obtain the evaluation information of the graph document to be evaluated may include the following steps:
[0061] The graph document to be evaluated, the second prompt information, and background information related to the graph document to be evaluated are input into the second language model to obtain evaluation information of the graph document to be evaluated.
[0062] The background information may include knowledge of the field to which the graph document to be evaluated belongs, knowledge of other related fields, and relevant information of the demander, etc. Exemplarily, the background information may be constructed as a vector library, and the background information vectors related to the graph document to be evaluated may be extracted from the vector library by vectorizing the entities, attributes, and relationships in the graph document to be evaluated, and calculating the similarity with the vectors in the vector library.
[0063] Exemplarily, the second prompt information may be as follows:
[0064] You are a knowledge graph ontology design enthusiast, and need to check the JSON format ontology design according to the inspection requirements and background information, and return the inspection results according to the inspection requirements;
[0065] Inspection requirements:
[0066] 1. Check the relationship hierarchy of the knowledge graph ontology design and return the depth of the deepest level.
[0067] 2. Check whether there are entities in the ontology design that have no relationship with other entities. If so, return the entity name.
[0068] 3. Based on the background information, check whether there are any position errors in the "source entity" and "target entity" of the "relationship". If so, return the relationship.
[0069] 》
[0070] Background information:
[0071] 《》
[0072] Body design:
[0073] 《》
[0074] Fill in the background information into the "Background Information:《》" in the above second prompt information, fill in the graph document to be evaluated into the "Ontology Design:《》" in the above second prompt information, and then input the spliced information into the second language model to complete the evaluation process.
[0075] Figure 3 The schematic diagram shows the output of evaluation information after processing the above-mentioned graph document to be evaluated, the second prompt information, and the background information. By evaluating the graph document, the construction and maintenance process of the graph can be accelerated and the cycle can be shortened.
[0076] In one embodiment, the method for generating a graph document may further include the following steps:
[0077] Obtaining a target graph document; the target graph document includes a first graph document, or a second graph document formed by modifying the first graph document, or a third graph document formed by further modifying the second graph document;
[0078] Obtaining third prompt information for generating simulation data;
[0079] The target graph document and the third prompt information are input into the third language model to obtain simulated data matching the target graph document.
[0080] Among them, if the second graph document is used as the document to be evaluated, the user can make further modifications to the second graph document according to the evaluation information, such as converting it into a second graph, modifying the second graph to form a third graph, converting the third graph into a third graph document, or directly modifying the second graph document to obtain a third graph document.
[0081] This exemplary embodiment can use any one of the first graph document, the second graph document, and the third graph document as the target document to perform the simulation data generation process.
[0082] The third prompt information may be prompt information matching the third language model, and may have a specific prompt information template. The prompt information template may be written in advance by a designer, and the third prompt information may be generated according to specific circumstances.
[0083] For example, the third prompt information is as follows:
[0084] According to the generated ontology design, simulated data containing {} entities and corresponding relationships are generated. The format of the simulated data is JSON.
[0085] Body design:
[0086] 《》
[0087] The third language model may be a generative model, and may be the same model as the first language model or the second language model, or may be different from both the first language model and the second language model.
[0088] The target graph document and the third prompt information can be input into different input channels of the third language model respectively. The target graph document and the third prompt information can also be combined and input into the third language model, such as filling the target graph document with "Ontology Design:《》" in the third prompt information, and then inputting the spliced information into the third language model, and the model outputs simulation data matching the target graph document. For example, the simulation data can be in JSON format.
[0089] In one embodiment, the method for generating a graph document may further include the following steps:
[0090] The target knowledge graph is generated by parsing the target graph document and combining it with simulated data.
[0091] Exemplarily, the target graph document and simulation data can be passed to the knowledge graph platform through an interface. The knowledge graph platform parses the target graph document and imports the simulation data into the graph database to complete rendering and generate the target knowledge graph. Figure 4 It shows that simulated data is generated through a third language model, and a target graph document with the simulated data is output, which is parsed and rendered by a knowledge graph platform to generate a target knowledge graph.
[0092] Figure 5 A flowchart of a method for generating a graph document in this exemplary embodiment is shown, comprising the following steps:
[0093] Step S501, obtaining graph requirement information;
[0094] Step S502, obtaining first prompt information for generating a graph document;
[0095] Step S503, inputting the graph requirement information and the first prompt information into the first language model to obtain a first graph document;
[0096] Step S504, generating a first graph corresponding to the first graph document by parsing the first graph document;
[0097] Step S505, in response to the modification of the first map, obtaining a second map formed after the modification of the first map;
[0098] Step S506, converting the second graph into a corresponding second graph document;
[0099] Step S507, obtaining a graph document to be evaluated; the graph document to be evaluated includes a first graph document, or a second graph document formed by modifying the first graph document;
[0100] Step S508, obtaining second prompt information for evaluating the graph document;
[0101] Step S509: input the graph document to be evaluated, the second prompt information, and background information related to the graph document to be evaluated into the second language model to obtain evaluation information of the graph document to be evaluated.
[0102] Step S510, obtaining a target graph document; the graph document to be evaluated includes a first graph document, or a second graph document formed after the first graph document is modified, or a third graph document formed after the second graph document is further modified;
[0103] Step S511, obtaining third prompt information for generating simulation data;
[0104] Step S512, inputting the target graph document and the third prompt information into a third language model to obtain simulated data matching the target graph document;
[0105] Step S513, generating a target knowledge graph by parsing the target graph document and combining it with simulation data.
[0106] This exemplary embodiment utilizes the excellent semantic analysis capabilities of large language models, etc. to generate the ontology design of the knowledge graph, evaluate the ontology design, and generate knowledge graph simulation data based on the ontology design. It can quickly complete the ontology design and evaluation of the knowledge graph according to the needs of designers and reduce the construction cycle of the knowledge graph.
[0107] By setting appropriate prompt words and using a large language model to analyze the needs of designers, quickly generate an ontology design, evaluate the generated ontology design, and generate knowledge graph simulation data, the ontology design of the knowledge graph can be quickly completed. This patent uses the excellent semantic analysis capabilities of the large model to implement end-to-end ontology design according to the needs of designers, and evaluate the ontology design. For scenarios where data acquisition is difficult, the large model can be combined with the ontology design to generate simulation data for graph analysis and testing, effectively reducing the construction cycle of the knowledge graph.
[0108] By presetting prompt words, the big model can generate knowledge graph ontology design files according to needs, and pass them to the knowledge graph platform through the interface to complete the design of the knowledge graph ontology. Without relying on existing data, the knowledge graph ontology design can be quickly completed end-to-end according to the needs of designers. The big model is combined with prompt words to conduct a preliminary evaluation of the structure and semantics of the knowledge graph ontology, avoiding subsequent revisions to the ontology and reducing the knowledge graph construction cycle. By combining the big model and ontology design to generate simulated data, it is possible to effectively conduct a preliminary analysis of the knowledge graph based on simulated data when real data cannot be quickly obtained.
[0109] The exemplary embodiment of the present disclosure also provides a graph document generation device. Figure 6 As shown, the graph document generating device 600 may include the following program modules:
[0110] A graph requirement information acquisition module 610, configured to acquire graph requirement information;
[0111] The prompt information acquisition module 620 is configured to acquire first prompt information for generating a graph document;
[0112] The graph document processing module 630 is configured to input the graph requirement information and the first prompt information into a first language model to obtain a first graph document.
[0113] In one implementation, the graph document processing module 630 is further configured to:
[0114] A first graph corresponding to the first graph document is generated by parsing the first graph document.
[0115] In one implementation, the graph document processing module 630 is further configured to:
[0116] In response to the modification of the first spectrum, obtaining a second spectrum formed by modifying the first spectrum;
[0117] The second graph is converted into a corresponding second graph document.
[0118] In one implementation, the graph document processing module 630 is further configured to:
[0119] Acquire a graph document to be evaluated; the graph document to be evaluated includes the first graph document, or a second graph document formed by modifying the first graph document;
[0120] Obtaining second prompt information for evaluating the graph document;
[0121] The graph document to be evaluated and the second prompt information are input into a second language model to obtain evaluation information of the graph document to be evaluated.
[0122] In one embodiment, the step of inputting the graph document to be evaluated and the second prompt information into a second language model to obtain evaluation information of the graph document to be evaluated includes:
[0123] The graph document to be evaluated, the second prompt information, and background information related to the graph document to be evaluated are input into the second language model to obtain evaluation information of the graph document to be evaluated.
[0124] In one implementation, the graph document processing module 630 is further configured to:
[0125] Acquire a target graph document; the target graph document includes the first graph document, or a second graph document formed by modifying the first graph document, or a third graph document formed by further modifying the second graph document;
[0126] Obtaining third prompt information for generating simulation data;
[0127] The target graph document and the third prompt information are input into a third language model to obtain simulated data matching the target graph document.
[0128] In one implementation, the graph document processing module 630 is further configured to:
[0129] The target knowledge graph is generated by parsing the target graph document and combining it with the simulation data.
[0130] The specific details of each part of the above-mentioned device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.
[0131] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0132] The exemplary embodiments of the present disclosure also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the game editing method is implemented.
[0133] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.
[0134] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.
[0135] The code of the computer program can be written in one or more programming languages. Programming languages such as C language, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).
[0136] Computer programs can be carried or transmitted through electrical, magnetic, optical, electromagnetic, infrared and other signals. Electronic devices can convert signals carrying computer programs into digital signals to run the computer programs. When a computer program runs on an electronic device, its code is used to enable the electronic device to execute (more specifically, the processor of the electronic device can execute) the method steps of various exemplary embodiments of the present disclosure, such as the above-mentioned game editing method, which includes the following steps: Step S110, obtaining graph requirement information; Step S120, obtaining first prompt information for generating a graph document; Step S130, inputting the graph requirement information and the first prompt information into a first language model to obtain a first graph document.
[0137] The above method steps are implemented through computer programs, and the processing power of the language model is utilized to realize an end-to-end solution from graph demand information to the first graph document. This solution does not require the in-depth involvement of domain experts, reduces labor and time costs, reduces dependence on existing data, and shortens the graph construction cycle.
[0138] The exemplary embodiments of the present disclosure also provide an electronic device. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as a computer program. The processor executes the method steps of various exemplary embodiments of the present disclosure by executing the executable instructions.
[0139] Reference below Figure 7 , the electronic device is exemplarily described in the form of a general-purpose computing device. It should be understood that Figure 7 The electronic device 700 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0140] like Figure 7 As shown, the electronic device 700 may include: a processor 710 , a memory 720 , a bus 730 , an I / O (input / output) interface 740 , and a network adapter 750 .
[0141] The memory 720 may include a volatile memory, such as a RAM 721, a cache unit 722, and may also include a non-volatile memory, such as a ROM 723. The memory 720 may also include one or more program modules 724, such program modules 724 include but are not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof may include the implementation of a network environment. For example, the program module 724 may include each module in the above-mentioned device.
[0142] The processor 710 may include one or more processing units. For example, the processor 710 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc.
[0143] The processor 710 can be used to execute executable instructions stored in the memory 720, such as the above-mentioned game editing method, which includes the following steps: step S110, obtaining graph requirement information; step S120, obtaining first prompt information for generating a graph document; step S130, inputting the graph requirement information and the first prompt information into a first language model to obtain a first graph document.
[0144] By executing the above method steps through the processor 710 and utilizing the processing power of the language model, an end-to-end solution from graph demand information to the first graph document is implemented without the need for in-depth involvement of domain experts, thereby reducing labor and time costs, reducing dependence on existing data, and shortening the graph construction cycle.
[0145] The bus 730 is used to realize the connection between different components of the electronic device 700, and may include a data bus, an address bus, and a control bus.
[0146] The electronic device 700 can communicate with one or more external devices 800 (eg, a keyboard, a mouse, an external controller, etc.) through the I / O interface 740 .
[0147] The electronic device 700 can communicate with one or more networks through the network adapter 750. For example, the network adapter 750 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. The network adapter 750 can communicate with other modules of the electronic device 700 through the bus 730.
[0148] although Figure 7 Not shown, other hardware and / or software modules may also be provided in the electronic device 700, including but not limited to: a display, a microcode, a device driver, a redundant processor, an external disk drive array, a RAID system, a tape drive, and a data backup storage system.
[0149] As can be seen from the above, the technical solution of the present disclosure can be implemented as a method, an apparatus, a system, a computer program product, a storage medium, an electronic device, etc. Those skilled in the art can understand that various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software, such as being respectively referred to as a "circuit", "module" or "system".
[0150] It should be understood that the present disclosure is not limited to the specific method steps or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. Those skilled in the art will easily think of other embodiments based on the specific embodiments provided by the present disclosure. Therefore, the specific embodiments provided by the present disclosure are only exemplary, and the scope and spirit of the present disclosure are indicated by the claims, and any variations, uses or adaptive changes of the present disclosure should be covered, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the technical field that are not disclosed in the present disclosure.
Claims
1. A method for generating a graph document, characterized in that: The method comprises: Obtain graph requirement information; Obtaining first prompt information for generating a graph document; The graph requirement information and the first prompt information are input into a first language model to obtain a first graph document.
2. The method according to claim 1, characterized in that The method further comprises: A first graph corresponding to the first graph document is generated by parsing the first graph document.
3. The method according to claim 2, characterized in that The method further comprises: In response to the modification of the first spectrum, obtaining a second spectrum formed by modifying the first spectrum; The second graph is converted into a corresponding second graph document.
4. The method according to claim 1, characterized in that: The method further comprises: Acquire a graph document to be evaluated; the graph document to be evaluated includes the first graph document, or a second graph document formed by modifying the first graph document; Obtaining second prompt information for evaluating the graph document; The graph document to be evaluated and the second prompt information are input into a second language model to obtain evaluation information of the graph document to be evaluated.
5. The method according to claim 4, characterized in that The step of inputting the graph document to be evaluated and the second prompt information into a second language model to obtain evaluation information of the graph document to be evaluated includes: The graph document to be evaluated, the second prompt information, and background information related to the graph document to be evaluated are input into the second language model to obtain evaluation information of the graph document to be evaluated.
6. The method according to claim 1, characterized in that The method further comprises: Acquire a target graph document; the target graph document includes the first graph document, or a second graph document formed by modifying the first graph document, or a third graph document formed by further modifying the second graph document; Obtaining third prompt information for generating simulation data; The target graph document and the third prompt information are input into a third language model to obtain simulated data matching the target graph document.
7. The method according to claim 6, characterized in that The method further comprises: The target knowledge graph is generated by parsing the target graph document and combining it with the simulation data.
8. A graph document generating device, characterized in that: The device comprises: A graph requirement information acquisition module configured to acquire graph requirement information; A prompt information acquisition module, configured to acquire first prompt information for generating a graph document; The graph document processing module is configured to input the graph requirement information and the first prompt information into a first language model to obtain a first graph document.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.
