Engineering cost data identification method and device and data identification system

By obtaining the engineering cost dictionary and building entity and relationship triplets, and generating a knowledge graph, the problem of automatic extraction and management of engineering cost data is solved, and the structured data management and query analysis are realized.

CN118569212APending Publication Date: 2024-08-30ZHANJIANG POWER SUPPLY BUREAU OF GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410731963.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In the prior art, engineering cost data contains a large number of different data formats, which are difficult to automatically extract and manage.

Method used

By obtaining the engineering cost dictionary, extracting and converting data from the project settlement slip or quantity visa form, building entity and relationship triples, and generating knowledge graphs for structured management.

Benefits of technology

It realizes automatic extraction and processing of unstructured text and tabular data, builds a knowledge graph, facilitates data query and analysis, and solves the management problem of data format diversity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118569212A
    Figure CN118569212A
Patent Text Reader

Abstract

The invention provides an engineering cost data identification method and apparatus, and a data identification system. The method comprises the steps of determining an engineering cost dictionary according to first target data; performing data extraction on the first target data to obtain second target data, third target data and fourth target data; converting the second target data and the fourth target data through a table matching rule to obtain fifth target data, and constructing a first triple according to the fifth target data; converting the third target data through a dictionary matching rule according to the project cost dictionary to obtain sixth target data, constructing a second triple according to the sixth target data, and constructing a third triple according to the sixth target data; and generating an entity csv file and a relation csv file according to the triad, and generating a knowledge graph according to the entity csv file and the relation csv file to obtain a target file. The method solves the problem that the project cost data is difficult to automatically extract and manage in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data communication technology, and in particular to a method and device for identifying engineering cost data, a computer-readable storage medium and a data identification system. Background Art

[0002] A large amount of production cost data with rich sources and complex formats will be generated in the whole process of power grid production projects from design, construction to acceptance, including semi-structured data, such as settlement statements; unstructured text data, such as design specifications, etc. These massive tables and text data contain rich knowledge related to power grid topology, assets, and equipment. However, taking the text data generated in the production project as an example, these data are mainly used for reading by engineering-related personnel, so the text content is not formatted, which is not conducive to computer processing and understanding, greatly increasing the difficulty and cost of obtaining knowledge from these data, so a flexible and efficient data organization method is needed. Natural language processing technology can effectively realize the extraction-conversion-loading of information, and then automatically analyze unstructured text data to mine valuable knowledge from it. Knowledge graph is a structured and semantically rich knowledge representation form that organizes and represents entities, concepts, relationships and their attributes in the real world in a graph. It is a graph structure containing entity nodes and relationship edges, which is used to describe the association and semantic relationship between different entities. The combination of the two realizes the process of mining knowledge and presenting knowledge to users in a structured form.

[0003] The existing technology lacks a systematic method for extracting engineering fraud data. Summary of the invention

[0004] The main purpose of the present application is to provide a method, device, computer-readable storage medium and data recognition system for identifying construction cost data, so as to at least solve the problem in the prior art that construction cost data contains a large amount of data in different data formats and is difficult to automatically extract and manage.

