Modeling method and device based on graphic model and natural language conversion
Through the modeling method of graphical model and natural language conversion, the mutual conversion between graphical model and natural language is realized, solving the problems of low modeling efficiency and difficulty in information exchange in the existing technology, and improving modeling efficiency and cross-domain collaboration capabilities.
Patent Information
- Application Number
- CN202510399956.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-01
- Publication Date
- 2025-07-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing MBSE field modeling tools are difficult to apply to non-professional personnel, are inefficient in modeling, and are difficult to communicate and collaborate.
Through the modeling method of graphical model and natural language conversion, the data input by the user is obtained and the intermediate process file is generated to realize the mutual conversion between the graphical model and natural language, and display the converted data for user modeling.
It improves modeling efficiency, lowers the modeling threshold, enables non-professional personnel to model, and promotes information exchange and collaboration among personnel in different fields.
Smart Images

Figure CN120298588A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of modeling technologies, and more particularly to a modeling method and apparatus based on the conversion between graphical models and natural language. Background Art
[0002] Existing modeling tools in the field of MBSE (Model-Based Systems Engineering) usually start from drawing a graph to construct a model. This modeling method is difficult, not suitable for non-professional modelers, and has low modeling efficiency. Summary of the Invention
[0003] The purpose of the present invention is to provide a modeling method and apparatus based on the conversion between graphical models and natural language, so as to improve the modeling efficiency and promote information exchange and collaboration among personnel in different fields regarding the model.
[0004] In a first aspect, the present invention provides a modeling method based on the conversion between graphical models and natural language, including:
[0005] During the modeling process, obtain first modeling data input by a user, where the first modeling data includes either a graphical model or text data;
[0006] Convert the first modeling data into a model file, and generate second modeling data based on the model file; wherein, the model file is an intermediate process file for realizing the conversion between the graphical model and natural language; the second modeling data includes the other of the graphical model and text data;
[0007] Display the second modeling data so that the user can obtain a target model based on the second modeling data.
[0008] In an optional embodiment, converting the first modeling data into a model file includes:
[0009] Extract key element information from the first modeling data, and convert the key element information into a model file; the model file includes node information and association information of the model, the node information includes the type and attributes of the node, and the association information includes the type and attributes of the association.
[0010] In an optional embodiment, the first modeling data is a graphical model; extracting key element information from the first modeling data and converting the key element information into a model file includes:
[0011] Obtain graphical element information in the graphical model, where the graphical element information includes node element information and association element information;
[0012] Convert the graphical element information into node information and association information according to a preset data structure, and store it as a model file.
[0013] In an alternative embodiment, the first modeling data is a graphical model; according to the model file, second modeling data is generated, including:
[0014] Obtaining text segment information from the model file;
[0015] Based on a preset first standard sentence pattern, organizing the natural language description of the text segment information to obtain the second modeling data.
[0016] In an alternative embodiment, the first modeling data is text data; key element information is extracted from the first modeling data and converted into a model file, including:
[0017] Performing element extraction on the text data to obtain node elements and association elements;
[0018] Based on a preset second standard sentence pattern, organizing the graphical model text language of the node elements and association elements to obtain a text paragraph;
[0019] Converting the text paragraph into node information and association information according to a preset data structure and storing it as a model file.
[0020] In an alternative embodiment, the first modeling data is text data; according to the model file, second modeling data is generated, including:
[0021] Using a graphics rendering engine to render a graphical model according to the node information and association information in the model file to obtain the second modeling data.
[0022] In an alternative embodiment, after displaying the second modeling data, the above method further includes:
[0023] Obtaining the first sub-model data currently selected by the user and differentially displaying the second sub-model data corresponding to the first sub-model data; wherein, the first sub-model data is a part of the first modeling data, and the second sub-model data is a part of the second modeling data; or, the first sub-model data is a part of the second modeling data, and the second sub-model data is a part of the first modeling data.
[0024] In a second aspect, the present invention provides a modeling device based on the conversion between a graphical model and natural language, including:
[0025] An obtaining module, configured to obtain first modeling data input by a user during the modeling process, where the first modeling data includes one of a graphical model and text data;
[0026] A conversion module for converting the first modeling data into a model file and generating second modeling data according to the model file; wherein, the model file is an intermediate process file for realizing the conversion between the graphical model and natural language; the second modeling data includes the other of the graphical model and the text data;
[0027] A display module for displaying the second modeling data so that the user can obtain the target model based on the second modeling data.
[0028] In a third aspect, the present invention provides an electronic device, including a memory and a processor. A computer program that can run on the processor is stored in the memory. When the processor executes the computer program, it implements the modeling method based on the conversion between the graphical model and natural language in any one of the foregoing embodiments.
[0029] In a fourth aspect, the present invention provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by the processor, it executes the modeling method based on the conversion between the graphical model and natural language in any one of the foregoing embodiments.
[0030] The modeling method and device based on the conversion between the graphical model and natural language provided by the present invention, in the modeling process, obtain the first modeling data input by the user, and the first modeling data includes one of the graphical model and the text data; convert the first modeling data into a model file, and generate second modeling data according to the model file; wherein, the model file is an intermediate process file for realizing the conversion between the graphical model and natural language; the second modeling data includes the other of the graphical model and the text data; display the second modeling data so that the user can obtain the target model based on the second modeling data. In this way, in the modeling process, the mutual conversion between the graphical model and natural language is realized, so that modeling can be carried out through natural language description, the modeling efficiency is improved, and at the same time, the information exchange and cooperation between different fields of personnel are promoted. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.
[0032] Figure 1 It is a schematic flowchart of a modeling method based on the conversion between a graphical model and natural language provided by an embodiment of the present invention;
[0033] Figure 2 It is a schematic flowchart of the conversion from a graphical model to natural language provided by an embodiment of the present invention;
[0034] Figure 3 A schematic flowchart of the conversion from natural language to a graphical model provided by an embodiment of the present invention;
[0035] Figure 4 A schematic structural diagram of a modeling device based on the conversion between a graphical model and natural language provided by an embodiment of the present invention;
[0036] Figure 5 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners
[0037] Next, the technical solutions of the present invention will be clearly and completely described in conjunction with the embodiments. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0038] In today's era of digital information explosion, the forms of information presentation are diverse. Among them, graphical models and natural languages are two extremely important expression forms. Graphical models, with their intuitive and vivid characteristics, can quickly convey complex structural and relational information. Natural language, on the other hand, has flexibility and rich semantic expression capabilities, facilitating people to communicate, record, and elaborate their views. Based on this, a modeling method and device based on the conversion between graphical models and natural languages provided by embodiments of the present invention can realize the mutual conversion between graphical models and natural languages, thereby enabling modeling through natural language descriptions, improving the efficiency of modeling, and promoting information exchange and collaboration among personnel in different fields.
[0039] To facilitate the understanding of this embodiment, first, a modeling method based on the conversion between a graphical model and natural language disclosed in the embodiments of the present invention will be introduced in detail.
[0040] Embodiments of the present invention provide a modeling method based on the conversion between a graphical model and natural language. This method can be executed by an electronic device with data processing capabilities, and this method can be applied, but is not limited to, models constructed based on objects, processes, and relationships. Refer to Figure 1 The schematic flowchart of a modeling method based on the conversion between a graphical model and natural language shown. This method mainly includes the following steps S110 to step S130:
[0041] Step S110, during the modeling process, obtain the first modeling data input by the user, and the first modeling data includes one of a graphical model and text data.
[0042] The above first modeling data can be a graphic model drawn by the user at the front end, or text data corresponding to the text content input by the user. During the modeling process, a real-time update mechanism can be adopted to obtain the first modeling data in real time. For example, continuously monitor the drawing process of the graphic or the changes in the graphic model (such as operations of adding, modifying, or deleting graphic elements), and update the graphic model; or, continuously monitor the changes in the text content in the natural language display window (such as adding, deleting, or modifying text paragraphs), and update the text data.
[0043] Step S120: Convert the first modeling data into a model file, and generate second modeling data according to the model file; wherein, the model file is an intermediate process file for realizing the conversion between the graphic model and natural language; the second modeling data includes the other of the graphic model and the text data.
[0044] In this embodiment, the mutual conversion between the graphic model and natural language can be realized through the medium of the model file. The model file contains all the node information and association information of the model. Information can be extracted from the model file to render the graphic model, and at the same time, information can also be extracted from the model file for generating natural language. As long as the model file is complete, a graphic model and natural language with corresponding content can be generated simultaneously.
[0045] In some possible embodiments, the step of converting the first modeling data into a model file may include: extracting key element information from the first modeling data, and converting the key element information into a model file; the model file includes the node information and association information of the model, the node information includes the type and attributes of the nodes, and the association information includes the type and attributes of the associations.
[0046] When the first modeling data is a graphic model, the model file can be obtained in the following way: obtain the graphic element information in the graphic model, where the graphic element information includes node element information and association element information; according to a preset data structure, convert the graphic element information into node information and association information, and store it as a model file. Specifically, when implemented, all relevant node element information and association element information and other graphic element information can be obtained by parsing the graphic model; both the nodes and the associations have preset fixed data structures, so the graphic element information can be organized according to this data structure to obtain the node information and association information.
[0047] Furthermore, when the first modeling data is a graphical model, the text segment information can be obtained from the model file and organized to generate the corresponding natural language description, that is, the second modeling data. Here, "organization" means combining the text segments using appropriate reserved words to form a text that conforms to the natural language expression form. For example, an airplane has a speed attribute, and "has" and "attribute" are reserved words fixed according to the associated meaning. In addition, special symbols such as spaces and commas can be used to integrate certain situations in the graphical model. Specifically, in the face of multiple associated mergers, for the associations with the same endpoints, reasonable integration can be carried out. For example, if there is a graphical representation of multiple factory chimneys simultaneously discharging different pollutants into the same area, the generated text description can be "The different pollutants discharged by Factory Chimney 1, Factory Chimney 2... jointly affect the environment of this area."
[0048] In a possible implementation, when the first modeling data is a graphical model, the second modeling data can be obtained in the following way: obtain the text segment information from the model file; organize the natural language description of the text segment information based on a preset first standard sentence pattern to obtain the second modeling data. The text segment information can be filled into the first standard sentence pattern to form the second modeling data.
[0049] When the first modeling data is text data, considering that natural language has certain ambiguity and generality, one graphical element corresponds to multiple natural language texts. However, conversely, one natural language may not necessarily have a corresponding graphical element. Therefore, when converting from natural language to a graphical model, the natural language needs to be processed first to generate text equivalent to the graphical model, and then the text is converted into a graphical model. Based on this, the model file can be obtained in the following way: extract the element information from the text data to obtain node elements and association elements; organize the graphical model text language of the node elements and association elements based on a preset second standard sentence pattern to obtain a text paragraph; convert the text paragraph into node information and association information according to a preset data structure and store it as a model file.
[0050] In specific implementation, advanced natural language processing tools can be utilized, such as large models based on deep learning, knowledge graph construction technologies, etc., to comprehensively analyze text data. Through a series of operations such as part-of-speech tagging, syntactic analysis, and semantic understanding, the node elements and associated elements therein can be accurately extracted. Subsequently, the extracted node elements and associated elements can be reorganized into text paragraphs according to the text format corresponding to the nodes and associations, constructing a representation form that conforms to the text language rules of the graphical model. For the missing attribute descriptions, default values can be used for filling. Optionally, to ensure that the finally generated graphical model meets the user's requirements, the generated text paragraphs can be optimized manually, and the user can confirm whether the text paragraphs meet their modeling intentions. If the user modifies the text paragraphs, the modified text paragraphs need to be verified against the second standard sentence pattern to ensure that they conform to the expression form. Finally, the node element information and associated element information contained in the text paragraphs can be organized according to the preset data structure, and the corresponding model file can be generated.
[0051] Furthermore, when the first modeling data is text data, a graphics rendering engine can be used to render the graphical model according to the node information and association information in the model file, obtaining the second modeling data. On the operation interface, whenever a new text paragraph is added to the natural language display window, the corresponding graphical model will be rendered.
[0052] Step S130, display the second modeling data so that the user can obtain the target model based on the second modeling data.
[0053] During the modeling process, the second modeling data can be displayed in real time, so that the user can modify the first modeling data based on the second modeling data or continue with the modeling operation until the modeling is completed to obtain the target model. When the first modeling data is a graphical model and the second modeling data is text data, the target model can be composed of the first modeling data; when the first modeling data is text data and the second modeling data is a graphical model, the target model can be composed of the second modeling data.
[0054] In addition, to facilitate the user to quickly locate the target and better understand the model content, the first modeling data and the second modeling data can be displayed in one-to-one correspondence. Based on this, after displaying the second modeling data, the above method further includes: obtaining the first sub-model data currently selected by the user and differentially displaying the corresponding second sub-model data of the first sub-model data; wherein, the first sub-model data is a part of the first modeling data, and the second sub-model data is a part of the second modeling data; or, the first sub-model data is a part of the second modeling data, and the second sub-model data is a part of the first modeling data.
[0055] The difference display method for natural language sentences can be one or more of the following methods: highlighting, bolding, underlining, changing the background color, changing the text color, etc.; the difference display method for graphic elements in the graphic model can be one or more of the following methods: highlighting, changing the color of the graphic element, changing the background color of the graphic element, etc. It should be noted that the specific difference display method is not limited in this embodiment.
[0056] In a possible implementation, when the user selects a graphic element in the graphic model, the corresponding natural language sentence in the natural language display window can be highlighted; conversely, when a natural language sentence is selected in the natural language display window, the corresponding graphic element (there may be more than one) in the graphic model will also be highlighted accordingly. This method can help users quickly locate the target and better understand the model content.
[0057] The modeling method based on the conversion between graphic model and natural language provided by the embodiment of the present invention obtains the first modeling data input by the user during the modeling process, and the first modeling data includes one of the graphic model and text data; converts the first modeling data into a model file, and generates the second modeling data according to the model file; wherein, the model file is an intermediate process file for realizing the conversion between the graphic model and natural language; the second modeling data includes the other of the graphic model and text data; displays the second modeling data so that the user can obtain the target model based on the second modeling data. In this way, during the modeling process, the mutual conversion between the graphic model and natural language is realized, so that modeling can be carried out through natural language description, improving the modeling efficiency and promoting the information exchange and collaboration between different fields of personnel for the model at the same time.
[0058] For the convenience of understanding, the conversion between the graphic model and natural language during the modeling process will be introduced in detail below.
[0059] The embodiment of the present invention realizes two-way translation by corresponding the graphic model generated by the graphic interface operation with the selected natural language one by one. The natural language description will be generated synchronously while operating the graphic interface; conversely, when the natural language description is input, the graphic element expression will be generated synchronously.
[0060] First, the conversion rules between the graphic model and natural language are introduced as follows:
[0061] The graphic model and natural language can be converted into each other, indicating that the graphic model and the converted natural language are equivalent to each other, that is, each feature point on the graphic model has corresponding natural language expression content.
[0062] The modeling language has clear definitions for modeling elements and their meanings, so the mutual conversion rules between the graphic model and natural language can be determined according to the relevant standards of the modeling language.
[0063] The modeling elements are mainly divided into two types: nodes and the relationships between nodes (i.e., associations).
[0064] 1) Nodes: Define the description rules of things, mainly describe the nature of the nodes themselves, including the types of nodes and the attributes of nodes, the manifestation forms of the attributes on the graphical model (i.e., how these attributes are manifested on the graphical model), and the corresponding text fragments (i.e., what the corresponding natural language is);
[0065] 2) Associations: Define the description rules of associations, mainly describe the nodes connected at both ends of the association and the meaning of the association itself. Similarly, it includes the types of associations, the attributes of associations, how these attributes are manifested on the graphical model, and what the corresponding natural language is.
[0066] Next, the construction of the conversion module is introduced as follows:
[0067] Taking the model file as the medium, realize the mutual conversion between the graphical model and natural language.
[0068] The model file contains all the node information and association information of the model. Based on the node information and association information, the corresponding graphical elements and text fragments can be generated. Information can be extracted from the model file to render the graphical model, and at the same time, information can also be extracted from the model file to generate natural language. As long as the model file is complete, a graphical model and natural language with corresponding content can be generated simultaneously.
[0069] It should be noted that the storage form of the model in the computer is the model file, and what is presented to the user is the graphical model and natural language description.
[0070] Next, refer to Figure 2 to introduce in detail the process of converting from the graphical model to natural language. As Figure 2 shown, the process of converting from the graphical model to natural language includes the following steps S210 to step S230:
[0071] Step S210, generate a model file according to the graphical model.
[0072] The user draws a graphical model at the front end, and each node and association can be stored in the model file in a specific format (i.e., the preset data structure).
[0073] Real-time update and monitoring of the model file: When the user draws a graphical model, start the real-time update mechanism, continuously monitor the drawing process of the graph, and store the graphical element information in the model file in a specific format. Each addition, modification, or deletion operation of the graph will be promptly reflected in this model file to ensure the immediacy and integrity of the data.
[0074] Step S220: Organize the text fragment information in the model file into natural language.
[0075] Obtain the text fragment information from the model file, organize it, generate the corresponding natural language description, and display it on the front end.
[0076] Organization means combining text fragments using appropriate reserved words to form text that conforms to the form of natural language expression. For example, an airplane has a speed attribute, and "has" and "attribute" are reserved words fixed according to the associated meaning.
[0077] In addition, special symbols such as spaces and commas can also be used to integrate certain situations in the graphical model. Specifically, in the face of multiple associated mergers, for associations with the same endpoints, reasonable integration is carried out. For example, if there is a graphical representation of multiple factory chimneys simultaneously discharging different pollutants into the same area, the generated text description is: "The different pollutants discharged by Factory Chimney 1, Factory Chimney 2... jointly affect the environment of this area."
[0078] Step S230: Update the natural language in real time.
[0079] The natural language display window on the front end will respond to changes in the model file in real time, which is manifested on the operation interface that whenever a new node or association is added, the natural language display window will correspondingly display the corresponding natural language statement.
[0080] The following refers to Figure 3 A detailed introduction to the process of converting from natural language to a graphical model is given. As Figure 3 shown, the process of converting from natural language to a graphical model includes the following steps S310 to S340:
[0081] Step S310: Extract elements from natural language.
[0082] After obtaining the input text content, use advanced natural language processing tools, such as large models based on deep learning, knowledge graph construction technologies, etc., to comprehensively analyze the text. Through a series of operations such as part-of-speech tagging, syntactic analysis, and semantic understanding, accurately extract the node elements and relationship elements therein. For example, for the text "The river runs through the city, and the factories in the city discharge sewage to pollute the river", node elements such as "river", "city", "factory", "sewage", etc., and relationship elements such as "runs through", "discharges", "pollutes", etc. can be extracted.
[0083] Step S320: Form text paragraphs through element integration.
[0084] Reorganize the extracted text segment elements into text paragraphs according to the text format of nodes and associations, and construct a representation form that conforms to the text language rules of the graphical model. For the missing attribute descriptions, default values can be used for filling. To ensure that the finally generated graphical model meets the user's requirements, manual processing of the generated text paragraphs is required. The user confirms whether the processed text meets their modeling intention. If modifications are made, the modified text needs to be verified to ensure that it conforms to the expression form.
[0085] For example, organize the above elements as "The river, as a natural water body, passes through this area of the city. Factories in the city discharge sewage, and the sewage discharge pollutes the river."
[0086] Step S330, generate a model file according to the text paragraph.
[0087] Generate a corresponding model file according to the node elements and association elements included in the text paragraph.
[0088] Step S340, render the graphical model in real time according to the model file.
[0089] Using a graphics rendering engine, according to the node information and association information in the model file, render an intuitive and clear graphical model on the user interface. Shown on the operation interface, whenever a new text paragraph is added to the natural language display window, the corresponding graphical model will be rendered.
[0090] In summary, the modeling method based on the conversion between graphical models and natural languages provided by the embodiments of the present invention has the following advantages:
[0091] 1. Lower the modeling threshold: Provide a modeling method for non-professional modelers to generate graphical models according to text. As long as the text paragraph conforms to the modeling intention, the corresponding model can be generated.
[0092] 2. Improve the modeling accuracy: The graphical model and natural language are equivalent to each other, and both are updated in real time during the modeling process, which helps the modeler to discover model problems in a timely manner.
[0093] 3. Facilitate cross-domain collaboration: Break the communication barriers formed by the differences in information expression methods among people with different professional backgrounds. Technical personnel, management personnel, business personnel, etc. can freely switch between graphical models and natural languages according to their own habits and needs to achieve more efficient collaboration.
[0094] Corresponding to the above modeling method based on the conversion between graphical models and natural languages, the embodiments of the present invention also provide a modeling device based on the conversion between graphical models and natural languages. See Figure 4Schematic structural diagram of a modeling device based on the conversion between a graphical model and natural language. The device includes:
[0095] An acquisition module 401, configured to acquire first modeling data input by a user during the modeling process, where the first modeling data includes one of a graphical model and text data;
[0096] A conversion module 402, configured to convert the first modeling data into a model file and generate second modeling data according to the model file; wherein, the model file is an intermediate process file for implementing the conversion between the graphical model and natural language; the second modeling data includes the other of the graphical model and text data;
[0097] A display module 403, configured to display the second modeling data so that the user can obtain a target model based on the second modeling data.
[0098] The modeling device based on the conversion between the graphical model and natural language provided by the embodiments of the present invention acquires, during the modeling process, first modeling data input by a user, where the first modeling data includes one of a graphical model and text data; converts the first modeling data into a model file and generates second modeling data according to the model file; wherein, the model file is an intermediate process file for implementing the conversion between the graphical model and natural language; the second modeling data includes the other of the graphical model and text data; and displays the second modeling data so that the user can obtain a target model based on the second modeling data. In this way, during the modeling process, the mutual conversion between the graphical model and natural language is realized, so that modeling can be performed through natural language description, the modeling efficiency is improved, and at the same time, the information exchange and collaboration between personnel in different fields of the model are promoted.
[0099] Further, the above conversion module 402 is specifically configured to: extract key element information from the first modeling data and convert the key element information into a model file; the model file includes node information and association information of the model, the node information includes the type and attributes of the node, and the association information includes the type and attributes of the association; and generate second modeling data according to the model file.
[0100] Further, the above first modeling data is a graphical model; the conversion module 402 is further configured to: acquire graphical element information in the graphical model, where the graphical element information includes node element information and association element information; convert the graphical element information into node information and association information according to a preset data structure and store it as a model file.
[0101] Further, the above first modeling data is a graphical model; the conversion module 402 is further configured to: acquire text segment information from the model file; organize the natural language description of the text segment information based on a preset first standard sentence pattern to obtain second modeling data.
[0102] Further, the first modeling data described above is text data; the conversion module 402 is further configured to: extract elements from the text data to obtain node elements and association elements; organize the node elements and association elements into the text language of the graphical model based on a preset second standard sentence pattern to obtain text paragraphs; convert the text paragraphs into node information and association information according to a preset data structure, and store them as model files.
[0103] Further, the first modeling data described above is text data; the conversion module 402 is further configured to: use a graphics rendering engine to render the graphical model according to the node information and association information in the model file to obtain second modeling data.
[0104] Further, the above device further includes a differential display module, configured to: obtain the first sub-model data currently selected by the user, and differentially display the corresponding second sub-model data of the first sub-model data; wherein, the first sub-model data is a part of the first modeling data, and the second sub-model data is a part of the second modeling data; or, the first sub-model data is a part of the second modeling data, and the second sub-model data is a part of the first modeling data.
[0105] The modeling device based on the conversion between the graphical model and natural language provided in this embodiment has the same implementation principle and the same technical effects as those in the foregoing embodiment of the modeling method based on the conversion between the graphical model and natural language. For a brief description, for the parts not mentioned in the embodiment of the modeling device based on the conversion between the graphical model and natural language, reference may be made to the corresponding content in the foregoing embodiment of the modeling method based on the conversion between the graphical model and natural language.
[0106] As Figure 5 shown, an electronic device 500 provided in an embodiment of the present invention includes: a processor 501, a memory 502, and a bus. The memory 502 stores a computer program that can run on the processor 501. When the electronic device 500 runs, the processor 501 communicates with the memory 502 through the bus, and the processor 501 executes the computer program to implement the above-mentioned modeling method based on the conversion between the graphical model and natural language.
[0107] Specifically, the above-mentioned memory 502 and processor 501 can be general-purpose memory and processor, and no specific limitation is made here.
[0108] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it executes the modeling method based on the conversion between a graphical model and natural language in the foregoing method embodiment. The computer-readable storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a RAM, a magnetic disk, or an optical disc that can store program codes.
[0109] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" in this article means any one of multiple or any combination of at least two of multiple. For example, including at least one of A, B, and C can represent selecting any one or more elements from the set composed of A, B, and C.
[0110] In all the examples shown and described here, any specific value should be construed as merely exemplary, rather than as a limitation. Therefore, other examples of the exemplary embodiments may have different values.
[0111] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of apparatuses, methods, and computer program products according to multiple embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, the program segment, or the part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0112] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods. For another example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some communication interfaces. The indirect coupling or communication connection of devices or modules can be in electrical, mechanical or other forms.
[0113] The modules described as separate components may or may not be physically separated. The components shown as modules may or may not be physical modules, that is, they can be located in one place or distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0114] In addition, in each embodiment of the present invention, the functional modules can be integrated in a processing module, or each module can exist physically alone, or two or more modules can be integrated in one module.
[0115] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A modeling method based on the conversion between graphical models and natural language, characterized in that, Including: During the modeling process, obtain the first modeling data input by the user, where the first modeling data includes one of a graphical model and text data; Convert the first modeling data into a model file, and generate second modeling data based on the model file; wherein, the model file is an intermediate process file for realizing the conversion between the graphical model and natural language; the second modeling data includes the other of the graphical model and text data; Display the second modeling data so that the user can obtain a target model based on the second modeling data.
2. The method according to claim 1, wherein The converting the first modeling data into a model file includes: Extract key element information from the first modeling data, and convert the key element information into a model file; the model file includes node information and association information of the model, the node information includes the type and attributes of the node, and the association information includes the type and attributes of the association.
3. The method according to claim 2, characterized in that, When the first modeling data is a graphical model; the extracting key element information from the first modeling data and converting the key element information into a model file includes: Obtain the graphical element information in the graphical model, where the graphical element information includes node element information and association element information; Convert the graphical element information into node information and association information according to a preset data structure, and store it as the model file.
4. The method according to any one of claims 1 to 3, characterized in that When the first modeling data is a graphical model; the generating second modeling data based on the model file includes: Obtain text fragment information from the model file; Organize the natural language description of the text fragment information based on a preset first standard sentence pattern to obtain the second modeling data.
5. The method according to claim 2, wherein When the first modeling data is text data; the extracting key element information from the first modeling data and converting the key element information into a model file includes: Extract elements from the text data to obtain node elements and association elements; Organize the graphical model text language of the node elements and the association elements based on a preset second standard sentence pattern to obtain a text paragraph; Convert the text paragraph into node information and association information according to a preset data structure, and store it as the model file.
6. The method according to any one of claims 1-2 and 5, characterized in that, When the first modeling data is text data; the generating second modeling data based on the model file includes: Use a graphics rendering engine to render a graphical model according to the node information and association information in the model file to obtain the second modeling data.
7. The method according to claim 1, characterized in that, After the displaying the second modeling data, the method further includes: Obtain the first sub-model data currently selected by the user, and differentially display the corresponding second sub-model data of the first sub-model data; wherein, the first sub-model data is a part of the first modeling data, and the second sub-model data is a part of the second modeling data; or, the first sub-model data is a part of the second modeling data, and the second sub-model data is a part of the first modeling data.
8. A modeling device based on the conversion between a graphical model and natural language, characterized in that, Including: An acquisition module, configured to acquire first modeling data input by a user during a modeling process, where the first modeling data includes one of a graphic model and text data; A conversion module, configured to convert the first modeling data into a model file, and generate second modeling data according to the model file; wherein, the model file is an intermediate process file for realizing the conversion between a graphic model and natural language; the second modeling data includes the other of a graphic model and text data; A display module, configured to display the second modeling data, so that the user obtains a target model based on the second modeling data.
9. An electronic device, comprising a memory and a processor, wherein a computer program capable of running on the processor is stored in the memory, and is characterized in that When the processor executes the computer program, it implements the modeling method based on the conversion between a graphic model and natural language according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is run by a processor, it executes the modeling method based on the conversion between a graphic model and natural language according to any one of claims 1-7.
Citation Information
Patent Citations
Image generation method and terminal device
CN110136216A
Industrial data knowledge extraction method and device, computer equipment and storage medium
CN116956923A
Image generation method and device, electronic equipment and storage medium
CN117115306A