Railway construction stage operation instruction book intelligent query method

By using large-scale modeling technology to organize the text of work instructions during the railway engineering construction phase and establish a knowledge graph, the problems of large number of documents and complex queries were solved, enabling intelligent querying and question answering, and improving query efficiency and accuracy.

CN119917704BActive Publication Date: 2025-11-04CHINA RAILWAY DESIGN GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The number of work instruction documents during the railway engineering construction phase is large, and the technical points are scattered, making the search process complex and cumbersome, and difficult to conduct efficient intelligent searches.

Method used

The large model technology is used to organize and structure the work instructions, build a knowledge graph, and realize intelligent query based on natural language. The large model understands the user's intent and generates query results.

Benefits of technology

It improves the freedom of querying work instructions during the railway construction phase, reduces the adverse effects of traditional text segmentation methods, realizes intelligent question answering based on knowledge graphs, and improves query efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917704B_ABST
    Figure CN119917704B_ABST
Patent Text Reader

Abstract

The application discloses a railway construction stage operation instruction book intelligent query method, including S1. Operation instruction book text arrangement, S2. Extract chapter number, divide chapter content, and establish chapter association, S3. Extract the summary of the chapter, S4. Create a railway construction stage operation instruction book knowledge graph, S5. Identify user query semantics, generate a query semantic set, S6. Query semantic set is converted into a knowledge graph query statement, S7. The graph query result is visualized and displayed, and the query result is output. The application takes large model technology as the core, faces the structured characteristics of the railway construction stage operation instruction book, highly integrates the natural language semantic understanding ability of the large model and the structured knowledge management ability of the knowledge graph, and realizes the intelligent query of the railway construction stage operation instruction book based on the natural language.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of railway engineering construction management, and in particular to a railway construction stage operation instruction book intelligent query method. BACKGROUND

[0002] The operation instruction book of the railway engineering construction stage is a guiding document specially prepared for the construction operation of the railway construction project. These documents aim to standardize the construction process of railway engineering, ensure engineering quality and safety, and improve construction efficiency. Railway engineering involves long-distance line construction, with large scale, high investment, long construction period, complex technology, and wide influence. In the early preparation stage of railway engineering construction, the operation instruction book is usually independently prepared by each construction unit for sub-contract sections and sub-division engineering. Taking a certain railway engineering as an example, the total length of the engineering is 136.36 kilometers, which is divided into 5 sections. Taking a section as an example, the section is divided into 26 sub-division engineering according to tunnel excavation, sprayed concrete construction, system anchor rod construction, etc. The total number of operation instruction books for this railway engineering is more than 130, with a file size of more than 140MB. The number of files is large, the technical points are scattered, and the query process is complex and tedious. SUMMARY

[0003] In order to solve the problems in the background art, the present application proposes a railway construction stage operation instruction book intelligent query method which improves the query freedom, realizes intelligent question and answer based on knowledge graph, and can also perform intelligent query based on natural language.

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

[0005] A railway construction stage operation instruction book intelligent query method, comprising the following steps:

[0006] S1, operation instruction book text arrangement: firstly, document collection, format conversion and document classification are performed, and then document data cleaning is performed to eliminate meaningless information;

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

[0008] S21, document batch processing: batch importing various documents according to document categories, recognizing text, tables and pictures in each document and outputting as {result1};

[0009] S22, if the current processing document has no picture, then enter S23; otherwise, store the picture, and enter S23;

[0010] S23, dividing the {result1} into chapter names, chapter contents, table names, table contents, and picture names according to the chapter numbers using a large model, and outputting it as {result2}; extracting the hierarchical relationship between the chapter numbers from the {result2} using a large model, and outputting it as {result3};