[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for identifying construction cost data is provided, comprising: obtaining first target data and determining a construction cost dictionary based on the first target data, wherein the first target data includes data of at least one of a construction settlement statement or a construction quantity certification sheet, and the construction cost dictionary includes entity words in the first target data and relationship categories between the entity words; extracting data from the first target data to obtain second target data, third target data and fourth target data, wherein the second target data is data in the first target data whose corresponding format is a first preset format, the third target data is text data in the first target data, and the fourth target data is table data in the first target data; extracting the second target data The fourth target data is converted through table matching rules to obtain fifth target data, and a first triple is constructed according to the fifth target data in the form of subject, object and association relationship using a table data matching method; the third target data is converted according to the engineering cost dictionary through dictionary matching rules to obtain sixth target data, and a second triple is constructed according to the sixth target data in the form of subject, predicate and object using a regular expression, and a third triple is constructed according to the sixth target data in the form of subject, object and association relationship using a probability model; an entity csv file and a relationship csv file are generated according to the first triple, the second triple and the third triple, and a knowledge graph is generated according to the entity csv file and the relationship csv file to obtain a target file.

[0006] Optionally, data extraction is performed on the first target data according to the engineering cost dictionary to obtain second target data, third target data and fourth target data, including: determining the data in the first target data whose corresponding format is the first preset format as the second target data, and determining the data other than the second target data as the seventh target data; converting the seventh target data into the second preset format, and extracting the table data through the extract_tables function to obtain the first candidate data, converting the data in the seventh target data other than the first candidate data into the third preset format, and extracting the text data through the pytesseract function to obtain the third target data, and extracting the table data through the OpenCV function to obtain the second candidate data; determining the first candidate data and the second candidate data as the fourth target data.

[0007] Optionally, the second target data and the fourth target data are converted through table matching rules to obtain the fifth target data, including: traversing the second target data and the fourth target data through the table matching rules, and when the table headers in the second target data and the fourth target data meet the first condition, identifying the cells occupied by the table header as the main table header, and the first condition is that the table header occupies multiple columns of cells; when the row cells adjacent to the main table header are the main table headers, merging the main table headers into the same cell; traversing the second target data and the fourth target data through the table matching rules, and when the table headers in the second target data and the fourth target data meet the second condition, identifying the cells occupied by the table header as secondary table headers, and the second condition is that the cells occupied by the table header are cells nested in a single column; merging the main table header with the secondary table header content, deleting the main table header and generating multiple cells occupying multiple rows and in the same column as the secondary table header to obtain the fifth target data.

[0008] Optionally, a first triplet is constructed according to the fifth target data in the form of subject, object and association relationship using a table data matching method, including: determining cells in each column except the first row in the fifth target data as entities; matching the label value of the first row cell in each column of the fifth target data with the entity words in the engineering cost dictionary to obtain the entity category corresponding to each label value: Among them, A is the character set contained in the label value, B is the entity word in the engineering cost dictionary, R is the correlation coefficient between A and B, and when R takes the maximum value, the entity category corresponding to B is the entity category corresponding to A; according to each entity category, the engineering cost dictionary is queried to determine the relationship category of the association relationship between the entities corresponding to the cells in different columns; according to each entity and each relationship category, multiple first triples are constructed: [ZB1, GX1, KT1]; wherein ZB1 is the subject in the first triple, GX1 is the relationship category in the first triple, and KT1 is the object to which the association relationship is applied.

[0009] Optionally, the third target data is converted according to the engineering cost dictionary through a dictionary matching rule to obtain the sixth target data, including: sentence-segmenting the third target data through the Spacy library to obtain multiple eighth target data; segmenting each of the eighth target data based on the engineering cost dictionary through the HanLP library, and matching the engineering cost dictionary based on each of the segmented words, and when the frequency of occurrence of the segmented words in one of the eighth target data in the engineering cost dictionary is greater than or equal to a preset value, the eighth target data is determined as the sixth target data.

[0010] Optionally, constructing a second triple according to the sixth target data in the form of subject, predicate and object using a regular expression and constructing a third triple according to the sixth target data in the form of subject, object and association relationship using a probability model, including: matching the sixth target data based on the regular expression, acquiring price data in the sixth target data to obtain ninth target data; performing grammatical analysis on the ninth target data through an LTP model to determine a first relational dependency arc and a second relational dependency arc, the first relational dependency arc being used to characterize the relationship between the subject and the predicate in the ninth target data, and the second relational dependency arc being used to characterize the relationship between the predicate and the object in the ninth target data; determining the second triple according to the first relational dependency arc and the second relational dependency arc; and inputting the sixth target data into an LSTM probability model to obtain the third triple: Among them, M is the training set, y i is the i-th input text, O i =(z, g, k) is the text y i The triples contained in , z is O i The subject in G includes all relation categories, g∈O i |z represents g is O i A set of said associations whose subject is z, g∈G\O i |z represents not in O i The relationship in p(z|y i ) is the preset probability, is the conditional probability.

[0011] Optionally, before generating an entity csv file and a relationship csv file based on the first triple, the second triple and the third triple, the method also includes: performing data cleaning and entity disambiguation on the first triple, the second triple and the third triple, the data cleaning is used to identify and correct outliers in the first triple, the second triple and the third triple, and the entity disambiguation is used to unify different entities with the same semantics in the first triple, the second triple and the third triple.

[0012] According to another aspect of the present application, a device for identifying construction cost data is provided, the device comprising: a first acquisition unit, for acquiring first target data and determining a construction cost dictionary based on the first target data, the first target data comprising data of at least one of a construction settlement statement or a construction quantity certification sheet, the construction cost dictionary comprising entity words in the first target data and relationship categories between the entity words; a second acquisition unit, for extracting data from the first target data to obtain second target data, third target data and fourth target data, the second target data being data in the first target data whose corresponding format is a first preset format, the third target data being text data in the first target data, and the fourth target data being table data in the first target data; a first processing unit, for extracting the second target data The target data and the fourth target data are converted into fifth target data through table matching rules, and a first triple is constructed according to the fifth target data in the form of subject, object and association relationship by using table data matching method; a second processing unit is used to convert the third target data through dictionary matching rules according to the engineering cost dictionary to obtain sixth target data, and use regular expressions to construct a second triple in the form of subject, predicate and object according to the sixth target data, and use a probability model to construct a third triple according to the sixth target data in the form of subject, object and association relationship; a construction unit is used to generate an entity csv file and a relationship csv file according to the first triple, the second triple and the third triple, and generate a knowledge graph according to the entity csv file and the relationship csv file to obtain a target file.

[0013] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described.

[0014] According to another aspect of the present application, a data identification system is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of the described methods.

[0015] Applying the technical solution of the present application, in the above-mentioned method for identifying engineering cost data, first, first, obtain the first target data and determine the engineering cost dictionary based on the first target data, the above-mentioned first target data includes data of at least one of the engineering settlement statement or the engineering quantity certification form, and the above-mentioned engineering cost dictionary includes entity words in the first target data and the relationship categories between the above-mentioned entity words; then, extract the data from the above-mentioned first target data to obtain the second target data, the third target data and the fourth target data, the above-mentioned second target data is the data in the above-mentioned first target data whose corresponding format is the first preset format, the above-mentioned third target data is the text data in the above-mentioned first target data, and the above-mentioned fourth target data is the table data in the above-mentioned first target data; then, the above-mentioned second target data and the above-mentioned fourth target data are combined into a single data structure. The target data is converted by table matching rules to obtain the fifth target data, and the first triplet is constructed according to the fifth target data in the form of subject, object and association relationship by using table data matching method; then, the third target data is converted by dictionary matching rules according to the engineering cost dictionary to obtain the sixth target data, and the second triplet is constructed according to the sixth target data in the form of subject, predicate and object by using regular expressions, and the third triplet is constructed according to the sixth target data in the form of subject, object and association relationship by using probability model; finally, the entity csv file and the relationship csv file are generated according to the first triplet, the second triplet and the third triplet, and the knowledge graph is generated according to the entity csv file and the relationship csv file to obtain the target file. The present application extracts and processes the unstructured text data and the table data respectively, extracts the cost information therein and inputs it into the graph database to construct the knowledge graph for structured management, which is convenient for data query and analysis, and solves the problem that the engineering cost data in the prior art contains a large amount of data in different data formats, which is difficult to automatically extract and manage. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A hardware structure block diagram of a mobile terminal according to a method for identifying construction cost data provided in an embodiment of the present application is shown;

[0017] Figure 2 A schematic flow chart of a method for identifying construction cost data provided according to an embodiment of the present application is shown;

[0018] Figure 3 A schematic diagram of a semantic grammar analysis provided according to an embodiment of the present application is shown;

[0019] Figure 4 A schematic diagram of the structure of a probabilistic algorithm network model provided according to an embodiment of the present application is shown;

[0020] Figure 5A structural block diagram of a device for identifying construction cost data provided according to an embodiment of the present application is shown.

[0021] The above drawings include the following reference numerals:

[0022] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION

[0023] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] As introduced in the background technology, in order to solve the problem in the prior art that the engineering cost data contains a large amount of data in different data formats and is difficult to automatically extract and manage, the embodiments of the present application provide a method, device, computer-readable storage medium and data recognition system for identifying engineering cost data.

[0027] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0028] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for identifying engineering cost data according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0029] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the display method of device information in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific examples of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0030] In this embodiment, a method for identifying engineering cost data running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0031] Figure 2 FIG. 1 is a flow chart of a method for identifying engineering cost data according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:

[0032] Step S201, obtaining first target data and determining a construction cost dictionary according to the first target data, wherein the first target data includes at least one of a construction settlement statement or a construction quantity certification sheet, and the construction cost dictionary includes entity words in the first target data and relationship categories between the entity words;

[0033] Specifically, the first target data is obtained by collecting data on the entire cost process of power grid production projects such as engineering settlement statements and engineering certification sheets, and the engineering cost dictionary is obtained based on a dictionary of power grid engineering cost data involving factors affecting engineering cost estimation.

[0034] In this embodiment, the collected data on the entire process of production project cost includes investment estimation documents, bidding documents, contract documents, construction process data, completion data, and settlement data, etc. Since there are many files, including multiple file formats, mainly word, pdf, and excel, this application uses the above three formats as examples for explanation.

[0035] In this embodiment, the above-mentioned engineering cost dictionary includes 7 types of entities, namely, single project, engineering characteristics, installation address, equipment name, purchase price, asset details and materials, wherein each type can be further refined, including but not limited to the following examples: For example, the equipment name can include transformers, disconnectors, generators, circuit breakers and insulators. In addition, the above-mentioned engineering cost dictionary also includes 7 types of associations, namely, the nature of the project, the installation address of the project, the equipment used in the project, the asset details of the project, the materials required for the project, the equipment price and the material price.

[0036] Step S202, extracting the first target data to obtain second target data, third target data and fourth target data, wherein the second target data is data in the first target data corresponding to a first preset format, the third target data is text data in the first target data, and the fourth target data is table data in the first target data;

