A method, system, device, and storage medium for text segmentation of drawings.

By reordering the disordered sentences after parsing the drawings and training an SVM model, the system can identify and segment sentences, thus solving the problems of accuracy and reliability in sentence segmentation of drawing text and achieving efficient text segmentation processing.

CN115841675BActive Publication Date: 2026-06-30CHENGDU YOUYI INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHENGDU YOUYI INFORMATION TECH CO LTD
Filing Date
2022-11-24
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing technologies cannot accurately and reliably segment the text of drawings, especially since the text after drawing parsing is out of order, making it impossible to directly use segmentation models for effective processing.

Method used

By reordering the disordered statements after parsing the drawings, a sequence of optional statements is generated. An SVM model is then used for training to build a recognition and sentence segmentation model, which identifies the correct statement sequence and performs sentence segmentation.

Benefits of technology

It achieves effective punctuation of drawing text, improves the accuracy and reliability of punctuation, avoids dimensionality reduction processing of learning samples, and is suitable for handling nonlinear problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115841675B_ABST
    Figure CN115841675B_ABST
Patent Text Reader

Abstract

This invention discloses a method, system, device, and storage medium for text segmentation of drawings. The method includes parsing the text of the drawing to obtain an initial sentence sequence; adjusting the initial sentence sequence according to the position of text boxes to generate an optional sentence sequence; annotating the optional sentence sequence with text and constructing a training set using the annotated text; training an SVM model using the training set to obtain a recognition model and a segmentation model; parsing the drawing to be processed to obtain an initial sentence sequence, and adjusting the initial sentence sequence according to the position of text boxes to generate an optional sentence sequence; using the recognition model to identify the correct sentence sequence from the optional sentence sequence of the drawing to be processed; and using the segmentation model to segment the correct sentence sequence. This invention can achieve effective segmentation of drawing text while ensuring processing efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of drawing text processing technology, specifically relating to a method, system, device, and storage medium for text segmentation of drawings. Background Technology

[0002] A characteristic of drawings is the presence of text boxes in various locations; some need to be merged, while others do not. For example, suppose a portion of the drawing consists of multiple text boxes, each containing corresponding content, such as... Figure 1 As shown. According to Figure 1 As can be seen, some text boxes in this example need to be merged. For example, the text boxes containing the words "design," "plan," and "drawing" need to be identified and integrated into a single text "design drawing"; the text box containing the phrase "This design drawing was produced by XXX Design Institute," and the text box adjacent to it containing the phrase "Submitted to YYY Company for construction. This is the first version of the design drawing for the YYY project; for details, please refer to other documents." should first be identified and integrated into a single text "This design drawing was produced by XXX Design Institute and submitted to YYY Company for construction. This is the first version of the design drawing for the YYY project; for details, please refer to other documents.", and then further segmented; the text boxes containing the phrases "produced by XXX," "reviewed by XXX," and "verified by XXX" should be identified and integrated into another paragraph.

[0003] Due to the unique nature of drawings, the order of the parsed text boxes is usually irregular. Therefore, existing machine learning-based sentence segmentation techniques cannot accurately and reliably segment the text of drawings, and ordinary text clustering also cannot achieve the same result. Summary of the Invention

[0004] To address the problem that existing technologies cannot accurately and reliably segment text in drawings, this invention provides a method, system, device, and storage medium for segmenting text in drawings. This invention first reorders the disordered statements obtained from directly parsing the drawing to obtain a selectable sequence. Then, a recognition model is used to identify the correct statement sequence from the selectable sequence. Finally, a segmentation model is used to segment the correct statement sequence, thereby achieving effective segmentation of the drawing text.

[0005] This invention is achieved through the following technical solution:

[0006] A method for text segmentation in drawings, comprising:

[0007] The initial statement sequence is obtained by parsing the drawing.

[0008] Adjust the initial statement sequence according to the position of the text box to generate an optional statement sequence;

[0009] The optional sentence sequences are text-annotated, and the annotated text is used to construct a training set;

[0010] The SVM model is trained using the training set to obtain the recognition model and the sentence segmentation model;

[0011] The drawing to be processed is parsed to obtain an initial statement sequence, and the initial statement sequence is adjusted according to the position of the text box to generate an optional statement sequence;