[0011] S3, extracting and traversing all chapter numbers, chapter contents, and hierarchical relationships in the {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 it as {result4};

[0012] S4, creating a knowledge graph of the railway construction stage operation guide;

[0013] S5, extracting the user input query text into entity types, entities, and entity attributes using a large model, and outputting it 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, visualizing the knowledge graph query result and outputting the query result:

[0016] First, list the {result6} items; then, display the {result6} in a graphical manner; finally, concatenate the corresponding content in {result6} into a long text and output it to the user after summarizing and inducing it by a large model.

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

[0018] S231 includes the following steps:

[0019] S2311, setting a task description for the large model to assist the large model in understanding the user's behavior;

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

[0021] S2313, providing specific examples for the large model to assist the large model in understanding the user's needs;

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

[0023] S2315, store S2312-S2314 as a prompt engineering, denoted as "prompt engineering 1"; input {result1} of step S21 and "prompt engineering 1" into the large model, and record the output result as {result2}.

[0024] The S232 includes the following steps:

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

[0026] S2322, specify the execution steps for the large model:

[0027] S2323, provide specific examples for the large model;

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

[0029] S2325, store S2322-S2324 as a prompt engineering, denoted as "prompt engineering 2"; input the output result {result2} of step S2315 and "prompt engineering 2" into the large model, and save the output result of the large model, denoted as {result3}.

[0030] S3 includes the following sub-steps:

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

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

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

[0034] S313, obtain the chapter content of Ch ic :

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

[0036] If {Ch ic} is not empty, sequentially take out {Ch ic ​the chapter content of each sub-chapter in {result2}, and splicing the chapter content of all sub-chapters as Ch ic corresponding chapter content;

[0037] S32, setting a role and a task description for the large model, the role and the task description being used to assist the large model in understanding the behavior of the user;

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

[0039] S4 includes the following sub-steps:

[0040] S41, creating node types and defining relationships between the node types, and creating an attribute set for each node type for storing attribute values of nodes in the node type;

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

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

[0043] S44, creating a chapter node N according to the {result2} and the {result4}, and taking the corresponding chapter name, chapter content, and chapter abstract of the chapter node N as attribute values of nodes corresponding to the chapter node N, to obtain a chapter node set {N R} corresponding to the document R;

[0044] S45, establishing a relationship between the document node F and nodes in {N R};

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

[0046] S47, creating a table node T j according to the table name and the table content in the {result2} and the mapping relationship defined in S42, j being a table node number, and a node attribute of the table node being the table name and the table content, and then establishing a relationship between the table node T j and nodes in {N R};

[0047] S48, create a graph node T according to the picture name in the {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 picture name, and then the graph node T is established p and the relationship of the node in the {F R} corresponding to it;

[0048] S49, embed the chapter content and chapter abstract corresponding to the chapter node N in the {N R} into a vector database; the vector database is used to quickly find long text information in the chapter content and the chapter abstract.

[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 abstract};

[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 type and the chapter node type is defined as "contains";

[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 "embedded graph";

[0058] S42 includes the following steps:

[0059] S421, map the node types: file: File; chapter: Chapter; table: Table; graph: Picture;

[0060] S422, mapping the relationships between node types, including: File, Chapter, include; parent-child: Chapter, Chapter, has; embedded table: Chapter, Table, has table; embedded picture: Chapter, Picture, has picture;

[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, list the {result6} items, only list the nodes and their node attributes of the query results, omit the relationships between nodes;

[0064] S72, display the {result6} in a graphical manner, where nodes are represented by circles, the node names are labeled inside the circles, and node relationships are represented by directed arrows;

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

[0066] S73 includes the following sub-steps:

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

[0068] S732, set the role and task 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 engineering 5";

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

[0070] In S1, the format conversion converts the pdf and doc format documents into docx format;

[0071] In S21, the {result1} includes {{document basic information}, {document text}, {document table}, {document picture}}, wherein: the {document basic information} includes: document name, document path, engineering 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 picture} includes: the position of the picture in the document, the picture name, and the binary data stream form of the picture;

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

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

[0076] 1. The present application takes large model technology as the core, and faces the structured characteristics of the railway construction stage operation instruction book, highly fuses the natural language semantic understanding ability of the large model and the structured knowledge management ability of the knowledge graph, and realizes the intelligent query of the railway construction stage operation instruction book based on natural language.

[0077] 2. The present application extracts the chapter and chapter level information of the railway construction stage operation instruction book based on large model technology, establishes the knowledge graph of the railway construction stage operation instruction book, and uses large model technology to summarize and induce the chapter content, expands the chapter attribute set, reduces the adverse effects brought by the traditional text segmentation method, and improves the query freedom.

[0078] 3. The present application understands the query intention of the user based on large model technology, converts the query intention into a query statement of the knowledge graph, splices the nodes and attributes of the query result into a long text, and summarizes it by large model, realizes the intelligent question and answer based on the knowledge graph.

[0079] 4. The present application maps the Chinese description to the English field, so that the processing efficiency of the knowledge graph on the field is higher than that of using Chinese alone. BRIEF DESCRIPTION OF DRAWINGS

[0080] Figure 1 is the flow chart of the intelligent query method of the railway construction stage operation instruction book of the present application.

[0081] Figure 2 is the flow chart of S2 of the intelligent query method of the railway construction stage operation instruction book of the present application.

[0082] Figure 3 is the running result schematic diagram of S4 of the railway construction stage operation instruction book intelligent query method of the present application. DETAILED DESCRIPTION

[0083] The method of the present application is described in detail below in combination with the drawings and examples.

[0084] As shown in the drawings, the railway construction stage operation instruction book intelligent query method of the present application includes the following steps: Figure 1

[0085] S1, operation instruction book text arrangement, including the following steps:

[0086] S11, document collection, format conversion and document checking are performed:

[0087] (1) Collect all operation instruction books of railway engineering, and store them according to engineering bid section, format and source. Check the document format, and convert the documents in pdf and doc formats into docx format.

[0088] (2) Check the document content. According to the "Railway Construction Project Operation Instruction Book Compilation Method", the document content should include scope of application, operation preparation, technical requirements, construction procedure, process flow, construction requirements, labor organization, material requirements, equipment and tool 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, document data cleaning is performed.

[0091] Remove irrelevant information in the document, including: header, footer, advertisement, watermark.

[0092] Remove format errors in the document, including: garbled code, extra spaces, extra line breaks.

[0093] Remove noise data in the document, including: repeated content, irrelevant links.

[0094] S2, extract chapter number, divide chapter content, and establish chapter association. As shown in the drawings, it includes the following steps: Figure 2

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

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

[0097] {document table} includes: the location of the table in the document, the table name, the table header set, the table data set, and the table annotation;

[0098] {document picture} includes: the location of the picture in the document, the picture name, and the picture; the picture is stored in binary data stream;

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

[0100] S22, picture transfer:

[0101] If the {document picture} of the current processing document is empty, go to S23, otherwise create a "picture" folder under the directory of the document, read the {document picture} one by one, and store the picture in binary data stream, name it with the "picture name" of the document picture, and the file format is "jpg".

[0102] S23, process {result1} obtained in S21 with the prompt word project of the large model, gradually extract the chapter number, divide the content, and establish the chapter association.

[0103] Specifically, the following steps are included:

[0104] S231, extract chapter number and divide chapter content, including the following steps:

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

[0106] Give a text that describes some chapter numbers and contents under chapter numbers that the user wants to query, and identify these chapter numbers and contents from the text. The task description is used to assist the large model to understand the user's behavior.

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

[0108] Step 1, extract all chapter numbers in {result1}, and output {chapter: chapterno}. Chapterno represents the extracted chapter number, and when the chapter number cannot be identified, 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, and when the chapter name cannot be identified, the first sentence after the chapter number is extracted as the chapter name; if there is no corresponding sentence, {} is output.

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

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

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

[0113] S2313, provide specific examples for the large model. Specific examples are used to help the large 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 body.

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

[0121] Output:

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

[0123] S2314 specifies the data input and output formats, as shown below:

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

[0125] -Actual Data-

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

[0127] Text: {text}

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

[0129] Output:

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

[0131] S2315, Store S2312 to S2314 as a prompt word project, denoted as "Prompt Word Project 1". Input {result1} from step S21 together with "Prompt Word Project 1" into the large model, save the output result of the large model, and denot the output result as {result2}.

[0132] S232, Establishing relationships between chapters includes the following steps:

[0133] S2321, Define the task description for the large model:

[0134] Given a text that describes the chapter numbers and hierarchical relationships between them that a user wants to query, extract the hierarchical relationships between the chapter numbers and output them in a specified format.

[0135] S2322 specifies the execution steps for the large model:

[0136] Step 1: Extract the chapter number from {result2}. The chapter number is enclosed in {} and begins 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; find the child chapter number of each chapter number 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, provide specific examples for the large model. The format of the specific examples is as follows:

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

[0140] - example -

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

[0142] Example:

[0143] Text: {chapter: 2.}{chname: 2.1, job 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, store S2322 to S2324 as a prompt word project, denoted as "Prompt word project 2". Input the output result {result2} of step S2315 and "Prompt word project 2" into the large model, and save the output result of the large model, denoted as {result3}.

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

[0151] S3, extract the summary of the chapter. Including the following sub-steps:

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

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

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

[0155] S313, get the chapter content of Ch ic

[0156] If {Ch ic} is empty, output the corresponding chapter content of Ch i found in {result2};

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

[0158] S32, set the role and task description for the large model: you are a text processing expert, please summarize the input text content, and the summary should not exceed 30 words.

[0159] S33, store S31 and S32 as prompt word engineering, denoted as "Prompt Word Engineering 3"; then input the results extracted in step S31 and "Prompt Word Engineering 3" into the large model, and save the output results of the large model, denoted as {result4}. {result4} includes chapter summaries of chapter content.

[0160] S4, create a knowledge graph for the railway construction stage operation guide, including the following steps:

[0161] S41, create node types and define relationships between node types, and create attribute sets for each node type.

[0162] First, create node types for the railway construction stage operation guide knowledge graph, including: file node type, chapter node type, table node type and graph node type.

[0163] Then, create attribute sets for each node type, specifically:

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

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

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

[0167] The attribute set of the graph node type is {picture name}.

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

[0169] Finally, the relationship between the node types of the knowledge graph of the railway construction stage operation guide book is defined, wherein:

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

[0171] The relationship between the chapter node type and the chapter node type 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 the chapter node type and the graph node type is defined as "embedded graph".

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

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

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

[0177] S422, map the relationship between the node types, include: File, Chapter, include; parent-child: Chapter, Chapter, has; embedded table: Chapter, Table, has table; embedded graph: Chapter, Picture, has picture;

[0178] S423, mapping the node type attribute, 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, reading each record in {resultl} in turn, each record corresponding to a job instruction document, let the currently read document be R, and create a document node F of the file type corresponding to R; extract {document basic information} in document R, and write {document name, document path, document format} in document R into the corresponding node attributes 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 row of output result in turn, extract the chapter number and create a chapter node N, extract {chapter name, chapter content, chapter abstract} corresponding to the chapter number, and write them into the corresponding node attributes of chapter node N according to the mapping relationship defined in S42; obtain the corresponding chapter node set {N R} formed by processing the output result set corresponding to document R;

[0181] S45, establish the inclusion relationship "include" between document node F and the nodes in {N R}.

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

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

[0184] S48, according to the picture name in {result2} and the mapping relationship defined in S42, create picture node T p, p is the number of the graph node, and the node attribute of the graph node is the picture name. Then the graph node T p corresponding to the node in {F R} is established.

[0185] The result of the knowledge graph created in an embodiment of the present application is shown in Figure 3 In Figure 3 , the nodes are represented by circles, the names of the nodes are labeled inside, the corresponding attributes are represented by boxes, the attribute names and corresponding attribute values of the nodes are listed in the boxes, the solid arrows represent the relationships between the nodes, and the dashed arrows represent the attributes derived from the nodes.

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

[0187] S5, identifying the user query semantics to generate a query semantic set.

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

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

[0190] Give a text that describes some entities, entity attributes, or other entities associated with the entity that the user wants to query, identify these types of entities from the text, and identify the attributes of the entity or other entities associated with the entity that the user wants to query.

[0191] S52, specify the 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 a file or a chapter.

[0193] S522, extract all entities in the query text and output {entity: nname, nodetype}. nname represents the entity name, and nodetype represents the entity type. The entities include chapter names, table names, and picture names. If the entity cannot be found, the most similar semantic 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, and atrtype represents the entity attribute type, including 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: Query the chapter of tunnel body excavation construction

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

[0202] Output:

[0203] {node: chapter} {entity: tunnel engineering tunnel body excavation construction operation guide, file}

[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, marked as "prompt word project 4", input the query text {client} and "prompt word project 4" into the large model, and save the output result of the large model, and mark the output result as query semantic set {result5}.

[0206] S6, convert the query semantic set into a knowledge graph query statement. Including 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] Take {node: chapter} {entity: tunnel engineering tunnel body excavation construction operation guide, file} 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}, sequentially traverse {result5}, find the first {node: nodetype} and jump out of the traversal. Taking the above example query as an example, find {node: chapter} and jump out of the traversal, decompose the field, and get the query subject as “chapter”;

[0210] S612, parse the limit condition of the query subject from {result5}. The limit condition is {entity: nname, ntype}, {attribute: atrname, atrtype}, query all limit conditions, and form a limit condition list. Taking the above example query as an example, the limit condition of the query subject of the above example is {entity: tunnel engineering tunnel body excavation construction operation guidance document, file}, and a limit condition list List({entity: tunnel engineering tunnel body excavation construction operation guidance document, file}) is formed;

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

[0212] In an embodiment of the application, HugeGraph graph database open sourced by Baidu is used to create a knowledge graph, so the statement conforming to the Gremlin syntax is converted. The conversion result is as follows:

[0213] g.V().has('file', 'tunnel engineering tunnel body excavation construction operation guidance document', 'N').bothE().otherV().hasLabel(‘chapter’)

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

[0215] g.V().has('File', 'tunnel engineering tunnel body excavation construction operation guidance document', 'N').bothE().otherV().

[0216] hasLabel(‘Chapter’)

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

[0218] In an embodiment of the application, HugeGraph graph database open sourced by Baidu is used to create a knowledge graph, the org.apache.hugegraph package is introduced, the background query interface is written, and the query of the knowledge graph is realized. Specifically as follows:

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

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

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

[0222] S7, visualize the knowledge graph query result and form a knowledge question and answer. Including the following steps:

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

[0224] S72, display {result6} in a graphical way, where nodes are represented by circles, the inside of the circle is labeled with the node name, and the node relationship in {result6} is represented by a directed arrow. In order to keep the graph neat, do not label the relationship name on the arrow;

[0225] S73, concatenate {result6} into a long text and summarize it by a large 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} as {node type: node name}, and concatenate the entity attribute type and attribute value in {result5} as {attribute type: attribute value}, and concatenate different concatenated items with “;”;

[0227] S732, set the role and task of the large model: you are a text induction expert, and you will induce and summarize the input text content. And take it as “prompt word engineering 5”;

[0228] S733, input the long text concatenated in S731 and the “prompt word engineering 5” generated in S732 into the large model for processing, and return the result to the user.

Claims

1. A railway construction stage work instruction manual intelligent query method, characterized in that, The method comprises the following steps: S1, document text processing: first, collect documents, convert formats, and classify documents, then clean up document data and remove meaningless information; S2, extract chapter numbers, divide chapter content, and establish chapter associations, including the following steps: S21, batch processing of documents: batch import various documents according to document categories, identify text, tables, and pictures in each document, and output as {result1}; S22, if the current processing document has no pictures, go to S23; otherwise, store the pictures, and go to S23; S23, divide the {result1} into chapter names, chapter contents, table names, table contents, and picture names according to the chapter numbers using a large model, and output as {result2}; extract the hierarchical relationships between the chapter numbers from the {result2} using a large model, and output as {result3}; S3, extract and traverse all chapter numbers, chapter contents, and hierarchical relationships in the {result2} and {result3}, summarize and generalize the chapter contents corresponding to the extracted chapter numbers and the sub-chapter contents they contain using a large model, and output as {result4}; S4, create a knowledge graph of the railway construction stage work instruction, including the following steps: S41, create node types and define relationships between node types, create attribute sets for each node type to store attribute values of nodes in the node type; S42, define mapping relationships: map the node types, relationships between node types, and Chinese descriptions of node type attributes in S41 to English fields; S43, create document node F and its node attribute attribute values according to the {result1}; S44, creating a chapter node N according to the {result2} and {result4}, and taking the corresponding chapter name, chapter content, chapter abstract as the attribute values of the nodes corresponding to the chapter node N, to obtain the chapter node set {N} corresponding to the document R R}; S45, establish the relationship between the document node F and the node in the {N R} corresponding thereto; S46, according to the hierarchical relationship between the chapter numbers in {result3} and the mapping relationship defined in S42, establish the relationship of the chapter nodes in {N R} in {result3}. S47, according to the table name and table content in the {result2} and the mapping relationship defined in S42, create a table node T j , j is the number of table nodes, the node attributes of the table node are table name and table content, and then the table node T j is created R corresponding to the relationship between the nodes in {N S48, according to the picture name in the {result2} and the mapping relationship defined by S42, create a graph node T p , p is the number of the graph node, the node attribute of the graph node is the picture name, and then the graph node T p is established in relation to the node in the {F R} corresponding to it; S49, embedding a chapter content and a chapter abstract of a chapter node N in a chapter node set {N R} into a vector database; the vector database is used for quickly searching long text information in the chapter content and the chapter abstract. S5, extract the user input query text into entity types, entities, and entity attributes using a large model, and output as {result5}; S6, convert the {result5} into a knowledge graph query statement and run it on the knowledge graph created in S4, and output the query result as {result6}; S7, visualize the knowledge graph query result and output the query result: First, list the {result6} items; then, display the {result6} in a graphical manner; finally, concatenate the corresponding content in {result6} into a long text and output it to the user after summarizing and inducing by a large model. 2.The railway construction phase work instruction manual intelligent query method according to claim 1, characterized in that: S23 includes the following steps: S231, extract chapter numbers and divide chapter content; S232, establish associations between chapters.

3. The railway construction phase work instruction manual intelligent query method according to claim 2, characterized in that, S231 includes the following steps: S2311, set task description for the large model to assist the large model in understanding user behavior; S2312, specify execution steps for the large model; S2313, provide specific examples for the large model to assist the large model in understanding user needs; S2314, specify the format of data input and output; S2315, store S2312-S2314 as a prompt word engineering, denoted as "prompt word engineering 1"; input {result1} of step S21 and "prompt word engineering 1" into the large model, and record the output result as {result2}.

4. The railway construction phase work instruction manual intelligent query method according to claim 3, characterized in that: The S232 includes the following steps: S2321, set a task description for the large model; S2322, specify the execution steps for the large model; S2323, provide specific examples for the large model; S2324, specify the actual data input and output formats; S2325, store S2322-S2324 as a prompt word engineering, denoted as "prompt word engineering 2"; input the output result {result2} of step S2315 and "prompt word engineering 2" into the large model, and save the output result of the large model, denoted as {result3}.

5. The railway construction phase work instruction manual intelligent query method according to claim 1, characterized in that: S3 includes the following sub-steps: S31, extract the chapter content of each chapter through {result2} and {result3}, including: S311, traverse and extract the chapter Ch in the {result2} i of the chapter content, i is the chapter number; S312, traverse the {result3} to find all sub-chapters of the Ch i , denoted as {Ch ic}, ic is the number of sub-chapters included in chapter i; S313, obtaining Ch ic of the chapter content: If {Ch ic} is empty, output where, is the Ch i corresponding chapter content; If {Ch ic} is not empty, the chapter numbers of {Ch ic} are taken out in turn, the chapter content of each sub-chapter is obtained in {result2}, and the chapter content of all sub-chapters is spliced as the corresponding chapter content of Ch ic . S32, set a role and a task description for the large model, which is used to assist the large model in understanding the user's behavior; S33, store steps S31-S32 as a prompt word engineering, denoted as "prompt word engineering 3"; input the extracted result in step S31 and "prompt word engineering 3" into the large model, and output {result4}.

6. The railway construction phase work instruction manual intelligent query method according to claim 1, characterized in that: The node types in S41 include: file node type, chapter node type, table node type, and picture node type; The file node type attribute set is {document name, document path, engineering section, document format, document source}; The chapter node type attribute set is {chapter number, chapter name, chapter content, chapter abstract}; The table node type attribute set is {table name, table content}; The picture node type attribute set is {picture name}; The relationship between the file node class and the chapter node class is defined as "contains"; The relationship between the chapter node type and the chapter node type 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 picture node type is defined as "embedded picture"; S42 includes the following steps: S421, map the node types, file: File; chapter: Chapter; table: Table; picture: Picture; S422, map the relationships between node types, include: File, Chapter, include; parent-child: Chapter, Chapter, has; embedded table: Chapter, Table, has table; embedded picture: Chapter, Picture, has picture; S423, mapping the node type attribute, 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.

7. The railway construction phase work instruction manual intelligent query method according to claim 1, characterized in that: S7 includes the following sub-steps: S71, list the {result6} items, only list the nodes and their node attributes of the query results, omit the relationships between nodes; S72, display the {result6} in a graphical manner, where nodes are represented by circles, the node names are labeled inside the circles, and node relationships are represented by directed arrows; S73, splice the {result6} into a long text and summarize it by a large model, and then return the result to the user.

8. The railway construction phase work instruction intelligent query method according to claim 7, characterized in that: S73 includes the following sub-steps: S731, splice the node type and node name in {result6} into {node type: node name}, and splice the entity attribute type and attribute value in {result5} into {attribute type: attribute value}; S732, set the role and task for the large model: the role is a text induction expert, and the task is to induce and summarize the input text content, and use it as "prompt word engineering 5"; S733, input the long text spliced in S731 and the "prompt word engineering 5" generated in S732 into the large model for processing, and output the result to the user.

9. The railway construction phase work instruction intelligent query method according to claim 1, characterized in that: In S1, the format conversion converts the pdf and doc format documents into docx format; In S21, the {result1} includes {{document basic information}, {document text}, {document table}, {document picture}}, wherein: the {document basic information} includes: document name, document path, engineering section, document format, document source; The {document table} includes: the location of the table in the document, the table name, the table header set, the table data set, and the table annotation; The {document picture} includes: the location of the picture in the document, the picture name, and the binary data stream form of the picture; In S22, the conversion is: first create a "picture" folder under the directory of the document, then convert the binary data stream form of the picture to the folder, and name it with the "picture name" of the document picture, and the file format of the picture is "jpg".

Citation Information

Patent Citations

  • Intelligent text information processing system

    CN115455935A

  • Machine learning systems and methods for automated generation of technical requirements documents

    US20240338659A1