[0037] Specifically, the first target data is divided into table data and structured text using PDF data extraction technology, the table data includes the second target data and the fourth target data, and the unstructured text includes the third target data.

[0038] Step S203, converting the second target data and the fourth target data through a table matching rule to obtain fifth target data, and constructing a first triplet in the form of subject, object and association relationship according to the fifth target data using a table data matching method;

[0039] Specifically, the tabular data is converted into a simple table without nesting through table matching rules (TMR), and the simple table is constructed into triples according to the subject, object and association relationship by using the engineering cost dictionary and the jaccard coefficient involving table data matching method (TDM) to obtain the above-mentioned first triple.

[0040] Step S204, converting the third target data according to the engineering cost dictionary through the dictionary matching rule to obtain the sixth target data, and constructing the second triple according to the sixth target data in the form of subject, predicate and object by using the regular expression, and constructing the third triple according to the sixth target data in the form of subject, object and association relationship by using the probability model;

[0041] Specifically, the unstructured text data is converted according to the dictionary matching rules (DMR) to extract the sentences containing the name of the power grid engineering category from the text to be processed. Then, the preprocessed unstructured text data is matched with the price data using regular expressions, and the subject-predicate-object structure of the sentence containing the price is analyzed based on the matched price with the help of dependency grammar analysis, and the subject-predicate-object triples are generated to obtain the above-mentioned second triples. The use of an LSTM probabilistic model involves an unstructured text matching method to extract entities and their relationships, and construct triple data sets of subjects, relationships and objects.

[0042] Step S205, generate an entity csv file and a relationship csv file according to the first triple, the second triple and the third triple, and generate a knowledge graph according to the entity csv file and the relationship csv file to obtain a target file.

[0043] Specifically, the first triple, the second triple and the third triple are subjected to data cleaning and entity disambiguation, entity csv files and relationship csv files are generated, and the Cypher language is used to import them into the Neo4j graph database to generate a knowledge graph to obtain the target file.

[0044] The entity csv file is to first number the entities, and then generate different csv files according to the entity type. The csv files include the entity number and entity value. The relationship csv file is to generate different csv files according to the relationship type. The csv files include the head entity number, relationship value, and tail entity number.

[0045] Through this embodiment, first, the first target data is obtained and the engineering cost dictionary is determined according to the first target data, the first target data includes data of at least one of the engineering settlement statement or the engineering quantity certification form, and the engineering cost dictionary includes entity words in the first target data and the relationship categories between the above entity words; then, the first target data is extracted to obtain the second target data, the third target data and the fourth target data, the second target data is the data in the first target data whose corresponding format is the first preset format, the third target data is the text data in the first target data, and the fourth target data is the table data in the first target data; then, the second target data and the fourth target data are matched by the table The fifth target data is converted by the rule, and the first triplet is constructed according to the subject, object and association relationship of the fifth target data by using the table data matching method; then, the third target data is converted according to the dictionary matching rule according to the engineering cost dictionary to obtain the sixth target data, and the second triplet is constructed according to the subject, predicate and object of the sixth target data by using the regular expression, and the third triplet is constructed according to the subject, object and association relationship of the sixth target data by using the probability model; finally, the entity csv file and the relationship csv file are generated according to the first triplet, the second triplet and the third triplet, and the target file is obtained by generating a knowledge graph according to the entity csv file and the relationship csv file. The present application extracts and processes the unstructured text data and the table data respectively, extracts the cost information therein and inputs it into the graph database to construct the knowledge graph for structured management, which is convenient for data query and analysis, and solves the problem that the engineering cost data in the prior art contains a large amount of data in different data formats, which is difficult to automatically extract and manage.

[0046] In order to obtain the second target data, the third target data and the fourth target data, in an optional implementation, the step S202 includes:

[0047] Step S2021, determining the data in the first target data that corresponds to the first preset format as the second target data, and determining the data other than the second target data as the seventh target data;

[0048] Specifically, the data in the excel format among the first target data is determined as the second target data, and the data in other data formats is determined as the seventh target data.

[0049] Step S2022, converting the seventh target data into a second preset format, and extracting the table data by extract_tables function to obtain the first candidate data, converting the data in the seventh target data except the first candidate data into a third preset format, and extracting the text data by pytesseract function to obtain the third target data, and extracting the table data by OpenCV function to obtain the second candidate data;

[0050] Specifically, the seventh target data is converted into a pdf file format, and then the table data is extracted by the extract_tables function of the pdfplumber library to obtain the first candidate data. The data other than the table data is converted into a png format, and the text data is extracted by the pytesseract function to obtain the third target data. The extracted text is further extracted with the OpenCV function to obtain the second candidate data. In the specific implementation process, the second candidate data may not exist.

[0051] Step S2023: determine the first candidate data and the second candidate data as the fourth target data.

[0052] Specifically, the table data extracted from the non-excel format data is determined as the fourth target data.

[0053] In order to obtain the fifth target data, in an optional implementation, the step S203 includes:

[0054] Step S2031, traversing the second target data and the fourth target data through the table matching rule, and identifying the cell occupied by the header as the main header when the headers in the second target data and the fourth target data meet the first condition, and the first condition is that the header occupies multiple columns of cells;

[0055] Specifically, a table containing nested rows and columns is retrieved through TMR, and cells spanning multiple columns are identified and named as main table headers.

[0056] Step S2032, when the row cells adjacent to the main table header are the main table headers, merge the main table headers into the same cell;

[0057] Specifically, check the cell type of the next row of the main header, and if it is still the main header, merge the contents of the two main headers into a new cell spanning multiple rows.

[0058] Step S2033, traversing the second target data and the fourth target data through the table matching rule, and if the table headers in the second target data and the fourth target data meet the second condition, marking the cells occupied by the table headers as secondary table headers, and the second condition is that the cells occupied by the table headers are cells nested in a single column;

[0059] Specifically, if there are multiple cells nested in a single column, they are identified as secondary table headers.

[0060] Step S2034, merging the main header and the sub-header contents, deleting the main header and generating a plurality of cells occupying multiple rows and in the same column as the sub-header to obtain the fifth target data.

[0061] Specifically, the content of the main table header and the secondary table header are merged. Finally, the main table header is deleted and multiple cells spanning multiple rows and in the same column as the secondary table header are generated.

[0062] In order to obtain the first triplet, in an optional implementation, the step S203 further includes:

[0063] Step S2035, determining the cells in each column except the first row in the fifth target data as entities;

[0064] Specifically, the nodes in each column except the first row are treated as entities through TDM.

[0065] Step S2036, matching the label value of the first row cell of each column in the fifth target data with the entity words in the engineering cost dictionary to obtain the entity category corresponding to each label value:

[0066]

[0067] Wherein, A is the character set contained in the above label value, B is the above entity word in the above engineering cost dictionary, R is the correlation coefficient between A and B, and when R takes the maximum value, the above entity category corresponding to B is the above entity category corresponding to A;

[0068] Specifically, the label value of the first row is matched with the entity words in the engineering cost dictionary to determine the entity category corresponding to the label value. The matching rule between the label value and the entity words in the dictionary is as shown in the above formula.

