Railway construction stage operation instruction intelligent query method

Through large-scale model technology and structured operation instructions for the railway engineering construction stage, a knowledge graph is established, complex and cumbersome problems are solved, and efficient and intelligent query and question-and-answer are achieved.

CN119917704AActive Publication Date: 2025-05-02CHINA RAILWAY DESIGN GRP CO LTD

Patent Information

Application Number
CN202510110673.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-05-02
Estimated Expiration
2045-01-23

AI Technical Summary

Technical Problem

The query process of the operation instructions in the railway engineering construction stage is complicated and cumbersome, with large files and scattered technical points, making it difficult to improve the query efficiency.

Method used

Use large-scale model technology to organize and structure the operation instruction manual texts of railway construction stages, establish a knowledge graph, and realize intelligent query and intelligent question-and-answer based on natural language.

Benefits of technology

It improves query freedom, reduces the adverse effects brought by traditional text segmentation methods, realizes intelligent question-and-answer and knowledge graph query, and improves query efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917704A_ABST
    Figure CN119917704A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent query method for a railway construction stage operation instruction, which comprises the following steps of: S1, sorting an operation instruction text, S2, extracting a chapter number, dividing chapter content and establishing chapter association, S3, extracting a summary of the chapter, S4, creating a knowledge graph of the railway construction stage operation instruction, S5, identifying user query semantics, generating a query semantic set, and S5, storing the query semantic set into a database, s6, converting the query semantic set into a knowledge graph query statement; and S7, visually displaying a graph query result, and outputting the query result. According to the method, a large model technology is taken as a core, the natural language semantic understanding capability of a large model and the structured knowledge management capability of a knowledge graph are highly fused for the structured characteristics of the railway construction stage operation instruction, and intelligent query of the railway construction stage operation instruction based on the natural language is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of railway engineering construction management, and in particular to an intelligent query method for operation instructions in a railway construction phase. Background Art

[0002] The operation instructions for the railway construction phase are guidance documents specially prepared for the construction work of railway construction projects. These documents are designed to standardize the construction process of railway projects, ensure the quality and safety of the project, and improve construction efficiency. Railway projects involve long-distance line construction, which is large-scale, high-investment, long-construction period, complex technology, and wide-ranging impact. In the early preparation stage of railway project construction, the operation instructions are usually independently prepared by each construction unit in sections and sub-projects. Take a railway project as an example. The project is 136.36 kilometers long and is divided into 5 sections. Taking section 1 as an example, the section is divided into 26 sub-projects according to tunnel excavation, shotcrete construction, system anchor construction, etc. There are more than 130 operation instructions for the railway project, with a size of more than 140MB. The number of files is large, the technical points are scattered, and the query process is complicated and cumbersome. Summary of the invention

[0003] In order to solve the problems in the background technology, the present invention proposes an intelligent query method for railway construction phase operation instructions, which improves the query freedom, can realize intelligent question and answer based on knowledge graph, and can also perform intelligent query based on natural language.

[0004] To this end, the present invention adopts the following technical solutions:

[0005] An intelligent query method for railway construction phase operation instructions includes the following steps:

[0006] S1, text organization of work instruction: firstly, document collection, format conversion and document classification are carried out, then document data cleaning is carried out to remove meaningless information;

[0007] S2, extracting chapter numbers, dividing chapter contents and establishing chapter associations, includes the following steps:

[0008] S21, document batch processing: Batch import various documents according to document categories, identify the text, tables and pictures in each document and output them as {result1};

[0009] S22, if the currently processed document has no image, then go to S23; otherwise, transfer the image and go to S23;

[0010] S23, using the big model to divide {result1} into chapter name, chapter content, table name, table content and picture name according to the chapter number, and output it as {result2}; using the big model to extract the hierarchical relationship between the chapter numbers from {result2}, and output it as {result3};

[0011] S3, extracting and traversing all chapter numbers, chapter contents and hierarchical relationships in {result2} and {result3}, summarizing and generalizing the chapter contents corresponding to the extracted chapter numbers and the sub-chapter contents contained therein using a large model, and outputting them as {result4};

[0012] S4, creating a knowledge graph of railway construction phase operation instructions;

[0013] S5, using the big model to extract the query text input by the user into entity types, entities and entity attributes, and output them as {result5};

[0014] S6, converting the {result5} into a knowledge graph query statement and running it on the knowledge graph created in S4, and outputting the query result as {result6};

[0015] S7, visualize the knowledge graph query results and output the query results:

[0016] First, the {result6} is listed in sub-items; then, the {result6} is displayed in a graphical form; finally, the corresponding contents in {result6} are spliced ​​into a long text, which is summarized and summarized by a large model and then output to the user.

[0017] S23 includes the following steps: S231, extracting chapter numbers and dividing chapter contents; S232, establishing associations between chapters.

[0018] S231 includes the following steps:

[0019] S2311, set task description for the big model to assist the big model in understanding user behavior;

[0020] S2312, specify execution steps for the large model;

[0021] S2313, provide specific examples for the big model to help it understand user needs;

[0022] S2314, specify the format of data input and output;

[0023] S2315, S2312 to S2314 are stored as a prompt word project, recorded as "prompt word project 1"; {result1} of step S21 and "prompt word project 1" are input into the large model together, and the output result is recorded as {result2}.

[0024] The S232 comprises the following steps:

[0025] S2321, set task description for large model;

[0026] S2322, specify execution steps for large models:

[0027] S2323, provides concrete examples for large models;

[0028] S2324, specify the actual data input and output format;

[0029] S2325, store S2322 to S2324 as a prompt word project, recorded as "prompt word project 2"; input the output result {result2} of step S2315 together with "prompt word project 2" into the large model, and save the output result of the large model, and record the output result as {result3}.

[0030] S3 includes the following sub-steps:

[0031] S31, extracting the chapter content of each chapter through {result2} and {result3}, including:

[0032] S311, traverse and extract the chapter Ch in {result2} i Chapter content, i is the chapter number;

[0033] S312, traverse the {result3}, find the Ch i All sub-chapters of ic}, ic is the number of the sub-chapter included in chapter i;

[0034] S313, get Ch ic Chapter Contents:

[0035] If {Ch ic} is empty, then output in, is the Ch found in {result2} i Corresponding chapter content;

[0036] If {Ch ic} is not empty, then take out {Ch ic}, get the chapter content of each sub-chapter in {result2}, and concatenate the chapter contents of all sub-chapter as Ch ic Corresponding chapter content;

[0037] S32, setting roles and task descriptions for the big model, where the roles and task descriptions are used to assist the big model in understanding the user's behavior;

[0038] S33, storing steps S31 to S32 as a prompt word project, recorded as "prompt word project 3"; then inputting the result extracted in step S31 together with "prompt word project 3" into the large model, and outputting {result4}.

[0039] S4 includes the following sub-steps:

[0040] S41, creating node types and defining the relationship between the node types, and creating an attribute set for each node type to store attribute values ​​of nodes in the node type;

[0041] S42, define mapping relationships: map the node types, relationships between node types, and Chinese descriptions of node type attributes in S41 into English fields;

[0042] S43, creating the document node F and the attribute values ​​of its node attributes according to {result1};

[0043] S44, creating a chapter node N according to {result2} and {result4}, and using the corresponding chapter name, chapter content, and chapter summary as the attribute value of the node corresponding to the chapter node N, to obtain the chapter node set {N R};

[0044] S45, establish document node F and its corresponding {N R}The relationship between the nodes in;

[0045] S46, according to the hierarchical relationship between the chapter numbers in {result3} and the mapping relationship defined in S42, a chapter node set {N R}The relationship between the chapter nodes in

[0046] S47, creating a table node T according to the table name and table content in {result2} and the mapping relationship defined in S42 j , j is the table node number, the node attributes of the table node are the table name and table content, and then create the table node T j The corresponding {N R}The relationship between the nodes in;

[0047] S48, creating a graph node T according to the image name in {result2} and the mapping relationship defined in S42 p , p is the number of the graph node, the node attribute of the graph node is the image name, and then establish the graph node T p The corresponding {F R}The relationship between the nodes in;

[0048] S49, the chapter node set {N R The chapter content and chapter summary corresponding to the chapter node N in} are embedded in a vector database; the vector database is used to quickly search for long text information in the chapter content and the chapter summary.

[0049] The node types in S41 include: file node type, chapter node type, table node type and graph node type;

[0050] The file node type attribute set is {document name, document path, project section, document format, document source};

[0051] The chapter node type attribute set is {chapter number, chapter name, chapter content, chapter summary};

[0052] The table node type attribute set is {table name, table content};

[0053] The graph node type attribute set is {picture name};

[0054] The relationship between the file node class and the chapter node class is defined as "included";

[0055] The relationship between the chapter node type and the chapter node type is defined as "parent-child";

[0056] The relationship between the chapter node type and the table node type is defined as "embedded table";

[0057] The relationship between the chapter node type and the graph node type is defined as an "embedded graph";

[0058] S42 includes the following steps:

[0059] S421, mapping node types, file: File; chapter: Chapter; table: Table; picture: Picture;

[0060] S422, mapping the relationship between node types, including: File, Chapter, include; parent and child: Chapter, Chapter, has; embedded table: Chapter, Table, hastable; embedded graph: Chapter, Picture, haspicture;

[0061] S423, mapping the node type attributes, document name: filename; document path: filepath; document format: fileformat; chapter number: chapterno; chapter name: chaptername; chapter content: chaptercontent; chapter abstract: chapterabstract; table name: tablename; table content: tablecontent; picture name: picturename.

[0062] S7 includes the following sub-steps:

[0063] S71, listing the {result6} in separate items, wherein only the nodes of the query result and their node attributes are listed, and the relationships between the nodes are omitted;

[0064] S72, displaying the {result6} in a graphical form, wherein nodes are represented by circles, names of nodes are marked inside the circles, and node relationships are represented by directed arrows;

[0065] S73, concatenate the {result6} into a long text, summarize it by the large model, and then return the result to the user.

[0066] S73 includes the following sub-steps:

[0067] S731, concatenate the node type and node name in {result6} into {node type:node name}, and concatenate the entity attribute type and attribute value in {result5} into {attribute type:attribute value};

[0068] S732, setting roles and tasks for the large model: the role is a text summarization expert, and the task is to summarize the input text content and use it as "prompt word project 5";

[0069] S733, input the long text spliced ​​in S731 and the "prompt word project 5" generated in S732 into the large model for processing, and output the result to the user.

[0070] In S1, during the format conversion, documents in pdf and doc formats are converted into docx formats;

[0071] In S21, the {result1} includes {{basic document information}, {document text}, {document table}, {document image}}, wherein: the {basic document information} includes: document name, document path, project section, document format, document source;

[0072] The {document table} includes: the position of the table in the document, the table name, the table header set, the table data set, and the table annotation;

[0073] The {document image} includes: the location of the image in the document, the image name, and the image in the form of a binary data stream;

[0074] The transfer described in S22 is: first create a "picture" folder in the directory of the document, then transfer the picture in the form of binary data stream to the folder, and name it with the "picture name" of the document picture. The file format of the picture is "jpg".

[0075] Compared with the prior art, the present invention has the following beneficial effects:

[0076] 1. The present invention takes the big model technology as the core, faces the structured characteristics of the operation instructions for the railway construction stage, highly integrates the natural language semantic understanding ability of the big model and the structured knowledge management ability of the knowledge graph, and realizes the intelligent query of the operation instructions for the railway construction stage based on natural language.

[0077] 2. The present invention extracts the chapter and chapter-level information of the railway construction phase operation instruction based on the big model technology, establishes the railway construction phase operation instruction knowledge graph, and uses the big model technology to summarize and generalize the chapter content, expand the chapter attribute set, reduce the adverse effects of traditional text segmentation methods, and improve the query freedom.

[0078] 3. The present invention understands the user's query intention based on the big model technology, converts the query intention into a query statement of the knowledge graph, and splices the nodes and attributes of the query results into a long text, which is summarized by the big model, thereby realizing intelligent question and answer based on the knowledge graph.

[0079] 4. The present invention maps Chinese descriptions into English fields, making the knowledge graph more efficient in processing fields than simply using Chinese. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] Figure 1 It is a flow chart of the intelligent query method of the railway construction phase operation instruction book of the present invention.

[0081] Figure 2 It is a flow chart of S2 of the intelligent query method for operation instructions in the railway construction stage of the present invention.

[0082] Figure 3 It is a schematic diagram of the operation result of S4 of the intelligent query method for operation instructions in the railway construction stage of the present invention. DETAILED DESCRIPTION

[0083] The method of the present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0084] like Figure 1 As shown, the intelligent query method for railway construction phase operation instructions of the present invention comprises the following steps:

[0085] S1, text organization of the work instruction, includes the following steps:

[0086] S11, document collection, format conversion and document inspection:

[0087] (1) Collect all railway engineering work instructions and store them according to project sections, formats, and sources. Check the document format and convert documents in pdf and doc formats to docx format.

[0088] (2) Check the content of the document. According to the Methods for Compilation of Construction Operation Instructions for Railway Construction Projects, the content of the document should include the scope of application, work preparation, technical requirements, construction procedures, process flow, construction requirements, labor organization, material requirements, equipment and tooling configuration, quality control and inspection, and safety and environmental protection requirements.

[0089] (3) Check the document version to ensure that the parsed document is the latest version.

[0090] S12, performing document data cleaning.

[0091] Remove irrelevant information from documents, including headers, footers, advertisements, and watermarks.

[0092] Remove formatting errors in documents, including: garbled characters, extra spaces, and extra line breaks.

[0093] Remove noise data from documents, including duplicate content and irrelevant links.

[0094] S2, extract chapter numbers, divide chapter contents, and establish chapter associations. Figure 2 As shown, it includes the following steps:

[0095] S21, batch processing of documents. Use existing document processing tools to batch import various documents according to document categories, identify the text, tables and pictures in the documents, and output them by category: the output format of each document is {{basic information of the document}, {document text}, {document table}, {document picture}}, where:

[0096] {Basic document information} includes: document name, document path, project section, document format, and document source;

[0097] {Document table} includes: the position of the table in the document, the table name, the table header set, the table data set, and the table comments;

[0098] {Document Image} includes: the location of the image in the document, the image name and the image; the image is stored as a binary data stream;

[0099] Save the output result and record it as {result1}.

