Natural language based modeling processing method, device, equipment and storage medium
Through natural language-based modeling processing methods, large language models are used to automatically extract and generate modeling codes, solving the problems of coding complexity and low efficiency in existing 3D modeling technology, and realizing efficient and automatic 3D modeling scenarios. Generate and update.
Patent Information
- Application Number
- CN202410216763.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-27
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-02-27
AI Technical Summary
In existing 3D modeling technology, users need to have high modeling and coding capabilities. The modeling process is cumbersome, time-consuming and labor-intensive. When the modeling scene changes, users need to rewrite the modeling code, which is a complicated process.
Adopting a natural language-based modeling processing method, it receives user-input modeling requirement text through a preset modeling processing model, automatically extracts modeling requirements and generates modeling code, and uses large language models for modeling requirement extraction and code generation. , reduce user coding requirements and realize automatic updating of modeling code to adapt to scene changes.
Users do not need to have advanced coding capabilities to perform 3D modeling, which significantly improves modeling efficiency, simplifies the modeling process, reduces coding burden, and enables real-time updating of modeling scenarios.
Smart Images

Figure CN118151908B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to computer technology, and in particular to a natural language-based modeling processing method, apparatus, device and storage medium. Background Art
[0002] With the rapid development of science and technology, major industrial manufacturers are continuously developing new industrial products. Among them, in order to realize the visualization of industrial products and help users better present design solutions, 3D modeling technology has gradually become an indispensable part of the industrial production field.
[0003] In the existing 3D modeling technology, users can model 3D scenes manually in simulation modeling tools or platforms by dragging and clicking the mouse. At the same time, users can manually write program code execution scripts in simulation modeling tools or platforms to meet the needs of rapid modeling.
[0004] However, in the existing 3D modeling technology, users need to have high modeling coding capabilities, and the 3D modeling process is cumbersome, time-consuming and labor-intensive. Summary of the invention
[0005] The present application provides a natural language-based modeling processing method, device, equipment and storage medium to solve the problem that the existing three-dimensional modeling process is cumbersome, time-consuming and labor-intensive.
[0006] In a first aspect, the present application provides a natural language based modeling processing method, comprising:
[0007] Receiving a modeling request sent by a terminal, wherein the modeling request includes a modeling requirement text input by a user;
[0008] A preset modeling processing model is used to extract at least one modeling requirement from the modeling requirement text, and a modeling code is generated based on a preset modeling code library and the at least one modeling requirement; the modeling processing model is a model pre-trained based on a large language model and includes a modeling requirement extraction part and a code generation part, and the modeling code library includes a plurality of modeling code units corresponding to different modeling requirements;
[0009] A modeling scene is generated according to the modeling code, and the modeling scene is returned to the terminal.
[0010] In a possible design of the first aspect, the using of a preset modeling processing model, extracting at least one modeling requirement from the modeling requirement text, and generating a modeling code based on a preset modeling code library and the at least one modeling requirement, includes:
[0011] Using the modeling requirement extraction part in the modeling processing model to identify and extract the modeling requirement text to obtain the at least one modeling requirement;
[0012] The code generation part in the modeling processing model is used to obtain the modeling code unit corresponding to each modeling requirement based on the at least one modeling requirement, the modeling code library and the modeling code tree, and the modeling code unit corresponding to each modeling requirement is generated, merged and completed to obtain the modeling code;
[0013] The modeling code tree is used to represent the connection between each modeling requirement and the modeling code unit, and the modeling code tree includes multiple classes for representing the geometric properties, appearance and category of the modeling object, functions under each class and at least one parameter included in each function.
[0014] In a possible design of the first aspect, generating, merging, and completing the modeling code units corresponding to each modeling requirement to obtain the modeling code includes:
[0015] Merge the modeling code units corresponding to each modeling requirement to obtain the initial code;
[0016] The initial code is subjected to necessary content randomization modeling code completion based on a sampling method that obeys a multinomial distribution and a sampling method that obeys a continuous uniform distribution to obtain the modeling code.
[0017] In a possible design of the first aspect, generating a modeling scenario according to the modeling code includes:
[0018] The modeling code is input into a three-dimensional modeling simulation platform corresponding to the modeling code library to perform simulation modeling to obtain the modeling scene.
[0019] In a possible design of the first aspect, the method further includes:
[0020] receiving a supplementary modeling request sent by the terminal, wherein the supplementary modeling request includes a supplementary requirement text for the modeling scenario input by the user;
[0021] Extracting at least one supplementary modeling requirement from the supplementary modeling requirement text according to the modeling processing model, and updating the modeling code based on a preset modeling code library and the at least one supplementary modeling requirement to obtain a new modeling code;
[0022] Perform simulation modeling according to the new modeling code to obtain a new modeling scenario;
[0023] The new modeling scene is returned to the terminal.
[0024] In a possible design of the first aspect, extracting at least one supplementary modeling requirement from the supplementary modeling requirement text according to the modeling processing model, and updating the modeling code based on a preset modeling code library and the at least one supplementary modeling requirement to obtain a new modeling code includes:
[0025] Using the modeling requirement extraction part in the modeling processing model to identify and extract the supplementary modeling requirement text to obtain the at least one supplementary modeling requirement;
[0026] The code generation part in the modeling processing model is used to obtain the modeling code unit corresponding to each supplementary modeling requirement based on the at least one supplementary modeling requirement, the modeling code library and the modeling code tree, and the modeling code unit corresponding to each supplementary modeling requirement is merged into the modeling code to obtain the new modeling code.
[0027] In a possible design of the first aspect, the method further includes:
[0028] Based on the logical structure in the modeling code library, a data set of modeling object descriptions acquired in advance is calibrated to obtain a training data set and a verification data set; the data set includes a plurality of natural language texts and a modeling code corresponding to each natural language text, and each natural language text includes keywords for expressing modeling requirements;
[0029] The pre-built initial modeling model is trained according to the training data set until the value of the set loss function converges, and the trained model is verified based on the verification data set to obtain the modeling processing model;
[0030] Among them, the initial modeling model is constructed based on a large language model, and the initial modeling model includes a modeling requirement extraction part and a code generation part. The code generation part includes a multi-layer network, and the multi-layer network is used to: determine the classes, functions and parameters involved in the modeling code unit corresponding to each modeling requirement based on the modeling requirement, and perform code completion.
[0031] In a second aspect, the present application provides a natural language based modeling processing device, comprising:
[0032] A receiving module, configured to receive a modeling request sent by a terminal, wherein the modeling request includes a modeling requirement text input by a user;
[0033] A processing module, configured to extract at least one modeling requirement from the modeling requirement text by using a preset modeling processing model, and generate a modeling code based on a preset modeling code library and the at least one modeling requirement; the modeling processing model is a model including a modeling requirement extraction part and a code generation part pre-trained based on a large language model, and the modeling code library includes a plurality of modeling code units corresponding to different modeling requirements;
[0034] The processing module is further used to generate a modeling scene according to the modeling code, and return the modeling scene to the terminal.
[0035] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0036] The memory stores computer-executable instructions;
[0037] The processor executes the computer-executable instructions stored in the memory to implement the natural language-based modeling processing method as described in any one of the first aspects.
[0038] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the natural language-based modeling and processing method as described in any one of the first aspects.
[0039] In a fifth aspect, the present application provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it is used to implement the natural language-based modeling and processing method described in any one of the first aspects.
[0040] The natural language-based modeling processing method, device, equipment and storage medium provided in the present application relate to computer technology. In this scheme, the preset modeling processing model can receive the modeling request sent by the terminal, and can automatically extract the modeling requirements based on the modeling requirement text included in the modeling request. On this basis, the preset modeling processing model automatically generates the modeling code with the extracted modeling requirements and the modeling code library. This step does not require the user to manually write the relevant program code, thereby reducing the requirements for the user's modeling coding ability. Among them, the modeling code generated by the preset modeling processing model can be directly compiled and executed in the three-dimensional modeling simulation software to generate the corresponding modeling scene and return it to the terminal. This process only requires the user to simply describe the demand for scene modeling through natural language, without the need for the user to have high modeling coding ability, and the modeling efficiency is significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0042] Figure 1 A schematic diagram of an application scenario of the natural language based modeling processing method provided in this application;
[0043] Figure 2 A flowchart of a first embodiment of a natural language based modeling processing method provided in this application;
[0044] Figure 3 A flowchart of a second embodiment of a natural language based modeling processing method provided in this application;
[0045] Figure 4 A tree structure diagram of the modeling code tree provided for this application;
[0046] Figure 5 A tree structure diagram of the modeling code tree when importing objects in the modeling provided by this application;
[0047] Figure 6 A flowchart of a third embodiment of the natural language based modeling processing method provided in this application;
[0048] Figure 7 A flowchart of a fourth embodiment of a natural language based modeling processing method provided in this application;
[0049] Figure 8 A flowchart of a fifth embodiment of a natural language based modeling processing method provided in this application;
[0050] Fig. 9 A flowchart of a sixth embodiment of the natural language-based modeling processing method provided in this application;
[0051] Fig.10 A flowchart of the seventh embodiment of the natural language-based modeling processing method provided in this application;
[0052] Fig.11 A schematic diagram of the overall framework of a large-model-based industrial production scenario modeling code generation method provided in this application;
[0053] Fig.12 A schematic diagram of the structure of a first embodiment of a natural language based modeling and processing device provided in the present application;
[0054] Fig.13 A schematic diagram of the structure of an electronic device for natural language based modeling and processing provided in this application.
[0055] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0056] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0057] First, the terms involved in this application are explained:
[0058] Large language model: refers to a deep learning model trained using a large amount of text data, which can generate natural language text or understand the meaning of language text.
[0059] NVIDIA Omniverse: refers to NVIDIA's graphics and simulation products based on NVIDIA RTX and Pixar Universal SceneDescription (USD), which can realize 3D scene modeling.
[0060] With the continuous expansion of industrial production, new industrial products are constantly being developed. Among them, in order to more intuitively understand the accuracy of the details and functions of the industrial products to be developed, 3D modeling technology has gradually been applied in the field of industrial production.
[0061] In the existing 3D modeling technology, users generally use mainstream simulation modeling tools or platforms to achieve modeling of 3D scenes. Specifically, based on the simulation modeling tools or platforms, users model 3D scenes manually by dragging and clicking the mouse. At the same time, users can manually write program code execution scripts in the simulation modeling tools or platforms to achieve the needs of rapid modeling.
[0062] However, in the existing 3D modeling technology, users need to have high modeling coding capabilities. At the same time, when the 3D scene to be built changes, users need to rewrite the corresponding modeling code to achieve new modeling requirements. The process is cumbersome, time-consuming and labor-intensive. On this basis, when users use the more mainstream simulation modeling tools or platforms at this stage to generate scene modeling codes, they usually only formulate the parts of the scene that users are more interested in. It is difficult to give all the modeling details in the scene to be built, and the process is relatively vague.
[0063] In view of the above problems, the inventors found in the process of studying the modeling process that if you want to realize the establishment of a modeling scene, you need to write the corresponding modeling code, and the writing of the modeling code requires the user to have a high modeling coding ability. At the same time, when the modeling scene changes, the modeling code needs to be changed synchronously, and the way to change the modeling code mainly relies on manual work. Based on this, the inventors consider whether the writing of the modeling code can get rid of the dependence on the user, but be completed automatically by the modeling processing model. Specifically, the modeling processing model can receive the modeling requirement text input by the user and extract the modeling requirements in the modeling requirement text in real time. At the same time, the corresponding modeling code is generated based on the modeling requirements and the modeling code library. The modeling code can be directly compiled and executed in the three-dimensional modeling simulation software to generate a three-dimensional scene. This process does not require the user to have a high modeling coding ability, and when the modeling requirements change, the modeling requirement text can be directly modified. The modeling processing model can update the modeling code in real time, thereby changing the modeling scene without the user having to rewrite the modeling code, thereby improving the modeling efficiency. At the same time, a tree structure of the modeling code tree is designed to describe the relationship between classes, functions and parameters in the generated modeling code in a logical and clearly structured way, which is convenient for expanding and improving the modeling code library and can provide data support for the training of the modeling processing model.
[0064] Figure 1 This is a schematic diagram of an application scenario of the natural language based modeling processing method provided in this application. Figure 1 As shown, the application scenario of the solution provided by the present application includes a terminal device 100 and a server 101. The server 101 is used to deploy a modeling processing model 1011 and a three-dimensional modeling simulation software 1012. Figure 1 Only one terminal device 100 and one server 101 are shown in the figure, but it should be understood that there may be two or more terminal devices 100 and servers 101.
[0065] The terminal device 100 is mainly used to receive the modeling request input by the user, and send the modeling request to the modeling processing model 1011 deployed in the server 101 in real time. The modeling request includes the user's description of the three-dimensional scene modeling requirements in natural language. When the modeling processing model 1011 deployed in the server 101 receives the modeling request sent by the terminal device 100, it first extracts the modeling requirements corresponding to the modeling request, then generates the modeling code based on the modeling requirements and the modeling code library, and finally transmits the modeling code to the three-dimensional modeling simulation software 1012 deployed in the server 101 to achieve the establishment of the three-dimensional scene.
[0066] After the three-dimensional scene is established, the three-dimensional modeling simulation software 1012 deployed in the server 101 returns the three-dimensional scene to the terminal device 100 in real time for the user to view.
[0067] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0068] Figure 2 This is a flow chart of the first embodiment of the natural language based modeling processing method provided in this application. Figure 2 As shown, the process of the natural language-based modeling processing method may include:
[0069] S201: receiving a modeling request sent by a terminal, where the modeling request includes a modeling requirement text input by a user.
[0070] In this step, when the user has a modeling request, he can enter the pre-set URL in the terminal device to enter the modeling website. The pre-set URL is determined when the modeling website is built, and the modeling website is deployed in the server.
[0071] Specifically, the modeling website provides a location for users to input modeling requests, and can receive the modeling requests input by users in real time, and transmit the modeling requests to the modeling processing model preset in the modeling website. The modeling request includes the modeling requirement text input by the user, and the modeling requirement text is composed of natural language description. For example, the modeling requirement text input by the user is "Please generate an industrial assembly line scene, including a conveyor belt and a robotic arm."
[0072] S202: Using a preset modeling processing model, extract at least one modeling requirement from the modeling requirement text, and generate modeling code based on a preset modeling code library and at least one modeling requirement; the modeling processing model is a model pre-trained based on a large language model and includes a modeling requirement extraction part and a code generation part, and the modeling code library includes modeling code units corresponding to multiple different modeling requirements.
[0073] In this step, based on step S201, after receiving the modeling request sent by the terminal, the modeling processing model deployed in the server extracts at least one modeling requirement from the modeling requirement text included in the modeling request, and generates a modeling code based on a preset modeling code library and at least one modeling requirement.
[0074] Among them, the modeling processing model is a model that is pre-trained based on a large language model and includes a modeling requirement extraction part and a code generation part. Specifically, a large language model is a deep learning model trained based on massive text data. It can not only generate natural language text, but also deeply understand the meaning of the text and process various natural language tasks. Common large language models include GPT-3, GPT-4, LaMDA, LLaMA 2, etc.
[0075] During pre-training, the pre-trained large language model uses a large amount of text data from the Internet to learn the statistical characteristics, grammatical structure and semantic meaning of the language, so that the model attempts to understand the relationship between words, phrases and sentences, and extracts modeling requirements from the natural language input by the user more efficiently and accurately. When faced with input text data, the input text is first encoded into a vector representation through processing, while retaining the contextual information of the text to better understand the meaning of the instruction. On this basis, the self-attention mechanism is used for the correlation between the previous and next texts in natural language, allowing the large language model to pay different degrees of attention to different parts when processing the input, which helps to capture long-distance dependencies and contextual information, especially focusing on the modeling requirements of user input.
[0076] After the large language model is pre-trained, the large language model needs to be fine-tuned to adapt to the generation task of a specific modeling code, that is, the modeling processing model fine-tunes the network structure based on the pre-trained large language model to realize the functions of modeling requirement extraction and code generation. Among them, extracting at least one modeling requirement from the modeling requirement text included in the modeling request is performed by a neural network with a modeling requirement extraction function in the modeling processing model, and the input of this part of the neural network is the modeling request, and the output is the modeling requirement. Generating modeling code based on a preset modeling code library and at least one modeling requirement is performed by a neural network with a code generation function in the modeling processing model, and the input of this part of the neural network is the modeling requirement, and the output is the modeling code.
[0077] The modeling code library includes multiple modeling code units corresponding to different modeling requirements. The modeling code unit is composed of a pre-labeled data set, which includes the standard modeling code corresponding to each modeling object. Based on the modeling requirements and the modeling code library, the modeling code corresponding to the modeling request can be obtained by modeling the processing model.
[0078] S203: Generate a modeling scene according to the modeling code, and return the modeling scene to the terminal.
[0079] In this step, based on step S202, the preset modeling processing model extracts at least one modeling requirement from the modeling requirement text, and after generating a modeling code based on the preset modeling code library and at least one modeling requirement, the modeling code is input into the corresponding three-dimensional modeling simulation software to generate a modeling scene, and the modeling scene is returned to the terminal.
[0080] Among them, the modeling code output by the modeling processing model can be directly compiled and executed in the corresponding three-dimensional modeling and simulation software. Three-dimensional modeling and simulation software include NVIDIA Omniverse, Unity, Blender, etc. In this application, NVIDIA Omniverse is mainly used as a three-dimensional modeling and simulation software. The main reason is that NVIDIA Omniverse three-dimensional modeling and simulation software has a Python compilation environment, which allows users to use code to write scripts to implement functions such as modeling and simulation, and it is also convenient to introduce open source and third-party Python libraries to assist in the code modeling process. At the same time, NVIDIA Omniverse three-dimensional modeling and simulation software has a highly realistic virtual environment in modeling and simulation, supporting a variety of industrial application scenarios including industrial production, architectural design, and automotive engineering. On this basis, the visual effects of NVIDIA Omniverse three-dimensional modeling and simulation software are relatively outstanding, using ray tracing, physical materials and advanced light source simulation, high-performance GPU accelerated rendering and other methods to provide users with more immersive visual effects.
[0081] The 3D modeling simulation software is based on the modeling code. After generating the modeling scene, it will feed back the generated modeling scene to the terminal in real time for the user to view.
[0082] The modeling processing method based on natural language provided in this embodiment mainly describes the process of generating a modeling scene based on a modeling processing model and a three-dimensional modeling simulation software. Among them, the modeling processing model can automatically extract the modeling requirements of the user and generate corresponding modeling codes based on the modeling requirements. The three-dimensional modeling simulation software can directly generate a modeling scene according to the modeling code. The modeling processing method based on natural language does not require the user to write modeling codes, and the modeling efficiency is significantly improved.
[0083] Figure 3 This is a flow chart of the second embodiment of the natural language based modeling processing method provided in this application. Figure 3 As shown, based on the above embodiment, a preset modeling processing model is used to extract at least one modeling requirement from the modeling requirement text, and a modeling code is generated based on a preset modeling code library and at least one modeling requirement. The process of the natural language-based modeling processing method may include:
[0084] S301: Using the modeling requirement extraction part in the modeling processing model to identify and extract the modeling requirement text to obtain at least one modeling requirement.
[0085] In this step, when the modeling processing model deployed in the server receives the modeling request sent by the terminal, the modeling requirement extraction part in the modeling processing model is used to identify and extract the modeling requirement text to obtain at least one modeling requirement.
[0086] The modeling processing model mainly includes two parts: modeling requirement extraction and code generation. Among them, the neural network involved in the modeling requirement extraction part takes the modeling request sent by the terminal as input, and the modeling request includes the modeling requirement text, such as "please generate a robotic arm and add a suction cup to the end of the robotic arm." Based on the modeling requirement text, the neural network involved in the modeling requirement extraction part can perform recognition and extraction, such as identifying the modeling request of "please generate a robotic arm and add a suction cup to the end of the robotic arm" to extract at least one modeling requirement, namely "a robotic arm with a suction cup at the end."
[0087] S302: The code generation part in the modeling processing model is used to obtain the modeling code unit corresponding to each modeling requirement based on at least one modeling requirement, a modeling code library and a modeling code tree, and the modeling code unit corresponding to each modeling requirement is generated, merged and completed to obtain the modeling code; wherein the modeling code tree is used to represent the connection between each modeling requirement and the modeling code unit, and the modeling code tree includes multiple classes for representing the geometric properties, appearance and category of the modeling object, the functions under each class and at least one parameter included in each function.
[0088] In this step, based on step S301, after the modeling processing model extracts at least one modeling requirement according to the modeling requirement text, it obtains the modeling code unit corresponding to each modeling requirement based on the code generation part in the modeling processing model, and merges and completes the modeling code units corresponding to each modeling requirement to obtain the modeling code.
[0089] The neural network structure corresponding to the code generation part in the modeling processing model is built based on the logical structure of the modeling code tree. When the modeling processing model obtains the modeling code unit corresponding to each modeling requirement, the main content based on it is at least one modeling requirement, a modeling code library and a modeling code tree.
[0090] The modeling requirements are extracted by the modeling requirements extraction part in the modeling processing model, and the modeling code base is the data training set involved in the pre-training of the modeling processing model, which includes the standard modeling codes corresponding to multiple modeling objects. Based on the classes, functions and parameters corresponding to each modeling object, the standard modeling code corresponding to each modeling object is composed. At the same time, the composition of the standard modeling code corresponding to each modeling object follows the logical structure of the modeling code tree.
[0091] Specifically, the modeling code tree is a predefined tree structure, which is mainly used to represent the connection between each modeling requirement and the modeling code unit. Figure 4 This is a tree structure diagram of the modeling code tree provided in this application. Figure 4 As shown, in the tree structure of the modeling code tree, the class is the top-level element, representing an abstract template of an object. At the same time, each class can contain multiple functions, which are class methods used to perform specific operations. On this basis, each function can accept multiple parameters, and the parameters are responsible for passing data or information to the function. When a modeling requirement is obtained, the modeling requirement will correspond to at least one modeling object, and the modeling object corresponds to a class in the modeling code tree. Based on the determined class, at least one function and parameter corresponding to the class can be obtained. According to the class, function and parameter, the modeling code unit corresponding to the modeling requirement can be obtained.
[0092] Different modeling objects correspond to different classes, different class structures have different functions, and different functions also correspond to different parameters. Here, in the actual modeling process, when a certain modeling object is imported, the tree structure of the corresponding modeling code tree is as follows: Figure 5 shown. Figure 5 This is a tree structure diagram of the modeling code tree when importing objects in the modeling provided by this application. Figure 5 In accordance with Figure 4 The tree structure of the defined modeling code tree. When importing a modeling object, that is, when importing an object, first declare the class of the object, and then define several functions in this class to describe the geometric properties, appearance and object category corresponding to the imported object, and then assign different parameters to different functions. For example, in the function describing the geometric properties, assign the position of the three-dimensional object in the Cartesian coordinate system, assign Euler angles to represent the rotation of the object, assign a scaling scale to represent the size of the object, etc. At the same time, you can also assign material, texture and other parameters in the function describing the appearance of the object, and assign different uses and material categories to the object in the category function describing the object.
[0093] After the modeling processing model obtains the modeling code unit corresponding to at least one modeling requirement, it is necessary to generate, merge and complete the modeling code unit corresponding to each modeling requirement to obtain the modeling code. Among them, in the modeling request obtained by the terminal, the modeling requirement text includes at least one modeling requirement. Therefore, before generating the modeling code, the modeling processing model first obtains at least one modeling code unit corresponding to at least one modeling requirement, and then merges the obtained at least one modeling code unit. Considering that when the modeling code unit is obtained based on the modeling requirement, the modeling scenario generated only by relying on the partial scenario requirements specified by the user is usually incomplete. At this time, it is necessary to perform the modeling code completion operation after the modeling code unit is merged to obtain the complete modeling code.
[0094] The natural language-based modeling processing method provided in this embodiment mainly describes how to generate modeling code based on the modeling requirements extracted by the modeling processing model. Among them, in order to facilitate the establishment of a modeling code library in a logical and clearly structured manner, a tree structure of a modeling code tree is defined. Based on the tree structure, the modeling processing model can assign corresponding classes and subordinate functions and parameters to each possible modeling object. At the same time, based on the tree structure, the modeling processing model is also convenient for establishing a mapping relationship between the modeling requirements expressed in natural language and the different classes, functions and parameters in the modeling code, forming data with a mapping relationship of "natural language-modeling code", which is convenient for the subsequent use of a large amount of "natural language-modeling code" data as input to train the modeling processing model, so as to improve the modeling processing model's ability to understand and extract modeling requirements in the user's natural language, thereby generating more intelligent modeling code.
[0095] Figure 6 This is a flow chart of the third embodiment of the natural language based modeling processing method provided in this application. Figure 6 As shown, based on the above embodiment, the modeling code units corresponding to each modeling requirement are generated, merged and completed to obtain the modeling code. The process of the natural language-based modeling processing method may include:
[0096] S601: Merge the modeling code units corresponding to each modeling requirement to obtain an initial code.
[0097] In this step, before the modeling processing model generates a complete modeling code based on the modeling requirements, the modeling processing model needs to first merge the modeling code units corresponding to each modeling requirement to obtain the initial code.
[0098] Among them, the modeling processing model first obtains the modeling code unit corresponding to each modeling requirement based on the mapping relationship between the modeling requirements and the modeling code library, and then merges the obtained multiple modeling code units to finally obtain the initial code.
[0099] The content involved in the initial code is mainly based on modeling requirements, and the parts other than modeling requirements are not involved. Therefore, after obtaining the initial code, it is necessary to perform the modeling code completion operation.
[0100] S602: Based on a sampling method that obeys a multinomial distribution and a sampling method that obeys a continuous uniform distribution, the initial code is randomized to complete the necessary content of the modeling code to obtain a modeling code.
[0101] In this step, after the initial code is obtained based on step S601, the expected requirements and usage habits of the user using the modeling processing model are taken into consideration, that is, when the modeling processing model is used to generate the modeling code, usually only the parts of the modeling scene that the user is more interested in are specified, such as the more important mechanical arms, mechanical grippers, parts appearance materials, workbenches, etc. in the process production tasks. Therefore, the modeling scene generated only by relying on the partial scene requirements specified by the user is usually incomplete.
[0102] For example, in an industrial scene, in addition to the parts specified in the modeling requirements, there are still many parts that need to be modeled in a relatively complete industrial scene. For example, the background, lighting and other parts in the industrial scene. At the same time, it is usually difficult to give very precise values in the modeling requirements described in natural language. For example, the modeling requirement is "place part A at the end of the conveyor belt." Among them, the word "end" is a more precise expression in natural language, but it is indeed vague in the modeling code and needs to be further standardized so as to be converted into a coordinate system position that can be recognized by the 3D modeling simulation software.
[0103] Therefore, after obtaining the initial code, the modeling processing model needs to further generate the parts of the modeling scenario that are not specifically required by the modeling requirements. Among them, for the situation where the modeling requirements do not specify the modeling requirements or the expressions are vague, the modeling processing model divides the modeling parameters of the modeling object into two categories: discrete parameters and random parameters. Based on the above two types of parameter types, the modeling processing model internally embeds a sampling method based on polynomial distribution and a sampling method based on continuous uniform distribution, and completes the initial code with necessary content randomized modeling code, thereby obtaining a complete modeling code.
[0104] Specifically, the discrete parameters involved in the modeling object refer to those parameters that can only take certain discrete values, rather than any continuous values within a certain range. For example, the type of light source in an industrial production line is a discrete parameter. The values that can be selected during the modeling process include point light sources, line light sources, surface light sources, spotlights, ring light sources, parallel light sources, and spherical light sources. In view of the characteristics of discrete parameters, the modeling processing model adopts a sampling method that obeys a polynomial distribution to complete the modeling code.
[0105] Taking the light source type as an example, the sampling method that obeys the polynomial distribution used in the model building process first numbers the point light source, line light source, surface light source, spotlight, ring light source, parallel light source and spherical light source involved in the light source type as -3, -2, -1, 0, 1, 2, 3. On this basis, the sampling obeys the polynomial distribution with a mean of (-3–2–1+0+1+2+3) / 7=0 and a variance of [(-3-0)2*(1 / 7)+(-2-0)2*(1 / 7)+...+(3-0)2*(1 / 7)]=4.
[0106] The continuous parameters involved in the modeling object refer to those parameters that can take any continuous value within a certain range. For example, the color temperature of the light source can usually take any value between 2800K and 6800K during the modeling process. In the modeling process, based on the characteristics of continuous parameters, the modeling processing model adopts a sampling method that obeys a continuous uniform distribution to complete the modeling code. Taking the value of the color temperature of the light source as an example, based on the sampling method that obeys a continuous uniform distribution adopted by the modeling processing model, any value can be taken within a continuous range, and the probability density function is defined as follows:
[0107]
[0108] Among them, I [2800,6800] Represents the uniform distribution function on the interval [2800, 6800].
[0109] The modeling code obtained by randomizing the necessary content of the initial code based on the sampling method that obeys the polynomial distribution and the sampling method that obeys the continuous uniform distribution will strictly conform to the actual situation of the corresponding modeling scenario. For example, in an industrial production environment, the modeling processing model strictly conforms to the actual situation of the real industrial production environment in the process of completing the necessary content of the initial code based on the sampling method that obeys the polynomial distribution and the sampling method that obeys the continuous uniform distribution. For example, the ceiling lights in the industrial production line usually use surface light sources or line light sources instead of point light sources, and the surface material of the conveyor belt is usually leather or metal materials instead of plastic or textile materials.
[0110] The natural language-based modeling processing method provided in this embodiment mainly illustrates that the modeling code generated by the modeling processing model includes two parts: initial code and completion code. Among them, based on the modeling requirements, the modeling processing model generates the initial code. For the parts that are not specifically required or unclear in the modeling requirements, the modeling processing model performs necessary content randomization modeling code completion on the initial code based on the sampling method that obeys the polynomial distribution and the sampling method that obeys the continuous uniform distribution to obtain the final complete modeling code. This modeling processing method can improve the modeling code output by the modeling processing model and achieve a more refined and complete modeling effect.
[0111] Figure 7 This is a flow chart of the fourth embodiment of the natural language based modeling processing method provided in this application. Figure 7 As shown, based on any of the above embodiments, a modeling scenario is generated according to the modeling code, and the process of the natural language-based modeling processing method may include:
[0112] S701: Input the modeling code into a three-dimensional modeling simulation platform corresponding to the modeling code library to perform simulation modeling to obtain a modeling scene.
[0113] In this step, after the modeling processing model outputs a complete modeling code, the complete modeling code is directly used as input to the three-dimensional modeling simulation platform. The three-dimensional modeling simulation platform performs simulation modeling based on the modeling code to obtain a modeling scene.
[0114] Among them, the three-dimensional modeling simulation platform corresponds to the modeling code library. Specifically, due to the large variety of three-dimensional modeling simulation platforms, each different three-dimensional modeling simulation platform corresponds to a different modeling code format. For example, the modeling code format supported by three-dimensional modeling simulation platform A is a, while the modeling code format supported by three-dimensional modeling simulation platform B is b. Therefore, before applying the modeling processing model to generate the modeling code, it is necessary to determine in advance the three-dimensional modeling simulation platform that will subsequently execute the modeling code. Based on the selected three-dimensional modeling simulation platform, the format of the modeling code library is determined, and the format of the modeling code library is consistent with the modeling code format supported by the three-dimensional modeling simulation platform, so that the modeling code output by the application of the modeling processing model can be directly compiled and run in the selected three-dimensional modeling simulation platform to obtain the modeling scene.
[0115] The natural language-based modeling processing method provided in this embodiment mainly describes how to obtain a modeling scene based on a modeling code and a three-dimensional modeling simulation platform. The modeling code format generated by the modeling processing model is consistent with the modeling code format supported by the three-dimensional modeling simulation platform. The modeling code does not need to be manually written, but is directly generated by the modeling processing model based on the modeling requirements, thereby improving the modeling efficiency.
[0116] Figure 8This is a flow chart of the fifth embodiment of the natural language based modeling processing method provided in this application. Figure 8 As shown, based on any of the above embodiments, the process of the natural language based modeling processing method further includes:
[0117] S801: receiving a supplementary modeling request sent by a terminal, where the supplementary modeling request includes a supplementary requirement text for a modeling scenario input by a user.
[0118] In this step, after the modeling processing model feeds back the modeling scenario generated based on the modeling requirements to the terminal, if the user is not satisfied with the generated modeling scenario, the user can further input a supplementary modeling request through the terminal. After the terminal receives the supplementary modeling request, it sends the modeling request to the modeling processing model. After the modeling processing model receives the supplementary modeling request sent by the terminal, it executes the corresponding modeling scenario update operation.
[0119] The supplementary modeling request includes the supplementary requirement text for the modeling scene entered by the user. For example, the initial modeling request is "please generate an industrial assembly line scene, including a conveyor belt and a robotic arm", and the supplementary modeling request is "please add a suction cup to the end of the robotic arm, make the generated industrial assembly line scene brighter, and adjust the light source to cold light".
[0120] S802: extracting at least one supplementary modeling requirement from the supplementary modeling requirement text according to the modeling processing model, and updating the modeling code based on a preset modeling code library and the at least one supplementary modeling requirement to obtain a new modeling code.
[0121] In this step, based on step S801, after the modeling processing model receives the supplementary modeling request sent by the terminal, it extracts at least one supplementary modeling requirement from the supplementary modeling requirement text included in the supplementary modeling request, and based on the preset modeling code library and at least one supplementary modeling requirement, updates the modeling code to obtain a new modeling code.
[0122] The operation of updating the modeling code by the modeling processing model based on the supplementary modeling request is mainly to supplement or delete the modeling code based on the previously obtained modeling code. For example, the modeling objects included in the initial modeling request are E, F, and G, while the modeling objects included in the supplementary modeling request are E, G, and H. Therefore, in the process of updating the modeling code, the modeling processing model needs to delete the original modeling code part about the modeling object F based on the supplementary modeling request, and newly generate the modeling code part about the modeling object H, so as to update the modeling code and obtain the new modeling code.
[0123] S803: Perform simulation modeling according to the new modeling code to obtain a new modeling scene.
[0124] In this step, based on step S802, after the modeling processing model obtains a new modeling code based on the supplementary modeling request, simulation modeling is performed according to the new modeling code to obtain a new modeling scene.
[0125] The operation flow of performing simulation modeling based on the new modeling code to obtain a new modeling scene can refer to step S701, which will not be repeated here.
[0126] S804: Return the new modeling scene to the terminal.
[0127] In this step, based on step S803, simulation modeling is performed according to the new modeling code, and after a new modeling scene is obtained, the new modeling scene is returned to the terminal.
[0128] The new modeling scene is provided for the user to view and review at the terminal. If the user is still not satisfied with the new modeling scene, the user resubmits a supplementary modeling request and re-executes steps S801 to S804 until a modeling scene that satisfies the user is generated.
[0129] The natural language-based modeling processing method provided in this embodiment mainly describes how the modeling processing model updates the modeling code based on the supplementary modeling requirements to achieve the establishment of a new modeling scenario. When the user is not satisfied with the initially established modeling scenario, he can further repeatedly propose new adjustment requirements for the generated modeling scenario through natural language instructions. The modeling processing model will fine-tune the generated modeling code accordingly, and finally achieve a modeling effect that satisfies the user and improves the user experience.
[0130] Fig. 9 This is a flow chart of the sixth embodiment of the natural language based modeling processing method provided in this application. Fig. 9 As shown, based on the above embodiment, at least one supplementary modeling requirement is extracted from the supplementary modeling requirement text according to the modeling processing model, and based on the preset modeling code library and the at least one supplementary modeling requirement, the modeling code is updated to obtain a new modeling code. The process of the natural language-based modeling processing method may include:
[0131] S901: Using the modeling requirement extraction part in the modeling processing model to identify and extract the supplementary modeling requirement text, and obtain at least one supplementary modeling requirement.
[0132] In this step, when the modeling processing model receives the supplementary modeling request sent by the terminal, the modeling processing model needs to execute an update operation of the modeling code.
[0133] The first step of updating the modeling code of the modeling processing model is that the modeling requirement extraction part in the modeling processing model identifies and extracts the supplementary modeling requirement text to obtain at least one supplementary modeling requirement. The method for obtaining the supplementary modeling requirement is consistent with the method for obtaining the previous modeling requirement, and can refer to step S301, which will not be repeated here.
[0134] S902: Using the code generation part in the modeling processing model, based on at least one supplementary modeling requirement, a modeling code library and a modeling code tree, obtain the modeling code unit corresponding to each supplementary modeling requirement, and merge the modeling code unit corresponding to each supplementary modeling requirement into the modeling code to obtain a new modeling code.
[0135] In this step, based on step S901, the modeling requirement extraction part in the modeling processing model identifies and extracts the supplementary modeling requirement text. After obtaining at least one supplementary modeling requirement, the code generation part in the modeling processing model is used to obtain the modeling code unit corresponding to each supplementary modeling requirement based on at least one supplementary modeling requirement, the modeling code library and the modeling code tree, and the modeling code unit corresponding to each supplementary modeling requirement is merged into the modeling code to obtain a new modeling code.
[0136] Among them, the process of the code generation part in the modeling processing model obtaining the modeling code unit corresponding to each supplementary modeling requirement can refer to step S302, which will not be repeated here.
[0137] The modeling processing model merges the modeling code units corresponding to each supplementary modeling requirement into the modeling code. This means that based on the supplementary modeling request, after obtaining the corresponding supplementary modeling code, the modeling processing model merges the supplementary modeling code with the previous modeling code to obtain a new modeling code. The new modeling code not only meets the previous modeling requirements, but also meets the supplementary modeling requirements.
[0138] The natural language-based modeling processing method provided in this embodiment mainly describes how the modeling processing model generates new modeling codes based on supplementary modeling requests. When the user is not satisfied with the generated modeling scenario, the modeling processing model can repeatedly make modeling requests, and the modeling processing model can update the modeling code based on the supplementary modeling requests, and then generate a new modeling scenario until a modeling scenario that satisfies the user is achieved. This process does not require the user to repeatedly adjust the modeling code, but only needs to input the modeling request, which improves the user experience while improving the modeling efficiency.
[0139] Fig.10 This is a flow chart of the seventh embodiment of the natural language based modeling processing method provided in this application. Fig.10 As shown, based on any of the above embodiments, the process of the natural language based modeling processing method further includes:
[0140] S1001: Based on the logical structure in the modeling code library, a data set of pre-acquired descriptions of modeling objects is calibrated to obtain a training data set and a verification data set; the data set includes multiple natural language texts and a modeling code corresponding to each natural language text, and each natural language text includes keywords for expressing modeling requirements.
[0141] In this step, when the modeling code is generated, the model structure used is the modeling processing model, and the modeling processing model needs to be trained multiple times before it is applied. During the training process, a large amount of data sets are required.
[0142] The data set is divided into a training data set and a validation data set. The training data set is mainly used to fit the modeling processing model, and the validation data set is mainly used to evaluate the modeling processing model.
[0143] In the process of building a data set, it is necessary to obtain a data set describing the modeling object in advance, then calibrate these data sets, and finally divide the calibrated data set into a training data set and a verification data set according to a certain ratio. For example, the division ratio is 9 to 1, that is, the training data set accounts for 90% of the calibrated data set, and the verification data set accounts for 10% of the calibrated data set.
[0144] The data set of modeling object description is organized based on the logical structure in the modeling code library. The data set includes multiple natural language texts and the modeling code corresponding to each natural language text. The natural language text is the user's description of the modeling scene in the form of natural language. Each natural language text corresponds to a modeling code, which is the key content for generating the modeling scene.
[0145] Each natural language text includes keywords used to express modeling requirements. The keywords will be screened out by the modeling processing model to provide data support for the establishment of subsequent modeling codes. For example, the natural language text is "Please generate robotic arms and industrial parts", so the keywords for modeling requirements in the natural language text can be "robotic arms" and "industrial parts".
[0146] S1002: Train the pre-built initial modeling model according to the training data set until the value of the set loss function converges, and verify the trained model based on the verification data set to obtain a modeling processing model; wherein, the initial modeling model is built based on a large language model, and the initial modeling model includes a modeling requirement extraction part and a code generation part, and the code generation part includes a multi-layer network, and the multi-layer network is used to: determine the classes, functions and parameters involved in the modeling code unit corresponding to the modeling requirement based on each modeling requirement, and perform code completion.
[0147] In this step, based on step S1001, after obtaining the training data set and the verification data set, it is necessary to train the pre-constructed initial modeling model according to the training data set until the value of the set loss function converges, and verify the trained model based on the verification data set to obtain the modeling processing model.
[0148] Among them, the pre-built initial modeling model is obtained by changing the network structure on the basis of the large language model. Specifically, after obtaining the pre-trained large language model, it is necessary to fine-tune the large language model to adapt to the specific modeling code generation task. The specific fine-tuning operation is to perform specific training on the last few layers of the large language model to achieve the mapping conversion between modeling requirements and modeling codes. Among them, the large language model after fine-tuning, that is, the initial modeling model, includes a modeling requirement extraction part and a code generation part.
[0149] The code generation part includes a multi-layer network, which is used to: determine the classes, functions and parameters involved in the modeling code unit corresponding to the modeling requirement based on each modeling requirement, and perform code completion. Among them, in combination with a specific modeling code generation task, a hierarchical generation structure is designed, and the hierarchical generation structure is mainly used to realize the conversion between modeling requirements and modeling codes. In terms of logical structure, the hierarchical generation structure is based on the tree structure of the modeling code tree. First, it generates the first layer of suitable classes, then generates the second layer of suitable functions, and finally selects suitable parameters for the functions in the third layer. Based on the hierarchical generation structure, the initial modeling code can be obtained. On this basis, considering the parts that are not mentioned or vaguely expressed in the modeling requirements, at least one layer of network structure is designed to realize the completion function of the initial modeling code.
[0150] After the model framework of the modeling processing model is built, the modeling processing model is trained multiple times so that it can complete the task of generating modeling code. During the training process, the pre-built initial modeling model is first trained according to the training data set until the value of the set loss function converges, where the loss function is defined as:
[0151]
[0152] Specifically, L represents the loss function, N represents the length of the generated modeling code sequence, V represents the length of the target modeling code sequence, and Q i,j represents the probability of the target modeling code sequence at time step i for vocabulary j, P i,j is the probability of generating the modeled code sequence for vocabulary j at time step i.
[0153] The convergence of the set loss function value is indicated by the absolute value of the difference between two adjacent loss function values being less than or equal to a preset threshold. For example, the preset threshold is 5%. At this time, the two adjacent loss function values are 100 and 100.03 respectively, and the absolute value of the difference between the two loss function values is 0.03, which is less than the preset threshold of 5%, indicating that the model training is completed.
[0154] At the same time, in the process of training the pre-built initial modeling model according to the training data set until the value of the set loss function converges, the trained model needs to be verified based on the validation data set to obtain the modeling processing model. The model parameters are dynamically adjusted based on the performance of the pre-built initial modeling model in the validation data set to avoid the occurrence of overfitting problems.
[0155] Based on the training data set and the validation data set, a modeling processing model for generating modeling codes can be obtained.
[0156] The natural language-based modeling processing method provided in this embodiment mainly describes how to obtain a modeling processing model. Among them, a pre-training combined with fine-tuning method is adopted to obtain a modeling processing model, which can save the time and cost of training the modeling processing model. At the same time, the designed hierarchical generation structure can generate modeling codes more systematically, and the logical structure is clear. On this basis, the constructed modeling processing model can adapt to natural language input of different styles and improve the user experience.
[0157] Fig.11 This is a schematic diagram of the overall framework of a large-scale model-based industrial production scenario modeling code generation method provided in this application. Fig.11 As shown, the natural language 1102 is a description of the scene modeling requirements of the user 1101, and the large model 1103 can intelligently understand the modeling requirements of the user 1101, thereby intelligently, accurately and quickly generating modeling codes 1104 that can be directly compiled and executed in the three-dimensional modeling simulation software, which are used to realize automatic modeling in the modeling software and generate modeling scenes 1105. At the same time, the large model 1103 can further receive the natural language instructions of the user 1101 for scene modeling, and repeatedly put forward new adjustment requirements for the generated modeling scene 1105. The large model 1103 will fine-tune the generated modeling code 1104 accordingly, so as to finally achieve a modeling effect that satisfies the user.
[0158] Among them, the specific technical scheme of the industrial production scene modeling code generation method 1106 based on the large model can be divided into: the establishment of a modeling code library 11061, the construction of a large language model 11062, and the randomized modeling code completion method 11063. Specifically, the establishment of the modeling code library 11061 organizes and represents the classes, functions, parameters and other contents required in the modeling code in a tree structure efficiently, concisely and orderly, so as to facilitate the connection between natural language and modeling code to train the large model. The construction of the large language model 11062 combines the powerful natural language understanding ability of the large language model, adopts the self-attention mechanism combined with context information to effectively extract the user's modeling requirements for the scene, and designs a hierarchical code generation mechanism to accurately convert the user's modeling requirements into scene modeling code. The randomized modeling code completion method 11063 targets the continuous parameters and discrete parameters of the modeling target respectively, and combines the parameter sampling range and characteristics of the modeling target to further improve the modeling code output by the large model to achieve a more refined and complete modeling effect.
[0159] Fig.12 This is a schematic diagram of the structure of the first embodiment of the natural language based modeling processing device provided in this application. Fig.12 As shown, the natural language based modeling processing device 1200 includes:
[0160] The receiving module 1201 is used to receive a modeling request sent by a terminal, where the modeling request includes a modeling requirement text input by a user;
[0161] The processing module 1202 is used to extract at least one modeling requirement from the modeling requirement text using a preset modeling processing model, and generate a modeling code based on a preset modeling code library and at least one modeling requirement; the modeling processing model is a model pre-trained based on a large language model and includes a modeling requirement extraction part and a code generation part, and the modeling code library includes modeling code units corresponding to multiple different modeling requirements;
[0162] The processing module 1202 is further used to generate a modeling scene according to the modeling code and return the modeling scene to the terminal.
[0163] Optionally, the processing module 1202 is specifically configured to:
[0164] Using the modeling requirement extraction part in the modeling processing model to identify and extract the modeling requirement text, and obtain at least one modeling requirement;
[0165] The code generation part in the modeling processing model is adopted to obtain the modeling code unit corresponding to each modeling requirement based on at least one modeling requirement, a modeling code library and a modeling code tree, and generate, merge and complete the modeling code unit corresponding to each modeling requirement to obtain the modeling code; wherein the modeling code tree is used to represent the connection between each modeling requirement and the modeling code unit, and the modeling code tree includes multiple classes for representing the geometric properties, appearance and category of the modeling object, the functions under each class and at least one parameter included in each function.
[0166] Optionally, the processing module 1202 is further specifically configured to:
[0167] Merge the modeling code units corresponding to each modeling requirement to obtain the initial code;
[0168] Based on the sampling method that obeys the multinomial distribution and the sampling method that obeys the continuous uniform distribution, the necessary content of the initial code is randomly completed to obtain the modeling code.
[0169] Optionally, the processing module 1202 is further configured to:
[0170] The modeling code is input into a three-dimensional modeling simulation platform corresponding to the modeling code library for simulation modeling to obtain a modeling scene.
[0171] The receiving module 1201 is further used for:
[0172] A supplementary modeling request sent by a receiving terminal is received, where the supplementary modeling request includes a supplementary requirement text for a modeling scenario input by a user.
[0173] Optionally, the processing module 1202 is further configured to:
[0174] Extracting at least one supplementary modeling requirement from the supplementary modeling requirement text according to the modeling processing model, and updating the modeling code based on a preset modeling code library and the at least one supplementary modeling requirement to obtain a new modeling code;
[0175] Perform simulation modeling according to the new modeling code to obtain a new modeling scenario;
[0176] Return the new modeling scene to the terminal.
[0177] Optionally, the processing module 1202 is further configured to:
[0178] Using the modeling requirement extraction part in the modeling processing model to identify and extract the supplementary modeling requirement text, and obtain at least one supplementary modeling requirement;
[0179] The code generation part in the modeling processing model is adopted to obtain the modeling code unit corresponding to each supplementary modeling requirement based on at least one supplementary modeling requirement, a modeling code library and a modeling code tree, and the modeling code unit corresponding to each supplementary modeling requirement is merged into the modeling code to obtain a new modeling code.
[0180] Optionally, the processing module 1202 is further configured to:
[0181] Based on the logical structure in the modeling code library, a data set of modeling object descriptions acquired in advance is calibrated to obtain a training data set and a verification data set; the data set includes multiple natural language texts and a modeling code corresponding to each natural language text, and each natural language text includes keywords used to express modeling requirements;
[0182] The pre-built initial modeling model is trained according to the training data set until the value of the set loss function converges, and the trained model is verified based on the verification data set to obtain a modeling processing model;
[0183] Among them, the initial modeling model is built based on the large language model. The initial modeling model includes a modeling requirement extraction part and a code generation part. The code generation part includes a multi-layer network. The multi-layer network is used to: determine the classes, functions and parameters involved in the modeling code unit corresponding to the modeling requirement based on each modeling requirement, and perform code completion.
[0184] The natural language-based modeling and processing device provided in this embodiment can be used to execute the natural language-based modeling and processing method in any of the aforementioned method embodiments, and its implementation principle and technical effects are similar. The natural language-based modeling and processing device does not require manual writing of modeling codes, but directly generates modeling codes with the help of a modeling processing model, thereby effectively improving modeling efficiency.
[0185] Fig.13 This is a schematic diagram of the structure of the electronic device for modeling and processing based on natural language provided in this application. Fig.13 As shown, the electronic device may specifically include a receiver 1300, a transmitter 1301, a processor 1302, and a memory 1303. The receiver 1300 and the transmitter 1301 are used to implement data transmission between the electronic device and the terminal, the memory 1303 stores computer-executable instructions; the processor 1302 executes the computer-executable instructions stored in the memory 1303 to implement the natural language-based modeling processing method in the above embodiment.
[0186] An embodiment of the present application also provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by a processor, they are used to implement the natural language-based modeling processing method in the above embodiment.
[0187] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the natural language-based modeling processing method provided in any one of the above embodiments.
[0188] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0189] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A modeling processing method based on natural language, characterized in that: include: Receiving a modeling request sent by a terminal, wherein the modeling request includes a modeling requirement text input by a user; Using a preset modeling processing model, extracting at least one modeling requirement from the modeling requirement text, and generating a modeling code based on a preset modeling code library and the at least one modeling requirement; The modeling processing model is a model pre-trained based on a large language model and includes a modeling requirement extraction part and a code generation part, and the modeling code library includes a plurality of modeling code units corresponding to different modeling requirements; Generate a modeling scene according to the modeling code, and return the modeling scene to the terminal; The method of using a preset modeling processing model to extract at least one modeling requirement from the modeling requirement text, and generating a modeling code based on a preset modeling code library and the at least one modeling requirement, includes: Using the modeling requirement extraction part in the modeling processing model to identify and extract the modeling requirement text to obtain the at least one modeling requirement; The code generation part in the modeling processing model is used to obtain the modeling code unit corresponding to each modeling requirement based on the at least one modeling requirement, the modeling code library and the modeling code tree, and the modeling code unit corresponding to each modeling requirement is generated, merged and completed to obtain the modeling code; The modeling code tree is used to represent the connection between each modeling requirement and the modeling code unit, and the modeling code tree includes a plurality of classes for representing the geometric properties, appearance and category of the modeling object, functions under each class and at least one parameter included in each function; The generating, merging and completing the modeling code units corresponding to each modeling requirement to obtain the modeling code includes: Merge the modeling code units corresponding to each modeling requirement to obtain the initial code; Based on a sampling method that obeys a polynomial distribution and a sampling method that obeys a continuous uniform distribution, the initial code is subjected to random modeling code completion of necessary contents to obtain the modeling code; wherein the necessary contents include background and lighting in the modeling scene; Generating a modeling scene according to the modeling code includes: Inputting the modeling code into a three-dimensional modeling simulation platform corresponding to the modeling code library to perform simulation modeling to obtain the modeling scene; The method further comprises: receiving a supplementary modeling request sent by the terminal, wherein the supplementary modeling request includes a supplementary requirement text for the modeling scenario input by the user; Extracting at least one supplementary modeling requirement from the supplementary modeling requirement text according to the modeling processing model, and updating the modeling code based on a preset modeling code library and the at least one supplementary modeling requirement to obtain a new modeling code; Perform simulation modeling according to the new modeling code to obtain a new modeling scenario; The new modeling scene is returned to the terminal.
2. The method according to claim 1, characterized in that The step of extracting at least one supplementary modeling requirement from the supplementary modeling requirement text according to the modeling processing model, and updating the modeling code based on a preset modeling code library and the at least one supplementary modeling requirement to obtain a new modeling code includes: Using the modeling requirement extraction part in the modeling processing model to identify and extract the supplementary modeling requirement text to obtain the at least one supplementary modeling requirement; The code generation part in the modeling processing model is used to obtain the modeling code unit corresponding to each supplementary modeling requirement based on the at least one supplementary modeling requirement, the modeling code library and the modeling code tree, and the modeling code unit corresponding to each supplementary modeling requirement is merged into the modeling code to obtain the new modeling code.
3. The method according to claim 1, characterized in that: The method further comprises: Based on the logical structure in the modeling code library, a data set of modeling object descriptions acquired in advance is calibrated to obtain a training data set and a verification data set; the data set includes a plurality of natural language texts and a modeling code corresponding to each natural language text, and each natural language text includes keywords for expressing modeling requirements; The pre-built initial modeling model is trained according to the training data set until the value of the set loss function converges, and the trained model is verified based on the verification data set to obtain the modeling processing model; Among them, the initial modeling model is constructed based on a large language model, and the initial modeling model includes a modeling requirement extraction part and a code generation part. The code generation part includes a multi-layer network, and the multi-layer network is used to: determine the classes, functions and parameters involved in the modeling code unit corresponding to each modeling requirement based on the modeling requirement, and perform code completion.
4. A modeling processing device based on natural language, characterized in that: include: A receiving module, configured to receive a modeling request sent by a terminal, wherein the modeling request includes a modeling requirement text input by a user; A processing module, configured to extract at least one modeling requirement from the modeling requirement text by using a preset modeling processing model, and generate a modeling code based on a preset modeling code library and the at least one modeling requirement; The modeling processing model is a model pre-trained based on a large language model and includes a modeling requirement extraction part and a code generation part, and the modeling code library includes a plurality of modeling code units corresponding to different modeling requirements; The processing module is further used to input the modeling code into a three-dimensional modeling simulation platform corresponding to the modeling code library to perform simulation modeling, obtain a modeling scene, and return the modeling scene to the terminal; Wherein, the processing module is specifically used for: Using the modeling requirement extraction part in the modeling processing model to identify and extract the modeling requirement text to obtain the at least one modeling requirement; The code generation part in the modeling processing model is used to obtain the modeling code unit corresponding to each modeling requirement based on the at least one modeling requirement, the modeling code library and the modeling code tree, and the modeling code unit corresponding to each modeling requirement is merged to obtain the initial code; the initial code is subjected to the necessary content random modeling code completion based on the sampling method obeying the polynomial distribution and the sampling method obeying the continuous uniform distribution to obtain the modeling code; wherein the necessary content includes the background and lighting in the modeling scene; The modeling code tree is used to represent the connection between each modeling requirement and the modeling code unit, and the modeling code tree includes a plurality of classes for representing the geometric properties, appearance and category of the modeling object, functions under each class and at least one parameter included in each function; The processing module is further used to: receive a supplementary modeling request sent by the terminal, wherein the supplementary modeling request includes a supplementary requirement text for the modeling scenario input by the user; Extracting at least one supplementary modeling requirement from the supplementary modeling requirement text according to the modeling processing model, and updating the modeling code based on a preset modeling code library and the at least one supplementary modeling requirement to obtain a new modeling code; Perform simulation modeling according to the new modeling code to obtain a new modeling scenario; The new modeling scene is returned to the terminal.
5. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the natural language-based modeling processing method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the natural language-based modeling processing method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Provable high-security software construction method and system
CN114995809A
Equipment development method and system based on generative artificial intelligence model
CN116450100A
