Method and device for generating process description text and electronic equipment
By analyzing nodes and lines in the flowchart, identifying text data and applying text conversion rules, automatically generating process description text, solving the problem of time-consuming and error-prone problems of manually writing process instructions, and achieving efficient and accurate document generation.
Patent Information
- Application Number
- CN202411392008.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2024-12-17
Smart Images

Figure CN119152531A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular, to a method, device and electronic device for generating process description text. Background Art
[0002] In the fields of software development, business process management and project management, demand personnel often sort out the requirements through flowcharts. The next stage is to output the requirements specification. Writing accurate and clear process specifications is crucial to ensure the smooth progress of the work. However, for complex flowcharts, manually writing process specifications is often time-consuming and prone to errors.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a method, device and electronic device for generating a process description text, so as to at least solve the technical problem in the related art that the process description is manually written in order to output the description based on the flowchart, which is time-consuming and error-prone.
[0005] According to one aspect of an embodiment of the present application, a method for generating a process description text is provided, comprising: obtaining an original image corresponding to an original flowchart for which the process description text is to be generated; parsing the nodes in the original image to obtain text data contained in each node and association information between each node; adjusting the text data according to preset text conversion rules and association information to obtain the process description text corresponding to the original flowchart.
[0006] Optionally, before parsing the nodes in the original image, the method further includes: determining the image color of the original image to obtain a determination result; and when the determination result indicates that the original image is a color image, converting the original image into a grayscale image.
[0007] Optionally, parsing the nodes in the original image includes: identifying the nodes and lines contained in the original flowchart in the original image; determining the node labels to which the nodes belong, and the line labels to which the lines belong, based on the nodes and lines contained in the original flowchart, wherein the node labels are used to represent the shape information of the nodes, and the line labels are used to represent the type information of the lines; determining the association information between the nodes in the original flowchart based on the node labels and the line labels; and identifying the text data contained in the associated nodes based on the association information.
[0008] Optionally, determining the node label to which the node belongs, and the line label to which the line belongs, includes: extracting contour information of the nodes and lines of the original flowchart in the original image; matching the contour information of the node with a preset node shape template to obtain a first matching result; determining the node label to which the node belongs based on the first matching result; and determining the line label to which the line belongs based on the contour information of the line.
[0009] Optionally, identifying text data contained in associated nodes includes: identifying entity information contained in the text in the associated nodes; performing syntactic analysis on the text in the associated nodes to obtain text component information; obtaining relationship features in the associated nodes through a relationship extraction model; determining text features in the associated nodes based on the relationship features, wherein the text features include associated text features, key text features and specific text features, the associated text features are used to represent features corresponding to text that has a relationship with an entity in the text, the key text features are used to represent features corresponding to words that are important in the text relationship, and the specific text features are used to represent features corresponding to words with specific attributes; and determining text data based on the entity information, text component information, relationship features and text features.
[0010] Optionally, adjusting text data according to preset text conversion rules and associated information includes: receiving a text conversion rule input by a target object; determining target data satisfying the text conversion rule from the text data; and adjusting the target data according to the text conversion rule.
[0011] Optionally, the method further includes: in the process of adjusting the text data, obtaining erroneous data that cannot be converted according to the text conversion rules; and performing text cleaning on the erroneous data.
[0012] According to another aspect of an embodiment of the present application, a device for generating a process description text is also provided, including: an acquisition module, used to acquire an original image corresponding to an original flowchart for generating the process description text; a parsing module, used to parse the nodes in the original image to obtain text data contained in each node and association information between each node; an adjustment module, used to adjust the text data according to preset text conversion rules and association information to obtain the process description text corresponding to the original flowchart.
[0013] According to another aspect of the embodiment of the present application, an electronic device is also provided, including: a memory for storing program instructions; a processor, connected to the memory, for executing program instructions to implement the following functions: obtaining an original image corresponding to an original flowchart for generating a process description text; parsing the nodes in the original image to obtain text data contained in each node and association information between each node; adjusting the text data according to preset text conversion rules and association information to obtain a process description text corresponding to the original flowchart.
[0014] According to another aspect of the embodiments of the present application, a non-volatile storage medium is provided, which includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the method for generating the above-mentioned process description text by running the computer program.
[0015] According to another aspect of the embodiments of the present application, a computer program product is provided, including computer instructions, which implement the above-mentioned method for generating a process description text when executed by a processor.
[0016] In an embodiment of the present application, an original image corresponding to an original flowchart for process description text to be generated is obtained; the nodes in the original image are parsed to obtain text data contained in each node and association information between each node; the text data is adjusted according to preset text conversion rules and association information to obtain a process description text corresponding to the original flowchart, thereby achieving the purpose of automatically generating a process description document, thereby achieving the technical effect of improving document writing efficiency, and further solving the technical problem in the related art that outputting instructions based on flowcharts is done by manually writing process instructions, which is time-consuming and error-prone. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 It is a hardware structure block diagram of a computer terminal for implementing a method for generating a process description text according to an embodiment of the present application;
[0019] Figure 2 is a flowchart of a method for generating a process description text according to an embodiment of the present application;
[0020] Figure 3 It is a structural diagram of a device for generating a process description text according to an embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] First, some nouns or terms that appear in the process of explaining the embodiments of the present application are subject to the following explanations:
[0024] Relation extraction: refers to the process of automatically identifying and extracting relationships or associations between entities from text. In the field of natural language processing, relationship extraction is an important task that aims to help machines understand the connections between entities in text. Once the entity and relationship types are determined, the relationship extraction algorithm analyzes the text context to find clues and evidence supporting the relationship between entities. These clues can be words, phrases, sentence structures, etc. The algorithm will use these clues to determine whether the relationship between entities exists and extract relevant information.
[0025] Match and replace: Text transformation rule technology is based on the concepts of matching and replacing. By defining a matching pattern, you can locate the part of the input text that meets specific conditions and then replace or adjust it. The matching pattern can be described using regular expressions, wildcards, or custom rule syntax. The replacement operation can be a simple text replacement, string concatenation, or a more complex logical operation.
[0026] The method embodiment of generating the process description text provided in the embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a method for generating a flow description text. Figure 1As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions connected via a wired and / or wireless network. In addition, it may also include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, and a BUS bus. Those skilled in the art can understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0027] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0028] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method for generating the process description text in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned method for generating the process description text. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0029] The transmission module 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission module 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0030] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .
[0031] It should be noted that, in some optional embodiments, the above Figure 1 The computer terminal shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computer terminal described above.
[0032] In the above-mentioned operating environment, an embodiment of the present application provides an embodiment of a method for generating a process description text. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0033] Figure 2 is a flowchart of a method for generating a process description text according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:
[0034] Step S202, obtaining an original image corresponding to the original flowchart for generating the process description text.
[0035] In the above step S202, the original flowchart is a visual representation used to show a series of steps, decision points, data flows or other elements to illustrate how a process or system operates. It is commonly used in project management, software development, business process analysis and other fields. Flowcharts can be created by hand-drawing, software tools (such as Visio, Lucidchart, Draw.io, etc.) or other graphic design tools. The original image refers to an image file that has not been modified or has only been basically processed. In an embodiment of the present application, the original image refers to an image containing the original flowchart content. For example, it can be a bitmap (such as PNG, JPEG format) or a vector graphic (such as the vector part in SVG, PDF format).
[0036] Step S204, parsing the nodes in the original image to obtain the text data contained in each node and the association information between each node.
[0037] In the above step S204, before parsing the original image, it is necessary to perform necessary preprocessing on the original image to improve the accuracy and efficiency of subsequent processing steps. The preprocessing steps may include, for example: image enhancement: adjusting the contrast, brightness, sharpening, etc. of the image to improve the image quality; noise removal: reducing the noise in the image to make the image clearer; binary / grayscale: converting a color image into a grayscale image or a binary image (black and white image) to simplify the image processing process.
[0038] Node detection is the process of identifying graphical elements in an image that represent flowchart nodes. For example, image segmentation can be used to divide the original image into multiple regions or objects. Shape recognition algorithms (such as edge detection, Hough transform, etc.) are used to detect nodes of rectangular, circular or other specific shapes that exist in different regions.
[0039] After detecting the nodes, it is necessary to extract the text data contained in each node, for example, using OCR technology to convert the text contained in the node into editable text data, wherein OCR technology can recognize characters in the image and convert them into corresponding text strings. By detecting the lines or arrows connecting the nodes in the image, the relative positions of the nodes and the directions of the connecting lines, the hierarchical relationships and sequential relationships between the nodes can be inferred, or a specialized graph parsing algorithm (such as topological sorting, depth-first search, etc.) can be used to analyze the structure of the flowchart, thereby extracting the association information between the nodes.
[0040] Step S206, adjusting the text data according to the preset text conversion rules and the associated information to obtain a process description text corresponding to the original flow chart.
[0041] In step S204 of the method for generating the process description text, before parsing the nodes in the original image, the method also includes: judging the image color of the original image to obtain a judgment result; if the judgment result indicates that the original image is a color image, converting the original image into a grayscale image.
[0042] In the embodiment of the present application, it is necessary to determine whether the original image is a color image or a grayscale image. This step can be completed by checking the pixel data of the image file. Color images usually contain three color channels of red, green, and blue (RGB), while grayscale images only have one brightness channel. By reading the metadata or actual pixel data of the image file, the color type of the image can be determined. In the case where the judgment result indicates that the original image is a color image, the color image needs to be converted into a grayscale image. A grayscale image is a black and white image in which the brightness level of each pixel is represented by a single numerical value rather than the value of the three RGB channels. The purpose of grayscale conversion is to simplify the image processing process, because grayscale images only contain brightness information and do not involve color, which helps to reduce the amount of calculation and increase the processing speed. Grayscale conversion can be achieved by a variety of methods, such as weighted average method (the most commonly used method is to take the weighted average of the three RGB components, where the weights are usually set according to the sensitivity of the human eye to different colors), maximum method (selecting the maximum value of the three RGB components as the grayscale value) or minimum method (selecting the minimum value of the three RGB components as the grayscale value), etc.
[0043] In step S204 of the above-mentioned method for generating the process description text, the nodes in the original image are parsed, including: identifying the nodes and lines contained in the original flowchart in the original image; determining the node labels to which the nodes belong, and the line labels to which the lines belong, based on the nodes and lines contained in the original flowchart, wherein the node labels are used to represent the shape information of the nodes, and the line labels are used to represent the type information of the lines; determining the association information between the nodes in the original flowchart based on the node labels and the line labels; and identifying the text data contained in the associated nodes based on the association information.
[0044] In the embodiment of the present application, algorithms such as image segmentation and edge detection are used to identify nodes (usually objects with shapes such as rectangles, circles, etc.) and lines (paths connecting nodes) in the image. After identifying the nodes and lines, the next step is to assign labels to them. Node labels are used to represent the shape information of nodes, such as rectangles, circles, diamonds, etc., and this information is usually matched and determined based on the boundary shape of the node or a preset template. Line labels are used to represent the type information of lines, such as straight lines, curves, lines with arrows, etc., and this information can be determined based on the geometric properties of the lines or the relative positions with other elements. The association information between nodes is determined by analyzing the lines, and each line connects two nodes, indicating that there is some logical or physical connection between the two nodes. By analyzing the starting point, end point and middle point of the line, it can be determined which nodes are related to each other. After determining the association information between the nodes, the next step is to identify the text data contained in each node. These text data usually provide detailed descriptions of the node function, state or condition. Text can be extracted from an image through text recognition technology, such as optical character recognition (OCR). The OCR algorithm analyzes the pixel data inside the node and converts it into a readable character sequence.
[0045] In the above steps, determining the node label to which the node belongs and the line label to which the line belongs includes: extracting the contour information of the nodes and lines of the original flowchart in the original image; matching the contour information of the node with a preset node shape template to obtain a first matching result; determining the node label to which the node belongs based on the first matching result; and determining the line label to which the line belongs based on the contour information of the line.
[0046] In an embodiment of the present application, it is necessary to extract the contour information of nodes and lines from the original flowchart in the original image. For example, the above contour information can be obtained by edge detection algorithms of the image, such as Canny edge detector, Sobel operator, etc. These algorithms can identify areas with obvious brightness changes in the image, thereby outlining the boundaries of objects (such as nodes and lines). For nodes, the contour information usually includes the outer boundaries of their shapes; for lines, it includes their starting point, end point, and intermediate point or bending point.
[0047] After extracting the outline information of the node, the next step is to match this information with the preset node shape template. The preset node shape template is usually designed based on the common node shapes (such as rectangle, circle, diamond, etc.) in the flow chart. The matching process involves operations such as scaling, rotation and translation of the outline so as to optimally align the extracted node outline information with the template. The matching algorithm calculates the similarity or distance metric between the outline and the template, such as Hausdorff distance, outline matching score, etc., to obtain a first matching result. Based on the first matching result, the node label to which each node belongs can be determined. Specifically, the label corresponding to the template with the highest matching degree in the first matching result will be assigned to the node. If the matching result is not clear enough (for example, there are multiple highly similar templates), additional decision rules or heuristic methods need to be applied to select the most appropriate label.
[0048] Line labels can be determined based on their geometric properties and relative position to other elements. Line profile information (such as length, direction, curvature, whether it has an arrow, etc.) is used to classify lines. For example, straight lines can represent simple flow connections, while lines with arrows can represent flow directionality or decision points. In some cases, the label of a line can also depend on the type of nodes it connects or the specific relationship between them.
[0049] In the above steps, the text data contained in the associated nodes is identified, including: identifying the entity information contained in the text in the associated nodes; performing syntactic analysis on the text in the associated nodes to obtain text component information; obtaining the relationship features in the associated nodes through the relationship extraction model; determining the text features in the associated nodes based on the relationship features, wherein the text features include associated text features, key text features and specific text features, the associated text features are used to represent the features corresponding to the text related to the entity in the text, the key text features are used to represent the features corresponding to the words with importance in the text relationship, and the specific text features are used to represent the features corresponding to the words with specific attributes; the text data is determined based on the entity information, the text component information, the relationship features and the text features.
[0050] In the embodiment of the present application, entity recognition is a basic task in natural language processing (NLP), which aims to identify entities with specific meanings from text, such as names of people, places, names of organizations, time expressions, etc. In this step, the system identifies the entity information contained in the text in the associated node by applying an entity recognition model or algorithm. Syntactic analysis is the process of parsing the sentence structure of the text, which aims to identify the various components (such as subject, predicate, object, etc.) in the sentence and the relationship between them. Through syntactic analysis, the deep structural information of the text, i.e. the above-mentioned text component information, can be obtained. Relation extraction is the process of identifying the relationship between entities from the text. In this step, the system uses a relation extraction model to analyze the semantic connection between entities in the text, thereby extracting the relationship features between them. After identifying the entity information, performing syntactic analysis and extracting the relationship features, the system can further determine the features of the text based on this information. Text features include associated text features, key text features and specific text features. Related text features reflect the characteristics of texts related to entities in the text; key text features emphasize the important words in the text relationship; specific text features refer to the features corresponding to words with specific attributes or meanings. These features together constitute a comprehensive description and representation of the text content. The system integrates multiple aspects of information such as entity information, text component information, relationship features and text features to obtain text data.
[0051] In step S206 of the method for generating the process description text, the text data is adjusted according to the preset text conversion rules and associated information, including: receiving the text conversion rules input by the target object; determining the target data that meets the text conversion rules from the text data; and adjusting the target data according to the text conversion rules.
[0052] In an embodiment of the present application, a system or program needs to receive text conversion rules input from a user or other system. These rules define how to convert the input text data into a desired output format or content. The rules can be simple string replacement, complex regular expression matching and replacement, or semantic-based conversion logic. The input text conversion rules should be clear and specific so that the system can accurately understand and execute. These rules can, for example, include the text mode to be modified, the specific type of conversion operation (such as replacement, insertion, deletion, etc.) and the converted content or format. After receiving the text conversion rules, the system needs to traverse or query the text data, and by matching with the text conversion rules, the system can determine the target data that needs to be adjusted. After determining the target data, the system can adjust these data according to the preset text conversion rules. For example, it includes simple string replacement, text formatting, structural adjustment or more complex semantic conversion.
[0053] In step S206 of the method for generating the process description text, the method further includes: in the process of adjusting the text data, obtaining erroneous data that cannot be converted according to the text conversion rules; and performing text cleaning on the erroneous data.
[0054] In the embodiment of the present application, in the process of adjusting the text data, it is inevitable to encounter some erroneous data that cannot be converted according to the preset text conversion rules. These erroneous data may be generated due to various reasons, such as inconsistent data format, non-standard characters, missing necessary information or violation of specific rules. In order to ensure the quality of the data and the smooth progress of subsequent processing, these erroneous data need to be identified, extracted and cleaned.
[0055] Specifically, when executing text conversion rules, the system attempts to apply each rule to the text data. If a rule cannot be successfully applied to a piece of data (for example, because the data format does not match, the necessary tags are missing, or it contains unrecognizable characters), the data segment is marked as erroneous data. The text conversion process includes an exception handling mechanism to capture and handle any errors or abnormal situations that occur during the conversion process. Once the erroneous data is identified, it needs to be cleaned to correct the problem and make it meet the requirements of subsequent processing. Text cleaning usually includes the following steps:
[0056] 1. Data verification: First, verify the erroneous data to confirm that it cannot be converted according to the rules, for example by rechecking the data format, content integrity and consistency.
[0057] 2. Error classification: Classify the erroneous data into different types, such as format errors, missing content, non-standard characters, etc., to determine the appropriate cleaning strategy.
[0058] 3. Data correction: Depending on the type of error, take appropriate measures to correct the data. For example, this may include correcting the format, filling in missing information, deleting or replacing non-standard characters, etc. In some cases, if the data cannot be effectively corrected, it needs to be deleted from the data set.
[0059] 4. Revalidation: After the cleansing process is complete, revalidate the data to ensure that it has been corrected as intended and now complies with the requirements of the text transformation rules.
[0060] 5. Record cleaning logs: Record detailed logs of the cleaning process, including which data is cleaned, how it is cleaned, and the results after cleaning, to track data changes and conduct audits or backtracking when necessary.
[0061] After text cleaning, a relatively correct and complete requirement document is obtained. By defining different rules, it can adapt to different conversion requirements and input text structures. The rules can be adjusted and expanded according to specific tasks to adapt to different text conversion scenarios.
[0062] Through the above steps S202 to S206, the purpose of automatically generating process description documents is achieved, the possibility of human errors is reduced, and the technical effect of improving document writing efficiency and accuracy is achieved. In addition, the automatically generated process description documents have the same format and style, ensuring the consistency of the entire organization's internal processes, thereby solving the technical problem in the related technology that the flowchart-based output instructions are manually written through the process instructions, which is time-consuming and error-prone.
[0063] Figure 3 is a structural diagram of a device for generating a process description text according to an embodiment of the present application, such as Figure 3 As shown, the device comprises:
[0064] An acquisition module 30 is used to acquire an original image corresponding to an original flowchart for generating a process description text;
[0065] The parsing module 32 is used to parse the nodes in the original image to obtain the text data contained in each node and the association information between each node;
[0066] The adjustment module 34 is used to adjust the text data according to the preset text conversion rules and associated information to obtain the process description text corresponding to the original flow chart.
[0067] In the parsing module in the above-mentioned process description text generation device, the parsing module is also used to judge the image color of the original image and obtain a judgment result; when the judgment result indicates that the original image is a color image, the original image is converted into a grayscale image.
[0068] In the parsing module in the above-mentioned process description text generation device, the parsing module is also used to identify the nodes and lines contained in the original flowchart in the original image; based on the nodes and lines contained in the original flowchart, determine the node labels to which the nodes belong, and the line labels to which the lines belong, wherein the node labels are used to represent the shape information of the nodes, and the line labels are used to represent the type information of the lines; based on the node labels and line labels, determine the association information between the nodes in the original flowchart; based on the association information, identify the text data contained in the associated nodes.
[0069] In the parsing module in the above-mentioned process description text generation device, the parsing module is also used to extract the contour information of the nodes and lines of the original flowchart in the original image; match the contour information of the node with the preset node shape template to obtain a first matching result; determine the node label to which the node belongs based on the first matching result; determine the line label to which the line belongs based on the contour information of the line.
[0070] In the parsing module in the device for generating the above-mentioned process description text, the parsing module is also used to identify the entity information contained in the text in the associated nodes; perform syntactic analysis on the text in the associated nodes to obtain text component information; obtain the relationship features in the associated nodes through the relationship extraction model; determine the text features in the associated nodes based on the relationship features, wherein the text features include associated text features, key text features and specific text features, the associated text features are used to represent the features corresponding to the text related to the entity in the text, the key text features are used to represent the features corresponding to the words with importance in the text relationship, and the specific text features are used to represent the features corresponding to the words with specific attributes; determine the text data based on the entity information, text component information, relationship features and text features.
[0071] In the adjustment module in the process description text generation device, the adjustment module is also used to receive the text conversion rule input by the target object; determine the target data that meets the text conversion rule from the text data; and adjust the target data according to the text conversion rule.
[0072] In the adjustment module in the device for generating the process description text, the adjustment module is also used to obtain erroneous data that cannot be converted according to the text conversion rules during the process of adjusting the text data; and perform text cleaning on the erroneous data.
[0073] It should be noted that Figure 3 The generation device of the process description text in is used to execute Figure 2 The method for generating the process description text shown in the figure, therefore the relevant explanations in the above-mentioned method for generating the process description text are also applicable to the device for generating the process description text, and will not be repeated here.
[0074] An embodiment of the present application also provides an electronic device, which includes a memory and a processor, wherein the memory is used to store program instructions; the processor is connected to the memory and is used to execute program instructions to implement the following functions: obtaining an original image corresponding to an original flowchart for generating a process description text; parsing the nodes in the original image to obtain text data contained in each node and association information between each node; adjusting the text data according to preset text conversion rules and association information to obtain a process description text corresponding to the original flowchart.
[0075] It should be noted that the above electronic equipment is used to execute Figure 2 The method for generating the process description text shown in the figure, therefore the relevant explanations in the above-mentioned method for generating the process description text are also applicable to the electronic device and will not be repeated here.
[0076] An embodiment of the present application also provides a non-volatile storage medium, which includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the following method for generating a process description text by running the computer program: obtaining an original image corresponding to an original flowchart for generating the process description text; parsing the nodes in the original image to obtain text data contained in each node and association information between each node; adjusting the text data according to preset text conversion rules and association information to obtain the process description text corresponding to the original flowchart.
[0077] It should be noted that the above non-volatile storage medium is used to execute Figure 2 The method for generating the process description text shown in the figure, therefore the relevant explanations in the above-mentioned method for generating the process description text are also applicable to the non-volatile storage medium, and will not be repeated here.
[0078] An embodiment of the present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the method for generating a process description text in each embodiment of the present application.
[0079] The embodiments of the present application also provide a computer program, which, when executed by a processor, implements the steps of the method for generating a process description text in each embodiment of the present application.
[0080] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0081] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0082] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0083] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0084] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0085] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0086] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for generating a process description text, characterized in that: include: Obtaining an original image corresponding to an original flowchart of a process description text to be generated; Parsing the nodes in the original image to obtain text data contained in each node and association information between each node; The text data is adjusted according to a preset text conversion rule and the associated information to obtain a process description text corresponding to the original flow chart.
2. The method according to claim 1, characterized in that: Before parsing the nodes in the original image, the method further includes: Determine the image color of the original image and obtain a determination result; In a case where the determination result indicates that the original image is a color image, the original image is converted into a grayscale image.
3. The method according to claim 1, characterized in that: Parsing the nodes in the original image includes: Identify nodes and lines contained in the original flowchart in the original image; According to the nodes and lines included in the original flowchart, determine the node label to which the node belongs and the line label to which the line belongs, wherein the node label is used to represent the shape information of the node and the line label is used to represent the type information of the line; Determine association information between nodes in the original flow chart according to the node labels and the line labels; According to the association information, the text data contained in the associated nodes is identified.
4. The method according to claim 3, characterized in that Determining the node label to which the node belongs and the line label to which the line belongs includes: Extracting contour information of nodes and lines of the original flowchart in the original image; Matching the outline information of the node with a preset node shape template to obtain a first matching result; Determining a node label to which the node belongs according to the first matching result; The line label to which the line belongs is determined according to the contour information of the line.
5. The method according to claim 3, characterized in that: Identify the text data contained in the associated node, including: Identify entity information contained in the text in the associated node; Performing syntactic analysis on the text in the associated node to obtain text component information; Acquire the relational features in the associated nodes through a relation extraction model; Determining text features in the associated nodes according to the relationship features, wherein the text features include associated text features, key text features and specific text features, the associated text features are used to represent features corresponding to texts that are related to entities in the text, the key text features are used to represent features corresponding to words that are important in the text relationship, and the specific text features are used to represent features corresponding to words that have specific attributes; The text data is determined based on the entity information, the text component information, the relationship feature and the text feature.
6. The method according to claim 1, characterized in that Adjusting the text data according to a preset text conversion rule and the associated information includes: Receive text conversion rules input by the target object; Determining target data satisfying the text conversion rule from the text data; The target data is adjusted according to the text conversion rule.
7. The method according to claim 1, characterized in that The method further comprises: In the process of adjusting the text data, obtaining erroneous data that cannot be converted according to the text conversion rule; Perform text cleaning on the erroneous data.
8. A device for generating a process description text, characterized in that: include: An acquisition module, used for acquiring an original image corresponding to an original flowchart of a process description text to be generated; A parsing module, used to parse the nodes in the original image to obtain the text data contained in each node and the association information between each node; The adjustment module is used to adjust the text data according to the preset text conversion rules and the associated information to obtain the process description text corresponding to the original flow chart.
9. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is connected to the memory and is used to execute program instructions to implement the following functions: obtaining an original image corresponding to an original flowchart for generating a process description text; parsing nodes in the original image to obtain text data contained in each node and association information between each node; adjusting the text data according to a preset text conversion rule and the association information to obtain a process description text corresponding to the original flowchart.
10. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the method for generating a process description text as described in any one of claims 1 to 7 by running the computer program.
11. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the method for generating a process description text as described in any one of claims 1 to 7 is implemented.
