Training data generation method, equipment and program product

By identifying target edges from initial geometry and generating spliced ​​geometry and text descriptions, this method addresses the lack of high-quality geometric data in multimodal large models, thereby improving the accuracy of geometric visual understanding and problem-solving in mathematical answering models.

CN120976339APending Publication Date: 2025-11-18IFLYTEK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511027492.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-24
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Existing multimodal large models lack large-scale, high-quality geometric datasets when solving vision-based geometric problems, resulting in low accuracy of mathematical problem-solving models in answering geometric problems.

Method used

By determining the target edge from the edges of the initial geometry, determining the size and rotation parameters based on the target edge, generating the stitched geometry, and combining it with text descriptions to generate training data, the process is iterated until the conditions are met, providing high-quality geometric figures and text descriptions for training mathematical answering models.

Benefits of technology

It enhances the mathematical problem-solving model's visual understanding of geometric figures, improves the accuracy of solving geometric mathematical problems, and provides large-scale, high-quality training data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976339A_ABST
    Figure CN120976339A_ABST
Patent Text Reader

Abstract

The invention provides a training data generation method and device and a program product. The training data generation method comprises the steps that a target edge is determined from all edges of an initial geometric figure; determining a size parameter and a rotation parameter of a next geometric figure based on the target edge; based on the size parameter and the rotation parameter, drawing a next geometric figure by taking the target edge as a coincident edge on the basis of the initial geometric figure, and generating a spliced geometric figure; determining the spliced geometric figure as an initial geometric figure, returning to execute the step of determining the target edge from all the edges of the initial geometric figure, and circularly executing the processing until a preset splicing ending condition is met, so as to obtain all spliced geometric figures; and generating text descriptions corresponding to the spliced geometric figures, and generating training data based on the spliced geometric figures and the text descriptions corresponding to the spliced geometric figures. According to the invention, the accuracy of solving the geometric mathematical problem by the mathematical answer model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to a training data generation method, device and program product. BACKGROUND

[0002] With the development of large language models, there currently exists an application of large language models to solve complex mathematical problems. Although existing mathematical problems mainly focus on text problems, some mathematical problems such as geometric mathematical problems require text and visual understanding of the problem. A multi-modal large model combining a large language model and a visual model to solve mathematical problems requiring simultaneous understanding of text and image information has become a focus of widespread attention.

[0003] Currently, there are some challenges in using a multi-modal large model to solve geometric mathematical problems based on vision, mainly being the lack of large-scale and high-quality geometric figure datasets. Compared with pure text data, the cost of collecting such geometric figure datasets from publicly available sources is high, and a large amount of manual work is required to filter out low-quality data. Therefore, due to the lack of large-scale and high-quality geometric figure datasets, the accuracy of mathematical answer models in solving geometric mathematical problems is currently low. SUMMARY

[0004] The present application provides a training data generation method, device and program product to improve the accuracy of mathematical answer models in solving geometric mathematical problems.

[0005] According to a first aspect of an embodiment of the present application, a training data generation method is provided, comprising:

[0006] determining a target edge from edges of an initial geometric figure;

[0007] determining a size parameter and a rotation parameter of a next geometric figure based on the target edge;

[0008] drawing the next geometric figure based on the initial geometric figure with the target edge as a coinciding edge based on the size parameter and the rotation parameter, to generate a concatenated geometric figure;

[0009] determining the concatenated geometric figure as an initial geometric figure, and returning to perform the step of determining a target edge from edges of an initial geometric figure, and cyclically performing the above processing until a preset concatenation end condition is met, to obtain each concatenated geometric figure;

[0010] generating a text description corresponding to each of the concatenated geometric figures, and generating training data based on each of the concatenated geometric figures and the text description corresponding to each of the concatenated geometric figures; wherein the training data is used to train a mathematical answer model.

[0011] Optionally, the determining the target edge from the edges of the initial geometric figure comprises:

[0012] The edges of the initial geometric figure are removed from the edges of the initial geometric figure to obtain available edges of the initial geometric figure;

[0013] The target edge is selected from the available edges of the initial geometric figure.

[0014] Optionally, the determining the size parameter and the rotation parameter of the next geometric figure based on the target edge comprises:

[0015] The length of the target edge and the angle between the target edge and the horizontal direction are determined based on the end point coordinates of the target edge;

[0016] The size parameter of the next geometric figure is determined based on the length of the target edge;

[0017] The rotation parameter of the next geometric figure is determined based on the angle between the target edge and the horizontal direction and the end point coordinates of the target edge.

[0018] Optionally, the drawing the next geometric figure based on the initial geometric figure with the target edge as the coincident edge and generating the spliced geometric figure based on the size parameter and the rotation parameter comprises:

[0019] The shape of the next geometric figure is determined;

[0020] The vertex coordinates of the next geometric figure are determined based on the shape of the next geometric figure, the size parameter and the rotation parameter;

[0021] The end point coordinates of the auxiliary line of the next geometric figure are determined based on the vertex coordinates of the next geometric figure;

[0022] The next geometric figure is drawn based on the initial geometric figure with the target edge as the coincident edge and the auxiliary line is drawn in the next geometric figure based on the vertex coordinates of the next geometric figure and the end point coordinates of the auxiliary line of the next geometric figure, and the spliced geometric figure is generated.

[0023] Optionally, the determining the end point coordinates of the auxiliary line of the next geometric figure based on the vertex coordinates of the next geometric figure comprises:

[0024] The midpoint coordinates of the edges of the next geometric figure are determined based on the vertex coordinates of the next geometric figure;

[0025] determine a first target point and a second target point from the vertices and the midpoints of the edges of the next geometric figure based on the vertex coordinates, the midpoint coordinates of the edges, and the endpoint coordinates of the edges of the next geometric figure, wherein a line connecting the first target point and the second target point does not coincide with the edges of the next geometric figure;

[0026] determine the coordinates of the first target point and the coordinates of the second target point as the endpoint coordinates of the auxiliary line of the next geometric figure.

[0027] Optionally, the generating of the text description corresponding to each of the spliced geometric figures comprises:

[0028] For any one of the spliced geometric figures, the following operations are performed:

[0029] generating the attribute corresponding to each of the basic geometric figures in the any one of the spliced geometric figures, wherein the any one of the spliced geometric figures is obtained by splicing the basic geometric figures;

[0030] generating the text description corresponding to the any one of the spliced geometric figures based on the target edges of the any one of the spliced geometric figures and the attribute corresponding to each of the basic geometric figures.

[0031] Optionally, the generating of the attribute corresponding to each of the basic geometric figures in the any one of the spliced geometric figures comprises:

[0032] For any one of the basic geometric figures in the any one of the spliced geometric figures, the following operations are performed:

[0033] generating the vertex coordinates of the any one of the basic geometric figures;