[0100] S22, transfer the pictures:

[0101] If the {document picture} of the currently processed document is empty, enter S23, otherwise create a "picture" folder in the directory of the document, read the {document picture} in sequence, transfer the picture stored in the binary data stream, name it with the "picture name" of the document picture, and the file format is "jpg".

[0102] S23, processing {result1} obtained in S21 with the large model prompt word engineering, gradually extracting chapter numbers, dividing contents, and establishing chapter associations.

[0103] The specific steps include:

[0104] S231, extracting chapter numbers and dividing chapter contents, including the following steps:

[0105] S2311, set task description for large model:

[0106] Given a text that describes some chapter numbers and contents that the user wants to query, identify these chapter numbers and contents from the text. Task description is used to assist the large model in understanding user behavior.

[0107] S2312, specifies execution steps for the large model, including:

[0108] Step 1, extract all chapter numbers in {result1} and output {chapter: chapterno}. Chapterno represents the extracted chapter number. When the chapter number cannot be identified, {} is output.

[0109] Step 2: extract all chapter numbers and their corresponding chapter names in {result1}, and output {chname:chapterno,chaptername}. Chaptername represents the extracted chapter name. When the chapter name cannot be identified, the first sentence after the chapter number is taken as the chapter name; if there is no corresponding sentence, {} is output.

[0110] Step 3: extract all chapter numbers and their corresponding chapter contents in {result1}, and output {content:chapterno,chapercontent}. Chapercontent represents the extracted chapter content, which does not include the chapter name. If the chapter content corresponding to the chapter number cannot be identified, {} is output.

[0111] Step 4, extract all chapter numbers and corresponding table names and table contents in {result1}, and output {table:chapterno,tablename,tablecontent}. tablename represents the extracted table name, tablecontent represents the extracted table content, where: the table content is the concatenation of the table header set, the table data set, and the table notes, and the specific concatenation format is {{notes: table notes}, {cols: column 1, column 2...}, {rows: {row 1 first cell, row 1 second cell, ...}, {row 2 first cell, row 2 second cell}, ...}}; if the table name and table content cannot be identified, output {}.

[0112] Step 5: extract all chapter numbers and their corresponding picture names in {result1} and output {picture:chapterno,picturename}. picturename indicates the picture name. If the picture name cannot be identified, {} is output.

[0113] S2313, provide specific examples for the big model. The specific examples are used to help the big model understand the user's needs. The format of the specific example is as follows:

[0114] ############

[0115] -Example-

[0116] ############

[0117] Example:

[0118] Text: 1. Scope of application

[0119] Applicable to the excavation construction of XXXXX tunnel.

[0120] ############

[0121] Output:

[0122] {chapter: 1.}{chname: 1., Scope of application}{content: 1., Applicable to the excavation construction of the XXXXX tunnel.}{}{}

[0123] S2314, specify the data input and output formats as follows:

[0124] ######################

[0125] - Actual data -

[0126] ######################

[0127] Text: {text}

[0128] ######################

[0129] Output:

[0130] In the above example, XXXXX represents the tunnel name, such as Yangcun.

[0131] S2315, S2312 to S2314 are stored as a prompt word project, recorded as "prompt word project 1". {result1} of step S21 and "prompt word project 1" are input into the large model, and the output result of the large model is saved, and the output result is recorded as {result2}.

[0132] S232, establishing associations between chapters, including the following steps:

[0133] S2321, set task description for large model:

[0134] Given a piece of text that describes some chapter numbers that the user wants to query and the hierarchical relationship between the chapter numbers, extract the hierarchical relationship between the chapter numbers and output it in the specified format.

[0135] S2322, specify execution steps for large models:

[0136] Step 1, extract the chapter number in {result2}, the chapter number is enclosed in {} and starts with "chapter:";

[0137] Step 2: Identify the hierarchical relationship between the chapter numbers extracted in step 1 and output {layer: pchapterno, cchapterno}. pchapterno represents the parent chapter number and cchapterno represents the child chapter number. The child chapter number of each chapter number is searched in turn. The parent chapter number is shorter than the child chapter number. If the child chapter number cannot be found, it is not output.

[0138] S2323, provides specific examples for large models. The format of the specific examples is as follows:

[0139] ############

[0140] -Example-

[0141] ############

[0142] Example:

[0143] Text: {chapter: 2.} {chname: 2., homework preparation}

[0144] {chapterno: 2.1}{chname: 2.1, internal technical preparation}

[0145] ############

[0146] Output:

[0147] {layer: 2, 2.1}

[0148] S2324, specify the actual data input and output format. The format is the same as step S2314.

[0149] S2325, S2322 to S2324 are stored as a prompt word project, recorded as "prompt word project 2". The output result {result2} of step S2315 is input into the large model together with "prompt word project 2", and the output result of the large model is saved, and the output result is recorded as {result3}.