[0069] Step S2037, querying the engineering cost dictionary according to each of the entity categories to determine the relationship category of the association relationship between the entities corresponding to cells in different columns;

[0070] Specifically, the relationship categories between entities in different columns are determined according to the entity categories.

[0071] Step S2038: construct a plurality of the first triples according to the above entities and the above relationship categories:

[0072] [ZB1, GX1, KT1];

[0073] Among them, ZB1 is the subject in the above-mentioned first triplet, GX1 is the above-mentioned relationship category in the above-mentioned first triplet, and KT1 is the above-mentioned object to which the above-mentioned association relationship is imposed.

[0074] Specifically, according to the entities in the above table data and the association relationship between the entities, the corresponding first triples are determined to obtain a plurality of the above first triples.

[0075] In order to obtain the sixth target data, in an optional implementation, the step S204 includes:

[0076] Step S2041, using the Spacy library to segment the third target data to obtain a plurality of eighth target data;

[0077] Specifically, the unstructured text data is segmented into sentences using the Spacy library through DMR to obtain the eighth target data mentioned above.

[0078] Step S2042, segmenting each of the above-mentioned eighth target data based on the above-mentioned engineering cost dictionary through the HanLP library, and matching the above-mentioned segmented words with the above-mentioned engineering cost dictionary. When the frequency of occurrence of the above-mentioned segmented words in the above-mentioned eighth target data in the above-mentioned engineering cost dictionary is greater than or equal to a preset value, the above-mentioned eighth target data is determined as the sixth target data.

[0079] Specifically, the eighth target data is segmented using the HanLP library in combination with the above-mentioned engineering cost dictionary, and then each segmented word is traversed to determine whether it exists in the dictionary. A threshold is set based on the entity in the triple, that is, the above-mentioned preset value. When the frequency of a segmented word in a sentence appearing in the dictionary is greater than or equal to the set value, it is determined that the sentence meets the extraction requirements. The power grid engineering cost data is extracted from the text through the above matching method.

[0080] It is understandable that entities often represent individuals, concepts, things, etc. in the real world, and have independent existence and attributes. Entities can be specific entities, such as people, places, organizations, etc., and specific problems require specific analysis. In this application, the entities to be found are seven types of entities: single project, project characteristics, installation address, equipment name, purchase price, asset detailed description, and material name. In the triple of this application, there are two entities, so the above setting value is set to 2.

[0081] In order to obtain the second triplet and the third triplet, in an optional implementation, the step S204 further includes:

[0082] Step S2041, matching the sixth target data based on the regular expression, obtaining price data in the sixth target data to obtain ninth target data;

[0083] Specifically, the ninth target data is obtained by matching the price data through a regular expression.

[0084] Step S2042, performing grammatical analysis on the ninth target data through the LTP model to determine a first dependency arc and a second dependency arc, wherein the first dependency arc is used to represent the relationship between the subject and the predicate in the ninth target data, and the second dependency arc is used to represent the relationship between the predicate and the object in the ninth target data;

[0085] Specifically, Figure 3 As shown in the figure, taking "XX power grid purchased a large number of transformers, among which the price of dry-type transformers is 34,000 yuan" as an example, the ninth target data mentioned above is analyzed by the LTP model to obtain multiple relationship dependency arcs, among which SBV is the subject-verb dependency arc, which describes the relationship between the subject and the predicate in the sentence, and VOB is the verb-object dependency arc, which describes the relationship between the predicate and the object in the sentence.

[0086] Step S2043, determining the second triple according to the first relationship dependency arc and the second relationship dependency arc;

[0087] Specifically, combining the two can obtain a subject-verb-object triple (subject, verb, object). In order to enrich the semantics, the attributive modification relationship ATT between the subject and the object is found to obtain (att-subject, verb, att-object) to obtain the above-mentioned second triple.

[0088] Step S2044, input the sixth target data into the LSTM probability model to obtain the third triplet:

[0089]

[0090] Among them, M is the training set, y i is the i-th input text, O i =(z, g, k) is the text y i The triples contained in , z is O i The subject in G includes all relation categories, g∈O i |z represents g is O iA set of the above associations with z as the subject, g∈G\O i |z represents not in O i The above relationship in p(z|y i ) is the preset probability, is the conditional probability.

[0091] Specifically, the model encodes the input text through LSTM to obtain contextual semantic information to represent characters or words, and then directly decodes the results of the encoding layer through the subject recognition module to identify all possible subjects, and then identifies all possible objects under each relationship. The structure of the above model is as follows Figure 4 shown.

[0092] To ensure the accuracy of the target file, in an optional implementation, before generating the entity csv file and the relationship csv file according to the first triple, the second triple and the third triple, the method further includes:

[0093] Step S301, performing data cleaning and entity disambiguation on the first triplet, the second triplet and the third triplet, wherein the data cleaning is used to identify and correct outliers in the first triplet, the second triplet and the third triplet, and the entity disambiguation is used to unify different entities with the same semantics in the first triplet, the second triplet and the third triplet.

[0094] Specifically, data cleaning refers to identifying and correcting errors, inconsistencies, and outliers in data sets. It avoids possible data value anomalies, inconsistent data formats, data duplication, and other issues. Entity disambiguation is to set a unified name for synonyms of entities.

[0095] In addition, the method of the present application also includes entity alignment, the goal of which is to find the same entities described in different data sets and establish a corresponding relationship between them, so as to link the triplets obtained from different data sources and store them in the knowledge graph.

[0096] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0097] The present application embodiment also provides a kind of identification device of construction cost data, it should be noted that the identification device of construction cost data of the present application embodiment can be used to execute the identification method for construction cost data provided by the present application embodiment. The device is used to implement the above-mentioned embodiment and preferred implementation mode, and the description has been made no further details. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented with software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0098] The following is an introduction to the device for identifying engineering cost data provided in an embodiment of the present application.

[0099] Figure 5 is a structural block diagram of a device for identifying engineering cost data according to an embodiment of the present application. Figure 5 As shown, the device comprises:

[0100] A first acquisition unit 10 is used to acquire first target data and determine a construction cost dictionary according to the first target data, wherein the first target data includes at least one of a construction settlement statement or a construction quantity certification sheet, and the construction cost dictionary includes entity words in the first target data and relationship categories between the entity words;

[0101] Specifically, the first target data is obtained by collecting data on the entire cost process of power grid production projects such as engineering settlement statements and engineering certification sheets, and the engineering cost dictionary is obtained based on a dictionary of power grid engineering cost data involving factors affecting engineering cost estimation.

[0102] In this embodiment, the collected data on the entire process of production project cost includes investment estimation documents, bidding documents, contract documents, construction process data, completion data, and settlement data, etc. Since there are many files, including multiple file formats, mainly word, pdf, and excel, this application uses the above three formats as examples for explanation.

[0103] In this embodiment, the above-mentioned engineering cost dictionary includes 7 types of entities, namely, single project, engineering characteristics, installation address, equipment name, purchase price, asset details and materials, wherein each type can be further refined, including but not limited to the following examples: For example, the equipment name can include transformers, disconnectors, generators, circuit breakers and insulators. In addition, the above-mentioned engineering cost dictionary also includes 7 types of associations, namely, the nature of the project, the installation address of the project, the equipment used in the project, the asset details of the project, the materials required for the project, the equipment price and the material price.