[0034] determining the edge length of each of the edges of the any one of the basic geometric figures based on the vertex coordinates of the any one of the basic geometric figures;

[0035] determining the angle of the any one of the basic geometric figures;

[0036] generating the attribute corresponding to the any one of the basic geometric figures based on the shape, the vertex coordinates, the edge length of each of the edges, and the angle of the any one of the basic geometric figures.

[0037] Optionally, the method further comprises:

[0038] annotating the edge length and the angle in the any one of the basic geometric figures.

[0039] According to a second aspect of an embodiment of the present application, an electronic device is provided, comprising a memory and a processor;

[0040] The memory is connected with the processor, and is configured to store programs;

[0041] The processor is configured to realize the training data generation method according to the first aspect by running the programs in the memory.

[0042] According to a third aspect of the embodiments of the present application, a computer program product is provided, which includes computer program instructions, and the computer program instructions enable the processor to execute the training data generation method according to the first aspect when the computer program instructions are run by the processor.

[0043] In the present application, the target edge is determined from each edge of the initial geometric figure, the size parameter and the rotation parameter of the next geometric figure are determined based on the target edge, the next geometric figure is drawn based on the initial geometric figure with the target edge as the coinciding edge based on the size parameter and the rotation parameter, the spliced geometric figure is generated, the spliced geometric figure is determined as the initial geometric figure, and the step of determining the target edge from the initial geometric figure is returned to be executed, and the above processing is executed in a loop until a preset splicing end condition is met, each spliced geometric figure is obtained, the next geometric figure is iteratively spliced using the multi-hop rule, and in the process of splicing the new geometric figure each time, the size parameter and the rotation parameter of the next geometric figure need to rely on the target edge of the initial geometric figure formed by the last splicing, which can ensure that the splicing between the figures conforms to the geometric logic and improves the quality of the spliced geometric figure. Each spliced geometric figure corresponds to a text description, and the training data is generated based on each spliced geometric figure and the text description corresponding to each spliced geometric figure, wherein the training data is used to train the mathematical answering model, the plurality of spliced geometric figures formed in the splicing process can all be used as training data, the number of spliced geometric figures is improved, large-scale and high-quality geometric figures and text descriptions are provided for model training, the visual understanding ability of the mathematical answering model for geometric figures is improved, and the accuracy of the mathematical answering model in solving geometric mathematical problems is further improved. BRIEF DESCRIPTION OF DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are only embodiments of the present application, and those skilled in the art can obtain other drawings according to the provided drawings without creating any creative labor.

[0045] FIG. 1 A flowchart of a training data generation method provided in the embodiments of the present application;

[0046] FIG. 2A flowchart of step 101 provided in an embodiment of the present application is shown in FIG. 1A.

[0047] FIG. 3 A flowchart of step 102 provided in an embodiment of the present application is shown in FIG. 2A.

[0048] FIG. 4 A flowchart of step 103 provided in an embodiment of the present application is shown in FIG. 3A.

[0049] FIG. 5 A flowchart of step 403 provided in an embodiment of the present application is shown in FIG. 4A.

[0050] FIG. 6 A flowchart of generating a text description provided in an embodiment of the present application is shown in FIG. 5A.

[0051] FIG. 7 A flowchart of step 601 provided in an embodiment of the present application is shown in FIG. 6A.

[0052] FIG. 8 A structural diagram of a training data generation apparatus provided in an embodiment of the present application is shown in FIG. 7A.

[0053] FIG. 9 A structural diagram of an electronic device provided in an embodiment of the present application is shown in FIG. 8A. DETAILED DESCRIPTION

[0054] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0055] Example Implementation Environment

[0056] The training data generation method according to the embodiments of the present application can be executed by an electronic device such as a terminal device or a server. The terminal device can be a user equipment, a mobile device, a computing device, a wearable device, etc. The server can be a physical server, a server cluster composed of multiple physical servers, or a cloud server capable of cloud computing. The method can be realized by a processor calling computer readable program instructions stored in a memory.

[0057] Example Method

[0058] Please refer to FIG. 1 In an exemplary embodiment, a training data generation method is provided. As shown in FIG. 1B, the method includes the following steps. FIG. 1As shown, the flow of the training data generation method mainly includes:

[0059] Step 101, determining a target edge from each edge of an initial geometric figure.

[0060] In some embodiments, before step 101, the training data generation method further includes: determining a shape of the initial geometric figure; determining a size parameter of the initial geometric figure; determining each vertex coordinate of the initial geometric figure based on the shape of the initial geometric figure and the size parameter; and drawing the initial geometric figure based on each vertex coordinate of the initial geometric figure.

[0061] In an exemplary embodiment, a set of basic geometric shapes can be defined first, and then a basic geometric shape is randomly selected from the set of basic geometric shapes, and the selected basic geometric shape is determined as the shape of the initial geometric figure.

[0062] In an exemplary embodiment, the set of basic geometric shapes can include, but is not limited to, each basic geometric shape listed as follows:

[0063] (1) Square: side length L, starting point coordinate (x, y), four vertex coordinates [(x, y), (x+L, y), (x+L, y+L), (x, y+L)].

[0064] (2) Rectangle: length L, width W, starting point coordinate (x, y), four vertex coordinates [(x, y), (x+L, y), (x+L, y+W), (x, y+W)].

[0065] (3) Isosceles triangle: base length L, height H, starting point coordinate (x, y), three vertex coordinates [(x, y), (x+L, y), (x+L / 2, y+H)].

[0066] (4) Right triangle: base length L, height H, starting point coordinate (x, y), three vertex coordinates [(x, y), (x+L, y), (x, y+H)].

[0067] (5) General triangle: base length L, height H, starting point coordinate (x, y), three vertex coordinates [(x, y), (x+L, y), (x+l, y+H)], l∈[0, L].

[0068] (6) Parallelogram: base length L, height H, internal angle α, starting point coordinate (x, y), four vertex coordinates [(x, y), (x+L, y), (x+L+H / tanα, y+H), (x+H / tanα, y+H)].

[0069] (7) Fan: radius r, start angle θ1, end angle θ2, center coordinate (x, y), three vertex coordinates [(x, y), (x + rcosθ1, y + rsinθ1), (x + rcosθ2, y + rsinθ2)].

[0070] In an example embodiment, determining the size parameter of the initial geometric figure can include randomly selecting the size parameter of the initial geometric figure. The size parameter can include at least one of length, width, height, angle, and the size parameter can also include other parameters related to the shape of the initial geometric figure.

