Urban planning entity relationship extraction model training method, extraction method and device

By designing the urban planning entity relationship extraction model, using the large language model and Roberta model to annotate and vector characterize the urban planning standard data, the problem of rapid retrieval and precise matching of standard knowledge in the existing technology is solved, and urban planning is realized The efficient extraction and matching of standard knowledge provides effective auxiliary tools for planning business.

CN119415944APending Publication Date: 2025-02-11BEIJING URBAN PLANNING & DESIGN INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411363303.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

The existing urban planning standard management platform cannot achieve rapid retrieval, precise matching and cross-correlation of standard knowledge, and it is difficult to effectively assist planners in preparing, reviewing, and evaluating tasks.

Method used

By designing the urban planning entity relationship extraction model, using the preset large language model to mark the urban planning standard data, generate urban planning entity data with relationship type annotations, and input it into the Roberta model to obtain the labeled corpus vector representation, Finally, a model is trained to extract entities and relationships in urban planning standards in batches.

Benefits of technology

It realizes rapid retrieval and precise matching of urban planning standards knowledge, improves the efficiency of preparation, review, evaluation and other tasks in planning business, and can batch extract entities and relationships in urban planning standards to provide a foundation for building a knowledge graph.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415944A_ABST
    Figure CN119415944A_ABST
Patent Text Reader

Abstract

The invention provides an urban planning entity relationship extraction model training method and device and an extraction method and device. The method relates to the technical field of urban planning, and comprises the steps of extracting cue words based on a preset urban planning entity relationship, and performing data labeling on preprocessed urban planning standard data through a preset large language model to obtain multiple pieces of urban planning entity data carrying relationship type labels; after the urban planning entity data carrying the relation type labels are input into a target Roberta model, label corpus word vector representation is output; training a preset entity relationship extraction model based on the tagged corpus word vector representation to obtain a city planning entity relationship extraction model; wherein the urban planning entity relationship extraction model is used for extracting entities and relationships in the urban planning standard in batches.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of urban planning, and in particular to an urban planning entity relationship extraction model training method, an extraction method and a device. Background Art

[0002] Urban planning standards are relevant contents compiled and formulated to effectively guide urban planning. The rapid and comprehensive development of urban planning standards has brought convenience to the development of planning business, but it has also led to information confusion. The existing urban planning standards management platform has realized the digital construction of standards such as classified storage and full-text retrieval, but it cannot achieve rapid retrieval, accurate matching and cross-correlation of standard knowledge, making it difficult to effectively assist planners in tasks such as compilation, review and evaluation.

[0003] Therefore, how to effectively and rapidly retrieve and match standard knowledge has become a problem that needs to be solved urgently in the industry. Summary of the invention

[0004] The present invention provides a city planning entity relationship extraction model training method, extraction method and device, which are used to solve the defect of how to effectively perform rapid retrieval and matching of standard knowledge in the prior art.

[0005] The present invention provides a method for training an urban planning entity relationship extraction model, comprising: Based on the preset urban planning entity relationship, prompt words are extracted, and the pre-processed urban planning standard data is annotated through the preset large language model to obtain multiple urban planning entity data with relationship type annotations; After inputting the urban planning entity data carrying the relationship type annotations into the target Roberta model, outputting the annotated corpus word vector representation; Training a preset entity relationship extraction model based on the annotated corpus word vector representation to obtain an urban planning entity relationship extraction model; The urban planning entity relationship extraction model is used to batch extract entities and relationships in urban planning standards.

[0006] According to a method for training a model for extracting entity relationships from urban planning provided by the present invention, the method for obtaining pre-processed urban planning standard data specifically comprises: After the format of the urban planning standard data document is converted, unstructured text is extracted and the extracted unstructured text is stored in the sqlite database; On the basis of retaining semantic integrity, the unstructured text is segmented, and then the segmented text data is cleaned to obtain pre-processed urban planning standard data.

[0007] According to a method for training an urban planning entity relationship extraction model provided by the present invention, after inputting the urban planning entity data carrying relationship type annotations into a target Roberta model, before the step of outputting the annotated corpus word vector representation, the method further includes: The preset Roberta model is fine-tuned through the unlabeled basic urban planning terms and basic urban planning specifications information to obtain the target Roberta model in the field of urban planning.