[0012] The correct statement sequence is identified from the optional statement sequence of the drawing to be processed using the recognition model.

[0013] The correct sentence sequence is segmented using the aforementioned sentence segmentation model.

[0014] Existing text segmentation techniques based on sentence segmentation models suffer from limitations due to the nature of drawings, where the parsed text is often out of order, making direct segmentation impossible. This means existing text segmentation techniques are ineffective for segmenting drawing text, exhibiting poor accuracy and reliability. This invention, however, leverages the relative positions of text boxes and language input habits (e.g., Chinese input is from left to right and top to bottom) to reorganize the out-of-order sentences after drawing parsing, resulting in two optional text sequences. The correct sentence sequence must lie within these two sequences. These optional sequences are then labeled, and a training set of labeled text is obtained to train an SVM model. This model can then identify the correct sentence sequence from the two optional sequences, allowing the sentence segmentation model to effectively segment the drawing text. Furthermore, this invention utilizes the advantages of SVM models (suitable for hyperdimensional and nonlinear data processing), eliminating the need for dimensionality reduction of training samples and addressing nonlinearity issues, thus ensuring both efficiency and accuracy in text recognition and segmentation.

[0015] In a preferred embodiment, the present invention adjusts the initial statement sequence according to the position of the text box to generate an optional statement sequence, specifically as follows:

[0016] Based on the positional relationship of the text boxes and the writing habits of different languages, the initial sentence sequence is adjusted to obtain several optional sentence sequences.

[0017] In a preferred embodiment, the present invention performs text annotation on the optional statement sequence and constructs a training set using the annotated text, specifically as follows:

[0018] Several optional statement sequences are labeled using the word2Vec format.

[0019] In a preferred embodiment, the SVM model of the present invention consists of two SVMs. The first SVM takes an optional sequence of statements as input and outputs the accuracy of the statement group in determining whether it is "incorrect" or not. The second SVM takes the correct sequence of statements identified by the first SVM as input and outputs the accuracy of the statement group in determining whether it is "disconnected" or not.

[0020] In a preferred embodiment, the training set of the present invention includes several labeled text data.

[0021] Secondly, this invention proposes a text segmentation system for drawings, comprising:

[0022] The parsing module is used to acquire drawings and parse them to obtain an initial statement sequence;

[0023] The reorganization module is used to adjust the initial statement sequence according to the position of the text box to generate an optional statement sequence;

[0024] The annotation module is used to annotate the optional sentence sequence and construct a training set using the annotated text;

[0025] The model building module uses the training set to train the SVM model to obtain the recognition model and the sentence segmentation model;

[0026] The recognition module uses the recognition model to identify the correct statement sequence from the optional statement sequence of the drawing to be processed;

[0027] The sentence segmentation module uses the sentence segmentation model to segment the correct sentence sequence.

[0028] In a preferred embodiment, the parsing module of the present invention parses the drawing to be processed to obtain an initial statement sequence, and the reorganization module adjusts the initial statement sequence of the drawing to be processed according to the position of the text box to generate an optional statement sequence.

[0029] In a preferred embodiment, the recombination module of the present invention adjusts the initial sentence sequence according to the positional relationship of the text boxes and the writing habits of different languages ​​to obtain two optional sentence sequences.

[0030] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in the present invention.

[0031] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the present invention.

[0032] The present invention has the following advantages and beneficial effects:

[0033] This invention first reassembles the disordered sentences obtained after directly parsing the original drawing to obtain a normal selectable sequence. Then, a recognition model is used to identify the correct sequence. Finally, a sentence segmentation model is used to segment the correct sequence into sentences. This application can effectively achieve text segmentation of drawings while ensuring the accuracy and reliability of the segmentation.

[0034] Because sentence groups have a large number of features, the training samples are high-dimensional. Conventional machine learning methods require dimensionality reduction of these samples. Furthermore, the features of sentence groups are generally non-linear data, and conventional machine learning methods are not effective at handling non-linear problems. Therefore, this invention uses SVM to recognize and segment sentence sequences. SVM is well-suited for processing high-dimensional data like text, eliminating the need for dimensionality reduction of training samples, thus improving the efficiency of text recognition and segmentation. It is also suitable for solving non-linear problems, improving processing performance. Attached Figure Description

