Intelligent detection report generation method driven by large language model

Through the intelligent generation method of detection reports driven by large language model, the problem that existing technology is difficult to meet the flexible and changeable and strict format requirements of detection reports is solved, and the efficient generation and quality improvement of detection reports is achieved.

CN119150832APending Publication Date: 2024-12-17SHANGHAI RESEARCH INSTITUTE OF BUILDING SCIENCES CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411168536.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

When generating inspection reports, the information system of existing inspection and testing services is difficult to meet the flexible and varied format requirements of the inspection reports, resulting in high costs and low efficiency.

Method used

Using a large language model-driven intelligent generation method for detection reports, obtaining the initial information of the detector and report template information, constructing prompt words, and using the large language model to generate chapters/paragraph content, combining them into a complete detection report to meet the strict format and content Require.

Benefits of technology

It saves the cost of repeatedly modifying the system, improves the efficiency and quality of the testing report generation, and can generate reports that meet the requirements of the testing report.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150832A_ABST
    Figure CN119150832A_ABST
Patent Text Reader

Abstract

The invention provides a detection report intelligent generation method driven by a large language model, and relates to the technical field of artificial intelligence, and the method comprises the steps: obtaining the initial information of a detection object and report template information; according to the initial information of the detected object, basic information, detection data and a detection conclusion of the detected object to be generated are extracted from the information system to serve as detected object information; according to the report template information and the detected object information, respectively constructing corresponding cue words according to chapters or paragraphs; inputting the cue word into a large language model to obtain corresponding chapter / paragraph content; based on report template information, the chapter / paragraph content is combined and assembled into a complete report, and generation of the detection report is completed. According to the invention, the cost of repeatedly modifying the system can be saved, and the generation efficiency and quality of the detection report are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method for intelligently generating a detection report driven by a large language model. Background Art

[0002] Inspection and testing services are an important part of the national quality infrastructure, and are high-tech services and productive services that the country focuses on supporting. The writing of product test reports is an important part of inspection and testing services and the ultimate embodiment of service results. However, due to the diversity of objects faced by inspection and testing services and the professionalism of testing services, there are very strict requirements on the format and content of test reports, and it generally takes a lot of time to complete the writing of test reports.

[0003] At present, some information systems for inspection and testing services have modules and tasks for automatically generating reports, which are mainly based on report templates and logical judgment methods. It is necessary to cover all report writing possibilities when writing software, otherwise the generated reports may not meet the requirements. However, due to the flexible and changeable requirements of inspection reports, it takes a lot of cost and effort to frequently modify templates and logic.

[0004] With the development of artificial intelligence technology and big language model technology, it has shown excellent capabilities in text content generation, information extraction, text optimization, etc. However, the test report not only requires the big language model to be able to generate and verify the content and conclusions corresponding to the test data, but also needs to strictly comply with the format and professional terminology required by the test report. Existing artificial intelligence technology cannot directly generate reports that meet these requirements. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides a large language model-driven intelligent test report generation method, which can save the cost of repeatedly modifying the system and improve the generation efficiency and quality of the test report.

[0006] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is: a method for intelligently generating a test report driven by a large language model, comprising:

[0007] S1: Obtain the initial information of the test object and the report template information;

[0008] S2: extracting basic information, test data and test conclusion of the test object to be generated from the information system according to the initial information of the test object as test object information;

[0009] S3: constructing corresponding prompt words according to the report template information and the detected object information respectively by chapter or paragraph;

[0010] S4: inputting the prompt word into a large language model to obtain corresponding chapter / paragraph content;

[0011] S5: Based on the report template information, the chapter / paragraph contents are combined and assembled into a complete test report to complete the generation of the test report.

[0012] The beneficial effects of the present invention are as follows: the processor uses the initial information of the detected object and the report template information, constructs prompt words, uses a large language model to obtain the chapter / paragraph content, and splices the test report. In this way, a report that meets strict format and content requirements can be generated, saving the cost of repeatedly modifying the system and improving the generation efficiency and quality of the test report.

[0013] Further, the S2 includes:

[0014] According to the detected object information, the basic information, detection data and detection conclusion content of the detected object to be generated are obtained through the API.

[0015] Further, the S3 includes:

[0016] According to the report template information and the detected object information, corresponding prompt words are constructed based on the chapter / paragraph information therein; wherein the prompt words include instructions, context, input data and output instructions.

[0017] Furthermore, the large language model is obtained through training, and the specific training process includes:

[0018] The preprocessed prompt words are used as training samples to train the large language model, and the trained large language model is obtained by selecting training and fine-tuning parameters; the preprocessing includes cleaning, word segmentation, and encoding processing, and the fine-tuning parameters include the training rounds, batch size, loss function determination and evaluation indicators, and the evaluation indicators include recall rate and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] This specification will be further described in the form of exemplary embodiments, which will be described in detail by the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure, wherein:

[0020] Figure 1 This is an exemplary flow chart of a method for intelligently generating detection reports driven by a large language model according to some embodiments of this specification. DETAILED DESCRIPTION

[0021] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0022] Example

[0023] Figure 1 This is an exemplary flow chart of a method for intelligently generating a detection report driven by a large language model according to some embodiments of this specification. Figure 1 As shown, the process includes the following steps. In some embodiments, the process can be executed by a processor.

[0024] S1: Obtain the initial information of the test object and the report template information.

[0025] The initial information of the detected object is basic information used to identify the detected object. For example, the initial information of the detected object may include the type, name, and system code of the detected object.

[0026] The report template information is information reflecting the basic situation of the report template. For example, the report template information may include the report template name (template_name).

[0027] In some embodiments, the processor can obtain the detection object information and report template information through the network or manual input.

[0028] S2: According to the initial information of the detection object, basic information of the detection object, detection data and detection conclusion to be generated are extracted from the information system as the detection object information.

[0029] The information system is a system that stores the information of the corresponding detected object. For example, the information system may include a bridge information system, a road information system, and a product information system.

[0030] The detection object information is the information required to generate the detection object report. For example, the detection object information may include basic information of the detection object to be generated, detection data and detection conclusion, etc.

[0031] The basic information of the object to be detected to be generated is information reflecting the basic detection conditions of the object to be detected. For example, the basic information of the object to be detected to be generated may include the detection date (date), the detection unit (company), the detection personnel (person), the detection location (location) and the image (image) of the object to be detected.

[0032] The test data is data that reflects the overall process of the test. For example, the test data may include the test method (test_method), the test content (test_context), the result data (test_data), and the test photo (test_image).

[0033] The test conclusion is data reflecting the test results and suggestions. For example, the test conclusion may include an overall conclusion and a suggestion.

[0034] In some embodiments, the processor can utilize a corresponding information system to extract basic information, test data, and test conclusions of the test object to be generated.

[0035] In some embodiments, the processor can obtain the basic information of the test object, the test data and the test conclusion content to be generated through the information system gateway according to the initial information of the test object.

[0036] The information system gateway is the API gateway of the information system and is used to transmit data.

[0037] S3: construct corresponding prompt words according to the report template information and the detected object information respectively by chapter or paragraph.

[0038] Prompt words are instruction data used to run the large language model. For example, prompt words may include instructions, context, input data, and output instructions; for example, the prompt words for bridge information may be: Please write a summary of bridge inspection content according to the format and wording of the example and the bridge information and inspection data provided.

[0039] In some embodiments, the processor can implement S3 based on the following steps: clarifying the target and context; studying and analyzing examples to obtain common features; and constructing prompt words based on the target, the context, and the common features.

[0040] In some embodiments, the processor may determine different goals based on different chapters, such as generating an introduction to a bridge, and understand the contextual information of the content to be generated, including the theme, style, and tone.

[0041] In some embodiments, the processor can identify common features of effective prompt words in examples, such as keywords, sentence patterns, tone, etc., by studying and analyzing examples.

[0042] In some embodiments, the processor may generate prompt words based on the target, the context, and the common features, and design fill-in-the-blank prompt words according to task requirements to ensure that the prompt words contain necessary context information.

[0043] In some embodiments, the processor may construct corresponding prompt words based on the report template information and the detection object information and the chapter / paragraph information therein.

[0044] S4: Input the prompt word into the large language model to obtain the corresponding chapter / paragraph content.

[0045] The large language model is a neural network model used to obtain chapter / paragraph content. For example, the large language model may include models such as ChatGLM, Wenxin Yiyan, Tongyi Qianwen, ChatGTP, Llama, and Gemma.

[0046] In some embodiments, the expression of the large language model may be:

[0047] y = f(x);

[0048] Among them, y represents the output of the large language model, and x represents the input prompt word of the large language model.

[0049] In some embodiments, the processor may utilize network data to obtain a large language model.

[0050] In some embodiments, the processor can use the preprocessed prompt words as training samples to train the large language model, and obtain a trained large language model by selecting training and fine-tuning parameters (including training rounds, batch size, determination of loss function, and evaluation indicators); the preprocessing may include cleaning, word segmentation, encoding and other processing, and the evaluation indicators may include recall rate and accuracy, etc.