[0008] According to a method for training an urban planning entity relationship extraction model provided by the present invention, a preset entity relationship extraction model is trained based on the annotated corpus word vector representation to obtain an urban planning entity relationship extraction model, including: Dividing each of the annotated corpus word vector representations into a training set and a validation set; Training a preset entity relationship extraction model based on the training set, and stopping the training when a preset condition is met, thereby obtaining an urban planning entity relationship extraction model; Verifying the urban planning entity relationship extraction model through the verification set to obtain a verification result; Among them, the preset entity relationship extraction model is the global pointer model Global Pointer.

[0009] The present invention also provides a method for extracting entity relationships in urban planning, comprising: performing format conversion and data preprocessing on an urban planning standard document to obtain an urban planning standard text; Input the urban planning standard text into the urban planning entity relationship extraction model, and output the entities and relationships in the urban planning standard text

[0010] The urban planning entity relationship extraction model is obtained by training a preset entity relationship extraction model based on the annotated corpus word vector representation; The annotated corpus word vector representation is based on the preset urban planning entity relationship extraction prompt words, and the pre-processed urban planning standard data is annotated by a preset large language model to obtain multiple urban planning entity data with relationship type annotations. The urban planning entity data with relationship type annotations are input into the target Roberta model to obtain the annotated corpus word vector representation.

[0011] The embodiment of the present invention provides a training device for an urban planning entity relationship extraction model, comprising: a labeling module, which is used to label preprocessed urban planning standard data based on preset urban planning entity relationship extraction prompt words through a preset large language model to obtain a plurality of urban planning entity data carrying relationship type labels; A processing module, configured to input the urban planning entity data carrying the relationship type annotations into a target Roberta model and output an annotated corpus word vector representation; A training module, used to train a preset entity relationship extraction model based on the annotated corpus word vector representation to obtain an urban planning entity relationship extraction model; The urban planning entity relationship extraction model is used to batch extract entities and relationships in urban planning standards.

[0012] Optionally, the device is also used for: After the format of the urban planning standard data document is converted, unstructured text is extracted and the extracted unstructured text is stored in the sqlite database; On the basis of retaining semantic integrity, the unstructured text is segmented, and then the segmented text data is cleaned to obtain pre-processed urban planning standard data.

[0013] Optionally, the device is also used for: The preset Roberta model is fine-tuned through the unlabeled basic urban planning terms and basic urban planning specifications information to obtain the target Roberta model in the field of urban planning.

[0014] Optionally, the device is also used for: Dividing each of the annotated corpus word vector representations into a training set and a validation set; Training a preset entity relationship extraction model based on the training set, and stopping the training when a preset condition is met, thereby obtaining an urban planning entity relationship extraction model; Verifying the urban planning entity relationship extraction model through the verification set to obtain a verification result; Among them, the preset entity relationship extraction model is the global pointer model Global Pointer.

[0015] The embodiment of the present application also provides a device for extracting urban planning entity relationships, including: A preprocessing module is used to convert the format of the urban planning standard file and perform data preprocessing to obtain the urban planning standard text; The extraction module is used to input the urban planning standard text into the urban planning entity relationship extraction model, and output the entities and relationships in the urban planning standard text.

[0016] The urban planning entity relationship extraction model is obtained by training a preset entity relationship extraction model based on the annotated corpus word vector representation; The annotated corpus word vector representation is based on the preset urban planning entity relationship extraction prompt words, and the pre-processed urban planning standard data is annotated by a preset large language model to obtain multiple urban planning entity data with relationship type annotations. The urban planning entity data with relationship type annotations are input into the target Roberta model to obtain the annotated corpus word vector representation.

[0017] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the urban planning entity relationship extraction model training method or the urban planning entity relationship extraction method as described above is implemented.

[0018] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the urban planning entity relationship extraction model training method or urban planning entity relationship extraction method as described above is implemented.

[0019] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned urban planning entity relationship extraction model training methods or urban planning entity relationship extraction methods.

[0020] The urban planning entity relationship extraction model training method, extraction method and device provided by the present invention use the characteristics of urban planning standard text to design prompt words including annotation rules and annotation strategies, use a general large language model to obtain sufficient urban planning entity data with relationship type annotations, input the annotated data into an embedding model for vector representation, and use it to train a deep learning model for entity relationship joint extraction. The trained model can process urban planning standard texts in batches and quickly extract a large number of entities and relationships, providing a basis for building knowledge graphs or other applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0022] Figure 1 A flow chart of a method for training a model for extracting entity relationships from urban planning provided in an embodiment of the present application; Figure 2 A schematic diagram of a model framework provided for an embodiment of the present application; Figure 3A schematic diagram of a method for extracting urban planning entity relationships provided in an embodiment of the present application; Figure 4 The urban planning entity relationship extraction model training device provided in the embodiment of the present application; Figure 5 A schematic diagram of the structure of a device for extracting entity relationships in urban planning provided in an embodiment of the present application; Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] Knowledge graph (KG) describes concepts, entities and their relationships in the objective world in a structured form, and has powerful semantic processing, content organization and visualization capabilities. The construction of knowledge graph mainly includes corpus construction, entity extraction, relationship extraction, knowledge fusion, knowledge storage and other links. Among them, entity and relationship extraction are the most basic and important, and the quality of extraction significantly affects the accuracy of knowledge graph.