[0035] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, do not constitute a limitation thereof. In the drawings:

[0036] Figure 1 This is an example diagram of some text boxes in a drawing.

[0037] Figure 2 This is a schematic diagram of the sentence segmentation method according to an embodiment of the present invention.

[0038] Figure 3 This is a block diagram illustrating the principle of the sentence segmentation system according to an embodiment of the present invention. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.

[0040] Example 1

[0041] Existing text segmentation techniques are based on segmentation models to process text into segments. However, due to the characteristics of drawings, the parsed text is out of order, making it impossible to directly use segmentation models for segmentation. In other words, existing text segmentation techniques cannot effectively segment the text of drawings, and cannot guarantee the accuracy and reliability of the segmentation. Therefore, this embodiment proposes a text segmentation method for drawings.

[0042] Specifically, such as Figure 2 As shown, the text segmentation method proposed in this embodiment of the invention specifically includes the following steps:

[0043] Step 1: Perform text parsing on the drawing to obtain the initial statement sequence.

[0044] Step 2: Adjust the initial statement sequence according to the position of the text box to generate an optional statement sequence.

[0045] Step 3: Annotate the optional sentence sequences with text, and use the annotated text to construct a training set.

[0046] Step 4: Train the SVM model using the training set to obtain the recognition model and the sentence segmentation model.

[0047] Step 5: Parse the drawing to be processed to obtain the initial statement sequence, and adjust the initial statement sequence according to the position of the text box to generate an optional statement sequence.

[0048] Step 6: Use the recognition model to identify the correct sentence sequence from the optional sentence sequence, and use the sentence segmentation model to segment the correct sentence sequence.

[0049] The statements obtained by directly parsing the original drawing are out of order and cannot be directly used as input for model training. Therefore, this embodiment of the invention reorders the out-of-order statements based on the relative position information between text boxes in the original drawing and the language input habits in the original drawing, resulting in several optional statement sequences, which are then used as corpus for model training.

[0050] Specifically Figure 1 The example drawing shown is used as an example for illustration. First, Figure 1 The disordered statements obtained by parsing the drawing shown might be:

[0051] Design, Drawings: This design was produced by XXX Design Institute; Production: XXX; Review: XXX; Approval: XXX; Submitted to YYY Company for construction. This is the first draft of the design for the YYY project; for details not covered, please refer to other documents.

[0052] For the above disordered sentences, the sentence segmentation model cannot directly perform sentence segmentation. According to the position of the text box and the writing habits of different languages, such as the Chinese writing habit of left to right and top to bottom, the above disordered sentences are reordered to obtain two optional sentence sequences, namely: (1) Design, design, drawing, this design drawing is made by XXX Design Institute, made by: XXX, handed over to YYY Company for construction. This is the first version of the design drawing of YYY project. For details, please refer to other documents, review: XXX, check: XXX; (2) Design, this design drawing is made by XXX Design Institute and handed over to YYY Company for construction. This is the first version of the design drawing of YYY project. For details, please refer to other documents, design, made by: XXX, review: XXX, check: XXX, drawing. The final effective and correct sentence sequence must come from one of the above two optional sentence sequences. Therefore, it is necessary to train and recognize these two optional sentence sequences and then confirm the sentence segmentation position.

[0053] This invention employs SVM to construct the recognition model and the sentence segmentation model. The specific process includes:

[0054] First, two optional sentence sequences are tagged, specifically using the word2Vec method. This tagging process utilizes existing HanLP part-of-speech tagging and syntactic analysis techniques, which will not be elaborated upon in this application. The two tagged sentence sequences are as follows:

[0055] (1) Optional statement sequence one:

[0056] Let (v), without error, without interruption.

[0057] Calculate (v), without error, without interruption

[0058] Graph (n, fs) is correct; disconnect.

[0059] This design drawing was produced by XXX Design Institute (r / n / p / nx / n / v, rhs), and contains no errors or breaks.

[0060] Construction was entrusted to YYY Company. This is the first draft of the YYY project design; for details not covered, please refer to other documents. (v / nx / n / v / vn / r / pnnx / n / uj / n / n / d / v / a / u / n / v / v / r / n, lhs), no error, disconnect.