[0104] A first acquisition unit 20 is used to extract the first target data to obtain second target data, third target data and fourth target data, wherein the second target data is data in the first target data corresponding to a first preset format, the third target data is text data in the first target data, and the fourth target data is table data in the first target data;

[0105] Specifically, the first target data is divided into table data and structured text using PDF data extraction technology, the table data includes the second target data and the fourth target data, and the unstructured text includes the third target data.

[0106] The first processing unit 30 is used to convert the second target data and the fourth target data into fifth target data by using a table matching rule, and construct a first triplet in the form of subject, object and association relationship according to the fifth target data by using a table data matching method;

[0107] Specifically, the tabular data is converted into a simple table without nesting through table matching rules (TMR), and the simple table is constructed into triples according to the subject, object and association relationship by using the engineering cost dictionary and the jaccard coefficient involving table data matching method (TDM) to obtain the above-mentioned first triple.

[0108] The second processing unit 40 is used to convert the third target data according to the engineering cost dictionary through the dictionary matching rule to obtain the sixth target data, and to construct the second triple according to the sixth target data in the form of subject, predicate and object by using the regular expression, and to construct the third triple according to the subject, object and association relationship by using the probability model;

[0109] Specifically, the unstructured text data is converted according to the dictionary matching rules (DMR) to extract the sentences containing the name of the power grid engineering category from the text to be processed. Then, the preprocessed unstructured text data is matched with the price data using regular expressions, and the subject-predicate-object structure of the sentence containing the price is analyzed based on the matched price with the help of dependency grammar analysis, and the subject-predicate-object triples are generated to obtain the above-mentioned second triples. The use of an LSTM probabilistic model involves an unstructured text matching method to extract entities and their relationships, and construct triple data sets of subjects, relationships and objects.

[0110] The construction unit 50 is used to generate an entity csv file and a relationship csv file according to the first triple, the second triple and the third triple, and to generate a knowledge graph according to the entity csv file and the relationship csv file to obtain a target file.

[0111] Specifically, the first triple, the second triple and the third triple are subjected to data cleaning and entity disambiguation, entity csv files and relationship csv files are generated, and the Cypher language is used to import them into the Neo4j graph database to generate a knowledge graph to obtain the target file.

[0112] The entity csv file is to first number the entities, and then generate different csv files according to the entity type. The csv files include the entity number and entity value. The relationship csv file is to generate different csv files according to the relationship type. The csv files include the head entity number, relationship value, and tail entity number.

[0113] Through this embodiment, the first acquisition unit acquires the first target data and determines the engineering cost dictionary according to the first target data, the first target data includes data of at least one of the engineering settlement statement or the engineering quantity certification form, and the engineering cost dictionary includes entity words in the first target data and the relationship categories between the above entity words; the second acquisition unit extracts data from the first target data to obtain second target data, third target data and fourth target data, the second target data is data in the first target data whose corresponding format is the first preset format, the third target data is text data in the first target data, and the fourth target data is table data in the first target data; the first processing unit processes the second target data and the fourth target data through a table The fifth target data is converted according to the matching rules, and the first triplet is constructed according to the fifth target data in the form of subject, object and association relationship by using the table data matching method; the second processing unit converts the third target data according to the dictionary matching rules according to the engineering cost dictionary to obtain the sixth target data, and uses regular expressions to construct the second triplet according to the sixth target data in the form of subject, predicate and object, and uses the probability model to construct the third triplet according to the sixth target data in the form of subject, object and association relationship; the construction unit generates an entity csv file and a relationship csv file according to the first triplet, the second triplet and the third triplet, and generates a knowledge graph according to the entity csv file and the relationship csv file to obtain the target file. The present application extracts and processes the unstructured text data and the table data respectively, extracts the cost information therein and inputs it into the graph database to construct the knowledge graph for structured management, which is convenient for data query and analysis, and solves the problem that the engineering cost data in the prior art contains a large amount of data in different data formats, which is difficult to automatically extract and manage.

[0114] In order to obtain the second target data, the third target data and the fourth target data, in an optional implementation manner, the second acquisition unit includes:

[0115] A first determining module, configured to determine the data in the first target data corresponding to the first preset format as the second target data, and determine the data other than the second target data as the seventh target data;

[0116] Specifically, the data in the excel format among the first target data is determined as the second target data, and the data in other data formats is determined as the seventh target data.

[0117] A first acquisition module is used to convert the seventh target data into a second preset format, extract the table data through the extract_tables function to obtain the first candidate data, convert the data in the seventh target data except the first candidate data into a third preset format, extract the text data through the pytesseract function to obtain the third target data, and extract the table data through the OpenCV function to obtain the second candidate data;

[0118] Specifically, the seventh target data is converted into a pdf file format, and then the table data is extracted by the extract_tables function of the pdfplumber library to obtain the first candidate data. The data other than the table data is converted into a png format, and the text data is extracted by the pytesseract function to obtain the third target data. The extracted text is further extracted with the OpenCV function to obtain the second candidate data. In the specific implementation process, the second candidate data may not exist.

[0119] The second determining module is used to determine the first candidate data and the second candidate data as the fourth target data.

[0120] Specifically, the table data extracted from the non-excel format data is determined as the fourth target data.

[0121] In order to obtain the fifth target data, in an optional implementation manner, the first processing unit includes:

[0122] A first processing module is used to traverse the second target data and the fourth target data through the table matching rule, and identify the cell occupied by the header as the main header when the headers in the second target data and the fourth target data meet the first condition that the header occupies multiple columns of cells;

[0123] Specifically, a table containing nested rows and columns is retrieved through TMR, and cells spanning multiple columns are identified and named as main table headers.

[0124] A second processing module is used for merging the main table headers into a same cell when the row cells adjacent to the main table headers are the main table headers;

[0125] Specifically, check the cell type of the next row of the main header, and if it is still the main header, merge the contents of the two main headers into a new cell spanning multiple rows.

[0126] A third processing module is used to traverse the second target data and the fourth target data through the table matching rule, and identify the cell occupied by the header as a secondary header when the header in the second target data and the fourth target data meets the second condition, and the second condition is that the cell occupied by the header is a single-column nested cell;

[0127] Specifically, if there are multiple cells nested in a single column, they are identified as secondary table headers.

[0128] The fourth processing module is used to merge the main header and the sub-header content, delete the main header and generate multiple cells occupying multiple rows and in the same column as the sub-header to obtain the fifth target data.

[0129] Specifically, the content of the main table header and the secondary table header are merged. Finally, the main table header is deleted and multiple cells spanning multiple rows and in the same column as the secondary table header are generated.

[0130] In order to obtain the first triplet, in an optional implementation manner, the first processing unit further includes:

[0131] A third determination module, used to determine the cells in each column except the first row in the fifth target data as entities;

[0132] Specifically, the nodes in each column except the first row are treated as entities through TDM.