[0071] In an example embodiment, drawing the initial geometric figure based on the vertex coordinates of the initial geometric figure can include directly drawing the initial geometric figure based on the vertex coordinates of the initial geometric figure without drawing auxiliary lines in the initial geometric figure. It can also include determining the end point coordinates of the auxiliary lines of the initial geometric figure based on the vertex coordinates of the initial geometric figure, and drawing the initial geometric figure based on the vertex coordinates of the initial geometric figure and the end point coordinates of the auxiliary lines of the initial geometric figure, and drawing the auxiliary lines in the initial geometric figure. The implementation process of determining the end point coordinates of the auxiliary lines of the initial geometric figure based on the vertex coordinates of the initial geometric figure and the implementation process of FIG. 5 are similar, and details are described in FIG. 5 , which will not be described here.

[0072] In some embodiments, as shown in FIG. 2 , step 101 includes:

[0073] Step 201 removes the coincident edges of the historical splicing from each edge of the initial geometric figure to obtain each available edge of the initial geometric figure.

[0074] In an example embodiment, as shown in FIG. 1 , the training data generation method provided by the embodiments of the present application is a cyclic process, so the initial geometric figure includes the first initial geometric figure and the initial geometric figure determined based on the spliced geometric figure in the subsequent cyclic process. The first initial geometric figure is not a spliced geometric figure, so there is no coincident edge of the historical splicing in each edge of the first initial geometric figure, and each edge of the first initial geometric figure is an available edge of the initial geometric figure. The initial geometric figure determined based on the spliced geometric figure in the subsequent cyclic process has the coincident edge of the historical splicing, so the coincident edge of the historical splicing needs to be removed to obtain each available edge of the initial geometric figure, so that the target edge selected from each available edge of the initial geometric figure in the next splicing cannot be the coincident edge of the historical splicing, which can avoid selecting the repeated target edge in multiple splicing, and ensure the diversity of the spliced geometric figure.

[0075] In the example embodiment, the initial geometric figure 1 is drawn, the initial geometric figure 1 is stored in the shape set shape, the shape set shape stores each basic geometric figure used for splicing, each edge of the initial geometric figure 1 is stored in the available edge set available_side, the available edge set available_side stores each available edge, an edge side1 is randomly selected from the available edge set available_side as a target edge 1, the edge side1 is stored in the selected edge set chosed_side, and the edge side1 is deleted from the available edge set available_side, the selected edge set chosed_side stores the coincident edges of each splicing history, the next geometric figure 1 is drawn with the target edge 1 as the coincident edge of the initial geometric figure 1 and the next geometric figure 1, and the initial geometric figure 1 and the next geometric figure 1 are spliced to obtain the spliced geometric figure 1.

[0076] The next geometric figure 1 is stored in the shape set shape, the spliced geometric figure 1 is determined as the initial geometric figure 2, each edge of the newly added geometric figure (i.e. the next geometric figure 1) in the shape set shape is traversed, if the edge of the next geometric figure 1 is not in the selected edge set chosed_side, the edge is stored in the available edge set available_side. The available edge set available_side stores each edge of the initial geometric figure 1 and the next geometric figure 1 after removing the edge side1, i.e. the available edge set available_side stores each edge of the initial geometric figure 2 after removing the edge side1. An edge side2 is randomly selected from the available edge set available_side as a target edge 2, the edge side2 is stored in the selected edge set chosed_side, and the edge side2 is deleted from the available edge set available_side, the next geometric figure 2 is drawn with the target edge 2 as the coincident edge of the initial geometric figure 2 and the next geometric figure 2, and the initial geometric figure 2 and the next geometric figure 2 are spliced to obtain the spliced geometric figure 2. Since the available edge set available_side stores each edge of the initial geometric figure 2 after removing the edge side1, the edge side2 is randomly selected from the available edge set available_side as the target edge 2, the edge side2 cannot be the edge side1, and the two splicings will not select the repeated target edge, each splicing will select a different edge of the existing shape for splicing, “jump” to a new spatial position, and ensure the diversity of the spliced geometric figure. The subsequent splicing process is similar and will not be repeated here.

[0077] Step 202, selecting a target edge from the available edges of the initial geometric figure.

[0078] The coincident edges of the historical splicing times are removed from the edges of the initial geometric figure to obtain the available edges of the initial geometric figure, the target edge is selected from the available edges of the initial geometric figure, the target edge selected from the available edges of the initial geometric figure in the next splicing time cannot be the coincident edge of the historical splicing times, the repeated target edge in the multiple splicing times can be avoided, the diversity of the spliced geometric figures is ensured, and then the training data is generated based on the spliced geometric figures and the text descriptions corresponding to the spliced geometric figures, the diversity of the training data is improved, diversified geometric figures and text descriptions are provided for the training of the mathematical answer model, the mathematical answer model is facilitated to fully learn various geometric figures, the visual understanding ability of the mathematical answer model for diversified geometric figures is improved, and then the accuracy of the mathematical answer model in solving diversified geometric mathematical problems is improved.

[0079] In some other embodiments, step 101 includes directly selecting a target edge from the edges of the initial geometric figure.

[0080] Step 102, determining the size parameter and the rotation parameter of the next geometric figure based on the target edge.

[0081] In some embodiments, as shown in FIG. 3 Step 102 includes:

[0082] Step 301, determining the length of the target edge and the angle between the target edge and the horizontal direction based on the end point coordinates of the target edge.

[0083] For example, the end point coordinates of the target edge side1 are (x1, y1) and (x2, y2), the angle θ between side1 and the horizontal direction and the length ρ of side1 are calculated, and the calculation formula is as follows:

[0084]

[0085] Step 302, determining the size parameter of the next geometric figure based on the length of the target edge.

[0086] For example, if the next geometric figure is a square, the length of the target edge can be determined as the side length of the square; if the next geometric figure is a sector, the length of the target edge can be determined as the radius of the sector.

[0087] Step 303, determining the rotation parameter of the next geometric figure based on the angle between the target edge and the horizontal direction and the end point coordinates of the target edge.

[0088] In the example embodiment, the rotation parameter can include a rotation center coordinate and a rotation angle. For example, (x2, y2) can be taken as the rotation center coordinate of the next geometric figure, and θ can be taken as the rotation angle of the next geometric figure, so that the coinciding edge of the rotated next geometric figure and the initial geometric figure is the target edge.

[0089] Based on the length of the target edge, the size parameter of the next geometric figure is determined, and based on the included angle of the target edge with the horizontal direction and the endpoint coordinates of the target edge, the rotation parameter of the next geometric figure is determined. In the process of splicing the next geometric figure each time, the size parameter and the rotation parameter of the next geometric figure need to rely on the target edge of the initial geometric figure formed by the last splicing, which can ensure that there is a coinciding edge when the initial geometric figure and the next geometric figure are spliced, and the coinciding edge is the target edge, ensuring that the splicing between the figures conforms to the geometric logic, improving the quality of the spliced geometric figure, and making the spliced geometric figure closer to the geometric figure in the real geometric mathematical problem, providing high-quality geometric figures and text descriptions for the training of the mathematical answer model, and improving the accuracy of the mathematical answer model in solving geometric mathematical problems.