[0025] Figure 1 A flow chart of a method for training a model for extracting entity relationships from urban planning provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, including: Step 110, extracting prompt words based on preset urban planning entity relationships, annotating the preprocessed urban planning standard data through a preset large language model, and obtaining a plurality of urban planning entity data carrying relationship type annotations; In an embodiment of the present application, first, the urban planning document is preprocessed, including format conversion and text cleaning.

[0026] Optionally, the method for obtaining the preprocessed urban planning standard data specifically includes: After the format of the urban planning standard data document is converted, unstructured text is extracted and the extracted unstructured text is stored in the sqlite database; On the basis of retaining semantic integrity, the unstructured text is segmented, and then the segmented text data is cleaned to obtain pre-processed urban planning standard data.

[0027] In the embodiment of the present application, the urban planning standard data document may exist in the formats of PDF, Word, Excel, etc. First, it is necessary to convert these documents in different formats into a format that can be used for text extraction, such as XML or plain text.

[0028] Extract the plain text contents from the converted document using tools such as pdf2xml, wapiti, GROBID, etc. These text contents are called unstructured texts because they do not contain the formatting information of the original document.

[0029] Store the extracted unstructured text into a SQLite database or other type of database. Databases provide a convenient way to manage and query large amounts of text data.

[0030] For long texts, in order to improve processing efficiency and accuracy, they need to be segmented into smaller text segments. Segmentation can be based on sentences, paragraphs, or other semantic units to ensure that each segmented text segment is semantically complete.

[0031] Data cleaning is performed on the segmented text fragments, including removing irrelevant punctuation, correcting garbled characters, removing extra spaces, processing format errors in the text, etc. This step is to ensure the quality of the data and provide accurate input for subsequent entity relationship extraction.

[0032] Then, cue words are designed according to the entity and relation types of urban planning, which guide the model to recognize specific entities in the text and the relations between them.

[0033] Specifically, we can first analyze the characteristics of the urban planning standard text, and under the guidance of domain experts, define entity types and relationship types to form annotation rules in the following form: {"subject_type": "standard", "predicate": "standard number", "object_type": "number"}

[0034] {"subject_type": "element", "predicate": "English name", "object_type": "name"}

[0035] {"subject_type": "element", "predicate": "element subclass", "object_type": "type"}

[0036] {"subject_type": "Feature", "predicate": "Distance", "object_type": "number"}

[0037] {"subject_type": "method", "predicate": "applies to", "object_type": "object"}

[0038] Then design prompts to guide the large language model to annotate data. The specific form of prompts is as follows: prompt = f"""

[0039] Please mark all entities and their relationships in the text, and make sure that each relationship correctly reflects the connection between entities. The following is a list of relationship types and a list of entity types: The following is a list of entity types: {entity_list}

[0040] The following is a "Relationship Category List": {relation_list}

[0041] "text" "spo_list" "predicate" "object_type" "subject_type" "object" "subject" are the keys, and the corresponding annotation content is the value.

[0042] The values ​​corresponding to "subject_type" and "object_type" must be in {entity_list}, and the value corresponding to "predicate" must be in {relation_list}. Values ​​outside the range of {entity_list} and {relation_list} should not appear.

[0043] Please annotate according to the following format and convert the annotation result into a json dictionary: {{

[0044] "text": 'Original text content',

[0045] "spo_list": [

[0046] {{

[0047] "predicate": "Relationship type",

[0048] "object_type": "Object type",

[0049] "subject_type": "Subject Type",

[0050] "object": "object",

[0051] "subject": "Subject"

[0052] Here are the sentences you will process: {sentence}"""

[0053] Where "entity type list": {entity_list} and "relation category list": {relation_list} are the entity types and relationship types defined in Step 2.