[0133] The fifth processing module is used to match the label value of the first row cell of each column in the fifth target data with the entity word in the engineering cost dictionary to obtain the entity category corresponding to each label value:

[0134]

[0135] Wherein, A is the character set contained in the above label value, B is the above entity word in the above engineering cost dictionary, R is the correlation coefficient between A and B, and when R takes the maximum value, the above entity category corresponding to B is the above entity category corresponding to A;

[0136] Specifically, the label value of the first row is matched with the entity words in the engineering cost dictionary to determine the entity category corresponding to the label value. The matching rule between the label value and the entity words in the dictionary is as shown in the above formula.

[0137] A fourth determination module is used to query the engineering cost dictionary to determine the relationship category of the association relationship between the entities corresponding to cells in different columns according to each of the entity categories;

[0138] Specifically, the relationship categories between entities in different columns are determined according to the entity categories.

[0139] A first construction module is used to construct a plurality of the first triples according to the above entities and the above relationship categories:

[0140] [ZB1, GX1, KT1];

[0141] Among them, ZB1 is the subject in the above-mentioned first triplet, GX1 is the above-mentioned relationship category in the above-mentioned first triplet, and KT1 is the above-mentioned object to which the above-mentioned association relationship is imposed.

[0142] Specifically, according to the entities in the above table data and the association relationship between the entities, the corresponding first triples are determined to obtain a plurality of the above first triples.

[0143] In order to obtain the sixth target data, in an optional implementation manner, the second processing unit includes:

[0144] A sixth processing module, configured to segment the third target data into sentences through a Spacy library to obtain a plurality of eighth target data;

[0145] Specifically, the unstructured text data is segmented into sentences using the Spacy library through DMR to obtain the eighth target data mentioned above.

[0146] The fifth determination module is used to segment each of the above-mentioned eighth target data based on the above-mentioned engineering cost dictionary through the HanLP library, and match the above-mentioned segmented words with the above-mentioned engineering cost dictionary. When the frequency of occurrence of the above-mentioned segmented words in the above-mentioned eighth target data in the above-mentioned engineering cost dictionary is greater than or equal to a preset value, the above-mentioned eighth target data is determined as the sixth target data.

[0147] Specifically, the eighth target data is segmented using the HanLP library in combination with the above-mentioned engineering cost dictionary, and then each segmented word is traversed to determine whether it exists in the dictionary. A threshold is set based on the entity in the triple, that is, the above-mentioned preset value. When the frequency of a segmented word in a sentence appearing in the dictionary is greater than or equal to the set value, it is determined that the sentence meets the extraction requirements. The power grid engineering cost data is extracted from the text through the above matching method.

[0148] It is understandable that entities often represent individuals, concepts, things, etc. in the real world, and have independent existence and attributes. Entities can be specific entities, such as people, places, organizations, etc., and specific problems require specific analysis. In this application, the entities to be found are seven types of entities: single project, project characteristics, installation address, equipment name, purchase price, asset detailed description, and material name. In the triple of this application, there are two entities, so the above setting value is set to 2.

[0149] In order to obtain the second triplet and the third triplet, in an optional implementation manner, the second processing unit further includes:

[0150] A second acquisition module is used to match the sixth target data based on the regular expression, and acquire the price data in the sixth target data to obtain the ninth target data;

[0151] Specifically, the ninth target data is obtained by matching the price data through a regular expression.

[0152] a sixth determination module, configured to perform grammatical analysis on the ninth target data through an LTP model to determine a first dependency arc and a second dependency arc, wherein the first dependency arc is used to characterize a relationship between a subject and a predicate in the ninth target data, and the second dependency arc is used to characterize a relationship between a predicate and an object in the ninth target data;

[0153] Specifically, Figure 3 As shown in the figure, taking "XX power grid purchased a large number of transformers, among which the price of dry-type transformers is 34,000 yuan" as an example, the ninth target data mentioned above is analyzed by the LTP model to obtain multiple relationship dependency arcs, among which SBV is the subject-verb dependency arc, which describes the relationship between the subject and the predicate in the sentence, and VOB is the verb-object dependency arc, which describes the relationship between the predicate and the object in the sentence.

[0154] A seventh determination module, configured to determine the second triple according to the first relationship dependency arc and the second relationship dependency arc;

[0155] Specifically, combining the two can obtain a subject-verb-object triple (subject, verb, object). In order to enrich the semantics, the attributive modification relationship ATT between the subject and the object is found to obtain (att-subject, verb, att-object) to obtain the above-mentioned second triple.

[0156] An input module is used to input the sixth target data into the LSTM probability model to obtain the third triplet:

[0157]

[0158] Among them, M is the training set, y i is the i-th input text, O i =(z, g, k) is the text y i The triples contained in , z is O i The subject in G includes all relation categories, g∈O i |z represents g is O i A set of the above associations with z as the subject, g∈G\O i |z represents not in O i The above relationship in p(z|y i ) is the preset probability, is the conditional probability.

[0159] Specifically, the model encodes the input text through LSTM to obtain contextual semantic information to represent characters or words, and then directly decodes the results of the encoding layer through the subject recognition module to identify all possible subjects, and then identifies all possible objects under each relationship. The structure of the above model is as follows Figure 4 shown.

[0160] To ensure the accuracy of the target file, in an optional implementation, the device further includes:

[0161] The third processing unit is used to perform data cleaning and entity disambiguation on the first triplet, the second triplet and the third triplet before generating the entity csv file and the relationship csv file according to the first triplet, the second triplet and the third triplet, wherein the data cleaning is used to identify and correct outliers in the first triplet, the second triplet and the third triplet, and the entity disambiguation is used to unify different entities with the same semantics in the first triplet, the second triplet and the third triplet.

[0162] Specifically, data cleaning refers to identifying and correcting errors, inconsistencies, and outliers in data sets. It avoids possible data value anomalies, inconsistent data formats, data duplication, and other issues. Entity disambiguation is to set a unified name for synonyms of entities.

[0163] In addition, the method of the present application also includes entity alignment, the goal of which is to find the same entities described in different data sets and establish a corresponding relationship between them, so as to link the triplets obtained from different data sources and store them in the knowledge graph.

[0164] The above-mentioned device for identifying engineering cost data includes a processor and a memory, and the above-mentioned first acquisition unit, first acquisition unit, first processing unit, unit, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions. The above-mentioned modules are all located in the same processor; or, the above-mentioned modules are located in different processors in any combination.

[0165] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the automatic recognition of structured data and substructured data can be achieved by adjusting the kernel parameters.

[0166] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0167] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for identifying engineering cost data.

[0168] Specifically, the identification methods of engineering cost data include:

[0169] Step S201, obtaining first target data and determining a construction cost dictionary according to the first target data, wherein the first target data includes at least one of a construction settlement statement or a construction quantity certification sheet, and the construction cost dictionary includes entity words in the first target data and relationship categories between the entity words;

[0170] Step S202, extracting the first target data to obtain second target data, third target data and fourth target data, wherein the second target data is data in the first target data corresponding to a first preset format, the third target data is text data in the first target data, and the fourth target data is table data in the first target data;