[0090] In other embodiments, step 102 includes: determining the length of the target edge and the included angle of the target edge with the vertical direction based on the endpoint coordinates of the target edge; determining the size parameter of the next geometric figure based on the length of the target edge; and determining the rotation parameter of the next geometric figure based on the included angle of the target edge with the vertical direction and the endpoint coordinates of the target edge.

[0091] Step 103, based on the size parameter and the rotation parameter, drawing the next geometric figure on the basis of the initial geometric figure with the target edge as the coinciding edge to generate the spliced geometric figure.

[0092] In some embodiments, step 103 includes: determining the shape of the next geometric figure; determining the coordinates of each vertex of the next geometric figure based on the shape, the size parameter, and the rotation parameter of the next geometric figure; and based on the coordinates of each vertex of the next geometric figure, drawing the next geometric figure on the basis of the initial geometric figure with the target edge as the coinciding edge to generate the spliced geometric figure.

[0093] In other embodiments, as shown in FIG. 4 step 103 includes:

[0094] Step 401, determining the shape of the next geometric figure.

[0095] In the example embodiment, step 401 can include: randomly selecting a basic geometric shape from the set of basic geometric shapes, and determining the selected basic geometric shape as the shape of the next geometric figure.

[0096] At step 402, coordinates of each vertex of the next geometric figure are determined based on a shape, a size parameter, and a rotation parameter of the next geometric figure.

[0097] In an example embodiment, a rotation attribute of the figure can be defined in advance, and rotation of a vertex of a planar geometry on a two-dimensional plane around a center point can be converted into a mathematical formula, which is as follows:

[0098] qx = ox + cos(θ)(x - ox) - sin(θ)(y - oy)

[0099] qy = oy + sin(θ)(x - ox) - cos(θ)(y - oy)

[0100] where (x, y) is a coordinate of a point to be rotated, (ox, oy) is a coordinate of a rotation center, θ is a rotation angle of counterclockwise rotation, and a coordinate of the rotated point is (qx, qy). Defining the rotation attribute of the figure in advance can enrich the diversity of the figure, and on the other hand, when multiple figures are spliced, the next geometric figure needs to be rotated according to the situation to be spliced with the initial geometric figure.

[0101] At step 403, end point coordinates of an auxiliary line of the next geometric figure are determined based on the coordinates of each vertex of the next geometric figure.

[0102] In an example embodiment, the auxiliary line can include, but is not limited to, at least one of a center line and a perpendicular line, and other types of auxiliary lines can also be included according to needs.

[0103] In some embodiments, as shown in FIG. 4B, step 403 includes: FIG. 5

[0104] At step 501, midpoint coordinates of each edge of the next geometric figure are determined based on the coordinates of each vertex of the next geometric figure.

[0105] At step 502, a first target point and a second target point are determined from each vertex and each midpoint of an edge of the next geometric figure based on the coordinates of each vertex, the midpoint coordinates of each edge, and the end point coordinates of each edge of the next geometric figure.

[0106] The line connecting the first target point and the second target point does not coincide with each edge of the next geometric figure.