[0054] Then, the preprocessed text and prompt words are input into the large language model, which analyzes the text content and tries to identify entities and their relationships. This process produces a set of labeled data, in which each entity is labeled with its type, and each relationship is labeled with its type and the entity it is related to.

[0055] For example, if the text content is "City parks should be located in the city center and cover at least 10 hectares of green space", the large language model may output the following annotation data: Entities: "City Park" (type: Feature), "City Center" (type: Location), "10 Hectares" (type: Area)

[0056] Relationship: "located in" (subject: city park, object: city center), "covered" (subject: city park, object: 10 hectares)

[0057] In an embodiment of the present application, these labeled data will be used to train a special urban planning entity relationship extraction model, which can understand the semantics of urban planning text and accurately extract entities and their relationships, thereby improving the efficiency and accuracy of data processing and reducing the workload of manual labeling.

[0058] Step 120, after inputting the urban planning entity data carrying the relationship type annotation into the target Roberta model, outputting the annotated corpus word vector representation; In an embodiment of the present application, unlabeled basic urban planning terms and basic urban planning specification information are collected, and the collected urban planning texts are preprocessed, including text cleaning, word segmentation, and stop word removal, to prepare data for fine-tuning the Roberta model.

[0059] The Roberta model is fine-tuned using the pre-processed urban planning data. After fine-tuning, the updated model parameters are saved. This fine-tuned model is called the target Roberta model in the urban planning field. The fine-tuned Roberta model can better understand and process the professional terms and expressions in the urban planning field.

[0060] Then, the urban planning entity data with relationship type annotations are input into the Roberta model. These data include text content as well as identified entities and relationships.

[0061] The Roberta model generates a word vector for each word input. These word vectors are points in a high-dimensional space that can capture the semantic information of the word. The word vector represents the semantic features of the vocabulary, so that words with similar semantics are also close in distance in the vector space.

[0062] Step 130, training a preset entity relationship extraction model based on the annotated corpus word vector representation to obtain an urban planning entity relationship extraction model; The urban planning entity relationship extraction model is used to batch extract entities and relationships in urban planning standards.

[0063] In an embodiment of the present application, the vector representation of the annotated corpus is used as a training set to fine-tune the global pointer model GlobalPointer to make it suitable for entity relationship extraction of urban planning standard text.

[0064] Figure 2 A schematic diagram of a model framework provided in an embodiment of the present application, such as Figure 2 As shown, Global Pointer is an entity-level entity relationship joint extraction model, which regards the beginning and the end as a whole, considers the start and end positions of the fragments from a global perspective, and divides the word vector representations of each annotated corpus into a training set and a verification set; based on the training set, the preset entity relationship extraction model is trained, and by setting the model parameters, the Global Pointer model, a joint entity relationship extraction model, finally obtains an F1 value of 0.871 for the training model, which can be used for batch extraction of entities and relationships in urban planning standards.

[0065] The model parameters are shown in Table 1 below: Table 1 Global Pointer model parameter settings

[0066] Figure 3 A flow chart of a method for extracting urban planning entity relationships provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, including: Step 310, after format conversion and data preprocessing of the urban planning standard file, an urban planning standard text is obtained; Step 320: input the urban planning standard text into the urban planning entity relationship extraction model, and output the entities and relationships in the urban planning standard text.

[0067] The urban planning entity relationship extraction model is obtained by training a preset entity relationship extraction model based on the annotated corpus word vector representation; The annotated corpus word vector representation is based on the preset urban planning entity relationship extraction prompt words, and the pre-processed urban planning standard data is annotated by a preset large language model to obtain multiple urban planning entity data with relationship type annotations. The urban planning entity data with relationship type annotations are input into the target Roberta model to obtain the annotated corpus word vector representation.

[0068] The specific implementation methods in the embodiments of the present application can refer to the above embodiments and will not be repeated here.

[0069] In an embodiment of the present application, prompt words including annotation rules and annotation strategies are designed through the features of urban planning standard text, and a general large language model is used to obtain sufficient urban planning entity data with relationship type annotations. The annotated data is input into an embedding model for vector representation, which is used to train a deep learning model for joint extraction of entity relationships. The trained model can process urban planning standard texts in batches and quickly extract a large number of entities and relationships, providing a basis for building knowledge graphs or other applications.

[0070] The urban planning entity relationship extraction model training device provided by the present invention is described below. The urban planning entity relationship extraction model training device described below and the urban planning entity relationship extraction model training method described above can be referenced to each other.