[0061] Production: XXX, (v / nr, fs), no error, disconnected

[0062] Review: XXX, (v / nr, fs), no error, disconnect

[0063] Review: XXX, (v / nr, fs), no error, disconnect.

[0064] (2) Optional statement sequence two:

[0065] Let (v), error, disconnect.

[0066] This design drawing was produced by XXX Design Institute (r / n / p / nx / n / v, rhs), and contains no errors or breaks.

[0067] Construction was entrusted to YYY Company. This is the first draft of the YYY project design; for details not covered, please refer to other documents. (v / nx / n / v / vn / r / pnnx / n / uj / n / n / d / v / a / u / n / v / v / r / n, lhs), no error, disconnect.

[0068] Calculation (v), error, continuous opening

[0069] Production: XXX, (v / nr, fs), no error, disconnected

[0070] Review: XXX, (v / nr, fs), no error, disconnect

[0071] Review: XXX, (v / nr, fs), no error, disconnect.

[0072] Graph (n, fs) is correct; disconnect.

[0073] It should be noted that the RHS (right half sentence) marker indicates that the text basically conforms to the syntactic structure, but has special symbols such as commas and colons at the end, or the sentence is missing an object. Similarly, LHS (left half sentence) indicates that the sentence has special symbols at the beginning or the sentence is missing a subject.

[0074] The fs (full sentence) tag indicates that the text conforms to the syntactic structure and can stand alone as a sentence without context.

[0075] In this embodiment, the annotated text is used as a training sample. Several annotated text sequences obtained in steps 1-3 are used to construct a training set for training the recognition model.

[0076] In this embodiment of the invention, two SVMs are used to construct the recognition model and the sentence segmentation model. The first SVM takes an optional sentence sequence as input and outputs the accuracy of the sentence group in determining whether it is "incorrect". The second SVM takes the correct sentence sequence (i.e., the optional sentence sequence with high accuracy) identified by the first SVM as input and outputs the accuracy of the judgment of whether it is "broken".

[0077] For details on the model training process, please refer to the applicant's prior patent application (CN201710187190.6, Text Segmentation Method and System for Drawing Layout), which will not be elaborated here.

[0078] This embodiment also proposes a text segmentation system for drawings, specifically as follows: Figure 3 As shown, the text segmentation system includes a parsing module, a recombination module, a labeling module, a model building module, a recognition module, and a segmentation module.

[0079] The parsing module is used to obtain the drawings and parse them to obtain the initial statement sequence.

[0080] The reorganization module is used to adjust the initial statement sequence based on the position of the text box and generate an optional statement sequence.

[0081] The annotation module annotates optional sentence sequences and uses the annotated text to construct a training set.

[0082] The model building module uses the training set to train the SVM model, resulting in the recognition model and the sentence segmentation model.

[0083] The recognition module uses a recognition model to identify the correct statement sequence from the optional statement sequences of the drawing to be processed. The optional statement sequence of the drawing to be processed is obtained by parsing the drawing into the parsing module to obtain the initial statement sequence, which is then adjusted and generated by the reorganization module.

[0084] The sentence segmentation module uses a sentence segmentation model to segment correct sentence sequences.

[0085] This embodiment also proposes a computer device for performing the methods described above in this embodiment.

[0086] Computer devices include a processor, internal memory, and a system bus; various device components, including internal memory and the processor, are connected to the system bus. A processor is hardware used to execute computer program instructions through basic arithmetic and logical operations within the computer system. Internal memory is a physical device used for temporary or permanent storage of computational programs or data (e.g., program state information). The system bus can be any of several types of bus architectures, including a memory bus or memory controller, a peripheral bus, and a local bus. The processor and internal memory can communicate via the system bus. Internal memory includes read-only memory (ROM) or flash memory (not shown in the figure), and random access memory (RAM), which typically refers to the main memory loaded with the operating system and computer programs.

[0087] Computer devices typically include an external storage device. The external storage device can be selected from a variety of computer-readable media, which are any usable media accessible by a computer device, including both removable and fixed media. Examples of computer-readable media include, but are not limited to, flash memory (microSD cards), CD-ROMs, digital versatile optical discs (DVDs) or other optical disc storage, magnetic tape cartridges, magnetic tapes, disk storage or other magnetic storage devices, or any other media that can be used to store desired information and is accessible by a computer device.