[0150] In one embodiment of the present invention, the large model used is Qwen2.5:32B, which is an open source model released by Alibaba on September 19, 2024. It is deployed using Ollama and runs on an NVIDIA GeForce RTX 4090 graphics card.

[0151] S3, an overview of the extraction section. It includes the following sub-steps:

[0152] S31, extract the content of each chapter through {result2} and {result3}. Specifically:

[0153] S311, traverse and extract chapter Ch in {result2} i , i is the chapter number;

[0154] S312, traverse {result3}, find Ch i All sub-chapters of ic}, ic is the number of the sub-chapter included in chapter i;

[0155] S313, get Ch ic Chapter Contents:

[0156] If {Ch ic} is empty, then output Ch is found in {result2} i Corresponding chapter content;

[0157] If {Ch ic} is not empty, then take out {Ch ic}, get the chapter content of each sub-chapter in {result2}, and concatenate the chapter contents of all sub-chapter as Ch ic The corresponding chapter content.

[0158] S32, set roles and task descriptions for the large model: You are a text processing expert. Please summarize the input text. The summary should not exceed 30 words.

[0159] S33, S31 and S32 are stored as a prompt word project, recorded as "prompt word project 3"; the result extracted in step S31 is input into the large model together with "prompt word project 3", and the output result of the large model is saved, and the output result is recorded as {result4}. {result4} includes a chapter summary of the chapter content.

[0160] S4, creating a knowledge graph of railway construction phase operation instructions, including the following sub-steps:

[0161] S41, creating node types and defining relationships between node types, and creating an attribute set for each node type.

[0162] First, node types are created for the knowledge graph of the railway construction phase operation instructions. The node types include: file node type, chapter node type, table node type and graph node type.

[0163] Then, create a set of attributes for each node type, specifically:

[0164] The file node type attribute set is {document name, document path, project section, document format, document source};

[0165] The attribute set of chapter node type is {chapter number, chapter name, chapter content, chapter summary};

[0166] The table node type attribute set is {table name, table content};

[0167] The graph node type attribute set is {image name}.

[0168] The attribute set is used to store the attribute value of each node.

[0169] Finally, the relationship between node types is defined for the knowledge graph of the railway construction phase operation instructions, where:

[0170] The relationship between the file node class and the chapter node class is defined as "contains";

[0171] The relationship between chapter node types is defined as "parent-child";

[0172] The relationship between the chapter node type and the table node type is defined as "embedded table";

[0173] The relationship between a chapter node type and a graph node type is defined as an "embedded graph".

[0174] S42, define the semantic mapping relationship of the graph fields.

[0175] Since the knowledge graph has low processing efficiency for Chinese, the Chinese descriptions of node types, relationships between node types, and node type attributes in S41 are mapped to English fields. The specific mapping relationship is as follows:

[0176] S421, map the node types: file: File; chapter: Chapter; table: Table; picture: Picture.

[0177] S422, mapping the relationship between node types, including: File, Chapter, include; parent and child: Chapter, Chapter, has; embedded table: Chapter, Table, hastable; embedded graph: Chapter, Picture, haspicture;

[0178] S423, mapping the node type attributes, document name: filename; document path: filepath; document format: fileformat; chapter number: chapterno; chapter name: chaptername; chapter content: chaptercontent; chapter abstract: chapterabstract; table name: tablename; table content: tablecontent; picture name: picturename.

[0179] S43, read each record in {result1} in turn, each record corresponds to a work instruction document, set the currently read document as R, and create a document node F of the corresponding file class; extract {basic document information} in document R, and write {document name, document path, document format} in document R into the corresponding node attribute of document node F according to the semantic mapping relationship defined in S42;

[0180] S44, in {result2} and {result4}, read the output result set corresponding to document R, read each line of output result in turn, extract the chapter number and create chapter node N, extract the {chapter name, chapter content, chapter summary} corresponding to the chapter number, and write them into the corresponding node attribute of chapter node N according to the mapping relationship defined in S42; obtain the corresponding chapter node set {N} formed by processing the output result set corresponding to document R. R};

[0181] S45, establish document node F and its corresponding {N R}The inclusion relationship "include" of the node in .

[0182] S46, according to the hierarchical relationship between the chapter numbers in {result3} and the mapping relationship defined in S42, a chapter node set {N R}The parent-child relationship of each chapter node is "has".

[0183] S47, create table node T according to the table name and table content in {result2} and the mapping relationship defined in S42 j , j is the table node number, and the node attributes of the table node are the table name and table content. Then create the table node T j The corresponding {N R} of the embedded table relation "hastable".

[0184] S48, create a graph node T according to the image name in {result2} and the mapping relationship defined in S42 p, p is the number of the graph node, and the node attribute of the graph node is the image name. Then create the graph node T p The corresponding {F R} of the embedded graph relation "haspicture" of the nodes in .

