Instruction drawing information extraction method and device, equipment and medium
By constructing text serial number detection and tree-shaped hierarchical structure of illustration drawings, combined with large language model and rule credibility evaluation, the credibility problem of information extraction of illustration drawings is solved, and more accurate information extraction is achieved.
Patent Information
- Application Number
- CN202510057831.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-07-04
AI Technical Summary
When processing description drawings, it is difficult to determine the credibility of the information extraction results, and there are randomness and errors in the answers of large language models, and it is impossible to accurately extract key details.
By identifying the text serial numbers in the drawings, building a tree-like hierarchical structure of the explanatory statements, combining the large language model and the rule credibility evaluation method, positioning and splicing relevant segment contents, and extracting information.
It improves the accuracy and credibility of information extraction, solves the semantic integrity problem of long text paragraphs, is compatible with mapping errors and recognition omissions, and reduces the random impact of large language models.
Smart Images

Figure CN120260064A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of engineering drawing information extraction, and particularly relates to a method, device, equipment and medium for extracting descriptive drawing information based on a large language model and rule credibility evaluation. Background Art
[0002] The content of the descriptive documents and drawings of construction projects is basically composed of long text paragraphs and tables. As an important type of data in the construction industry, it comprehensively describes the attribute information and design details of buildings in various professional fields such as fire protection, water supply and drainage, electricity, and heating ventilation. The former includes global attribute information such as the project name, building area, and number of floors of the building, and the latter includes engineering design information such as the setting of wall materials for each part. These information are difficult to be expressed by drawing local images and can only be described in natural language, and need to be identified and extracted from the descriptive drawings.
[0003] As Figure 1 shown, the text of the descriptive drawing is relatively long, and it has significant characteristics different from general text documents in terms of structure and content. Structurally, the descriptive paragraph has a tree-like logical hierarchy, consisting of various chapters. Under each chapter, it is stated item by item in the form of "general - sub - points", and each item often starts with a serial number; in terms of content, the descriptive paragraph contains professional vocabulary in the construction field, with a flexible expression method. When expressing engineering design information, there are situations where the statement content is divided into the values of multiple subject objects, and the statement content involves multiple sentences, etc.
[0004] For the information extraction of general documents, the existing methods are mainly divided into two categories: matching rules and deep learning models. Among them, the former uses rules such as keywords and regular expressions to perform matching extraction in the document paragraphs. Its answer is deterministic, but it lacks the analysis and understanding of semantics, and it is difficult to preset the strictness of the rules, and it is easy to have the phenomena of missed matching or mis - matching. The latter, represented by large language models, can form an analysis and judgment of the semantics of common texts based on pre - trained corpora. However, it uses an autoregressive transformer model architecture and samples and generates each text among the tokens with higher probabilities based on conditional distribution probability calculation. Therefore, the generated answer content has a certain randomness and it is difficult to obtain accurate and reliable results.
[0005] The pre-set information items to be extracted in the explanatory drawings include two categories: global attribute information and engineering design information. Taking the number of building floors as an example, the former has a unique value, and the value keyword is "(above / below ground) xx floors"; taking the wall material as an example, the latter is usually described separately for different types of parts such as above and below ground, exterior and interior walls, and partition walls in some special rooms, and the value keywords are "xx bricks", "xx blocks", etc., which may include specific details such as the thickness and model of the material. The global attribute information can be extracted by either rules or large models, while the engineering design information has different subject objects and diverse value contents, making it difficult to accurately match and extract using rules.
[0006] For example, in Related Technology 1, a method for extracting document information based on a question-and-answer model is proposed. A prompt is constructed using the document to be extracted and a pre-set question template, which is then input into a pre-trained question-and-answer model to obtain the answer generated by the model, and then the information extraction result is parsed. In Related Technology 2, a method for training and applying a large language model to review project documents is proposed. The chapter names of the document are matched using pre-set keywords to determine the structure of the project document and construct a knowledge graph for annotation, which is used to train and optimize the large language model. During the review, rules are manually configured and converted into prompts for the large model to guide the large model to generate responses, and further parsed to generate review results. In Related Technology 3, a method for extracting information by locating relevant text segments in a document based on vector retrieval is proposed. The document content is divided into different granularities such as sentence granularity, page granularity, and chapter granularity according to the number of characters to obtain multiple text segments. Then, the similarity scores between each text segment and the user's question are calculated through vector encoding, and the most relevant text segment is retrieved and input into the large language model. The answer of the large language model is parsed and a function for locating the relevant text segment is provided. In Related Technology 4, a method for segmenting document content based on the hierarchical structure of the document title is proposed. First, each level of document title and document paragraph are identified, and then the corresponding set of document titles to which each document paragraph belongs is matched according to the regional position of each document paragraph. The content of each paragraph and its corresponding document title are combined as the document segmentation result, so as to ensure the semantic integrity when performing vector encoding or content retrieval on each text segment as a unit later.
[0007] However, the aforementioned Related Art 1 and Related Art 2 are oriented towards general documents. The entire content of the document is input into the large language model, and information extraction is performed based on the answers of the large model. However, the text of the explanatory drawings is relatively long, and writing all of it into the prompt will reduce the inference efficiency and the model's attention to key details. Therefore, it is necessary to accurately locate the relevant text segments and exclude the interference of irrelevant text segments. The aforementioned Related Art 3 is oriented towards general documents. It divides paragraphs and chapters based on the number of text characters, and then converts the paragraph text into semantic vectors through an embedding model to perform paragraph positioning related to the question. However, the number of characters in each paragraph of the explanatory drawings varies, and it is impossible to determine the character count standard for each division granularity. Moreover, its content has an overall hierarchical structure, and inappropriate paragraph segmentation positions may cause semantic fragmentation or context loss, resulting in the generated vectors being unable to accurately reflect the overall semantics of the paragraphs. At the same time, the lengths of each text segment are uneven, which will lead to different information densities of the corresponding semantic vectors: for long paragraphs, it is difficult to effectively extract the precise key content in the document from its vector results; for short paragraphs, it is difficult to fully express the semantics of the paragraph from its vector results, thereby resulting in the similarity calculation results not meeting the actual requirements. The aforementioned Related Art 4 is oriented towards documents with a hierarchical structure in the title, as Figure 2 shown. It distinguishes each level of the title and the paragraph content based on the numbering rule at the beginning, and then combines the paragraph content with the corresponding document title set to form the text segmentation result. However, the paragraph content of the explanatory drawings is also presented item by item, so the entire text has a numbering hierarchical structure, as Figure 1 shown. It is impossible to distinguish the title and the paragraph content through the preset numbering rule. If the deepest-level content is concatenated with the corresponding hierarchical content mentioned above to form the text segmentation, it will cause the longer text segments in the middle to appear repeatedly in the segmentation result, affecting the segmentation semantics and reducing the retrieval efficiency.
[0008] Therefore, there is an urgent need for an information extraction method for explanatory drawings that does not rely on parsing the answers generated by the large language model to obtain the information results, can determine the credibility of the results, and can judge and handle the situation where the large model answers incorrectly. Summary of the Invention
[0009] The present invention provides an information extraction method, device, equipment, and medium for explanatory drawings to solve the problems in the prior art that all rely on parsing the answers generated by the large language model to obtain the information results, it is difficult to determine the credibility of the results, and it is impossible to judge and handle the situation where the large model answers incorrectly.
[0010] An embodiment of the first aspect of the present invention provides a method for extracting illustrative drawing information, including the following steps: performing text recognition or text extraction on a target specification drawing to obtain a single-line text result list data; traversing the single-line text result list data to extract the content of each single-line text serial number; using a preset large language model to verify the content of each single-line text serial number to retain the content of multiple single-line text serial numbers with serial number results; determining, according to the proportion of the number of single-line texts with serial number results in the single-line text result list data, whether to use the content of each single-line text serial number with serial number results or the preset large language model to perform sentence division on the single-line text result list data to obtain an illustrative sentence result list; traversing the illustrative sentence result list to determine the hierarchical relationship of all illustrative sentences to generate an illustrative sentence tree-like hierarchical structure; inputting the name keyword and value keyword of a preset information item to be extracted into the illustrative sentence tree-like hierarchical structure to locate relevant sentence nodes and splice them based on the reading order to obtain relevant paragraph content containing the information item; parsing and extracting the relevant paragraph content containing the information item based on the preset large language model and credibility evaluation method to obtain a final information result.
[0011] Optionally, the determining, according to the proportion of the number of single-line texts with serial number results in the single-line text result list data, whether to use the content of each single-line text serial number with serial number results or the preset large language model to perform sentence division on the single-line text result list data to obtain an illustrative sentence result list includes:
[0012] Calculating the proportion of the number of single-line texts with serial number results in the single-line text result list data. If the proportion is higher than a preset proportion threshold, then use the content of each single-line text serial number with serial number results as the starting point of an illustrative sentence, and sequentially add the content of single-line texts without serial number results to the current illustrative sentence range from the starting point until a new single-line text with a serial number result is traversed, which is used as the starting point of the next illustrative sentence, and continue to repeat this process to obtain the illustrative sentence result list. Otherwise, input the single-line text result list data into the preset large language model to determine whether line breaks can be added at the beginning and end of a single-line text based on semantic integrity. Use each single-line text with a line break that can be added at the beginning as the starting point of an illustrative sentence, and sequentially add the single-line text whose previous single-line text end cannot add a line break or the current beginning cannot add a line break to the current illustrative sentence range from the starting point until a single-line text that does not meet the condition is traversed, which is used as the starting point of the next illustrative sentence, and continue to repeat this process to obtain the illustrative sentence result list.
[0013] Optionally, the traversing the illustrative sentence result list to determine the hierarchical relationship of all illustrative sentences to generate an illustrative sentence tree-like hierarchical structure includes:
[0014] Set a virtual root node;
[0015] Traverse the list of statement description results, and determine whether two statement descriptions belong to the same level based on whether the serial numbers of the two statement descriptions belong to the same group, so as to generate the tree-like index structure.
[0016] Optionally, the traversing the list of statement description results, and determining whether two statement descriptions belong to the same level according to whether the serial numbers of the two statement descriptions belong to the same group to determine the hierarchical relationship of all the statement descriptions, so as to generate the tree-like index structure, includes:
[0017] Traverse the list of statement description results, and each time based on the serial number content of the current statement description, locate the node in the previously traversed statement descriptions that is in the same group as the serial number of the current statement description. If a node in the same group is found, store the current statement description node as the next sibling node of the current statement description node; otherwise, store the current statement description node as the child node of the previous statement description node, and recursively find the parent node of each statement description node until the virtual root node;
[0018] Judge whether the serial number of each statement description node is in the same group as the current statement description node,
[0019] If they belong to the same group, obtain the consistency quantity and omission situation of the comprehensive serial number text, head symbol, and tail symbol of each statement description node to determine the credibility of each statement description node, and select the statement description node that is closest to the current statement description node and has the highest credibility with the same group serial number to store at the same level. After determining the hierarchical relationship of all the statement descriptions, obtain the tree-like index structure.
[0020] Optionally, inputting the name keyword and value keyword of the preset information item to be extracted into the tree-like hierarchical structure of the statement description, so as to locate the relevant statement nodes and splice them based on the reading order to obtain the relevant paragraph content containing the information item, includes:
[0021] Take the name keyword of the preset information item to be extracted as the primary matching word, and take the value keyword of the preset information item to be extracted as the secondary matching word;
[0022] Use the primary matching word to locate all the statement description nodes in the tree-like hierarchical structure of the statement description that contain the name keyword;
[0023] Use the secondary matching words to further retrieve all the statement nodes containing the name keywords. If the child nodes under the statement nodes corresponding to the name keywords do not contain the secondary matching words, it means that the corresponding information values are not included in the text segments under the statement nodes corresponding to the name keywords, and they need to be removed. Otherwise, retain the child nodes under the statement nodes corresponding to the name keywords and their parent nodes containing the primary matching words, and splice them based on the reading order to obtain the relevant text segments containing the information items.
[0024] Optionally, based on the preset matching rules, parse and extract the relevant text segments containing the information items according to the credibility to obtain the final information result, including:
[0025] Use the credibility evaluation method to evaluate the relevant text segments containing the information items to obtain the credibility of each text segment;
[0026] Parse and extract the relevant text segments containing the information items according to the credibility of each text segment to obtain the first information result and its credibility;
[0027] Construct a first prompt word framework including the task background, information description, output format, and Q&A examples based on the relevant text segments containing the information items;
[0028] Input the first prompt word framework into the preset large language model to obtain multiple model answers;
[0029] Parse the multiple model answers based on the rule matching method to obtain the second information result;
[0030] Compare the credibility of the first information result with the preset credibility threshold. If the credibility of the first information result is greater than or equal to the preset credibility threshold, use the first information result as the final information result. Otherwise, construct a second prompt word framework including the task background, information description, the first information result, and the second information result, and input the second prompt word framework into the preset large language model to obtain the first probability of generating the first information result and the second probability of the second information result. Compare the first probability with the second probability. If the first probability is greater than the second probability, use the first information result as the final information result. Otherwise, use the second information result as the final information result.
[0031] In a second aspect embodiment of the present invention, there is provided an explanatory drawing information extraction device, including: a data extraction module, configured to perform text recognition or text extraction on a target explanatory drawing to obtain a single-line text result list data; a content extraction module, configured to traverse the single-line text result list data to extract the content of each single-line text serial number; a verification module, configured to verify the content of each single-line text serial number by using a preset large language model to retain the content of multiple single-line text serial numbers with serial number results; a statement division module, configured to determine whether to use the content of each single-line text serial number with a serial number result or the preset large language model to divide the single-line text result list data according to the proportion of the number of single-line texts with serial number results in the single-line text result list data, to obtain an explanatory statement result list; a generation module, configured to traverse the explanatory statement result list to determine the hierarchical relationship of all explanatory statements to generate an explanatory statement tree-like hierarchical structure; a paragraph positioning and splicing module, configured to input the name keyword and value keyword of a preset information item to be extracted into the explanatory statement tree-like hierarchical structure to locate relevant statement nodes and splice them based on the reading order to obtain relevant paragraph content containing the information item; an analysis and extraction module, configured to analyze and extract the relevant paragraph content containing the information item based on the preset large language model and credibility evaluation method to obtain a final information result.
[0032] In a third aspect embodiment of the present invention, there is provided an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the program to implement the explanatory drawing information extraction method as described in the above embodiment.
[0033] In a fourth aspect embodiment of the present invention, there is provided a computer program product, where when the computer program / instructions are executed by a processor, the above-mentioned explanatory drawing information extraction method is implemented.
[0034] In a fifth aspect embodiment of the present invention, there is provided a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the program is executed by a processor, the above-mentioned explanatory drawing information extraction method is implemented.
[0035] The method, device, equipment and medium for extracting explanatory drawing information according to the embodiments of the present invention solve the problems that since the number of text paragraphs in explanatory drawings is large and the length is long, if all are written into the prompt words of the large language model at one time, the inference efficiency of the model and the extraction accuracy of key details will be reduced; if written into the prompt words paragraph by paragraph and asked in turn, the information extraction efficiency will be affected; solve the problem that explanatory drawings do not have a fixed document template and design standard, the expression methods of each paragraph are diverse and the content length is uncertain, and it is difficult to divide the paragraph titles and chapter contents according to the number of text characters or preset rules; solve the problem that explanatory drawings are developed paragraph by paragraph and item by item in a "general - part" form, and the linear block - by - block method for text content will destroy the logical hierarchical relationship between paragraphs and affect the semantic integrity and context correlation of each text block; solve the problem that explanatory drawings are manually drawn, there are abnormal situations such as repeated and discontinuous statement numbers, and the recognition results of some serial number symbols are missing and incorrect, which will also affect the hierarchical division effect based on rules; solve the problem that the rule - based extraction and judgment methods cannot understand the text semantics and are prone to mis - matching phenomena, while the content generated by the large language model has a certain randomness and may produce incorrect answers.
[0036] Additional aspects and advantages of the present invention will be given in part in the following description, become apparent in part from the following description, or be understood through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The above - mentioned and / or additional aspects and advantages of the present invention will become apparent and be easily understood from the following description of the embodiments in conjunction with the drawings, where:
[0038] Figure 1 is an example diagram for explaining drawing text;
[0039] Figure 2 is an example diagram of a document structure with a hierarchical structure for titles;
[0040] Figure 3 is a flowchart of a method for extracting explanatory drawing information provided by an embodiment of the present invention;
[0041] Figure 4 is an example schematic diagram of the result of dividing explanatory statements provided by an embodiment of the present invention, where (a) is a schematic diagram of the original explanatory drawing content (partial), (b) is a schematic diagram of the corresponding single - line text list data (partial), and (c) is a schematic diagram of the divided explanatory statement data (partial);
[0042] Figure 5 is an example diagram of a tree - like hierarchical result provided by an embodiment of the present invention;
[0043] Figure 6A block diagram of an illustrative drawing information extraction device provided by an embodiment of the present invention;
[0044] Figure 7 A structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners
[0045] The embodiments of the present invention will be described in detail below. The examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to explain the present invention, but should not be construed as limiting the present invention.
[0046] The illustrative drawing information extraction method, device, equipment and medium of the embodiments of the present invention will be described below with reference to the accompanying drawings.
[0047] Figure 3 A flowchart of an illustrative drawing information extraction method provided by an embodiment of the present invention.
[0048] As Figure 3 shown, the illustrative drawing information extraction method includes the following steps:
[0049] In step S301, text recognition or text extraction is performed on the target illustrative drawing to obtain a single-line text result list data.
[0050] In the actual execution process, as Figure 4 shown, an existing OCR model or text parsing tool is used to process the illustrative drawing of the construction project, and the position coordinates and text content of each single-line text can be obtained. Among them, the id of each explanatory statement in the text content is its reading order number in the whole text, starting from 0 and increasing incrementally, text is the text content, which is obtained by connecting the single-line text content it contains in the reading order, serial is the serial number content, where pre_ch, serial_text, and post_ch respectively represent the head symbol, serial number text, and tail symbol that make up the serial number content.
[0051] Specifically, the PaddleOCR model is used to perform text recognition on the target illustrative drawing or the pythonpdf-plumber library function is used to perform text extraction on the target illustrative drawing to obtain the recognition and extraction result; the overlapping text bounding boxes in the recognition and extraction result are merged to obtain the single-line text result list data, where the single-line text result list data includes the text content and text box position coordinates of all single-line texts.
[0052] In step S302, the single-line text result list data is traversed to extract the serial number content of each single-line text.
[0053] In step S303, a preset large language model is used to verify the content of each single-line text serial number to retain the content of multiple single-line text serial numbers with serial number results.
[0054] In the actual execution process, the serial number content at the beginning of each single-line text is matched and extracted from the single-line text result list data according to the preset rules, and then the preset large language model is used to judge whether the serial number content at the beginning of each single-line text is the serial number content of the corresponding single-line text. If so, the serial number content result verified and determined by the large model is retained; otherwise, it is considered that there is no serial number result for this single-line text. Finally, the content of multiple single-line text serial numbers with serial number results is obtained.
[0055] In step S304, according to the proportion of the number of single-line texts with serial number results in the single-line text result list data, it is determined whether to use the serial number content of each single-line text with serial number results or the preset large language model to divide the single-line text result list data into statements to obtain a list of statement results.
[0056] In the actual execution process, it is judged whether the whole content has a clear chapter structure according to the proportion of single-line texts with serial numbers, so as to determine the division method. If the proportion is higher than the preset threshold, the starting position of the single-line text with serial number content is used as the starting point of the division range of each statement; otherwise, the large language model is used to judge whether the beginning and end of each single-line text need the information of the previous or next text to complete the semantic meaning, and the position that does not need to complete the semantic meaning is used as the starting point of the division range of each statement.
[0057] Specifically, calculate the proportion of the number of single-line texts with serial number results in the single-line text result list data. If the proportion is higher than the preset proportion threshold, the serial number content of each single-line text with serial number results is used as the starting point of a statement, and the serial number content of the single-line text without serial number results is added to the current statement range in turn from the starting point until a new single-line text with serial number results is traversed, which is used as the starting point of the next statement, and this process is repeated continuously to obtain a list of statement results. On the contrary, the single-line text result list data is input into the preset large language model to judge whether line breaks can be added at the beginning and end of the single-line text according to semantic integrity. Each single-line text with a line break that can be added at the beginning is used as the starting point of a statement, and the single-line text whose previous single-line text end cannot add a line break or the current beginning cannot add a line break is added to the current statement range in turn from the starting point until a single-line text that does not meet the conditions is traversed, which is used as the starting point of the next statement, and this process is repeated continuously to obtain a list of statement results.
[0058] In step S305, traverse the list of statement description results to determine the hierarchical relationships of all statement descriptions, so as to generate a tree-like hierarchical structure of statement descriptions.
[0059] In some embodiments, traversing the list of statement description results to determine the hierarchical relationships of all statement descriptions, so as to generate a tree-like hierarchical structure of statement descriptions, includes:
[0060] Set a virtual root node;
[0061] Traverse the list of statement description results, and judge whether two statement descriptions belong to the same level according to whether the serial numbers of the two statement descriptions belong to the same group, so as to determine the hierarchical relationships of all statement descriptions and generate a tree-like index structure.
[0062] In some embodiments, traversing the list of statement description results, and judge whether two statement descriptions belong to the same level according to whether the serial numbers of the two statement descriptions belong to the same group, so as to determine the hierarchical relationships of all statement descriptions and generate a tree-like index structure, includes:
[0063] Traverse the list of statement description results. Each time, based on the serial number content of the current statement description, locate the node in the previously traversed statement descriptions that is in the same group as the serial number of the current statement description. If a node in the same group is found, store the current statement description node as the next sibling node of the current statement description node; otherwise, store the current statement description node as the child node of the previous statement description node, and recursively find the parent node of each statement description node until the virtual root node;
[0064] Judge whether the serial number of each statement description node belongs to the same group as the current statement description node,
[0065] If they belong to the same group, obtain the consistency quantity and the error and omission situation of the comprehensive serial number text, the head symbol, and the tail symbol of each statement description node to determine the credibility of each statement description node, and select the statement description node that is closest to the current statement description node and has the highest credibility with the same-group serial number as the same level for storage. After determining the hierarchical relationships of all statement descriptions, a tree-like index structure is obtained.
[0066] In the actual execution process, traverse the list of statement description results, and judge whether two statement descriptions belong to the same level according to whether the serial numbers of the two statement descriptions belong to the same group, and then obtain the hierarchical relationships of all statement descriptions and store them as a tree-like index structure.
[0067] Specifically, such as Figure 5As shown in the figure, an embodiment of the present invention designs a method for storing tree - like hierarchical results correspondingly. Specifically, a virtual root node with an id of - 1 is defined, and two dictionaries, father_dict and children_dict, are maintained. In father_dict, the key of each data item is the id of each statement node, and the value is the id of its corresponding parent node. In children_dict, the key of each data item is the id of each statement node, and the value is a list of ids of its corresponding child nodes arranged in the reading order. If there are no child nodes, it is empty.
[0068] Traverse the statement result list. Each time, based on the serial number content of the current statement, locate the node in the previously traversed statements that is in the same group as the current statement's serial number. If a node in the same group is found, store the current statement node as the next sibling node of this node. If no node in the same group is found, store the current statement as a child node of the previous statement. When judging whether the serial numbers are in the same group, the embodiment of the present invention determines the credibility by comprehensively considering the consistency quantity of the serial number text, the head symbol, and the tail symbol, as well as common mistakes and omissions. During the process of locating nodes in the same group, the node that is closest to the current statement and has the highest credibility of being in the same group in terms of serial numbers is preferentially selected to accommodate errors and omissions in the serial numbers.
[0069] In step S306, input the name keyword and value keyword of the preset information item to be extracted into the statement tree - like hierarchical structure to locate the relevant statement nodes and splice them based on the reading order to obtain the relevant paragraph content containing the information item.
[0070] During the actual execution process, according to the name, object, and value content of the information item to be extracted, adopt the method of multi - level keyword matching to locate the node that is most likely to contain the relevant information statement, and splice the node content in the reading order to obtain the positioning result of the paragraph content related to the information.
[0071] Specifically, take the name keyword of the preset information item to be extracted as the first - level matching word and the value keyword as the second - level matching word. First, based on the first - level matching word, locate all statement nodes in the tree - like hierarchical structure that contain this keyword. Then, further retrieve all statement nodes that contain the name keyword using the second - level matching word. If the child nodes under the statement node corresponding to the name keyword do not contain the second - level matching word, it means that the paragraph content under the statement node corresponding to the name keyword does not contain the corresponding information value and needs to be removed. Otherwise, retain the child nodes under the statement node corresponding to the name keyword and their parent nodes that contain the first - level matching word, and splice them based on the reading order to obtain the relevant paragraph content containing the information item.
[0072] In step S307, based on a preset large language model and a credibility evaluation method, the relevant paragraph content containing information items is parsed and extracted to obtain a final information result.
[0073] In some embodiments, based on a preset matching rule, the relevant paragraph content containing information items is parsed and extracted according to credibility to obtain a final information result, including:
[0074] Using a credibility evaluation method to evaluate the relevant paragraph content containing information items to obtain the credibility of each paragraph;
[0075] Parsing and extracting the relevant paragraph content containing information items according to the credibility of each paragraph to obtain a first information result and its credibility;
[0076] Constructing a first prompt word framework including task background, information description, output format, and Q&A examples based on the relevant paragraph content containing information items;
[0077] Inputting the first prompt word framework into a preset large language model to obtain multiple model answers;
[0078] Parsing the multiple model answers based on a rule matching method to obtain a second information result;
[0079] Comparing the credibility of the first information result with a preset credibility threshold. If the credibility of the first information result is greater than or equal to the preset credibility threshold, the first information result is used as the final information result. Otherwise, a second prompt word framework including task background, information description, the first information result, and the second information result is constructed and input into the preset large language model to obtain a first probability of generating the first information result and a second probability of the second information result. Comparing the first probability with the second probability. If the first probability is greater than the second probability, the first information result is used as the final information result. Otherwise, the second information result is used as the final information result.
[0080] In the actual execution process, with the preset information items to be extracted and the relevant paragraph content containing information items as inputs, for the global attribute information, first, based on the preset matching rule, the information is extracted in descending order of credibility, and the information result with the highest credibility is retained. In addition, for the two types of information, the embodiments of the present invention design prompt word frameworks for the corresponding information extraction tasks, input them into the large language model, and parse the answers of the model based on the rule matching method to retain the information results. Finally, for the information jointly extracted by the two methods, the consistency of the results is checked. If there are contradictory phenomena, screening is performed according to the credibility threshold. When the credibility of the result obtained by rule matching is low, the large model is used to judge the two results again to obtain the final information result.
[0081] In the information extraction part of the large model, the prompt words corresponding to the large model include the task background, information description, output format, extraction examples, and the information-related text segments obtained from the previous module. Among them, the task background part will state the input content of the task, the role the model needs to play, the operations to be performed, and the expected output; the information description part will state the meaning of the information, the value content, and the common statement methods; the output format part will stipulate that the answer is in JSON format and state the key-value requirements for each item; the extraction examples part will state one or two information-corresponding text segment examples and the expected output.
[0082] In the result judgment part of the large model, the prompt words corresponding to the large model include the task background, information description, information-related text segments, and two extraction results. Among them, the two extraction results will be used as options A and B. The end part of the prompt words is "Answer:". Then, read the probability values of A and B when the large model predicts the next token, and take the option with the higher probability as the final information result.
[0083] The following further illustrates the method for extracting explanatory drawing information proposed in the embodiments of the present invention through a specific embodiment.
[0084] Step 1: Accept the explanatory drawings of the construction project as input. After confirmation, start the analysis and extraction process;
[0085] Step 2: Use the PaddleOCR model to perform text recognition on the explanatory drawings or use the python pdf-plumber library function to extract text from the explanatory drawings to obtain the recognition and extraction results, and merge the overlapping text bounding boxes in the recognition and extraction results to obtain a single-line text result list data. Among them, the single-line text result list data contains the text content and text box position coordinates of all single-line texts;
[0086] Step 3: Based on the single-line text result list data obtained in Step 2, use the preset matching rules to traverse backward from the starting character of the single-line text, and sequentially determine whether there are header symbols, serial number texts, and tail symbols. Among them, the header symbols include check marks and left parentheses, the tail symbols include right parentheses, semicolons, commas, and periods, and the serial number texts include single capital and lowercase English letters, Chinese numerals composed of "one" to "ten", and chapter numbers composed of Arabic numerals and decimal points.
[0087] Only when the serial number text is not empty, it is judged that there is a matching result, and the single-line text content and the matching result are put into the prompt words. Use the large language model to combine semantic integrity to judge whether the matching result is the serial number of the corresponding single-line text. If so, retain the matching results of the header symbol, serial number text, and tail symbol of the single-line text, otherwise it is considered that there is no serial number result for the single-line text.
[0088] Step 4: Calculate the proportion of the single-line text serial number content with existing serial numbers obtained in Step 3 in the single-line text result list data. If the proportion is higher than the threshold of 1 / 3, execute Step 4.1 to divide the explanatory statements according to the serial number results; otherwise, execute Step 4.2 to use the large language model to divide the explanatory statements according to semantics. After execution, concatenate the text contents of all single-line texts within the scope of each explanatory statement as the text content of the explanatory statement, and use the serial number result of the first single-line text within its scope as the serial number result of the explanatory statement.
[0089] Step 4.1: Based on the single-line text serial number content of multiple single-line texts with existing serial numbers obtained in Step 3, use the single-line text serial number content of each single-line text with an existing serial number as the starting point of an explanatory statement. Starting from the starting point, sequentially add the single-line text serial number content without an existing serial number to the scope of this explanatory statement until a new single-line text with an existing serial number is traversed, which serves as the starting point of the next explanatory statement. Repeat this process to obtain a list of explanatory statement results.
[0090] Step 4.2: Batch input the single-line text result list data into the large language model, and require the model to judge whether line breaks can be added at the beginning and end of the single-line text based on semantic integrity. Based on the obtained result list, use each single-line text whose beginning can add a line break as the starting point of an explanatory statement. Starting from the starting point, sequentially add the single-line text whose previous single-line text end cannot add a line break or whose current beginning cannot add a line break to the scope of this explanatory statement until a single-line text that does not meet the conditions is traversed, which serves as the starting point of the next explanatory statement. Repeat this process to obtain a list of explanatory statement results.
[0091] Step 5: Set a virtual root node, and traverse the list of explanatory statement results obtained in Step 4 from front to back. Denote the current explanatory statement as A. If A does not have a serial number result, judge based on the serial number result of the previous explanatory statement B: If B does not have a serial number result, store A and B at the same level; otherwise, store A as a child node of B. If A has a serial number result, start from the previous explanatory statement B and recursively find the parent node of each node until the root node. Then, judge whether the serial numbers of each node belong to the same group as the serial number of A according to the method in Step 5.1 in turn: If there is an explanatory statement node whose serial number is in the same group as the serial number of A during the search process, select the node C with the highest credibility and the closest distance, and store A and C at the same level; otherwise, store A as a child node of B. After the traversal is completed, obtain the hierarchical tree structure of the explanatory statements.
[0092] Step 5.1, obtain the serial number results a and b of two explanatory statements. Each serial number result contains a head symbol, serial number text, and tail symbol. If the types of the serial number texts are inconsistent, it is judged as not in the same group; otherwise, compare whether the head symbols and tail symbols of a and b are exactly the same. If they are the same, it is judged as in the same group, and the confidence level is recorded as the maximum value of 1.0. If they are not the same, check whether there are preset missed recognition and misrecognition situations, and at the same time judge whether the size order of the serial number texts is consistent with the front-back order of the statements. If both meet the requirements, it is also judged as in the same group, and the confidence level value is 0.5; otherwise, it is judged as not in the same group.
[0093] Step 6, based on the tree-like hierarchical structure of the explanatory statements obtained in Step 5, use the name keywords of the preset information items as the first-level matching words and the value keywords as the second-level matching words. Traverse each explanatory statement node according to the methods in Steps 6.1 - 6.2 to obtain the relevant text segments. Taking the statement of wall materials as an example, the list of first-level keyword candidates to be matched includes "wall materials", "wall materials used", "wall projects", etc., and the list of second-level keyword candidates includes "brick", "block", "autoclaved", "aerated", "concrete", etc.
[0094] Step 6.1, starting from the virtual root node, traverse each node in a depth-first search manner. For the current node A, first use the first-level matching words to match the content in A. If there is no matching result, continue to match all the child nodes of A. If there is a matching result, mark A, and then use the second-level matching words to match each node one by one starting from node A downwards.
[0095] Step 6.2, after the traversal is completed, if there is no first-level keyword matching result, the relevant text segment return result is empty; if there is a first-level keyword matching result but no second-level keyword matching result, splice and return the content of all explanatory statement nodes containing the first-level keyword matching and their sub-nodes in the reading order; otherwise, if there is a second-level keyword matching result, for the explanatory statement nodes whose sub-node content contains the second-level keyword and whose own content contains the first-level keyword, splice its own and all its sub-node content in the reading order to obtain all explanatory statement nodes containing the name keyword.
[0096] Step 7, based on the preset matching rule list of the project overview information items and all the explanatory statement nodes containing the name keyword in Step 6, parse and extract the corresponding information in the text segment in descending order of confidence level. When there is an analysis result for a certain rule, return the first extraction result and the corresponding confidence level.
[0097] Taking the extraction of the building floor number information as an example, the confidence levels of the corresponding matching rule list from high to low are as follows:
[0098] (1) Match keywords such as "building floors" or "floors" in the positioning paragraph, and within 10 characters after the keyword, match and extract the descriptions of "xx floors above ground", "xx floors underground", or "xx floors" and extract the numbers, with a result credibility of 1.0;
[0099] (2) Match the descriptions of "xx floors above ground" and "xx floors underground" in the paragraph and extract the numbers, with a result credibility of 0.8;
[0100] (3) Match all descriptions of "xx floors" in the paragraph and extract the numbers, taking the maximum value of the extraction results, with a result credibility of 0.4.
[0101] Step 8, based on the preset project overview and engineering practice information items, use all the description statement nodes containing name keywords in Step 6 to construct a prompt word framework including task background, information description, output format, and Q&A examples, input it into the large language model, and parse the answers of the model based on the rule matching method to obtain the second extraction result.
[0102] Taking the extraction of wall materials as an example, the prompt word framework consists of the following four parts:
[0103] (1) Task background: "You are a reviewer of the design content of a construction project. I will provide you with a paragraph about the engineering practice of the wall. The paragraph may describe the types of materials used for the wall part. Please judge and extract the non-load-bearing wall materials for each part and return them directly in json format."
[0104] (2) Information description: "The non-load-bearing wall parts may include above-ground and underground parts. Each part can be further divided into exterior walls and interior walls. There may also be partitions for some special rooms in the interior walls, such as water rooms, humid environments, etc. in kitchens, bathrooms, equipment rooms, etc. It depends on the specific content mentioned in the paragraph. Load-bearing walls made of reinforced concrete should be ignored. The material name refers to bricks, blocks, gypsum boards, etc. that include specific materials, specifications, and practices. If there are multiple materials in a certain part, they should all be recorded."
[0105] (3) Output format: "The keys of the returned answer json are generally divided into three items: 'exterior wall', 'interior wall', and'special part wall'. The values corresponding to the exterior wall and interior wall parts are of dict type, and their keys are divided into 'above ground' and 'underground', and the values are string types of complete material names; the value corresponding to the special part wall part is also of dict type, and its key is the room name or type mentioned, and the value is also a string type of complete material name."
[0106] (4) Q&A example: "Paragraph content: xxx; Extraction result: xxx".
[0107] Step 9: For the preset engineering practice information items, adopt the second information result in Step 8; for the preset project overview information items, check the first information result in Step 7 and the second information result in Step 8. If there is a contradiction, if the credibility of the first information result in Step 7 is greater than or equal to the threshold of 0.8, then use the first information result in Step 7 as the final information result; otherwise, construct a prompt word framework including the task background, information description, the first information result in Step 7, and the second information result in Step 8, set the two information results as Option A and Option B respectively, input them into the large language model again, obtain the probabilities of A and B when the large model generates option tokens, and use the result represented by the option with the higher probability as the final information result.
[0108] In summary, the method for extracting explanatory drawing information proposed in the embodiments of the present invention has the following beneficial effects:
[0109] (1) For the long text paragraph content of the explanatory drawing, a method for detecting text serial numbers and dividing explanatory statements based on matching rules and large language models is designed, and the single-line texts extracted or recognized are spliced into explanatory statements with complete semantics, which is convenient for subsequent retrieval and analysis;
[0110] (2) For the global hierarchical structure of the explanatory drawing content, a method for constructing a tree-like hierarchy based on rule credibility evaluation is designed, which is compatible with errors or omissions in the drawing drawing and recognition processes, and a multi-level matching strategy for information names and value keywords is designed based on the tree-like hierarchy result, so as to more centrally and accurately locate relevant information paragraphs;
[0111] (3) For the instability of the extraction results of the large language model, a method for extracting information based on rule credibility evaluation and large language models is designed to verify the extraction results of the large model, and when the rule credibility is low, the large model is used for comprehensive judgment to obtain as accurate results as possible.
[0112] Next, an explanatory drawing information extraction device according to an embodiment of the present invention will be described with reference to the accompanying drawings.
[0113] Figure 6 It is a block diagram of an explanatory drawing information extraction device according to an embodiment of the present invention.
[0114] As Figure 6 shown, the explanatory drawing information extraction device 60 includes: a data extraction module 601, a content extraction module 602, a verification module 603, a statement division module 604, a construction module 605, a paragraph positioning and splicing module 606, and an analysis and extraction module 607.
[0115] Among them, the data extraction module 601 is used to perform text recognition or text extraction on the target specification - type drawings to obtain a single - line text result list data. The content extraction module 602 is used to traverse the single - line text result list data to extract the content of each single - line text serial number. The verification module 603 is used to verify the content of each single - line text serial number using a preset large - language model to retain the content of the single - line text serial numbers with multiple serial number results. The statement division module 604 is used to determine whether to use the content of each single - line text serial number with a serial number result or the preset large - language model to divide the single - line text result list data into statements according to the proportion of the number of single - line texts with serial number results in the single - line text result list data, obtaining a statement result list. The generation module 605 is used to traverse the statement result list to determine the hierarchical relationship of all statements to generate a statement tree - like hierarchical structure. The paragraph positioning and splicing module 606 is used to input the name keywords and value keywords of the preset information items to be extracted into the statement tree - like hierarchical structure to locate the relevant statement nodes and splice them based on the reading order to obtain the relevant paragraph content containing the information items. The parsing and extraction module 607 is used to parse and extract the relevant paragraph content containing the information items based on the preset large - language model and the credibility evaluation method to obtain the final information result.
[0116] In some embodiments, the statement division module 604 includes:
[0117] Solve the proportion of the content of the single - line text serial numbers with multiple serial number results in the single - line text result list data. If the proportion is higher than the preset proportion threshold, use the content of each single - line text serial number with a serial number result as the starting point of a statement. Starting from the starting point, sequentially add the content of the single - line text serial numbers without serial number results within the current statement range until a new single - line text with a serial number result is traversed, which is used as the starting point of the next statement, and continue to repeat this process to obtain the statement result list. Otherwise, input the single - line text result list data into the preset large - language model to judge whether line breaks can be added at the beginning and end of the single - line text according to semantic integrity. Use each single - line text with a line break that can be added at the beginning as the starting point of a statement. Starting from the starting point, sequentially add the single - line text whose previous single - line text end cannot add a line break or the current starting point cannot add a line break within the current statement range until a single - line text that does not meet the conditions is traversed, which is used as the starting point of the next statement, and continue to repeat this process to obtain the statement result list.
[0118] In some embodiments, the generation module 605 includes:
[0119] A setting unit for setting a virtual root node;
[0120] A judgment unit is configured to traverse the list of statement results, determine whether two statements belong to the same level by judging whether the serial numbers of the two statements belong to the same group, so as to determine the hierarchical relationship of all statements and generate a tree-like index structure.
[0121] In some embodiments, the judgment unit includes:
[0122] Traverse the list of statement results. Each time, based on the serial number content of the current statement, locate the node in the previously traversed statements that is in the same group as the serial number of the current statement. If a node in the same group is found, store the current statement node as the next sibling node of the current statement node; otherwise, store the current statement node as the child node of the previous statement node, and recursively find the parent node of each statement node until the virtual root node.
[0123] Judge whether the serial number of each statement node belongs to the same group as the current statement node.
[0124] If they belong to the same group, obtain the consistency quantity and the omission situation of the comprehensive serial number text, the head symbol, and the tail symbol of each statement node to determine the credibility of each statement node, and select the statement node that is closest to the current statement node and has the highest credibility with the same group serial number as the same level for storage, and finally obtain a tree-like index structure.
[0125] In some embodiments, the paragraph positioning and splicing module 606 includes:
[0126] A setting unit is configured to use the name keywords of the preset information items to be extracted as the primary matching words, and use the value keywords of the preset information items to be extracted as the secondary matching words.
[0127] A positioning unit is configured to use the primary matching words to locate all statement nodes containing the name keywords in the tree-like hierarchical structure of statements.
[0128] A splicing unit is configured to further retrieve all statement nodes containing the name keywords by using the secondary matching words. If the child nodes under the statement node corresponding to the name keyword do not contain the secondary matching words, it means that the paragraph content under the statement node corresponding to the name keyword does not contain the corresponding information value, and removal is required; otherwise, retain the child nodes under the statement node corresponding to the name keyword and their parent nodes containing the primary matching words, and splice them based on the reading order to obtain the relevant paragraph content containing the information items.
[0129] In some embodiments, the parsing and extraction module 607 includes:
[0130] An evaluation unit is configured to evaluate the relevant paragraph content containing the information items by using a credibility evaluation method to obtain the credibility of each paragraph.
[0131] An extraction unit for parsing and extracting relevant passage content containing information items according to the credibility of each passage to obtain a first information result and its credibility;
[0132] A second construction unit for constructing a first prompt word framework including a task background, information description, output format, and Q&A example according to the relevant passage content containing information items;
[0133] An answering unit for inputting the first prompt word framework into a preset large language model to obtain multiple model answers;
[0134] An analysis unit for analyzing multiple model answers based on a rule matching method to obtain a second information result;
[0135] An information extraction unit for comparing the credibility of the first information result with a preset credibility threshold. If the credibility of the first information result is greater than or equal to the preset credibility threshold, the first information result is used as the final information result. Otherwise, a second prompt word framework including a task background, information description, the first information result, and the second information result is constructed and input into the preset large language model to obtain a first probability of generating the first information result and a second probability of the second information result. The first probability is compared with the second probability. If the first probability is greater than the second probability, the first information result is used as the final information result. Otherwise, the second information result is used as the final information result.
[0136] It should be noted that the foregoing explanation of the embodiment of the method for extracting explanatory drawing information also applies to the device for extracting explanatory drawing information of this embodiment, and will not be elaborated here.
[0137] The device for extracting explanatory drawing information according to the embodiment of the present invention has the following beneficial effects:
[0138] (1) For the long text passage content of the explanatory drawing, a method for detecting text serial numbers and dividing explanatory statements based on matching rules and a large language model is designed, and the single-line texts extracted or recognized are spliced into explanatory statements with complete semantics, which is convenient for subsequent retrieval and analysis;
[0139] (2) For the global hierarchical structure of the explanatory drawing content, a tree-like hierarchical construction method based on rule credibility evaluation is designed, which is compatible with errors or omissions in the drawing drawing and recognition processes, and a multi-level matching strategy for information names and value keywords is designed based on the tree-like hierarchical result, which can complete the positioning of relevant information passages more centrally and accurately;
[0140] (3) In view of the instability of the extraction results of large language models, an information extraction method based on rule credibility evaluation and large language models is designed to verify the extraction results of large models. When the rule credibility is low, the large model is used for comprehensive judgment to obtain as accurate results as possible.
[0141] Figure 7 The following is a schematic structural diagram of the electronic device provided by the embodiment of the present invention. The electronic device may include:
[0142] A memory 701, a processor 702, and a computer program stored on the memory 701 and executable on the processor 702.
[0143] When the processor 702 executes the program, it implements the description class drawing information extraction method provided in the above embodiment.
[0144] Further, the electronic device further includes:
[0145] A communication interface 703 for communication between the memory 701 and the processor 702.
[0146] The memory 701 is used to store a computer program executable on the processor 702.
[0147] The memory 701 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.
[0148] If the memory 701, the processor 702, and the communication interface 703 are implemented independently, the communication interface 703, the memory 701, and the processor 702 may be interconnected through a bus and communicate with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
[0149] Optionally, in specific implementation, if the memory 701, the processor 702, and the communication interface 703 are integrated on a chip, the memory 701, the processor 702, and the communication interface 703 may communicate with each other through an internal interface.
[0150] The processor 702 may be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0151] The embodiments of the present invention also provide a computer program product, and when the computer program / instructions are executed by a processor, the method for extracting the explanatory drawing information as described above is implemented.
[0152] The embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method for extracting the explanatory drawing information as described above is implemented.
[0153] In the description of this specification, the descriptions with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0154] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "N" is at least two, such as two, three, etc., unless otherwise specifically defined.
[0155] Any process or method description shown in the flowchart or described in other ways herein may be understood to represent a module, segment, or part of code including one or N executable instructions for implementing a customized logic function or process, and the scope of the preferred embodiments of the present invention includes additional implementations, where the functions may be executed in a substantially simultaneous manner or in a reverse order according to the involved functions, rather than in the order shown or discussed, which should be understood by those skilled in the art to which the embodiments of the present invention pertain.
[0156] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definitional sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or used in conjunction with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion (electronic device) having one or N wirings, a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically by optically scanning the paper or other media, followed by editing, interpretation, or otherwise processing as appropriate, and then stored in a computer memory.
[0157] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiments, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
[0158] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried by the method of the above embodiments can be completed by a program instructing relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.
[0159] In addition, in each embodiment of the present invention, each functional unit can be integrated into a processing module, or each unit can exist physically alone, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0160] The above-mentioned storage medium can be a read-only memory, a magnetic disk or an optical disc, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for extracting explanatory drawing information, characterized in that, Including the following steps: Perform text recognition or text extraction on the target specification - type drawings to obtain a list of single - line text result data; Traverse the list of single - line text result data to extract the content of each single - line text serial number; Use a preset large - language model to verify the content of each single - line text serial number to retain the content of multiple single - line text serial numbers with serial number results; Determine whether to use the content of each single - line text serial number with a serial number result or the preset large - language model to perform sentence division on the list of single - line text result data according to the proportion of the number of single - line texts with serial number results in the list of single - line text result data, and obtain a list of description sentence results; Traverse the list of description sentence results to determine the hierarchical relationship of all description sentences to generate a tree - like hierarchical structure of description sentences; Input the name keywords and value keywords of the preset information items to be extracted into the tree - like hierarchical structure of description sentences to locate relevant sentence nodes and splice them based on the reading order to obtain relevant paragraph content containing information items; Based on the preset large - language model and credibility evaluation method, parse and extract the relevant paragraph content containing information items to obtain the final information result.
2. The method for extracting explanatory drawing information according to claim 1, wherein The step of determining whether to use the content of each single - line text serial number with a serial number result or the preset large - language model to perform sentence division on the list of single - line text result data according to the proportion of the number of single - line texts with serial number results in the list of single - line text result data, and obtaining a list of description sentence results includes: Calculate the proportion of the number of single - line texts with serial number results in the list of single - line text result data. If the proportion is higher than the preset proportion threshold, use the content of each single - line text serial number with a serial number result as the starting point of a description sentence, and sequentially add the content of single - line texts without serial number results after the starting point to the current description sentence range until a new single - line text with a serial number result is traversed, which is used as the starting point of the next description sentence, and continue to repeat the current process to obtain the list of description sentence results. Otherwise, input the list of single - line text result data into the preset large - language model to determine whether line breaks can be added at the beginning and end of a single - line text according to semantic integrity. Use each single - line text with a line break that can be added at the beginning as the starting point of a description sentence, and sequentially add the single - line text whose previous single - line text end cannot add a line break or the current beginning cannot add a line break to the current description sentence range until a single - line text that does not meet the condition is traversed, which is used as the starting point of the next description sentence, and continue to repeat the current process to obtain the list of description sentence results.
3. The method for extracting explanatory drawing information according to claim 1, wherein The step of traversing the list of description sentence results to determine the hierarchical relationship of all description sentences to generate a tree - like hierarchical structure of description sentences includes: Set a virtual root node; Traverse the list of description sentence results, and determine whether two description sentences belong to the same level by judging whether the serial numbers of the two description sentences belong to the same group to determine the hierarchical relationship of all description sentences, so as to generate the tree - like index structure.
4. The method for extracting explanatory drawing information according to claim 3, characterized in that Traversing the result list of the description statements, and determining whether two description statements belong to the same level according to whether the serial numbers of the two description statements belong to the same group, so as to determine the hierarchical relationship of all the description statements, and generate the tree-like index structure, including: Traversing the result list of the description statements, and each time based on the serial number content of the current description statement, locating the node in the previously traversed description statements that is in the same group as the serial number of the current description statement. If a node in the same group is found, the current description statement node is stored as the next sibling node of the current description statement node. Otherwise, the current description statement node is stored as the child node of the previous description statement node, and recursively searching for the parent node of each description statement node until the virtual root node; Judging whether the serial number of each description statement node belongs to the same group as the current description statement node. If it belongs to the same group, obtaining the consistency quantity and the error and omission situation of the comprehensive serial number text, the head symbol, and the tail symbol of each description statement node, so as to determine the credibility of each description statement node, and selecting the description statement node that is closest to the current description statement node and has the highest credibility with the same-group serial number as the same-level storage. After determining the hierarchical relationship of all the description statements, the tree-like index structure is obtained.
5. The method for extracting explanatory drawing information according to claim 1, wherein Inputting the name keyword and the value keyword of the preset information item to be extracted into the tree-like hierarchical structure of the description statements, so as to locate the relevant statement nodes and splice them based on the reading order, and obtain the relevant paragraph content containing the information item, including: Taking the name keyword of the preset information item to be extracted as the first-level matching word, and taking the value keyword of the preset information item to be extracted as the second-level matching word; Using the first-level matching word to locate all the description statement nodes in the tree-like hierarchical structure of the description statements that contain the name keyword; Using the second-level matching word to further retrieve all the description statement nodes that contain the name keyword. If the child nodes under the description statement node corresponding to the name keyword do not contain the second-level matching word, it means that the paragraph content under the description statement node corresponding to the name keyword does not contain the corresponding information value, and it needs to be removed. Otherwise, retaining the child nodes under the description statement node corresponding to the name keyword and their parent nodes containing the first-level matching word, and splicing them based on the reading order, and obtaining the relevant paragraph content containing the information item.
6. The method for extracting explanatory drawing information according to claim 1, characterized in that, Based on the preset matching rule, parsing and extracting the relevant paragraph content containing the information item according to the credibility, so as to obtain the final information result, including: Using the credibility evaluation method to evaluate the relevant paragraph content containing the information item, and obtaining the credibility of each paragraph; Parsing and extracting the relevant paragraph content containing the information item according to the credibility of each paragraph, and obtaining the first information result and its credibility; Constructing a first prompt word framework including the task background, information description, output format, and Q&A example according to the relevant paragraph content containing the information item; Inputting the first prompt word framework into the preset large language model to obtain multiple model answers; Parsing the multiple model answers based on the rule matching method to obtain the second information result; Compare the credibility of the first information result with the preset credibility threshold. If the credibility of the first information result is greater than or equal to the preset credibility threshold, then use the first information result as the final information result. Otherwise, construct a second prompt word framework that includes the task background, information description, the first information result, and the second information result, and input the second prompt word framework into the preset large language model to obtain the first probability of generating the first information result and the second probability of the second information result. Compare the first probability with the second probability. If the first probability is greater than the second probability, then use the first information result as the final information result. Otherwise, use the second information result as the final information result.
7. An illustrative drawing information extraction device, characterized in that, Including: A data extraction module for performing text recognition or text extraction on the target specification - type drawings to obtain a list of single - line text result data; A content extraction module for traversing the list of single - line text result data to extract the content of each single - line text serial number; A verification module for using a preset large language model to verify the content of each single - line text serial number to retain the content of single - line text serial numbers with multiple serial number results; A statement division module for determining whether to use the content of each single - line text serial number with a serial number result or the preset large language model to divide the list of single - line text result data according to the proportion of the number of single - line texts with serial number results in the list of single - line text result data, and obtaining a list of description statement results; A generation module for traversing the list of description statement results to determine the hierarchical relationship of all description statements to generate a tree - like hierarchical structure of description statements; A paragraph location and splicing module for inputting the name keyword and value keyword of a preset information item to be extracted into the tree - like hierarchical structure of description statements to locate relevant statement nodes and splice them based on the reading order to obtain relevant paragraph content containing the information item; An analysis and extraction module for analyzing and extracting the relevant paragraph content containing the information item based on the preset large language model and credibility evaluation method to obtain the final information result.
8. An electronic device, characterized in that, Including: A memory, a processor, and a computer program stored on the memory and executable on the processor. The processor executes the program to implement the method for extracting information from specification - type drawings according to any one of claims 1 - 6.
9. A computer program product, characterized in that, When the computer program / instructions are executed by the processor, they implement the method for extracting information from specification - type drawings based on a large language model and rule credibility evaluation according to any one of claims 1 - 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to be used to implement the method for extracting information from specification - type drawings according to any one of claims 1 - 6.