A method for bridge disease diagnosis and maintenance measures recommendation based on large language model
Through the bridge disease diagnosis and maintenance measures recommendation method based on the large language model, the problem that bridge disease diagnosis relies on manual experience in the existing technology is solved, automated diagnosis is realized, efficiency and accuracy are improved, and costs and response times are reduced.
Patent Information
- Application Number
- CN202311568956.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-22
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2043-11-22
AI Technical Summary
Existing bridge disease diagnosis and maintenance methods rely too much on the professionalism of individual engineers, which involves the risk of misdiagnosis and the diagnostic process is complex and time-consuming, resulting in insufficient ability to handle bridge diseases in a timely manner.
A bridge disease diagnosis and maintenance measure recommendation method based on a large language model is adopted to achieve automated and intelligent diagnosis result output by acquiring and preprocessing highway bridge data, training the diagnostic model, and building a disease diagnosis and maintenance measure knowledge base.
It reduces the reliance on manual expert experience, reduces the misdiagnosis rate, improves the efficiency of diagnosis and maintenance decisions, reduces labor costs, and shortens the response time to bridge diseases.
Smart Images

Figure CN117575009B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of bridge disease diagnosis and maintenance, and in particular to a method for diagnosing bridge diseases and recommending maintenance measures based on a large language model. Background Art
[0002] By the end of 2022, the total number of highway bridges in China will reach 1,032,300, including 8,816 super-large bridges and 159,600 large bridges. It is worth noting that about 40% of the bridges in service have been in service for more than 20 years. During long-term use, the performance of bridge structures will deteriorate and suffer from various diseases. These problems not only affect driving safety, but also pose severe challenges to bridge maintenance and management.
[0003] At present, the diagnosis and maintenance of bridge defects mainly rely on the experience and knowledge of engineers. In complex or difficult to judge situations, expert consultation meetings are often held to provide diagnostic conclusions and maintenance recommendations. This traditional method has several obvious problems. First, it overly relies on the professional level and judgment ability of individual engineers or experts. Once the professional ability is limited or the judgment is wrong, it may lead to misdiagnosis. Second, the introduction of expert consultation meetings makes the entire diagnostic process complicated and time-consuming, increases costs, and reduces the ability to deal with bridge defects in a timely manner.
[0004] In recent years, large-scale language highway bridge diagnosis models based on neural networks have demonstrated remarkable capabilities in the fields of intelligent question answering and text generation. In the field of transportation, the rapid development of artificial intelligence technology is expected to play an important role in the design, construction, operation, management and maintenance of highway projects. In particular, the identification and diagnosis of bridge defects and the intelligent recommendation of maintenance measures are expected to achieve innovative development driven by artificial intelligence technology.
[0005] In view of the shortcomings of existing bridge disease diagnosis and maintenance methods, the present invention proposes a bridge disease diagnosis and maintenance measure recommendation method system based on a large language model. Summary of the invention
[0006] In order to solve at least one of the problems mentioned above, the present disclosure provides a method for diagnosing bridge defects and recommending maintenance measures based on a large language model.
[0007] According to one aspect of the present disclosure, a method for diagnosing bridge defects and recommending maintenance measures based on a large language model is provided, comprising: acquiring highway bridge data, and determining sample data through the highway bridge data; training a highway bridge diagnosis model based on the sample data; constructing a highway bridge defect diagnosis and maintenance measures knowledge base based on the sample data; and determining a second highway bridge diagnosis result based on a first highway bridge diagnosis result output by the highway bridge diagnosis model and the highway bridge defect diagnosis and maintenance measures knowledge base.
[0008] In some embodiments, the step of determining sample data through the highway bridge data includes: preprocessing the highway bridge data to obtain first data; marking the first data as input text data and label data by manual interpretation, and the input text data and label data construct sample data; dividing the sample data into training data, verification data and test data.
[0009] In some implementations, before the step of preprocessing the highway bridge data to obtain the first data, the step further includes: obtaining the highway bridge data using a data enhancement algorithm.
[0010] In some embodiments, the training process of training a highway bridge diagnostic model based on the sample data includes: taking input text data as the highway bridge diagnostic model; the output of the highway bridge diagnostic model is the predicted value of the bridge diagnostic result corresponding to the text data, the highway bridge diagnostic model uses the bridge diagnostic results of each collected historical case as the prediction target, the error value between the predicted value of the bridge diagnostic result and the prediction target as the first prediction error, the sum of the first prediction errors of all bridge diagnostic results as the training target, and the training stops when the sum of the first prediction errors reaches convergence.
[0011] In some embodiments, the highway bridge diagnostic model is any one of GPT-3, LLAMA, ChatGLM2, BLOOM or baichuan2.
[0012] In some embodiments, the process of constructing a highway bridge disease diagnosis and maintenance measures knowledge base based on the sample data includes: converting the sample data into a knowledge base vector, wherein the knowledge base vector contains input text data and label data; converting the knowledge base vector into a first-level sub-block and a second-level sub-block; wherein the first-level sub-block is composed of input text data, and the second-level sub-block is composed of label data; combining the first-level sub-block and the second-level sub-block into a whole through index information to construct a bridge disease and maintenance knowledge base.
[0013] In some embodiments, 7. The step of determining the second highway bridge diagnosis result based on the first highway bridge diagnosis result output by the highway bridge diagnosis model and the highway bridge disease diagnosis and maintenance measures knowledge base includes: converting the words in the user's question into a question vector; selecting a suitable knowledge base sub-block according to the question content; using the Sentence-transformer library to perform semantic matching on the question vector and the knowledge base vector to filter out the final answer; inputting the final answer into the highway bridge diagnosis model to obtain the highway bridge diagnosis result.
[0014] According to another aspect of the present disclosure, a system for diagnosing bridge defects and recommending maintenance measures based on a large language highway bridge diagnosis model is provided, comprising: a data determination module, used to obtain highway bridge data and determine sample data through the highway bridge data; a highway bridge diagnosis model training module, used to train a highway bridge diagnosis model based on the sample data; a knowledge base construction module, used to construct a highway bridge defect diagnosis and maintenance measures knowledge base based on the sample data; and a diagnosis module, used to determine a second highway bridge diagnosis result based on a first highway bridge diagnosis result output by the highway bridge diagnosis model and the highway bridge defect diagnosis and maintenance measures knowledge base.
[0015] According to another aspect of the present disclosure, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for diagnosing bridge defects and recommending maintenance measures based on a large language model as described in any of the above embodiments is implemented.
[0016] According to another aspect of the present disclosure, a readable storage medium is provided, wherein the readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the method for diagnosing bridge defects and recommending maintenance measures based on a large language model as described in any of the above embodiments.
[0017] The method for diagnosing bridge defects and recommending maintenance measures based on a large language model provided by the present disclosure obtains highway bridge data, determines sample data through the highway bridge data; trains a highway bridge diagnosis model based on the sample data; builds a highway bridge disease diagnosis and maintenance measures knowledge base based on the sample data; determines a second highway bridge diagnosis result based on the first highway bridge diagnosis result output by the highway bridge diagnosis model and the highway bridge disease diagnosis and maintenance measures knowledge base, which can be highly intelligent and automated. It can reduce dependence on the experience of artificial experts, reduce the misdiagnosis rate, and greatly improve the efficiency of diagnosis and maintenance decision-making. In addition, the system can also reduce the labor cost in the maintenance process and shorten the response time to bridge defects. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0019] Figure 1 The present invention is a flowchart of a method for diagnosing bridge defects and recommending maintenance measures based on a large language model according to an embodiment of the present invention.
[0020] Figure 2This is a schematic diagram of highway bridge data preprocessing in a method for diagnosing bridge defects and recommending maintenance measures based on a large language model according to an embodiment of the present invention.
[0021] Figure 3 The present invention is a schematic diagram of a process for constructing a bridge disease and maintenance knowledge base according to an embodiment of the present invention.
[0022] Figure 4 The present invention is a flowchart of a highway bridge diagnosis according to one embodiment of the present invention.
[0023] Figure 5 A schematic diagram of a system for diagnosing bridge defects and recommending maintenance measures based on a big language highway bridge diagnosis model according to an embodiment of the present disclosure.
[0024] Figure 6 A schematic diagram of an electronic device according to an embodiment of the present disclosure.
[0025] Figure 7 A schematic diagram of a storage medium according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] The present disclosure is further described in detail below in conjunction with the accompanying drawings and implementations. It is understood that the specific implementations described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.
[0027] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0028] Unless otherwise specified, the exemplary embodiments / embodiments shown will be understood as providing exemplary features of various details of some ways in which the technical concept of the present disclosure can be implemented in practice. Therefore, unless otherwise specified, the features of the various embodiments / embodiments can be combined, separated, interchanged and / or rearranged without departing from the technical concept of the present disclosure.
[0029] The terms used herein are for the purpose of describing specific embodiments, rather than being restrictive. As used herein, unless the context clearly indicates otherwise, the singular forms "one (kind, person)" and "said (the)" are also intended to include plural forms. In addition, when the terms "comprise" and / or "include" and their variations are used in this specification, it is explained that there are stated features, integral bodies, steps, operations, parts, assemblies and / or their groups, but it is not excluded that there are or add one or more other features, integral bodies, steps, operations, parts, assemblies and / or their groups. It should also be noted that, as used herein, the terms "substantially", "approximately" and other similar terms are used as approximate terms and not as degree terms, so that they are used to explain the inherent deviations of the measured values, calculated values and / or the values provided that will be recognized by those of ordinary skill in the art.
[0030] Figure 1 The present invention is a flowchart of a method for diagnosing bridge defects and recommending maintenance measures based on a large language model according to an embodiment of the present invention.
[0031] S101 acquires highway and bridge data, and determines sample data through the highway and bridge data.
[0032] The highway bridge data include common diseases and maintenance measures of simply supported beam bridges, common diseases and maintenance measures of continuous beam bridges, common diseases and maintenance measures of arch bridges, common diseases and maintenance measures of cable-structure bridges, common diseases and maintenance measures of supports, common diseases and maintenance measures of substructures, and common diseases and maintenance measures of ancillary facilities.
[0033] More specifically, common diseases and maintenance measures of simply supported bridges include common diseases of simply supported T-beams and their maintenance measures, common diseases of simply supported hollow slabs and their maintenance measures, common diseases of integral cast-in-place slabs and their maintenance measures; common diseases and maintenance measures of continuous beam bridges include common diseases of variable-section continuous beams and their maintenance measures, common diseases of cast-in-place equal-section continuous beams and their maintenance measures, and common diseases of prestressed continuous beams and their maintenance measures; common diseases and maintenance measures of arch bridges include common diseases of slab arch bridges and their maintenance measures, common diseases of rigid frame arch bridges and their maintenance measures, common diseases of truss arch bridges and their maintenance measures, common diseases of hyperbolic arch bridges and their maintenance measures, and common diseases of masonry arch bridges and their maintenance measures; common diseases and maintenance measures of cable-structured bridges include common diseases of upper and lower anchor heads of cables and their maintenance measures, diseases of cable steel wire and their maintenance measures, common diseases of cable PE sheaths and their maintenance measures, and common diseases of steel covers and their maintenance measures. Common diseases and maintenance measures of bearings include common diseases and maintenance measures of plate rubber bearings, common diseases and maintenance measures of pot rubber bearings, and other typical diseases and maintenance measures of bearings; common diseases and maintenance measures of substructures include common diseases and maintenance measures of pile-column abutments, common diseases and maintenance measures of pile-column piers, common diseases and maintenance measures of gravity abutments, common diseases and maintenance measures of other pier foundations, and common diseases and maintenance measures of blocks. Common diseases and maintenance measures of ancillary facilities include common diseases and maintenance measures of guardrails, common diseases and maintenance measures of bridge deck drainage systems, common diseases and maintenance measures of bridge deck pavements, common diseases and maintenance measures of sidewalks, common diseases and maintenance measures of expansion joints, and common diseases and maintenance measures of lighting and signs. The highway bridge data is preprocessed to obtain first data, and the first data is marked as input text data and label data by manual interpretation, and the input text data and label data construct sample data; the sample data is divided into training data, verification data and test data.
[0034] like Figure 2 As shown, the specific process of determining sample data through the highway bridge data is as follows:
[0035] S1 Define the fine-tuning task: First, clearly define the task or domain that you want to fine-tune the highway bridge diagnosis model to solve. This can be a variety of tasks such as text generation, text classification, question answering, etc. In this project, bridge disease diagnosis and maintenance measures recommendation are comprehensive tasks of text generation and question answering.
[0036] S2 Collect and prepare data: This part of the data is related to the fine-tuning task and requires the collection of a large-scale text data set. In order to ensure the quality of fine-tuning, it is necessary to collect professional text data related to bridge diseases and maintenance. Subsequently, the collected text needs to be preprocessed, including word segmentation, removal of stop words, processing of special characters, labeling, etc., to ensure the quality and consistency of the data.
[0037] S3 data cleaning and quality control: Check and clean the sample data to ensure data quality. This includes handling duplicate samples, abnormal data, or incorrect labels. It is also necessary to ensure that the labels match the text data to prevent inconsistencies.
[0038] S4 Labeled data: The fine-tuning task belongs to supervised learning. It is necessary to organize the data into question-answer pairs and label the data. High-quality labels are required to improve the performance of the highway bridge diagnosis model. Text data and labels or answers are combined into sample data. Each sample usually includes input text and corresponding labels or answers.
[0039] S5 Dataset division: Divide the dataset into training set, validation set and test set. Usually, the training set is used to train the highway bridge diagnosis model, the validation set is used to adjust hyperparameters and monitor the performance of the highway bridge diagnosis model, and the test set is used to finally evaluate the performance of the highway bridge diagnosis model. The common division ratio is 70% training set, 15% validation set and 15% test set.
[0040] In order to ensure that the collected text data can obtain reliable quality for fine-tuning the highway bridge diagnosis model, data augmentation techniques can also be used to transform or expand the existing data to increase the generalization ability of the highway bridge diagnosis model. This can include operations such as random deletion, replacement, or rearrangement of words.
[0041] S6 Dataset encoding: converting text data into a format acceptable to the highway bridge diagnosis model. The present invention adopts a token embedding mode to encode the data set as sample data for fine-tuning the highway bridge diagnosis model.
[0042] In order to increase the effectiveness of the data set, the present invention adopts the method of injecting noise to further form multiple new data sets on the data set collected by the above method, so that the large language highway bridge diagnosis model is robust to disturbances and the effect of fine-tuning training is enhanced.
[0043] As shown in the example, the highway bridge data collected above is used as the basis, and the content thereof needs to be preprocessed according to step S2, the data is cleaned according to step S3, and then the data is marked according to step S4 to produce a question-answer pair. A specific example is:
[0044] The initial content of the collected data is generally: "T-beam bridges have the characteristics of high rigidity and clear force. As long as the diaphragm connection is reliable, it has good working performance. The vertical cracks in the web of the T-beam do not affect the structural bearing capacity, but only the durability. For cracks with a width greater than 0.15 mm, pouring treatment is required; for cracks with a width less than or equal to 0.15 mm, only crack sealing treatment is required." According to steps S2, S3 and S4, it is made into a question-answer pair, which can be output as:
[0045] “Q: How should vertical cracks in the web of a T-beam be maintained?
[0046] A: Vertical cracks in the web of a T-beam do not affect the structural bearing capacity, but only the durability. For cracks with a width greater than 0.15 mm, grouting treatment is required; for cracks with a width less than or equal to 0.15 mm, crack sealing treatment is sufficient.
[0047] The prepared question-answer pairs are used for subsequent fine-tuning of the highway bridge diagnosis model.
[0048] Step S102: training a highway bridge diagnosis model based on the sample data.
[0049] The training process of training a highway bridge diagnosis model based on the sample data includes: taking input text data as the highway bridge diagnosis model; the output of the highway bridge diagnosis model is the predicted value of the bridge diagnosis result corresponding to the text data; the highway bridge diagnosis model uses the bridge diagnosis results of each collected historical case as the prediction target, the error value between the predicted value of the bridge diagnosis result and the prediction target as the first prediction error, the sum of the first prediction errors of all bridge diagnosis results as the training target, and stops training when the sum of the first prediction errors reaches convergence.
[0050] After obtaining sufficient data, the large language highway bridge diagnosis model can be fine-tuned. In the present invention, a low-rank adaptation (LoRA) method is used for fine-tuning. The LoRA method can utilize the inherent low-rank characteristics of the large language highway bridge diagnosis model and simulate full training by adding a bypass matrix, thereby achieving lightweight fine-tuning.
[0051] The general steps for fine-tuning are:
[0052] Select a pre-trained highway bridge diagnosis model: Select a suitable pre-trained large-scale language highway bridge diagnosis model. These highway bridge diagnosis models are usually pre-trained on large-scale corpora and have rich language knowledge. Import the constructed sample data into the fine-tuning framework and perform the fine-tuning process. The fine-tuning process usually includes multiple rounds of iterations to gradually optimize the highway bridge diagnosis model parameters.
[0053] Set hyperparameters: Define the hyperparameters in the fine-tuning process, including learning rate, batch size, number of training rounds, etc. The selection of these hyperparameters needs to be adjusted according to the professional task requirements in the vertical field.
[0054] Fine-tuning the highway bridge diagnosis model: Use the pre-trained highway bridge diagnosis model as the initial highway bridge diagnosis model, and then input the fine-tuning data into the highway bridge diagnosis model for training. The training process uses the back-propagation algorithm to adjust the highway bridge diagnosis model parameters. In each training iteration, the highway bridge diagnosis model will generate predictions or generate text based on the input text, which is then compared with the label or target, the loss value is calculated, and the highway bridge diagnosis model parameters are updated through back-propagation. The training process usually requires multiple epochs to ensure that the highway bridge diagnosis model converges to the best performance.
[0055] Validation and Tuning: Use the validation set to monitor the performance of the highway bridge diagnosis model. After each training round, evaluate the performance of the highway bridge diagnosis model on the validation set and adjust the highway bridge diagnosis model or hyperparameters based on the validation performance.
[0056] The present invention adopts a method of dynamically adjusting hyperparameters to control the fine-tuning process of the highway bridge diagnosis model according to the training loss value decline curve. Specifically, when the loss value of a certain process no longer decreases or increases, the fine-tuning process is terminated, the learning rate is adjusted, and the highway bridge diagnosis model fine-tuning is restarted.
[0057] The specific training steps in the present invention are generally:
[0058] First, supervised fine-tune (SFT) training is performed using the high-quality datasets collected above to improve the basic capabilities of the highway bridge diagnosis model.
[0059] Then, multiple data sets with added white noise are used for training to improve the anti-interference ability of the highway bridge diagnosis model; that is, before the highway bridge data is preprocessed to obtain the first data step, it also includes: using a data enhancement algorithm to obtain the highway bridge data, and the data enhancement algorithm can greatly improve the quality of training data and improve the anti-interference ability of the highway bridge diagnosis model.
[0060] Then, on the basis of retaining two-thirds of the SFT stage data, a data set containing white noise was superimposed and the reward model (RM) was used for training to further improve the capability of the highway bridge diagnosis model.
[0061] Finally, based on the data from the SFT stage, the Proximal Policy Optimization (PPO) algorithm is used for training to complete the final highway bridge diagnosis model training.
[0062] The highway bridge diagnosis model is any one of GPT-3, LLAMA, ChatGLM2, BLOOM or baichuan2.
[0063] Step S103: constructing a knowledge base of highway bridge disease diagnosis and maintenance measures based on the sample data.
[0064] The process of constructing a knowledge base of highway bridge disease diagnosis and maintenance measures based on the sample data includes:
[0065] Convert the sample data into a knowledge base vector, where the knowledge base vector contains input text data and label data;
[0066] The knowledge base vector is converted into a first-level sub-block and a second-level sub-block; wherein the first-level sub-block is composed of input text data, and the second-level sub-block is composed of label data;
[0067] The first-level sub-blocks and the second-level sub-blocks are combined into a whole through index information to construct a knowledge base of bridge diseases and maintenance.
[0068] Specifically, Figure 3 As shown, in order to construct an application for bridge disease diagnosis and maintenance measure recommendation based on the big language highway bridge diagnosis model, the highway bridge data collected above, the regular inspection reports of highway bridges, the text of the highway bridge and culvert maintenance specifications, and the text of the bridge technical condition assessment standards are needed as the basis for bridge disease diagnosis and maintenance measure recommendation. By constructing a knowledge base, the accuracy and reliability of the big language highway bridge diagnosis model in the professional field can be guaranteed, and the possibility of hallucinations in the highway bridge diagnosis model can be reduced.
[0069] It is a common process in the application of large language highway bridge diagnosis model to use documents as knowledge base and convert them into vector libraries (also called embedding libraries). Using common encoding forms (such as Word2Vec), the highway bridge diagnosis model uses word embedding to convert words into continuous vectors, and then represents documents as vectors by averaging or weighted averaging. After each document is converted into a vector representation, a vector library will be constructed. These vector libraries can be used for subsequent text retrieval and text classification tasks. The vector library is a key link in realizing the bridge disease diagnosis and maintenance measures recommendation method. It can enhance the effect of disease diagnosis and maintenance measures recommendation, reduce the illusion of the highway bridge diagnosis model, and make the content generated by it meet the professional requirements of the vertical field.
[0070] In order to ensure the smooth implementation of the bridge disease diagnosis and maintenance measures recommendation method and system based on the big language highway bridge diagnosis model, the document data is divided into blocks, and the overall knowledge base is constructed by forming sub-blocks. Each sub-block contains a separate part of information to avoid mutual interference between blocks. The specific actions can be summarized as follows:
[0071] The first-level sub-blocks of the vector library are divided according to different bridges. For example, according to the force characteristics of the bridge, it can be divided into simply supported beams, continuous beams, arch bridges, suspension bridges, and cable-stayed bridges. Continuous beams can be further subdivided into T-beams, box beams and other beam bridges according to the cross-sectional form of the main beam.
[0072] The document information is divided into secondary sub-blocks of the vector library according to the types of diseases, causes of diseases, maintenance strategies, etc., and each sub-block stores one type of information.
[0073] All sub-blocks of the knowledge base are combined into a whole through index information to build a complete bridge disease and maintenance knowledge base.
[0074] The graded knowledge base is updated regularly to expand content related to bridge defects and maintenance measures.
[0075] S104 determines a second highway bridge diagnosis result based on the first highway bridge diagnosis result output by the highway bridge diagnosis model and a highway bridge disease diagnosis and maintenance measures knowledge base.
[0076] Convert the words in the user's question into question vectors;
[0077] Select appropriate knowledge base sub-blocks based on the question content;
[0078] Use the Sentence-transformer library to semantically match the question vector and the knowledge base vector to filter out the final answer;
[0079] The final answer is input into the highway bridge diagnosis model to obtain the first highway bridge diagnosis result;
[0080] Determine the second highway bridge diagnosis result by combining the first highway bridge diagnosis result with the highway bridge disease diagnosis and maintenance measures knowledge base semantically
[0081] like Figure 4 As shown in the figure, specifically, after completing the fine-tuning of the big language highway bridge diagnostic model and the construction of the knowledge base, the big language highway bridge diagnostic model needs to be applied to bridge disease diagnosis and maintenance measures recommendation, so as to realize the application of this method in bridge maintenance. Considering the reliability of the currently used big language highway bridge diagnostic model in vertical field applications, this method also needs to be evaluated through comprehensive evaluation to ensure the reliability of the method.
[0082] The specific steps for implementing the bridge disease diagnosis and maintenance decision recommendation method based on the big language highway bridge diagnosis model can be expressed as follows:
[0083] The problem is passed through a common encoding form (such as Word2Vec) and the word embedding highway bridge diagnosis model is used to convert words into continuous vectors.
[0084] Pre-select the knowledge base to be loaded. You can select one or more sub-blocks. This step ensures that the knowledge bases do not interfere with each other.
[0085] The question vector is matched with the knowledge base vector by similarity, and the semantic analysis method based on the Sentence-transformer library is used to select the top k answers closest to the question as a reference.
[0086] Generate relevant prompt words according to the prompt word template, pass the prompt words to the large language highway bridge diagnosis model, and finally generate corresponding answers.
[0087] If the target text exists, a cosine similarity analysis can be performed to measure the relevance between the generated text and the target text based on the calculation results. If the relevance is low, it is regenerated.
[0088] To further ensure the reliability of answers, for questions that are out of scope, the highway bridge diagnosis model can be prohibited from automatically generating answers to mislead users.
[0089] Example 2
[0090] This embodiment is based on the embodiment. This embodiment discloses a system 400 for diagnosing bridge defects and recommending maintenance measures based on a big language highway bridge diagnosis model. Figure 5 The system is a method for diagnosing bridge defects and recommending maintenance measures based on a large language model. The same principles, means and effects will not be repeated in detail.
[0091] The system includes: a data determination module 410, which is used to obtain highway bridge data and determine sample data through the highway bridge data;
[0092] A highway bridge diagnostic model training module 420 is used to train a highway bridge diagnostic model based on the sample data;
[0093] A knowledge base construction module 430 constructs a knowledge base of highway bridge disease diagnosis and maintenance measures based on the sample data;
[0094] The diagnosis module 440 is used to determine a second highway bridge diagnosis result based on the first highway bridge diagnosis result output by the highway bridge diagnosis model and the highway bridge disease diagnosis and maintenance measures knowledge base.
[0095] Example 3
[0096] like Figure 6 As shown, according to another aspect of the present application, an electronic device 500 is also provided. The electronic device 500 may include one or more processors and one or more memories. The memories store computer readable codes, and when the computer readable codes are executed by one or more processors, the method for diagnosing bridge defects and recommending maintenance measures based on a large language model as described above may be executed.
[0097] The method or system according to the embodiment of the present application can also be used by Figure 6 The electronic device architecture shown in FIG. Figure 6 As shown, the electronic device 500 may include a bus 501, one or more CPUs 502, a read-only memory (ROM) 503, a random access memory (RAM) 504, a communication port 505 connected to a network, an input / output component 506, a hard disk 507, etc. The storage device in the electronic device 500, such as the ROM 503 or the hard disk 507, may store the method for diagnosing bridge defects and recommending maintenance measures based on a large language model provided in the present application. The method for diagnosing bridge defects and recommending maintenance measures based on a large language model may, for example, include: acquiring highway bridge data, and determining sample data through the highway bridge data; training a highway bridge diagnosis model based on the sample data; constructing a highway bridge disease diagnosis and maintenance measures knowledge base based on the sample data; and determining a second highway bridge diagnosis result based on the first highway bridge diagnosis result output by the highway bridge diagnosis model and the highway bridge disease diagnosis and maintenance measures knowledge base. Furthermore, the electronic device 500 may also include a user interface 508. Of course, Figure 6 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different devices. Figure 6 One or more components of an electronic device are shown.
[0098] Example 4
[0099] Figure 7 Schematic diagram of a computer-readable storage medium structure provided by an embodiment of the present application. Figure 7As shown, a computer-readable storage medium 600 according to an embodiment of the present application is shown. Computer-readable instructions are stored on the computer-readable storage medium 600. When the computer-readable instructions are executed by the processor, the method for diagnosing bridge defects and recommending maintenance measures based on a large language model according to an embodiment of the present application described with reference to the above figures can be executed. The storage medium 600 includes, but is not limited to, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory (cache). Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.
[0100] In addition, according to the implementation of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the present application provides a non-transitory machine-readable storage medium, the non-transitory machine-readable storage medium stores machine-readable instructions, the machine-readable instructions can be executed by a processor to execute instructions corresponding to the method steps provided in the present application, for example: obtaining highway bridge data, determining sample data through the highway bridge data; training a highway bridge diagnosis model based on the sample data; building a highway bridge disease diagnosis and maintenance measures knowledge base based on the sample data; determining a second highway bridge diagnosis result based on the first highway bridge diagnosis result output by the highway bridge diagnosis model and the highway bridge disease diagnosis and maintenance measures knowledge base. . When the computer program is executed by a central processing unit (CPU), the above functions defined in the method of the present application are executed.
[0101] The methods, apparatuses, and devices of the present application may be implemented in many ways. For example, the methods, apparatuses, and devices of the present application may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present application are not limited to the order specifically described above unless otherwise specified. In addition, in some embodiments, the present application may also be implemented as programs recorded in a recording medium, which include machine-readable instructions for implementing the method according to the present application. Therefore, the present application also covers recording media storing programs for executing the method according to the present application.
[0102] In addition, the parts of the above-mentioned technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive redundancy.
[0103] The specific implementation modes as described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation mode of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for diagnosing bridge defects and recommending maintenance measures based on a large language model, characterized in that: include: Acquire highway bridge data, and determine sample data through the highway bridge data; Training a highway bridge diagnosis model based on the sample data; Constructing a knowledge base of highway bridge disease diagnosis and maintenance measures based on the sample data; Determine the second highway bridge diagnosis result based on the first highway bridge diagnosis result output by the highway bridge diagnosis model and the highway bridge disease diagnosis and maintenance measures knowledge base; The step of determining sample data through the highway bridge data comprises: Preprocessing the highway bridge data to obtain first data; Using manual interpretation to mark the first data as input text data and label data, wherein the input text data and label data constitute sample data; Divide the sample data into training data, validation data and test data; The highway bridge diagnosis model is any one of GPT-3, LLAMA, ChatGLM2, BLOOM or baichuan2; The process of constructing a knowledge base of highway bridge disease diagnosis and maintenance measures based on the sample data includes: Convert the sample data into a knowledge base vector, where the knowledge base vector contains input text data and label data; The knowledge base vector is converted into a first-level sub-block and a second-level sub-block; wherein the first-level sub-block is composed of input text data, and the second-level sub-block is composed of label data; The first-level sub-blocks and the second-level sub-blocks are combined into a whole through index information to construct a knowledge base of bridge diseases and maintenance; The step of determining the second highway bridge diagnosis result based on the first highway bridge diagnosis result output by the highway bridge diagnosis model and the highway bridge disease diagnosis and maintenance measures knowledge base comprises: Convert the words in the user's question into question vectors; Select the appropriate knowledge base vector based on the question vector; The Sentence-transformer library is used to semantically match the question vector and the knowledge base vector to screen out the second highway bridge diagnosis results; The specific training steps of the highway bridge diagnosis model are generally as follows: First, supervised fine-tuning training is performed using the collected high-quality datasets to improve the basic capabilities of the highway bridge diagnosis model; Then, multiple data sets with added white noise were used for training to improve the anti-interference ability of the highway bridge diagnosis model; Then, on the basis of retaining two-thirds of the data from the supervised fine-tuning stage, a data set containing white noise was superimposed and the reward highway bridge diagnosis model was used for training to further improve the ability of the highway bridge diagnosis model. Finally, based on the data from the supervised fine-tuning stage, the proximal strategy optimization algorithm is used for training to complete the final highway bridge diagnosis model training.
2. The method for diagnosing bridge defects and recommending maintenance measures based on a large language model according to claim 1, characterized in that: Before the step of preprocessing the highway bridge data to obtain the first data, the method further includes: obtaining the highway bridge data using a data enhancement algorithm.
3. A system for diagnosing bridge defects and recommending maintenance measures based on a big language highway bridge diagnosis model, characterized in that: include: A data determination module, used to obtain highway bridge data and determine sample data through the highway bridge data; A highway bridge diagnostic model training module, used for training a highway bridge diagnostic model based on the sample data; A knowledge base construction module, which constructs a knowledge base of highway bridge disease diagnosis and maintenance measures based on the sample data; A diagnosis module, used to determine a second highway bridge diagnosis result based on a first highway bridge diagnosis result output by a highway bridge diagnosis model and a highway bridge disease diagnosis and maintenance measures knowledge base; The step of determining sample data through the highway bridge data comprises: Preprocessing the highway bridge data to obtain first data; Using manual interpretation to mark the first data as input text data and label data, wherein the input text data and label data constitute sample data; Divide the sample data into training data, validation data and test data; The highway bridge diagnosis model is any one of GPT-3, LLAMA, ChatGLM2, BLOOM or baichuan2; The process of constructing a knowledge base of highway bridge disease diagnosis and maintenance measures based on the sample data includes: Convert the sample data into a knowledge base vector, where the knowledge base vector contains input text data and label data; The knowledge base vector is converted into a first-level sub-block and a second-level sub-block; wherein the first-level sub-block is composed of input text data, and the second-level sub-block is composed of label data; The first-level sub-blocks and the second-level sub-blocks are combined into a whole through index information to construct a knowledge base of bridge diseases and maintenance; The step of determining the second highway bridge diagnosis result based on the first highway bridge diagnosis result output by the highway bridge diagnosis model and the highway bridge disease diagnosis and maintenance measures knowledge base comprises: Convert the words in the user's question into question vectors; Select the appropriate knowledge base vector based on the question vector; The Sentence-transformer library is used to semantically match the question vector and the knowledge base vector to screen out the second highway bridge diagnosis results; The specific training steps of the highway bridge diagnosis model are generally as follows: First, supervised fine-tuning training is performed using the collected high-quality datasets to improve the basic capabilities of the highway bridge diagnosis model; Then, multiple data sets with added white noise were used for training to improve the anti-interference ability of the highway bridge diagnosis model; Then, on the basis of retaining two-thirds of the data from the supervised fine-tuning stage, a data set containing white noise was superimposed and the reward highway bridge diagnosis model was used for training to further improve the ability of the highway bridge diagnosis model. Finally, based on the data from the supervised fine-tuning stage, the proximal strategy optimization algorithm is used for training to complete the final highway bridge diagnosis model training.
4. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and running on the processor. When the processor executes the program, the method for diagnosing bridge defects and recommending maintenance measures based on a large language model as described in any one of claims 1 to 2 is implemented.
5. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and the computer program is loaded by a processor to execute the method for diagnosing bridge defects and recommending maintenance measures based on a large language model as described in any one of claims 1 to 2.