[0107] In an example embodiment, the coordinates of each vertex and the midpoint coordinates of each edge of the next geometric figure are stored in a set of all points, and the set of all points ψ = {(x1, y1),..., (xn, yn)}. n n ​​Based on the endpoint coordinates of each edge, generate a set Ω = {((x1,y1),(x2,y2)),..., ...x2,y2)}; Based on the endpoint coordinates of each edge, generate a set Ω = {((x1,y1),(x2,y2)),...,(x2,y2)}; m ,y m ),(x n ,y n From the set of all points ψ, randomly select two points p1 = (z1, y1) and p2 = (x2, y2), and any side ((x1, y1) from the set of all sides Ω. m ,y m ),(x n ,y n The following comparisons are made:

[0108] If x2―x1≠0 and x m ―x n ≠0, indicating that the slope of the line connecting points p1 and p2 can be calculated, and the slope of the side ((x) is 0. m ,y m ),(x n ,y n It can also calculate the slope, the slope of the line connecting points p1 and p2. edge((x) m ,y m ),(x n ,y n The slope of )) If |slope1―slope2| is less than a preset value (e.g., 10), ―4 ), can be considered as the line connecting points p1 and p2 and the edge ((x m ,y m ),(x n ,y n If the slopes coincide or are parallel, points p1 and p2 cannot be determined as the first and second target points. If |slope1―slope2| is greater than or equal to a preset value (e.g., 10), then... ―4 ), can be considered as the line connecting points p1 and p2 and the edge ((x m ,y m ),(x n ,y n Since they are neither overlapping nor parallel, points p1 and p2 can be identified as the first target point and the second target point.

[0109] If x2-x1=0 and x m ―x n =0 indicates that the line connecting points p1 and p2 and the edge ((x) = ... m ,y m ),(x n ,y nBoth are perpendicular to the x-axis, so the slope cannot be calculated. Furthermore, the line connecting points p1 and p2 and the side ((x...)... m ,y m ),(x n ,y n If the lines coincide or are parallel, points p1 and p2 cannot be determined as the first and second target points. Since lines coinciding with the original edges of the figure do not need to be redrawn, and lines parallel to the original edges are generally useless in mathematical problem-solving, they are also discarded in this exemplary embodiment. In practice, it is also possible to only ensure that the lines connecting the first and second target points do not coincide with the edges of the next geometric figure, while retaining the lines connecting the first and second target points that are parallel to the edges of the next geometric figure; this application does not impose any limitations on this.

[0110] Step 503: Determine the coordinates of the first target point and the second target point as the endpoint coordinates of the auxiliary line of the next geometric figure.

[0111] Based on the coordinates of each vertex, the midpoint of each edge, and the endpoints of each edge of the next geometric figure, a first target point and a second target point are determined from the vertices and midpoints of the edges of the next geometric figure. The line connecting the first and second target points does not coincide with any edge of the next geometric figure. The coordinates of the first and second target points are used as the endpoint coordinates of the auxiliary lines of the next geometric figure. This allows for the drawing of auxiliary lines that do not coincide with the original edges of the figure, based on the vertices and midpoints of the edges. The mathematical problem-solving model is then trained on the assembled geometric figure with these auxiliary lines. This reduces the number of useless auxiliary lines, lowers the computational load during training, and improves the training efficiency. Furthermore, since most real-world geometric problems require auxiliary lines in their solutions, drawing necessary auxiliary lines in the assembled geometric figure helps improve the mathematical problem-solving model's understanding of real-world geometric problems and increases its accuracy in solving such problems.

[0112] In other embodiments, step 403 includes: determining the endpoint coordinates of the vertical lines of the next geometry based on the vertex coordinates of the next geometry.

[0113] Step 404: Based on the coordinates of each vertex of the next geometric figure and the endpoint coordinates of the auxiliary lines of the next geometric figure, draw the next geometric figure with the target edge as the overlapping edge on the basis of the initial geometric figure, and draw auxiliary lines in the next geometric figure to generate the spliced ​​geometric figure.

[0114] The auxiliary line is the basis of many geometric theorems. In the initial geometric figure, the next geometric figure is drawn with the target side as the coincident side, and the auxiliary line is drawn in the next geometric figure to generate the spliced geometric figure, so that the spliced geometric figure is more consistent with the real mathematical problem. Most real geometric mathematical problems need to draw auxiliary lines in the actual solving process. Training the mathematical answering model based on the spliced geometric figure with auxiliary lines is beneficial to improving the understanding ability of the mathematical answering model for real geometric mathematical problems and improving the accuracy of the mathematical answering model in solving geometric mathematical problems.

[0115] In step 104, it is judged whether the preset splicing end condition is met. If yes, step 105 is executed, otherwise, step 106 is executed.

[0116] In an exemplary embodiment, the preset splicing end condition can include that the number of spliced geometric figures is greater than or equal to a number threshold, for example, the number threshold is 4, the basic geometric figure 1 and the basic geometric figure 2 are spliced to obtain the spliced geometric figure 1, the spliced geometric figure 1 and the basic geometric figure 3 are spliced to obtain the spliced geometric figure 2, the spliced geometric figure 2 and the basic geometric figure 4 are spliced to obtain the spliced geometric figure 3, and the number of spliced basic geometric figures is equal to the number threshold 4, which meets the preset splicing end condition. The preset splicing end condition can also be other conditions, which are not limited by the present application.

[0117] In step 105, the text description corresponding to each spliced geometric figure is generated, and the training data is generated based on each spliced geometric figure and the text description corresponding to each spliced geometric figure.

[0118] The training data is used to train the mathematical answering model.

[0119] In some embodiments, in step 105, the text description corresponding to each spliced geometric figure is generated by inputting each spliced geometric figure into a large model to obtain the text description corresponding to each spliced geometric figure.

[0120] In another embodiment, as shown in FIG. 6 In step 105, the text description corresponding to each spliced geometric figure is generated by:

[0121] For any one spliced geometric figure, the following operations are performed:

[0122] In step 601, the attribute corresponding to each basic geometric figure in any one spliced geometric figure is generated.

[0123] The any one spliced geometric figure is obtained by splicing each basic geometric figure.

[0124] In some embodiments, as shown in FIG. 6, step 601 comprises: FIG. 7

[0125] For any one basic geometric figure in any one spliced geometric figure, the following operations are performed:

[0126] Step 701, generating the coordinates of each vertex of any one basic geometric figure.

[0127] In exemplary embodiments, a repetition check can be performed on the coordinates of each vertex of any one basic geometric figure to ensure the uniqueness of the vertex coordinates. And an English letter is assigned to each vertex as a label.

[0128] Step 702, determining the length of each edge of any one basic geometric figure based on the coordinates of each vertex of any one basic geometric figure.

[0129] Step 703, determining the angle of any one basic geometric figure.

[0130] For example, the angle θ' of a sector is θ2- θ1. For the angle of a general triangle, the calculation is as follows:

[0131]

[0132] Where (x1, y1) and (x3, y3) are the coordinates of the first vertex and the third vertex of the general triangle respectively. The general triangle has a base length L, a height H, a first vertex coordinate (x, y), a second vertex coordinate (x+L, y), and a third vertex coordinate (x+l, y+H), where l ∈ [0, L].

[0133] Step 704, generating the attribute corresponding to any one basic geometric figure based on the shape, the coordinates of each vertex, the length of each edge, and the angle of any one basic geometric figure.

[0134] In exemplary embodiments, the attribute corresponding to any one basic geometric figure is as follows: "The nth figure is {} shape, with {} vertices, the edge length {} = {} units, and the angle {} = {} degrees." If auxiliary lines such as midlines are also drawn in any one basic geometric figure, the attribute corresponding to any one basic geometric figure can also be as follows: "The nth figure is {} shape, with {} vertices, the edge length {} = {} units, and the angle {} = {} degrees. The point {} is the midpoint of the edge {}, connecting {} and {}." Where connecting {} and {} means connecting the first target point and the second target point to obtain the auxiliary line.

[0135] ​Based on the shape, the coordinates of each vertex, the length of each edge, and the angle of any one basic geometric figure, the attributes corresponding to any one basic geometric figure are generated. The attributes corresponding to the basic geometric figure are more comprehensive. Compared with the description of the figure generated by the large model, the accuracy of the attributes corresponding to the basic geometric figure obtained by the embodiments of the present application is higher, and the quality of the text description is higher. The accuracy of the text description is improved, high-quality geometric figures and text descriptions are provided for the training of the mathematical answering model, and the visual understanding ability of the mathematical answering model for geometric figures is improved.

[0136] In some embodiments, the training data generation method further comprises: labeling the length of each edge and the angle in any one basic geometric figure. For example, the English letters corresponding to each vertex can be labeled in any one basic geometric figure, the length of each edge can be labeled at the midpoint coordinate position of each edge, and the angle of any one basic geometric figure can be labeled at the starting coordinate position of any one basic geometric figure. Labeling the figure can increase the information in the figure. Training the mathematical answering model based on the spliced geometric figure after labeling the figure is beneficial to the mathematical answering model to fully understand various parameters of the spliced geometric figure during the training process, and improves the visual understanding ability of the mathematical answering model for geometric figures.

[0137] In other embodiments, step 601 comprises: inputting each basic geometric figure in any one spliced geometric figure into a large model to obtain the respective attributes corresponding to each basic geometric figure in any one spliced geometric figure.

[0138] Step 602, based on each target edge of any one spliced geometric figure and the respective attributes corresponding to each basic geometric figure, generating a text description corresponding to any one spliced geometric figure.

[0139] For example, the text description corresponding to the spliced geometric figure obtained by splicing 2 basic geometric figures is as follows: "the first figure is {} shape, the vertices have {}, the edge length {} = {} units, the angle {} = {} degrees, the point {} is the midpoint of the edge {}, and is connected with {}; take {} as the edge to construct the second figure; the second figure is {} shape, the vertices have {}, the edge length {} = {} units, the angle {} = {} degrees, the point {} is the midpoint of the edge {}, and is connected with {}". Among them, "the first figure is {} shape, the vertices have {}, the edge length {} = {} units, the angle {} = {} degrees, the point {} is the midpoint of the edge {}, and is connected with {}" is the attribute corresponding to the basic geometric figure 1, "the second figure is {} shape, the vertices have {}, the edge length {} = {} units, the angle {} = {} degrees, the point {} is the midpoint of the edge {}, and is connected with {}" is the attribute corresponding to the basic geometric figure 2, and "take {} as the edge to construct the second figure" is the target edge of the splicing of the basic geometric figure 1 and the basic geometric figure 2.

[0140] The text description corresponding to any one spliced geometry includes the properties of each basic geometry and the splicing edge of adjacent basic geometries, has high quality, and corresponds to the spliced geometry one-to-one, improves the accuracy of the text description, provides high-quality geometry and text description for the training of the mathematical answering model, and improves the visual understanding ability of the mathematical answering model for the geometry.

[0141] In step 106, the spliced geometry is determined as the initial geometry, and step 101 is returned to be executed.

[0142] In some embodiments, the training data includes each spliced geometry and a text description corresponding to each spliced geometry. Each spliced geometry For the i-th spliced geometry, N is the total number of spliced geometries; the text description corresponding to each spliced geometry is the text description corresponding to the i-th spliced geometry. The process of training the mathematical answering model based on the training data is as follows:

[0143] First, define the visual tokenization function φ v : The spliced geometry is encoded into a visual token (basic unit of text processing) sequence with a length of L v :

[0144]

[0145] Define the text tokenization function φ t : The text description corresponding to the spliced geometry is encoded into a text token sequence with a length of L t :

[0146]

[0147] The multi-modal input sequence is constructed as follows:

[0148]

[0149] where Prompt is a self-defined prompt sentence, guiding the mathematical answering model to generate a corresponding description based on the visual token sequence; EOS is an end symbol;

[0150] In the pre-training process, the Next-Token prediction mechanism can be used for training. The Next-Token prediction mechanism is to predict the next most likely element by analyzing a given text or data sequence. Let the parameters of the mathematical answer model be θ", and the prediction target at time step k be:

[0151]

[0152] After training convergence, the final model T is obtained in The subsequent fine-tuning training can be performed based on T in .

[0153] In summary, in this application, the target edge is determined from the edges of the initial geometric figure, the size parameter and the rotation parameter of the next geometric figure are determined based on the target edge, the next geometric figure is drawn based on the size parameter and the rotation parameter and the target edge as the coincident edge on the basis of the initial geometric figure, the spliced geometric figure is generated, the spliced geometric figure is determined as the initial geometric figure, and the step of determining the target edge from the edges of the initial geometric figure is returned for execution. The above processing is executed in a loop until the preset splicing end condition is met, and each spliced geometric figure is obtained. The multi-hop rule is used to iteratively splice the next geometric figure. In the process of splicing the new geometric figure each time, the size parameter and the rotation parameter of the next geometric figure need to rely on the target edge of the initial geometric figure formed by the last splicing, which can ensure that the splicing between the figures conforms to the geometric logic and improves the quality of the spliced geometric figure. The text description corresponding to each spliced geometric figure is generated, and the training data is generated based on each spliced geometric figure and the text description corresponding to each spliced geometric figure. The training data is used to train the mathematical answer model, and the plurality of spliced geometric figures formed in the splicing process can be used as the training data. The number of spliced geometric figures is increased, large-scale and high-quality geometric figures and text descriptions are provided for model training, the visual understanding ability of the mathematical answer model for geometric figures is improved, and the accuracy of the mathematical answer model for solving geometric mathematical problems is improved.

[0154] Example Device

[0155] Correspondingly, the application also provides a training data generation device, as shown in FIG. 8 , the training data generation device comprises:

[0156] The first processing unit 801 is configured to determine the target edge from the edges of the initial geometric figure.

[0157] The second processing unit 802 is configured to determine the size parameter and the rotation parameter of the next geometric figure based on the target edge.

[0158] The splicing unit 803 is configured to draw the next geometric figure based on the initial geometric figure with the target side as the coincident side according to the size parameter and the rotation parameter, and generate a spliced geometric figure.

[0159] The loop processing unit 804 is configured to determine the spliced geometric figure as the initial geometric figure, and return to execute the step of determining the target side from the edges of the initial geometric figure, and perform the above processing in a loop until a preset splicing end condition is met, to obtain each spliced geometric figure.

[0160] The generating unit 805 is configured to generate a text description corresponding to each of the spliced geometric figures, and generate training data based on each of the spliced geometric figures and the text description corresponding to each of the spliced geometric figures. The training data is used to train a mathematical answer model.

[0161] Optionally, the first processing unit 801 is specifically configured to:

[0162] remove the coincident sides of the historical splicing from the edges of the initial geometric figure to obtain available edges of the initial geometric figure;

[0163] select the target side from the available edges of the initial geometric figure.

[0164] Optionally, the second processing unit 802 is specifically configured to:

[0165] determine the length of the target side and the angle between the target side and the horizontal direction based on the end point coordinates of the target side;

[0166] determine the size parameter of the next geometric figure based on the length of the target side;

[0167] determine the rotation parameter of the next geometric figure based on the angle between the target side and the horizontal direction and the end point coordinates of the target side.

[0168] Optionally, the splicing unit 803 comprises:

[0169] The first processing subunit is configured to determine the shape of the next geometric figure.

[0170] The second processing subunit is configured to determine the vertex coordinates of the next geometric figure based on the shape of the next geometric figure, the size parameter, and the rotation parameter.

[0171] The third processing subunit is configured to determine the end point coordinates of the auxiliary line of the next geometric figure based on the vertex coordinates of the next geometric figure.

[0172] The drawing sub-unit is configured to draw the next geometric figure based on the initial geometric figure with the target side as the coinciding side and draw the auxiliary line in the next geometric figure based on the coordinates of each vertex of the next geometric figure and the coordinates of the end points of the auxiliary line, to generate a spliced geometric figure.

[0173] Optionally, the third processing sub-unit is specifically configured to:

[0174] determine the coordinates of the midpoints of each side of the next geometric figure based on the coordinates of each vertex of the next geometric figure;

[0175] determine the first target point and the second target point from the coordinates of each vertex and the coordinates of the midpoints of each side of the next geometric figure based on the coordinates of each vertex, the coordinates of the midpoints of each side, and the coordinates of the end points of each side of the next geometric figure, wherein the line connecting the first target point and the second target point does not coincide with each side of the next geometric figure;

[0176] determine the coordinates of the first target point and the coordinates of the second target point as the coordinates of the end points of the auxiliary line of the next geometric figure.

[0177] Optionally, the generating unit 805 is specifically configured to:

[0178] perform the following operations for any one spliced geometric figure:

[0179] generate the respective attributes of each basic geometric figure in the any one spliced geometric figure, wherein the any one spliced geometric figure is obtained by splicing each basic geometric figure;

[0180] generate the text description corresponding to the any one spliced geometric figure based on each target side of the any one spliced geometric figure and the respective attributes of each basic geometric figure.

[0181] Optionally, the generating unit 805 is specifically configured to:

[0182] perform the following operations for any one basic geometric figure in the any one spliced geometric figure:

[0183] generate the coordinates of each vertex of the any one basic geometric figure;

[0184] determine the length of each side of the any one basic geometric figure based on the coordinates of each vertex of the any one basic geometric figure;

[0185] determine the angle of the any one basic geometric figure;

[0186] generate the attribute corresponding to the arbitrary one basic geometric figure based on the shape, the coordinates of each vertex, the length of each edge, and the angle of the arbitrary one basic geometric figure.

[0187] Optionally, the training data generation apparatus further comprises:

[0188] The labeling unit is configured to label the length of each edge and the angle in the arbitrary one basic geometric figure.

[0189] The training data generation apparatus provided by the embodiment is of the same application concept as the training data generation method provided by the above-mentioned embodiments of the present application, can execute the training data generation method provided by any of the above-mentioned embodiments of the present application, and has the corresponding function modules and beneficial effects of executing the training data generation method. Technical details not described in detail in the embodiment can be found in the specific processing content of the training data generation method provided by the above-mentioned embodiments of the present application, which will not be described here again.

[0190] The functions implemented by the first processing unit 801, the second processing unit 802, the splicing unit 803, the loop processing unit 804, and the generation unit 805 described above can be implemented by the same or different processors, and the embodiments of the present application are not limited in this regard.

[0191] It should be understood that the units in the above apparatus can be implemented in the form of processor calling software. For example, the apparatus includes a processor connected with a memory, the memory stores instructions, and the processor calls the instructions stored in the memory to implement any of the above methods or to implement the functions of the units of the apparatus, wherein the processor can be a general processor such as a CPU or a microprocessor, and the memory can be an internal memory of the apparatus or an external memory of the apparatus. Alternatively, the units in the apparatus can be implemented in the form of hardware circuit. The functions of some or all of the units can be implemented by designing the hardware circuit. The hardware circuit can be understood as one or more processors. For example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the units are implemented by designing the logical relationship of elements in the circuit. For another example, in another implementation, the hardware circuit can be implemented by a PLD. Taking an FPGA as an example, it can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by a configuration file, so as to implement the functions of some or all of the units. All the units of the above apparatus can be implemented in the form of processor calling software, or all the units can be implemented in the form of hardware circuit, or part of the units can be implemented in the form of processor calling software, and the remaining part can be implemented in the form of hardware circuit.

[0192] In the embodiments of the present application, the processor is a circuit with signal processing capability. In one implementation, the processor can be a circuit with instruction reading and running capability, such as a CPU, a microprocessor, a GPU, or a DSP, etc. In another implementation, the processor can implement certain functions through a logic relationship of a hardware circuit, which is fixed or can be reconfigured. For example, the processor is a hardware circuit implemented by an ASIC or a PLD, such as an FPGA, etc. In the reconfigurable hardware circuit, the processor loads a configuration document to implement the hardware circuit configuration. It can be understood that the processor loads instructions to implement the functions of the above units.

[0193] It can be seen that each unit in the above apparatus can be one or more processors (or processing circuits) configured to implement the above methods, such as a CPU, a GPU, an NPU, a TPU, a DPU, a microprocessor, a DSP, an ASIC, an FPGA, or a combination of at least two of these processor forms.

[0194] In addition, each unit in the above apparatus can be integrated together or can be independently implemented. In one implementation, the units are integrated together to implement a SOC. The SOC can include at least one processor for implementing any of the above methods or the functions of the units of the apparatus. The at least one processor can be different, such as including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.

[0195] Example Electronic Device

[0196] An embodiment of the present application provides an electronic device, as shown in the figure, the device includes: FIG. 9

[0197] a memory 200 and a processor 210;

[0198] The memory 200 is connected with the processor 210, and is used for storing programs.

[0199] The processor 210 is used for implementing the training data generation method disclosed in any of the above embodiments by running the programs stored in the memory 200.

[0200] Specifically, the above electronic device can further include a bus, a communication interface 220, an input device 230, and an output device 240.

[0201] ​The processor 210, the memory 200, the communication interface 220, the input device 230 and the output device 240 are connected to each other through a bus. Among them:

[0202] The bus can include a path for transmitting information between various components of the computer system.

[0203] The processor 210 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of programs of the present application. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a ready-to-use programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0204] The processor 210 can include a main processor, and can also include a baseband chip, a modem, etc.

[0205] The memory 200 stores programs for executing the technical solutions of the present application, and can also store operating systems and other key services. Specifically, the program can include program code, and the program code includes computer operation instructions. More specifically, the memory 200 can include read-only memory (ROM), other types of static storage devices that can store static information and instructions, random access memory (RAM), other types of dynamic storage devices that can store information and instructions, disk storage, flash, etc.

[0206] The input device 230 can include a device that receives data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer or a gravity sensor, etc.

[0207] The output device 240 can include a device that allows information to be output to a user, such as a display screen, a printer, a speaker, etc.

[0208] The communication interface 220 can include a device using any transceiver to communicate with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.

[0209] The processor 210 executes the program stored in the memory 200, and calls other devices, which can be used to implement each step of any one of the training data generation methods provided by the embodiments of the present application.

[0210] Example Computer Program Product and Storage Medium

[0211] In addition to the method and device described above, the embodiments of the present application can also be a computer program product, which includes computer program instructions that, when executed by a processor, cause the processor to perform the steps in the training data generation method according to various embodiments of the present application described in any of the embodiments of the present specification.

[0212] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of the present application, including object-oriented programming languages such as Java, C++, and conventional procedural programming languages such as "C" language or similar programming languages. The program code can be executed entirely on a user computing device, partially on a user device, as an independent software package, partially on a user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0213] In addition, the embodiments of the present application can also be a storage medium having a computer program stored thereon, which is executed by a processor to perform the steps in the training data generation method according to various embodiments of the present application described in any of the embodiments of the present specification. The specific steps can include the following steps:

[0214] Step 101, determining a target edge from each edge of an initial geometric figure.

[0215] Step 102, determining a size parameter and a rotation parameter of a next geometric figure based on the target edge.

[0216] Step 103, based on the size parameter and the rotation parameter, drawing a next geometric figure with the target edge as the coinciding edge based on the initial geometric figure to generate a spliced geometric figure.

[0217] Step 104, determining whether a preset splicing end condition is met, if yes, executing step 105, otherwise, executing step 106.

[0218] Step 105, generating a text description corresponding to each spliced geometric figure, and generating training data based on each spliced geometric figure and the text description corresponding to each spliced geometric figure.

[0219] Wherein, the training data is used to train a mathematical answer model.

[0220] Step 106, determining the spliced geometric figure as the initial geometric figure, and returning to execute step 101.

[0221] For simple description, each of the foregoing method embodiments is described as a combination of a series of actions, but those skilled in the art shall understand that the present application is not limited to the action sequence described, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art shall understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.

[0222] It should be noted that each of the embodiments in the specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be understood by referring to each other. For device embodiments, because they are basically similar to method embodiments, they are described more simply, and the relevant parts refer to the part of the method embodiment.

[0223] The steps in the method of each embodiment of the present application can be adjusted, combined and reduced in sequence according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.

[0224] The modules and sub-modules in the devices and terminals in each embodiment of the present application can be combined, divided and reduced according to actual needs.

[0225] In several embodiments provided by the present application, it should be understood that the disclosed terminal, device and method can be implemented by other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or sub-modules is only a logical function division, and actual implementation can have another division manner, for example, a plurality of sub-modules or modules can be combined or integrated into another module, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be indirect coupling or communication connection through some interface, device or module, which can be electrical, mechanical or other forms.

[0226] The modules or sub-modules described as separate components can or can not be physically separated, and the components of the modules or sub-modules can or can not be physical modules or sub-modules, that is, they can be located in one place, or can be distributed to multiple network modules or sub-modules. According to actual needs, some or all of the modules or sub-modules can be selected to achieve the purpose of the present embodiment.

[0227] In addition, each functional module or sub-module in each embodiment of the present application can be integrated in one processing module, or each module or sub-module can exist physically alone, or two or more modules or sub-modules can be integrated in one module. The integrated module or sub-module can be realized in the form of hardware or in the form of a software functional module or sub-module.

[0228] Those skilled in the art will further appreciate that the units and algorithm steps of the examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or any combination thereof. To clearly illustrate the interchangeability of hardware and software, various components and steps have been described above generally in terms of their functionality, without limitation. The specific implementation of the described functionality no matter whether it is implemented in hardware or in software depends on the particular application and design constraints imposed on the overall system. Skilled persons can use various methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0229] The steps of the methods or algorithms described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination thereof. A software module can be located in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0230] Finally, it should be noted that, in the present text, the terms of relationship such as first and second are merely used to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0231] The above description of disclosed embodiments enables one of ordinary skill in the art to make and use the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating training data, characterized in that, include: Determine the target edge from the edges of the initial geometry; Based on the target edge, determine the size parameters and rotation parameters of the next geometric shape; Based on the size parameters and the rotation parameters, the next geometric figure is drawn with the target edge as the overlapping edge on the basis of the initial geometric figure, generating the spliced ​​geometric figure; The spliced ​​geometric shape is determined as the initial geometric shape, and the step of determining the target edge from each edge of the initial geometric shape is returned. The above process is repeated until the preset splicing end condition is met, and each spliced ​​geometric shape is obtained. Text descriptions corresponding to each of the spliced ​​geometric figures are generated, and training data is generated based on each of the spliced ​​geometric figures and their corresponding text descriptions; wherein, the training data is used to train a mathematical answering model.

2. The training data generation method according to claim 1, characterized in that, Determining the target edge from the edges of the initial geometry includes: Remove the overlapping edges from each historical splicing of the initial geometry to obtain each usable edge of the initial geometry; Select the target edge from the available edges of the initial geometry.

3. The training data generation method according to claim 1, characterized in that, The step of determining the size and rotation parameters of the next geometric shape based on the target edge includes: Based on the endpoint coordinates of the target edge, determine the side length of the target edge and the angle between the target edge and the horizontal direction; Based on the side length of the target edge, determine the size parameters of the next geometric shape; Based on the angle between the target edge and the horizontal direction, and the coordinates of the endpoints of the target edge, the rotation parameters of the next geometric shape are determined.

4. The training data generation method according to claim 1, characterized in that, Based on the size parameters and the rotation parameters, the next geometric shape is drawn on the basis of the initial geometric shape with the target edge as the overlapping edge, generating the stitched geometric shape, including: Determine the shape of the next geometric figure; Based on the shape of the next geometric figure, the size parameters, and the rotation parameters, determine the coordinates of each vertex of the next geometric figure; Based on the coordinates of each vertex of the next geometric figure, determine the coordinates of the endpoints of the auxiliary lines of the next geometric figure; Based on the coordinates of each vertex of the next geometric figure and the endpoint coordinates of the auxiliary lines of the next geometric figure, the next geometric figure is drawn with the target edge as the overlapping edge on the basis of the initial geometric figure, and the auxiliary lines are drawn in the next geometric figure to generate the spliced ​​geometric figure.

5. The training data generation method according to claim 4, characterized in that, Determining the endpoint coordinates of the auxiliary lines of the next geometric figure based on the coordinates of each vertex of the next geometric figure includes: Based on the coordinates of each vertex of the next geometric figure, determine the coordinates of the midpoints of each side of the next geometric figure; Based on the coordinates of each vertex, the midpoint coordinates of each side, and the endpoint coordinates of each side of the next geometric figure, a first target point and a second target point are determined from each vertex and the midpoint of each side of the next geometric figure; wherein the line connecting the first target point and the second target point does not coincide with any side of the next geometric figure. The coordinates of the first target point and the coordinates of the second target point are determined as the endpoint coordinates of the auxiliary line of the next geometric figure.

6. The training data generation method according to claim 1, characterized in that, The generation of text descriptions corresponding to each of the assembled geometric shapes includes: Perform the following operations on any assembled geometric shape: Generate the attributes corresponding to each basic geometric shape in any of the spliced ​​geometric shapes; wherein, any spliced ​​geometric shape is obtained by splicing together each of the basic geometric shapes; Based on the target edges of any spliced ​​geometric figure and the attributes corresponding to each basic geometric figure, a text description corresponding to any spliced ​​geometric figure is generated.

7. The training data generation method according to claim 6, characterized in that, The generation of the attributes corresponding to each basic geometric shape in any of the spliced ​​geometric shapes includes: Perform the following operations on any basic geometric shape in any of the assembled geometric figures: Generate the coordinates of each vertex of any given basic geometric shape; Based on the coordinates of each vertex of any given basic geometric figure, determine the side length of each side of that given basic geometric figure. Determine the angle of any one of the basic geometric figures; Based on the shape, vertex coordinates, side lengths, and angles of any given basic geometric figure, generate the attributes corresponding to that basic geometric figure.

8. The training data generation method according to claim 7, characterized in that, The method further includes: Mark the side lengths and angles of each side in any of the basic geometric figures.

9. An electronic device, characterized in that, Including memory and processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the training data generation method as described in any one of claims 1 to 8 by running a program in the memory.

10. A computer program product, characterized in that, It includes computer program instructions that, when executed by a processor, cause the processor to perform the training data generation method as described in any one of claims 1 to 8.