[0185] The result of the knowledge graph created in one embodiment of the present invention is as follows Figure 3 As shown. Figure 3 In the figure, nodes are represented by circles with the names of the nodes marked inside. The corresponding attributes are represented by boxes with the attribute names and corresponding attribute values ​​of the nodes listed inside the boxes. Solid arrows represent the relationship between nodes, and dotted arrows represent the attributes derived from the nodes.

[0186] S49, the chapter node set {N R The chapter content and chapter summary corresponding to the chapter node N in} are embedded in the vector database. The vector database is used to quickly find the long text information in the chapter content and chapter summary.

[0187] S5, identify the user query semantics and generate a query semantic set.

[0188] The user input text is processed by the large model prompt word engineering, and the query text {client} input by the user is converted into a query semantic set. It includes the following steps:

[0189] S51, set the task description for the large model:

[0190] Given a piece of text that describes some entities, entity attributes, or other entities associated with an entity that a user wants to query, identify these types of entities from the text, as well as identify the attributes of the entity or other entities associated with the entity that the user wants to query.

[0191] S52, specifying execution steps for the large model, including:

[0192] S521, extract all entity types in the query text and output {node:nodetype}. Nodetype represents the entity type, and the entity type is file or chapter.

[0193] S522, extract all entities in the query text and output {entity: nname, nodetype}. nname represents the entity name, nodetype represents the entity type, and the entity includes the chapter name, table name and picture name. If the entity cannot be found, the one with the closest semantics is found as the output result.

[0194] S523, extract all entity attributes in the query text and output {attribute: atrname, atrtype}. atrname represents the entity attribute name, atrtype represents the entity attribute type, and the entity attribute type includes chapter number and table content; table content corresponds to tablecontent; if the content cannot be found, convert the query text into a vector, and calculate the similarity with the data in the vector database formed in S49 to achieve enhanced retrieval.

[0195] S53, provide specific examples for large models. The format of the specific examples is as follows:

[0196] ############

[0197] -Example-

[0198] ############

[0199] Example:

[0200] Text: Check the chapter about tunnel excavation construction

[0201] ############

[0202] Output:

[0203] {node: chapter}{entity: Tunnel Engineering Excavation Work Instructions, Documents}

[0204] S54, specify the actual data input and output format. The format is the same as step S2314.

[0205] S55, store S51 to S54 as a prompt word project, record it as "prompt word project 4", input the query text {client} and "prompt word project 4" into the big model, and save the output result of the big model, record the output result as the query semantic set {result5}.

[0206] S6, converting the query semantic set into a knowledge graph query statement. This includes the following steps:

[0207] S61, convert the output result {result5} of step S5 into a knowledge graph query statement according to the mapping relationship in S42.

[0208] Taking the {node: chapter} {entity: tunnel engineering tunnel excavation construction work instructions, document} in S5 as an example, the specific steps are as follows:

[0209] S611, parse the query subject from {result5}. The query subject should be {node:nodetype}, traverse {result5} in sequence, and jump out of the traversal when the first {node:nodetype} is found. Taking the above query as an example, find {node:chapter} and jump out of the traversal, decompose the fields, and get the query subject as "chapter";

[0210] S612, parse the restriction conditions of the query subject from {result5}. The restriction conditions are {entity: nname, ntype}, {attribute: atrname, atrtype}, query all restriction conditions, and form a restriction condition list. Take the above query as an example, the restriction condition of the query subject is {entity: tunnel engineering tunnel excavation construction work instruction, file}, forming a restriction condition list List({entity: tunnel engineering tunnel excavation construction work instruction, file});

[0211] S613, convert S611 and S612 into a query statement.

[0212] In one embodiment of the present invention, the knowledge graph is created using Baidu's open source HugeGraph graph database, so it is converted into a statement that conforms to Gremlin syntax. The conversion result is as follows:

[0213] gV().has('Document', 'Tunnel Engineering Excavation Work Guide', 'N').bothE().otherV().hasLabel('Chapter')

[0214] S614, transform the query statement obtained in S613 according to the mapping relationship in S42, and the transformation result is as follows:

[0215] gV().has('File', 'Tunnel Engineering Excavation Construction Work Guide', 'N').bothE().otherV().

[0216] hasLabel('Chapter')

[0217] S62, runs the query text {client} on the knowledge graph created in S4 through the knowledge graph query statement, and outputs the query result {result6}.

[0218] In one embodiment of the present invention, the knowledge graph is created using Baidu's open source HugeGraph graph database, the org.apache.hugegraph package is introduced, and a background query interface is written to implement the query of the knowledge graph. The details are as follows:

[0219] GremlinManager gremlin=hugeClient.gremlin();

[0220] org.apache.hugegraph.structure.gremlin.ResultSet resultSet=gremlin.gremlin(sql).execute();

[0221] Here, sql is the query text {client} output in S61.

[0222] S7, visualize the knowledge graph query results to form knowledge questions and answers. It includes the following steps:

[0223] S71, list {result6} in separate items, only list the nodes of the query result and their node attributes, and omit the relationship between the nodes;

[0224] S72, display {result6} in a graphical form, wherein nodes are represented by circles, and the names of the nodes are marked inside the circles. The node relationships in {result6} are represented by directed arrows, and the relationship names are not marked on the arrows to keep the graph neat;

[0225] S73, concatenate {result6} into a long text, summarize it by the big model, and then return the result to the user. The specific steps are as follows:

[0226] S731, concatenate the node type and node name in {result6} into {node type:node name}, concatenate the entity attribute type and attribute value in {result5} into {attribute type:attribute value}, and use “;” to concatenate different concatenated items;

[0227] S732, set roles and tasks for the big model: You are a text summarization expert, summarize the input text content and use it as "prompt word project 5";

[0228] S733, input the long text spliced ​​in S731 and the "prompt word project 5" generated in S732 into the large model for processing, and return the result to the user.

Claims

1. An intelligent query method for railway construction phase operation instructions, characterized in that: The following steps are involved: S1, text organization of work instruction: firstly, document collection, format conversion and document classification are carried out, then document data cleaning is carried out to remove meaningless information; S2, extracting chapter numbers, dividing chapter contents and establishing chapter associations, includes the following steps: S21, document batch processing: Batch import various documents according to document categories, identify the text, tables and pictures in each document and output them as {result1}; S22, if the currently processed document has no image, then go to S23; otherwise, transfer the image and go to S23; S23, using the big model to divide {result1} into chapter name, chapter content, table name, table content and picture name according to the chapter number, and output it as {result2}; using the big model to extract the hierarchical relationship between the chapter numbers from {result2}, and output it as {result3}; S3, extracting and traversing all chapter numbers, chapter contents and hierarchical relationships in {result2} and {result3}, summarizing and generalizing the chapter contents corresponding to the extracted chapter numbers and the sub-chapter contents contained therein using a large model, and outputting them as {result4}; S4, creating a knowledge graph of railway construction phase operation instructions; S5, using the big model to extract the query text input by the user into entity types, entities and entity attributes, and output them as {result5}; S6, converting the {result5} into a knowledge graph query statement and running it on the knowledge graph created in S4, and outputting the query result as {result6}; S7, visualize the knowledge graph query results and output the query results: First, the {result6} is listed in sub-items; then, the {result6} is displayed in a graphical form; finally, the corresponding contents in {result6} are spliced ​​into a long text, which is summarized and summarized by a large model and then output to the user.

2. The intelligent query method for railway construction phase operation instructions according to claim 1 is characterized by: S23 includes the following steps: S231, extracting chapter numbers and dividing chapter contents; S232, establishing associations between chapters.

3. The intelligent query method for railway construction phase operation instructions according to claim 2 is characterized in that: S231 includes the following steps: S2311, set task description for the big model to assist the big model in understanding user behavior; S2312, specify execution steps for the large model; S2313, provide specific examples for the big model to help it understand user needs; S2314, specify the format of data input and output; S2315, store S2312 to S2314 as a prompt word project, recorded as "prompt word project 1"; input {result1} of step S21 together with "prompt word project 1" into the large model, and record the output result as {result2}.

4. The intelligent query method for railway construction phase operation instructions according to claim 3 is characterized by: The S232 comprises the following steps: S2321, set task description for large model; S2322, specify execution steps for large models: S2323, provides concrete examples for large models; S2324, specify the actual data input and output format; S2325, store S2322 to S2324 as a prompt word project, recorded as "prompt word project 2"; input the output result {result2} of step S2315 together with "prompt word project 2" into the large model, and save the output result of the large model, and record the output result as {result3}.

5. The intelligent query method for railway construction phase operation instructions according to claim 1 is characterized by: S3 includes the following sub-steps: S31, extracting the chapter content of each chapter through {result2} and {result3}, including: S311, traverse and extract the chapter Ch in {result2} i Chapter content, i is the chapter number; S312, traverse the {result3}, find the Ch i All sub-chapters of ic }, ic is the number of the sub-chapter included in chapter i; S313, get Ch ic Chapter Contents: If {Ch ic } is empty, then output in, is the Ch found in {result2} i Corresponding chapter content; If {Ch ic } is not empty, then take out {Ch ic }, get the chapter content of each sub-chapter in {result2}, and concatenate the chapter contents of all sub-chapter as Ch ic Corresponding chapter content; S32, setting roles and task descriptions for the big model, where the roles and task descriptions are used to assist the big model in understanding the user's behavior; S33, storing steps S31 to S32 as a prompt word project, recorded as "prompt word project 3"; then inputting the result extracted in step S31 together with "prompt word project 3" into the large model, and outputting {result4}.