[0071] Figure 4 The urban planning entity relationship extraction model training device provided in the embodiment of the present application is as follows: Figure 4 As shown, including: The annotation module 410 is used to extract prompt words based on the preset urban planning entity relationship, and annotate the preprocessed urban planning standard data through the preset large language model to obtain a plurality of urban planning entity data carrying relationship type annotations; The processing module 420 is used to input the urban planning entity data carrying the relationship type annotation into the target Roberta model, and output the annotated corpus word vector representation; The training module 430 is used to train the preset entity relationship extraction model based on the annotated corpus word vector representation to obtain an urban planning entity relationship extraction model; The urban planning entity relationship extraction model is used to batch extract entities and relationships in urban planning standards.

[0072] Optionally, the device is also used for: After the format of the urban planning standard data document is converted, unstructured text is extracted and the extracted unstructured text is stored in the sqlite database; On the basis of retaining semantic integrity, the unstructured text is segmented, and then the segmented text data is cleaned to obtain pre-processed urban planning standard data.

[0073] Optionally, the device is also used for: The preset Roberta model is fine-tuned through the unlabeled basic urban planning terms and basic urban planning specifications information to obtain the target Roberta model in the field of urban planning.

[0074] Optionally, the device is also used for: Dividing each of the annotated corpus word vector representations into a training set and a validation set; Training a preset entity relationship extraction model based on the training set, and stopping the training when a preset condition is met, thereby obtaining an urban planning entity relationship extraction model; Verifying the urban planning entity relationship extraction model through the verification set to obtain a verification result; Among them, the preset entity relationship extraction model is the global pointer model Global Pointer.

[0075] Figure 5 A schematic diagram of the structure of the urban planning entity relationship extraction device provided in the embodiment of the present application is shown in FIG. Figure 5 As shown, including: The preprocessing module 510 is used to convert the format of the urban planning standard file and perform data preprocessing to obtain the urban planning standard text; The extraction module 520 is used to input the urban planning standard text into the urban planning entity relationship extraction model, and output the entities and relationships in the urban planning standard text.

[0076] The urban planning entity relationship extraction model is obtained by training a preset entity relationship extraction model based on the annotated corpus word vector representation; The annotated corpus word vector representation is based on the preset urban planning entity relationship extraction prompt words, and the pre-processed urban planning standard data is annotated by a preset large language model to obtain multiple urban planning entity data with relationship type annotations. The urban planning entity data with relationship type annotations are input into the target Roberta model to obtain the annotated corpus word vector representation.

[0077] In an embodiment of the present application, prompt words including annotation rules and annotation strategies are designed through the features of urban planning standard text, and a general large language model is used to obtain sufficient urban planning entity data with relationship type annotations. The annotated data is input into an embedding model for vector representation, which is used to train a deep learning model for joint extraction of entity relationships. The trained model can process urban planning standard texts in batches and quickly extract a large number of entities and relationships, providing a basis for building knowledge graphs or other applications.

[0078] Figure 6 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the urban planning entity relationship extraction model training method, the method comprising: based on the preset urban planning entity relationship extraction prompt words, the pre-processed urban planning standard data is annotated by a preset large language model to obtain a plurality of urban planning entity data carrying relationship type annotations; After inputting the urban planning entity data carrying the relationship type annotations into the target Roberta model, outputting the annotated corpus word vector representation; Training a preset entity relationship extraction model based on the annotated corpus word vector representation to obtain an urban planning entity relationship extraction model; The urban planning entity relationship extraction model is used to batch extract entities and relationships in urban planning standards.

[0079] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0080] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can execute the urban planning entity relationship extraction model training method provided by the above methods, the method comprising: based on preset urban planning entity relationship extraction prompt words, using a preset large language model to perform data labeling on pre-processed urban planning standard data to obtain multiple urban planning entity data carrying relationship type labels; After inputting the urban planning entity data carrying the relationship type annotations into the target Roberta model, outputting the annotated corpus word vector representation; Training a preset entity relationship extraction model based on the annotated corpus word vector representation to obtain an urban planning entity relationship extraction model; The urban planning entity relationship extraction model is used to batch extract entities and relationships in urban planning standards.

[0081] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the urban planning entity relationship extraction model training method provided by the above methods, the method comprising: based on a preset urban planning entity relationship extraction prompt word, using a preset large language model to perform data annotation on the pre-processed urban planning standard data, to obtain a plurality of urban planning entity data carrying relationship type annotations; After inputting the urban planning entity data carrying the relationship type annotations into the target Roberta model, outputting the annotated corpus word vector representation; Training a preset entity relationship extraction model based on the annotated corpus word vector representation to obtain an urban planning entity relationship extraction model; The urban planning entity relationship extraction model is used to batch extract entities and relationships in urban planning standards.