[0171] Step S203, converting the second target data and the fourth target data through a table matching rule to obtain fifth target data, and constructing a first triplet in the form of subject, object and association relationship according to the fifth target data using a table data matching method;

[0172] Step S204, converting the third target data according to the engineering cost dictionary through the dictionary matching rule to obtain the sixth target data, and constructing the second triple according to the sixth target data in the form of subject, predicate and object by using the regular expression, and constructing the third triple according to the sixth target data in the form of subject, object and association relationship by using the probability model;

[0173] Step S205, generate an entity csv file and a relationship csv file according to the first triple, the second triple and the third triple, and generate a knowledge graph according to the entity csv file and the relationship csv file to obtain a target file.

[0174] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the method for identifying engineering cost data is executed when the program is run.

[0175] Specifically, the identification methods of engineering cost data include:

[0176] Step S201, obtaining first target data and determining a construction cost dictionary according to the first target data, wherein the first target data includes at least one of a construction settlement statement or a construction quantity certification sheet, and the construction cost dictionary includes entity words in the first target data and relationship categories between the entity words;

[0177] Step S202, extracting the first target data to obtain second target data, third target data and fourth target data, wherein the second target data is data in the first target data corresponding to a first preset format, the third target data is text data in the first target data, and the fourth target data is table data in the first target data;

[0178] Step S203, converting the second target data and the fourth target data through a table matching rule to obtain fifth target data, and constructing a first triplet in the form of subject, object and association relationship according to the fifth target data using a table data matching method;

[0179] Step S204, converting the third target data according to the engineering cost dictionary through the dictionary matching rule to obtain the sixth target data, and constructing the second triple according to the sixth target data in the form of subject, predicate and object by using the regular expression, and constructing the third triple according to the sixth target data in the form of subject, object and association relationship by using the probability model;

[0180] Step S205, generate an entity csv file and a relationship csv file according to the first triple, the second triple and the third triple, and generate a knowledge graph according to the entity csv file and the relationship csv file to obtain a target file.

[0181] An embodiment of the present invention provides a communication system, the communication system includes a primary communication domain, a secondary communication domain processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:

[0182] Step S201, obtaining first target data and determining a construction cost dictionary according to the first target data, wherein the first target data includes at least one of a construction settlement statement or a construction quantity certification sheet, and the construction cost dictionary includes entity words in the first target data and relationship categories between the entity words;

[0183] Step S202, extracting the first target data to obtain second target data, third target data and fourth target data, wherein the second target data is data in the first target data corresponding to a first preset format, the third target data is text data in the first target data, and the fourth target data is table data in the first target data;

[0184] Step S203, converting the second target data and the fourth target data through a table matching rule to obtain fifth target data, and constructing a first triplet in the form of subject, object and association relationship according to the fifth target data using a table data matching method;

[0185] Step S204, converting the third target data according to the engineering cost dictionary through the dictionary matching rule to obtain the sixth target data, and constructing the second triple according to the sixth target data in the form of subject, predicate and object by using the regular expression, and constructing the third triple according to the sixth target data in the form of subject, object and association relationship by using the probability model;

[0186] Step S205, generate an entity csv file and a relationship csv file according to the first triple, the second triple and the third triple, and generate a knowledge graph according to the entity csv file and the relationship csv file to obtain a target file.

[0187] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:

[0188] Step S201, obtaining first target data and determining a construction cost dictionary according to the first target data, wherein the first target data includes at least one of a construction settlement statement or a construction quantity certification sheet, and the construction cost dictionary includes entity words in the first target data and relationship categories between the entity words;

[0189] Step S202, extracting the first target data to obtain second target data, third target data and fourth target data, wherein the second target data is data in the first target data corresponding to a first preset format, the third target data is text data in the first target data, and the fourth target data is table data in the first target data;

[0190] Step S203, converting the second target data and the fourth target data through a table matching rule to obtain fifth target data, and constructing a first triplet in the form of subject, object and association relationship according to the fifth target data using a table data matching method;

[0191] Step S204, converting the third target data according to the engineering cost dictionary through the dictionary matching rule to obtain the sixth target data, and constructing the second triple according to the sixth target data in the form of subject, predicate and object by using the regular expression, and constructing the third triple according to the sixth target data in the form of subject, object and association relationship by using the probability model;

[0192] Step S205, generate an entity csv file and a relationship csv file according to the first triple, the second triple and the third triple, and generate a knowledge graph according to the entity csv file and the relationship csv file to obtain a target file.

[0193] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0194] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0195] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0196] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0197] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0198] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0199] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0200] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0201] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0202] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:

[0203] 1) The method for identifying engineering cost data of the present application, first, obtains first target data and determines an engineering cost dictionary based on the first target data, wherein the first target data includes data of at least one of an engineering settlement statement or an engineering quantity certification sheet, and the engineering cost dictionary includes entity words in the first target data and relationship categories between the entity words; then, extracts data from the first target data to obtain second target data, third target data and fourth target data, wherein the second target data is data in the first target data corresponding to a first preset format, the third target data is text data in the first target data, and the fourth target data is table data in the first target data; then, the second target data and the fourth target data are extracted. The fifth target data is converted by table matching rules, and the first triple is constructed according to the fifth target data in the form of subject, object and association relationship by using table data matching method; then, the third target data is converted according to the engineering cost dictionary by dictionary matching rules to obtain the sixth target data, and the second triple is constructed according to the sixth target data in the form of subject, predicate and object by using regular expressions, and the third triple is constructed according to the sixth target data in the form of subject, object and association relationship by using probability model; finally, an entity csv file and a relationship csv file are generated according to the first triple, the second triple and the third triple, and a knowledge graph is generated according to the entity csv file and the relationship csv file to obtain the target file. The present application extracts and processes unstructured text data and table data respectively, extracts the cost information therein and inputs it into the graph database to construct a knowledge graph for structured management, which is convenient for data query and analysis, and solves the problem that the engineering cost data in the prior art contains a large amount of data in different data formats, which is difficult to automatically extract and manage.

[0204] 2) The device for identifying engineering cost data of the present application, the first acquisition unit acquires first target data and determines an engineering cost dictionary according to the first target data, the first target data includes data of at least one of the engineering settlement statement or the engineering quantity certification form, the engineering cost dictionary includes entity words in the first target data and relationship categories between the entity words; the second acquisition unit extracts data from the first target data to obtain second target data, third target data and fourth target data, the second target data is data in the first target data corresponding to a first preset format, the third target data is text data in the first target data, and the fourth target data is table data in the first target data; the first processing unit extracts the second target data and the fourth target data The data is converted through table matching rules to obtain the fifth target data, and the first triplet is constructed according to the fifth target data in the form of subject, object and association relationship using the table data matching method; the second processing unit converts the third target data through the dictionary matching rules according to the engineering cost dictionary to obtain the sixth target data, and uses regular expressions to construct the second triplet according to the sixth target data in the form of subject, predicate and object, and uses the probability model to construct the third triplet according to the sixth target data in the form of subject, object and association relationship; the construction unit generates an entity csv file and a relationship csv file according to the first triplet, the second triplet and the third triplet, and generates a knowledge graph according to the entity csv file and the relationship csv file to obtain the target file. The present application extracts and processes the unstructured text data and the table data respectively, extracts the cost information therein and inputs it into the graph database to construct the knowledge graph for structured management, which is convenient for data query and analysis, and solves the problem that the engineering cost data in the prior art contains a large amount of data in different data formats, which is difficult to automatically extract and manage.