[0051] In some embodiments, the processor may clean the training samples by removing special characters, converting upper and lower case characters, deleting spaces, and processing repeated characters and content.

[0052] In some embodiments, the processor may tokenize the text according to a predefined dictionary, with the goal of dividing the text into smaller units (such as words or subwords) for ease of model processing.

[0053] In some embodiments, the processor can convert the segmented text into a numerical representation that can be processed by the model, using a pre-trained word embedding large language model for encoding.

[0054] In some embodiments, the loss function may be expressed as:

[0055]

[0056] Among them, L represents the output of the loss function, θ represents the parameters of the model, loss represents the loss function, and x t represents the t-th output of the large language model, and T represents the number of outputs of the large language model.

[0057] In some embodiments, during the training process, the processor may use the parameter θ to update the large language model through a back propagation algorithm so that L(θ) is minimized.

[0058] In some embodiments, the processor may input the prompt word X into the large language model to obtain Y=f(X), where Y is the obtained chapter and paragraph content.

[0059] Chapter / paragraph content is the text content output by the large language model based on the prompt words.

[0060] S5: Based on the report template information, the chapter / paragraph contents are combined and assembled into a complete test report to complete the generation of the test report.

[0061] A test report is a report that reflects information related to the test object and the results of the test process.

[0062] In some embodiments, the processor may combine and splice the chapter / paragraph contents in sequence to obtain a complete detection report.

[0063] In some embodiments, a complete inspection report may include: Please write a summary of the inspection of the bridge according to the format and wording of the example, based on the bridge information and inspection data provided:

[0064] Bridge Information:

[0065] Bridge: Nanpu Bridge

[0066] Bridge type: Cable-stayed bridge

[0067] Bridge length: Main bridge 846 meters

[0068] …

[0069] Test information:

[0070] Testing date: March 6 to September 12, 2023

[0071] Inspection parameters: Bridge technical condition

[0072] Testing basis: "Technical Standards for Urban Bridge Maintenance" (CJJ99-2017), "Technical Specifications for Urban Bridge Inspection and Evaluation" (CJJ / T233-2015);

[0073] Bridge damage: bridge deck pavement; 1#; upstream lane 3#; Puxi bridge tower; pothole; 1 location, S=0.05m2; picture number 2.1.1-1

[0074] Bridge deck pavement; 1#; Lane 3# on the upstream side; Pudong anchor pier; Crack; 1 location; Image number 2.1.1-2

[0075] …

[0076] Example:

[0077] According to the relevant provisions of the "Technical Standards for Urban Bridge Maintenance" (CJJ99-2017), Guilin Road No. 1 Bridge is a reinforced concrete beam bridge and belongs to III maintenance. Although the bridge structure components are damaged, it does not affect the safety of the bridge. The bridge's intact condition is assessed as Class B.

[0078] In some embodiments of this specification, the processor uses the initial information of the detected object and the report template information, constructs prompt words, uses a large language model to obtain chapter / paragraph content, and splices the test report. In this way, a report that meets strict format and content requirements can be generated, saving the cost of repeatedly modifying the system and improving the efficiency and quality of generating the test report.

[0079] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A method for intelligently generating a test report driven by a large language model, characterized in that: include: S1: Obtain the initial information of the test object and the report template information; S2: extracting basic information of the detected object, detection data and detection conclusion to be generated from the information system according to the initial information of the detected object as the detected object information; S3: constructing corresponding prompt words according to the report template information and the detected object information respectively by chapter or paragraph; S4: Based on the prompt word, use the large language model to obtain the corresponding chapter / paragraph content; S5: Based on the report template information, the chapter / paragraph contents are combined and assembled into a complete test report to complete the generation of the test report.

2. The method for intelligently generating a test report driven by a large language model according to claim 1, characterized in that: The S2 includes: According to the initial information of the test object, the basic information of the test object to be generated, the test data and the test conclusion content are obtained through the information system gateway.

3. The method for intelligently generating a test report driven by a large language model according to claim 1, characterized in that: The S3 includes: According to the report template information and the detected object information, corresponding prompt words are constructed based on the chapter / paragraph information therein.

4. The method for intelligently generating a test report driven by a large language model according to claim 1, characterized in that: The large language model is obtained through training, and the specific training process includes: The preprocessed prompt words are used as training samples to train the large language model, and the trained large language model is obtained by selecting training and fine-tuning parameters; the preprocessing includes cleaning, word segmentation, and encoding processing, and the fine-tuning parameters include the training rounds, batch size, loss function determination and evaluation indicators, and the evaluation indicators include recall rate and accuracy.