6. The intelligent query method for railway construction phase operation instructions according to claim 1 is characterized by: S4 includes the following sub-steps: S41, creating node types and defining the relationship between the node types, and creating an attribute set for each node type to store attribute values ​​of nodes in the node type; S42, define mapping relationships: map the node types in S41, the relationships between the node types, and the Chinese descriptions of the node type attributes into English fields; S43, creating the document node F and the attribute values ​​of its node attributes according to {result1}; S44, creating a chapter node N according to {result2} and {result4}, and using the corresponding chapter name, chapter content, and chapter summary as the attribute value of the node corresponding to the chapter node N, to obtain the chapter node set {N R }; S45, establish document node F and its corresponding {N R }The relationship between the nodes in; S46, according to the hierarchical relationship between the chapter numbers in {result3} and the mapping relationship defined in S42, a chapter node set {N R }The relationship between the chapter nodes; S47, creating a table node T according to the table name and table content in {result2} and the mapping relationship defined in S42 j , j is the table node number, the node attributes of the table node are the table name and table content, and then create the table node T j The corresponding {N R }The relationship between the nodes in; S48, creating a graph node T according to the image name in {result2} and the mapping relationship defined in S42 p , p is the number of the graph node, the node attribute of the graph node is the image name, and then establish the graph node T p The corresponding {F R }The relationship between the nodes in; S49, the chapter node set {N R The chapter content and chapter summary corresponding to the chapter node N in} are embedded in a vector database; the vector database is used to quickly search for long text information in the chapter content and the chapter summary.

7. The intelligent query method for railway construction phase operation instructions according to claim 6 is characterized by: The node types in S41 include: file node type, chapter node type, table node type and graph node type; The file node type attribute set is {document name, document path, project section, document format, document source}; The chapter node type attribute set is {chapter number, chapter name, chapter content, chapter summary}; The table node type attribute set is {table name, table content}; The graph node type attribute set is {picture name}; The relationship between the file node class and the chapter node class is defined as "included"; The relationship between the chapter node types is defined as "parent-child"; The relationship between the chapter node type and the table node type is defined as "embedded table"; The relationship between the chapter node type and the graph node type is defined as an "embedded graph"; S42 includes the following steps: S421, mapping node types, file: File; chapter: Chapter; table: Table; picture: Picture; S422, mapping the relationship between node types, including: File, Chapter, include; parent and child: Chapter, Chapter, has; embedded table: Chapter, Table, hastable; embedded graph: Chapter, Picture, haspicture; S423, mapping the node type attributes, document name: filename; document path: filepath; document format: fileformat; chapter number: chapterno; chapter name: chaptername; chapter content: chaptercontent; chapter abstract: chapterabstract; table name: tablename; table content: tablecontent; picture name: picturename.

8. The intelligent query method for railway construction phase operation instructions according to claim 1 is characterized by: S7 includes the following sub-steps: S71, listing the {result6} in separate items, wherein only the nodes of the query result and their node attributes are listed, and the relationships between the nodes are omitted; S72, displaying the {result6} in a graphical form, wherein nodes are represented by circles, names of nodes are marked inside the circles, and node relationships are represented by directed arrows; S73, concatenate the {result6} into a long text, summarize it by the large model, and then return the result to the user.

9. The intelligent query method for railway construction phase operation instructions according to claim 8 is characterized by: S73 includes the following sub-steps: S731, concatenate the node type and node name in {result6} into {node type:node name}, and concatenate the entity attribute type and attribute value in {result5} into {attribute type:attribute value}; S732, setting roles and tasks for the large model: the role is a text summarization expert, and the task is to summarize the input text content and use it as "prompt word project 5"; S733, input the long text spliced ​​in S731 and the "prompt word project 5" generated in S732 into the large model for processing, and output the result to the user.

10. The intelligent query method for railway construction phase operation instructions according to claim 1 is characterized by: In S1, during the format conversion, documents in pdf and doc formats are converted into docx formats; In S21, the {result1} includes {{basic document information}, {document text}, {document table}, {document image}}, wherein: the {basic document information} includes: document name, document path, project section, document format, document source; The {document table} includes: the position of the table in the document, the table name, the table header set, the table data set, and the table annotation; The {document image} includes: the location of the image in the document, the image name, and the image in the form of a binary data stream; The transfer described in S22 is: first create a "picture" folder in the directory of the document, then transfer the picture in the form of binary data stream to the folder, and name it with the "picture name" of the document picture. The file format of the picture is "jpg".

Citation Information

Patent Citations

  • Data processing method based on knowledge map

    CN109255031A

  • Intelligent searching method based on natural language and knowledge graph engineering information

    CN111708899A

  • Intelligent text information processing system

    CN115455935A

  • Knowledge graph visual query method based on graph abstract

    CN116361447A

  • Construction method, system and equipment of rule and regulation knowledge graph and medium

    CN116662561A

Cited By

  • Digital course generation method and system based on large language model

    CN120471029A

  • A method and system for generating digital courses based on a large language model

    CN120471029B