[0082] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0083] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for training an urban planning entity relationship extraction model, characterized in that: include: Based on the preset urban planning entity relationship, prompt words are extracted, and the pre-processed urban planning standard data is annotated through the preset large language model to obtain multiple urban planning entity data with relationship type annotations; After inputting the urban planning entity data carrying the relationship type annotations into the target Roberta model, outputting the annotated corpus word vector representation; Training a preset entity relationship extraction model based on the annotated corpus word vector representation to obtain an urban planning entity relationship extraction model; The urban planning entity relationship extraction model is used to batch extract entities and relationships in urban planning standards.

2. The urban planning entity relationship extraction model training method according to claim 1 is characterized in that: The method for obtaining the pre-processed urban planning standard data specifically includes: After the format of the urban planning standard data document is converted, unstructured text is extracted and the extracted unstructured text is stored in the sqlite database; On the basis of retaining semantic integrity, the unstructured text is segmented, and then the segmented text data is cleaned to obtain pre-processed urban planning standard data.

3. The urban planning entity relationship extraction model training method according to claim 1 is characterized in that: After inputting the urban planning entity data carrying the relationship type annotations into the target Roberta model, before the step of outputting the annotated corpus word vector representation, the method further includes: The preset Roberta model is fine-tuned through the unlabeled basic urban planning terms and basic urban planning specifications information to obtain the target Roberta model in the field of urban planning.

4. The urban planning entity relationship extraction model training method according to claim 1 is characterized in that: The preset entity relationship extraction model is trained based on the annotated corpus word vector representation to obtain an urban planning entity relationship extraction model, including: Dividing each of the annotated corpus word vector representations into a training set and a validation set; Training a preset entity relationship extraction model based on the training set, and stopping the training when a preset condition is met, thereby obtaining an urban planning entity relationship extraction model; Verifying the urban planning entity relationship extraction model through the verification set to obtain a verification result; Among them, the preset entity relationship extraction model is the global pointer model Global Pointer.

5. A method for extracting urban planning entity relationships, characterized in that: include: After format conversion and data preprocessing of the urban planning standard file, the urban planning standard text is obtained; Inputting the urban planning standard text into an urban planning entity relationship extraction model, and outputting entities and relationships in the urban planning standard text; The urban planning entity relationship extraction model is obtained by training a preset entity relationship extraction model based on the annotated corpus word vector representation; The annotated corpus word vector representation is based on the preset urban planning entity relationship extraction prompt words, and the pre-processed urban planning standard data is annotated by a preset large language model to obtain multiple urban planning entity data with relationship type annotations. The urban planning entity data with relationship type annotations are input into the target Roberta model to obtain the annotated corpus word vector representation.

6. A training device for an urban planning entity relationship extraction model, characterized in that: include: The annotation module is used to extract prompt words based on the preset urban planning entity relationship, and annotate the pre-processed urban planning standard data through the preset large language model to obtain multiple urban planning entity data with relationship type annotations; A processing module, configured to input the urban planning entity data carrying the relationship type annotations into a target Roberta model and output an annotated corpus word vector representation; A training module, used to train a preset entity relationship extraction model based on the annotated corpus word vector representation to obtain an urban planning entity relationship extraction model; The urban planning entity relationship extraction model is used to batch extract entities and relationships in urban planning standards.

7. A device for extracting urban planning entity relations, characterized in that: include: A preprocessing module is used to convert the format of the urban planning standard file and perform data preprocessing to obtain the urban planning standard text; An extraction module, used for inputting the urban planning standard text into an urban planning entity relationship extraction model, and outputting entities and relationships in the urban planning standard text; The urban planning entity relationship extraction model is obtained by training a preset entity relationship extraction model based on the annotated corpus word vector representation; The annotated corpus word vector representation is based on the preset urban planning entity relationship extraction prompt words, and the pre-processed urban planning standard data is annotated by a preset large language model to obtain multiple urban planning entity data with relationship type annotations. The urban planning entity data with relationship type annotations are input into the target Roberta model to obtain the annotated corpus word vector representation.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the urban planning entity relationship extraction model training method as described in any one of claims 1 to 4 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the urban planning entity relationship extraction model training method as described in any one of claims 1 to 4.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the urban planning entity relationship extraction model training method as described in any one of claims 1 to 4.