[0205] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for identifying engineering cost data, characterized in that: include: Acquire first target data and determine a construction cost dictionary according to the first target data, wherein the first target data includes data of at least one of a construction settlement statement or a construction quantity certification sheet, and the construction cost dictionary includes entity words in the first target data and relationship categories between the entity words; Extracting data from the first target data to obtain second target data, third target data, and fourth target data, wherein the second target data is data in the first target data corresponding to a first preset format, the third target data is text data in the first target data, and the fourth target data is table data in the first target data; The second target data and the fourth target data are converted into fifth target data by using a table matching rule, and a first triplet is constructed according to the fifth target data in the form of subject, object and association relationship by using a table data matching method; According to the engineering cost dictionary, the third target data is converted by dictionary matching rules to obtain sixth target data, and a second triple is constructed according to the sixth target data in the form of subject, predicate and object using a regular expression, and a third triple is constructed according to the sixth target data in the form of subject, object and association relationship using a probability model; Generate an entity csv file and a relationship csv file according to the first triple, the second triple and the third triple, and generate a knowledge graph according to the entity csv file and the relationship csv file to obtain a target file.

2. The method according to claim 1, characterized in that Extracting the first target data according to the engineering cost dictionary to obtain second target data, third target data and fourth target data includes: determining data in the first target data whose format is the first preset format as the second target data, and determining data other than the second target data as seventh target data; Convert the seventh target data into a second preset format, extract the table data by extract_tables function to obtain the first candidate data, convert the data in the seventh target data except the first candidate data into a third preset format, extract the text data by pytesseract function to obtain the third target data, and extract the table data by OpenCV function to obtain the second candidate data; The first candidate data and the second candidate data are determined as the fourth target data.

3. The method according to claim 1, characterized in that: Converting the second target data and the fourth target data into fifth target data through a table matching rule includes: The second target data and the fourth target data are traversed by the table matching rule, and when the table headers in the second target data and the fourth target data meet the first condition, the cells occupied by the table headers are identified as main table headers, and the first condition is that the table headers occupy multiple columns of cells; In the case where the row cells adjacent to the main table header are the main table headers, merging the main table headers into the same cell; The second target data and the fourth target data are traversed by the table matching rule, and when the table headers in the second target data and the fourth target data meet the second condition, the cells occupied by the table headers are marked as secondary table headers, and the second condition is that the cells occupied by the table headers are cells nested in a single column; The main header and the sub-header contents are merged, the main header is deleted, and a plurality of cells occupying multiple rows and being in the same column as the sub-header are generated to obtain the fifth target data.

4. The method according to claim 1, characterized in that: Using a table data matching method to construct a first triplet according to the fifth target data in the form of subject, object and association relationship, including: Determine cells in each column of the fifth target data except the first row as entities; The label value of the first row cell of each column in the fifth target data is matched with the entity word in the engineering cost dictionary to obtain the entity category corresponding to each label value: Wherein, A is the character set contained in the label value, B is the entity word in the engineering cost dictionary, R is the correlation coefficient between A and B, and when R takes the maximum value, the entity category corresponding to B is the entity category corresponding to A; According to each of the entity categories, the engineering cost dictionary is searched to determine the relationship category of the association relationship between the entities corresponding to cells in different columns; Construct a plurality of the first triples according to the entities and the relationship categories: [ZB1, GX1, KT1]; Among them, ZB1 is the subject in the first triplet, GX1 is the relationship category in the first triplet, and KT1 is the object to which the association relationship is applied.

5. The method according to claim 1, characterized in that According to the engineering cost dictionary, the third target data is converted by dictionary matching rules to obtain sixth target data, including: Sentence the third target data using the Spacy library to obtain a plurality of eighth target data; Each of the eighth target data is segmented based on the engineering cost dictionary through the HanLP library, and matched with the engineering cost dictionary based on each of the segmented words. When the frequency of occurrence of the segmented words in one of the eighth target data in the engineering cost dictionary is greater than or equal to a preset value, the eighth target data is determined as the sixth target data.

6. The method according to claim 1, characterized in that Using a regular expression to construct a second triplet according to the sixth target data in the form of a subject, a predicate and an object, and using a probability model to construct a third triplet according to the sixth target data in the form of a subject, an object and an association relationship, including: Matching the sixth target data based on the regular expression, acquiring price data in the sixth target data to obtain ninth target data; Performing grammatical analysis on the ninth target data through the LTP model to determine a first relational dependency arc and a second relational dependency arc, wherein the first relational dependency arc is used to characterize the relationship between a subject and a predicate in the ninth target data, and the second relational dependency arc is used to characterize the relationship between a predicate and an object in the ninth target data; Determine the second triple according to the first relationship dependency arc and the second relationship dependency arc; The sixth target data is input into the LSTM probability model to obtain the third triplet: Among them, M is the training set, y i is the i-th input text, O i =(z, g, k) is the text y i The triples contained in , z is O i The subject in G includes all relation categories, g∈O i |z represents g is O i A set of said associations whose subject is z, g∈G\O i |z represents not in O i The relationship in p(z|y i ) is the preset probability, is the conditional probability.

7. The method according to claim 1, characterized in that Before generating an entity CSV file and a relationship CSV file according to the first triple, the second triple and the third triple, the method further includes: Data cleaning and entity disambiguation are performed on the first triple, the second triple and the third triple, wherein the data cleaning is used to identify and correct outliers in the first triple, the second triple and the third triple, and the entity disambiguation is used to unify different entities with the same semantics in the first triple, the second triple and the third triple.

8. A device for identifying engineering cost data, characterized in that: The device comprises: A first acquisition unit is used to acquire first target data and determine a construction cost dictionary according to the first target data, wherein the first target data includes data of at least one of a construction settlement statement or a construction quantity certification sheet, and the construction cost dictionary includes entity words in the first target data and relationship categories between the entity words; a second acquisition unit, configured to extract data from the first target data to obtain second target data, third target data, and fourth target data, wherein the second target data is data in the first target data whose corresponding format is a first preset format, the third target data is text data in the first target data, and the fourth target data is table data in the first target data; a first processing unit, configured to convert the second target data and the fourth target data into fifth target data by using a table matching rule, and construct a first triplet according to the fifth target data in the form of subject, object and association relationship by using a table data matching method; A second processing unit is used to convert the third target data according to the engineering cost dictionary through a dictionary matching rule to obtain sixth target data, and to construct a second triplet according to the sixth target data in the form of subject, predicate and object using a regular expression, and to construct a third triplet according to the sixth target data in the form of subject, object and association relationship using a probability model; A construction unit is used to generate an entity csv file and a relationship csv file according to the first triple, the second triple and the third triple, and to generate a knowledge graph according to the entity csv file and the relationship csv file to obtain a target file.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.

10. A data recognition system, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of claims 1 to 7.