[0088] Computer devices can logically connect to one or more network terminals in a network environment. Network terminals can be personal computers, servers, routers, smartphones, tablets, or other public network nodes. Computer devices connect to network terminals through network interfaces (LAN interfaces). A Local Area Network (LAN) is a computer network interconnected within a limited area, such as a home, school, computer lab, or office building using network media. WiFi and twisted-pair Ethernet are the two most commonly used technologies for building LANs.

[0089] It should be noted that other computer systems, including more or fewer subsystems than computer equipment, are also applicable to the invention.

[0090] As described in detail above, the computer device applicable to this embodiment can perform the specified operations of the text segmentation method. The computer device performs these operations through software instructions executed by the processor in a computer-readable medium. These software instructions can be read into memory from a storage device or from another device via a local area network interface. The software instructions stored in memory cause the processor to execute the aforementioned method for processing group membership information. Furthermore, the present invention can also be implemented through hardware circuitry or hardware circuitry combined with software instructions. Therefore, implementing this embodiment is not limited to any specific combination of hardware circuitry and software.

[0091] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for text hyphenation for a drawing sheet, characterized by, include: The initial statement sequence is obtained by parsing the drawing. Adjust the initial statement sequence according to the position of the text box to generate an optional statement sequence; The optional sentence sequences are text-annotated, and the annotated text is used to construct a training set; The SVM model is trained using the training set to obtain the recognition model and the sentence segmentation model; The drawing to be processed is parsed to obtain an initial statement sequence, and the initial statement sequence is adjusted according to the position of the text box to generate an optional statement sequence; The correct statement sequence is identified from the optional statement sequence of the drawing to be processed using the recognition model. The sentence segmentation model is used to segment the correct sentence sequence. The SVM model consists of two SVMs. The first SVM takes an optional sequence of sentences as input and outputs the accuracy of the sentence group in determining whether it is "incorrect" or not. The second SVM takes the correct sequence of sentences identified by the first SVM as input and outputs the accuracy of the sentence group in determining whether it is "disconnected" or not.

2. A text hyphenation method for a graphic sheet according to claim 1, wherein Based on the position of the text box, the initial statement sequence is adjusted to generate an optional statement sequence, specifically as follows: Based on the positional relationship of the text boxes and the writing habits of different languages, the initial sentence sequence is adjusted to obtain several optional sentence sequences.

3. A text hyphenation method for a graphic sheet according to claim 2, wherein The optional sentence sequence is text-annotated, and the annotated text is used to construct a training set, specifically as follows: Several optional statement sequences are labeled using the word2Vec format.

4. A method for text segmentation in drawings according to any one of claims 1-3, characterized in that, The training set includes several labeled text data.

5. A text segmentation system for drawings, characterized in that, include: The parsing module is used to acquire drawings and parse them to obtain an initial statement sequence; The reorganization module is used to adjust the initial statement sequence according to the position of the text box to generate an optional statement sequence; The annotation module is used to annotate the optional sentence sequence and construct a training set using the annotated text; The model building module uses the training set to train the SVM model to obtain the recognition model and the sentence segmentation model; The recognition module uses the recognition model to identify the correct statement sequence from the optional statement sequence of the drawing to be processed; The sentence segmentation module uses the sentence segmentation model to segment the correct sentence sequence. The SVM model consists of two SVMs. The first SVM takes an optional sequence of sentences as input and outputs the accuracy of the sentence group in determining whether it is "incorrect" or not. The second SVM takes the correct sequence of sentences identified by the first SVM as input and outputs the accuracy of the sentence group in determining whether it is "disconnected" or not.

6. A text segmentation system for drawings according to claim 5, characterized in that, The parsing module parses the drawing to be processed to obtain an initial statement sequence, and the reorganization module adjusts the initial statement sequence of the drawing to be processed according to the position of the text box to generate an optional statement sequence.

7. A text segmentation system for drawings according to claim 5 or 6, characterized in that, The reorganization module adjusts the initial sentence sequence based on the positional relationship of the text boxes and the writing habits of different languages, resulting in two optional sentence sequences.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1-4.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-4.