Text analysis method based on large language model
By using a text parsing method based on a large language model, dynamically adjusting parameters, and utilizing a knowledge graph in the power plant domain, the problem of low efficiency and poor accuracy of traditional text parsing methods in power plant text processing is solved, achieving efficient, accurate text parsing and adaptive capabilities.
Patent Information
- Application Number
- CN202511797320.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-03-13
AI Technical Summary
Traditional text parsing methods suffer from low parsing efficiency, poor accuracy, and a lack of adaptive adjustment capabilities when processing power plant texts, especially when dealing with semantic diversity, ambiguity, and newly emerging terms.
A text parsing method based on a large language model is adopted. By configuring parameters through fuzzy PID control logic, the attention mechanism weights, the dynamic expansion threshold of the power plant entity dictionary, and the text segmentation granularity are dynamically adjusted. Combined with a power plant domain knowledge graph and an adaptive parsing parameter library, accurate parsing of power plant text is achieved.
It improves the accuracy and efficiency of text parsing, enhances adaptive adjustment capabilities, and can effectively handle the semantic diversity and ambiguity in power plant texts, ensuring the completeness of key information extraction and the standardization of format.
Smart Images

Figure CN121659928A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of text parsing technology, specifically to a text parsing method based on a large language model. Background Technology
[0002] With the continuous expansion of power plant scale and the constant improvement of power information technology, text data related to power grids and power plants is increasing. However, traditional text parsing methods rely on fixed rules and templates, making it difficult to effectively handle the semantic diversity, ambiguity, and newly emerging terms and expressions in text, resulting in low parsing accuracy. On the other hand, traditional parsing methods cannot dynamically adjust according to the characteristics and parsing requirements of different types of text, leading to poor adaptability when processing power plant texts from different sources and in different formats. Summary of the Invention
[0003] This application provides a text parsing method based on a large language model, which solves the technical problems of low efficiency, poor accuracy, and lack of adaptive adjustment capability in existing text parsing methods.
[0004] The technical solution to the above-mentioned technical problems in this application is as follows:
[0005] Firstly, this application provides a text parsing method based on a large language model, the method comprising:
[0006] Based on the preset text type and target parsing requirements, configure the parameters of the large language model using fuzzy PID control logic;
[0007] Within the text parsing window, the large language model parameters, power plant entity dictionary, and text segmentation granularity are used for parsing to determine the text parsing information. If the target parsing requirements are met, structured data is output; otherwise, the system returns to the parameter dynamic calibration module to optimize the attention mechanism weights of the large language model, the dynamic expansion threshold of the power plant entity dictionary, and the adaptive switching coefficient of the text segmentation granularity.
[0008] Simultaneously, the text input rate is adjusted, the entity matching frequency and text processing time of the text parsing window are monitored, and combined with the text parsing information, large language model parameters, power plant entity dictionary and text segmentation granularity are collected in the continuous parsing cycle to obtain an adaptive parsing parameter library, and parsing parameters are configured for new input power plant text.
[0009] This application provides one or more technical solutions, which have at least the following technical effects or advantages:
[0010] This application provides a text parsing method based on a large language model. First, it configures the parameters of the large language model using fuzzy PID control logic to better adapt to the semantic diversity and ambiguity in power plant texts, handling newly emerging terms and expressions. Second, during parsing, it optimizes the attention mechanism weights of the large language model, the dynamic expansion threshold of the power plant entity dictionary, and the adaptive switching coefficient of the text segmentation granularity in real time, improving the accuracy and efficiency of text parsing. Finally, it adjusts the text input rate and monitors relevant indicators, constructing an adaptive parsing parameter library based on text parsing information. This achieves precise parsing parameter configuration for newly input power plant texts, enhancing the adaptive adjustment capability of the entire parsing system and solving the problems of low parsing efficiency, poor accuracy, and lack of adaptive adjustment capability in traditional text parsing methods.
[0011] Through the above technical solutions, the text parsing method based on a large language model provided in this application can not only effectively handle the semantic diversity, ambiguity, and newly emerging terms and expressions in the text, but also improve the accuracy and efficiency of text parsing by dynamically adjusting the parameters of the large language model, the weight of the attention mechanism, the dynamic expansion threshold of the power plant entity dictionary, and the adaptive switching coefficient of the text segmentation granularity. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a flowchart illustrating a text parsing method based on a large language model provided in an embodiment of this application. Detailed Implementation
[0014] This application provides a text parsing method based on a large language model to address the technical problems of low efficiency, poor accuracy, and lack of adaptive adjustment capabilities in existing text parsing methods.
[0015] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0016] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0017] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid unnecessarily obscuring the description of this application. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0018] Examples, such as Figure 1 As shown, this application provides a text parsing method based on a large language model, including:
[0019] S10: Configure the parameters of the large language model based on the preset text type and target parsing requirements, using fuzzy PID control logic.
[0020] In this embodiment, the preset text types cover various categories such as power plant operation reports, equipment maintenance logs, and fault record texts. The target parsing requirements are determined based on the specific application scenario, such as extracting key equipment information, analyzing fault causes, and compiling operational metrics.
[0021] Based on the preset text type and target parsing requirements, and using fuzzy PID control logic, large language model parameters are configured. The fuzzy PID control logic combines the flexibility of fuzzy control with the precision of PID control.
[0022] The method, which configures large language model parameters based on fuzzy PID control logic, further includes:
[0023] Configure attention mechanism weights based on the density of text entities related to the power plant;
[0024] Based on the matching degree between the context window length and the attention mechanism weights, output constraints are configured, wherein the context window length is an association adjustment index mapped under the average length of the power plant text.
[0025] In this embodiment of the application, firstly, attention mechanism weights are configured based on the entity density of the power plant text. The entity density of the power plant text is determined by counting the number of entities within a unit text length. Texts with high entity density need to be assigned higher attention weights to capture information.
[0026] Secondly, output constraints are configured based on the matching degree between the context window length and the attention mechanism weights. The context window length reflects the scope of text processing, while the attention mechanism weights reflect the degree of attention paid to different text regions. When the matching degree between the context window length and the attention mechanism weights is high, it indicates that the current configuration can effectively capture key information in the text. In this case, the output constraints can be appropriately relaxed to improve parsing efficiency. Conversely, when the matching degree is low, the output constraints need to be tightened to ensure the accuracy of the parsing results.
[0027] Among them, the context window length is an association adjustment index mapped under the average length of power plant text. The average text length is obtained by statistical analysis of historical power plant text data, and a basic window length range is set based on the average text length. The window length is then dynamically adjusted in combination with the complexity of the current parsing task and the target parsing requirements.
[0028] For example, for power plant operation reports containing numerous technical terms and complex sentence structures, the context window length can be appropriately increased to fully capture the semantic information in the text; while for relatively concise and information-concentrated texts such as equipment maintenance logs, a shorter window length can be used to improve parsing efficiency. Furthermore, when configuring output constraints, in addition to considering the matching degree between the context window length and the attention mechanism weights, the semantic association rules in the power plant domain knowledge graph should also be combined to perform semantic consistency verification on the output results, ensuring that the parsed text information conforms to the professional expression habits and logical relationships of the power plant domain.
[0029] Specifically, based on the matching degree between the context window length and the attention mechanism weights, the method further includes:
[0030] The deviation between the preset text type and the target parsing requirements is divided into M fuzzy levels, and the M fuzzy levels are mapped one-to-one with the M fuzzy subsets of the large language model parameter adjustment amount.
[0031] Based on the M fuzzy subsets of the large language model parameter adjustment, a fuzzy rule matrix is established, and the context window length is configured.
[0032] In this embodiment, the deviation between the preset text type and the target parsing requirement is first divided into M fuzzy levels to measure the difference between the current parsing state and the ideal state. The fuzzy levels can be set according to actual needs, for example, they can be divided into five levels: "very small", "small", "medium", "large", and "very large", each corresponding to a different deviation range.
[0033] Meanwhile, the parameter adjustment amounts of the large language model are also divided into M fuzzy subsets, with each fuzzy subset mapped one-to-one with a fuzzy level, ensuring that each fuzzy level has a corresponding parameter adjustment strategy. For example, when the deviation is "very small," the corresponding parameter adjustment subset contains small parameter adjustments to maintain the stability of the current parsing state; while when the deviation is "very large," the corresponding parameter adjustment subset contains larger parameter adjustments to quickly correct the parsing deviation.
[0034] Secondly, a fuzzy rule matrix is established based on fuzzy subsets. The fuzzy rule matrix defines how to adjust the parameters of the large language model under different fuzziness levels. It can be formulated based on historical data or machine learning algorithms to ensure the scientific nature and effectiveness of parameter adjustment.
[0035] For example, a fuzzy rule could be: if the deviation is 'large', then increase the weight of the attention mechanism by 10% while reducing the text segmentation granularity by 0.5 units.
[0036] Finally, the context window length is configured based on the fuzzy rule matrix. The configuration of the context window length needs to consider the complexity of the current parsing task, the target parsing requirements, and the guidance of the fuzzy rule matrix. For example, when the deviation is large, the context window length needs to be increased to capture more semantic information; while when the deviation is small, the window length can be appropriately reduced to improve parsing efficiency.
[0037] By dynamically configuring the context window length as described above, we can ensure that the text parsing method maintains high accuracy and efficiency in different scenarios.
[0038] S20: In the text parsing window, the large language model parameters, power plant entity dictionary and text segmentation granularity are used to parse the text to determine the text parsing information. If the target parsing requirements are met, the structured data is output. Otherwise, the parameter dynamic calibration module is returned to optimize the attention mechanism weight of the large language model, the dynamic expansion threshold of the power plant entity dictionary and the adaptive switching coefficient of the text segmentation granularity.
[0039] In this embodiment, within the text parsing window, the input text is first parsed using pre-configured large language model parameters, a power plant entity dictionary, and text segmentation granularity. During parsing, the large language model parameters serve as the core driver, guiding the model on how to better understand and process text information; the power plant entity dictionary provides specialized terminology and entity relationships within the power plant domain, helping the model accurately identify key entities in the text; and the text segmentation granularity determines the fineness of the model's text segmentation, affecting the accuracy and efficiency of parsing.
[0040] Based on the above information, the text parsing information is determined, namely, extracting key data, entity relationships, and semantic information from the text. When the parsing result meets the preset target parsing requirements, the model will output structured data; if the parsing result fails to meet the target parsing requirements, the model will automatically return to the parameter dynamic calibration module. In the parameter dynamic calibration module, the model will optimize and adjust the attention mechanism weights of the large language model, the dynamic expansion threshold of the power plant entity dictionary, and the adaptive switching coefficient of the text segmentation granularity based on the feedback information during the parsing process.
[0041] Through continuous iteration and optimization, the model can gradually improve the accuracy and efficiency of parsing to adapt to the text parsing needs in different scenarios.
[0042] Within the text parsing window, the text is parsed using the large language model parameters, the power plant entity dictionary, and the text segmentation granularity to determine the text parsing information. The method includes:
[0043] The text segmentation granularity can be adjusted within a preset control range, and the granularity index corresponding to the text segmentation granularity is positively correlated with the power plant text entity composite degree and sentence nesting depth;
[0044] When the composite degree of the power plant text entities exceeds the preset density threshold, the amount of word segmentation granularity refinement adjustment is determined based on the entity matching accuracy.
[0045] The text segmentation granularity refinement adjustment is dynamically driven by PID control, and at the same time, the text segmentation directory is configured with semantic field stability based on power plant domain rules.
[0046] In this embodiment, firstly, the text segmentation granularity can be adjusted within a preset control range, and the adjustment is determined based on the entity complexity and sentence nesting depth of the power plant text. The entity complexity of the power plant text reflects the complexity of entity relationships in the text, while the sentence nesting depth reflects the complexity of sentence structure. The entity complexity and sentence nesting depth of the power plant text jointly influence the selection of the text segmentation granularity.
[0047] Specifically, the granularity index corresponding to the text segmentation granularity is positively correlated with the entity complexity and sentence nesting depth of the power plant text. That is, the higher the entity complexity and the greater the sentence nesting depth, the finer the required text segmentation granularity.
[0048] Furthermore, when the entity complexity of the power plant text exceeds the preset density threshold, it indicates that the entity relationships in the text are relatively complex. In this case, the refinement adjustment of the word segmentation granularity is determined by combining the entity matching accuracy. Entity matching accuracy reflects the accuracy of the model in recognizing entities in the text. By considering entity matching accuracy, it is ensured that the adjustment of the word segmentation granularity is neither too refined, leading to information redundancy, nor too coarse, resulting in the loss of key information.
[0049] The fine-tuning of text segmentation granularity is dynamically driven by PID control. PID control is a commonly used control algorithm that adjusts the control quantity through a combination of proportional, integral, and derivative components. In adjusting the text segmentation granularity, PID control dynamically adjusts the adjustment amount based on the deviation between the current segmentation granularity and the ideal segmentation granularity, ensuring that the adjustment of segmentation granularity is fast and accurate.
[0050] Meanwhile, to ensure semantic consistency of the text segmentation results, the text segmentation directory is configured with semantic field stability based on power plant domain rules. Power plant domain rules encompass professional knowledge and semantic relationships within the power plant domain. By configuring the text segmentation directory with semantic field stability, the segmentation results are ensured to conform to the professional expression habits and logical relationships of the power plant domain, thereby improving the accuracy and reliability of text parsing.
[0051] Furthermore, the method involves configuring the semantic field of the text segmentation directory using power plant domain rules, and includes:
[0052] Based on the power plant domain rules, the semantic fit between the text segmentation directory and the power plant domain knowledge graph is analyzed simultaneously. The semantic association logic is dynamically corrected based on the word segmentation granularity refinement adjustment amount. Then, the domain rule engine is set in the text parsing window.
[0053] Configure the triggering conditions of the domain rule engine according to the power plant safety regulations and equipment standard rules.
[0054] In this embodiment, firstly, based on power plant domain rules, the semantic fit between the text segmentation directory and the power plant domain knowledge graph is analyzed simultaneously to ensure that the segmentation results not only conform to grammatical rules but also reflect the professional knowledge and semantic relationships within the power plant domain. By comparing the entities, relationships, and attributes in the segmentation directory and the knowledge graph, the accuracy and rationality of the segmentation results can be evaluated.
[0055] Secondly, the semantic association logic is dynamically corrected based on the adjustment amount of the word segmentation granularity. Adjusting the word segmentation granularity affects the recognition of entities and relationships in the text. Therefore, it is necessary to make corresponding corrections to the semantic association logic based on the adjustment amount. This helps to maintain the consistency and accuracy of text parsing and ensures that reasonable parsing results can be obtained under different word segmentation granularities.
[0056] Secondly, a domain rule engine is configured within the text parsing window. This engine is a software component that executes power plant domain rules, enabling intervention and adjustment of the text parsing process based on preset rules. By introducing the domain rule engine, fine-grained control over text parsing is achieved, improving both accuracy and efficiency.
[0057] Finally, the triggering conditions for the domain rule engine are configured according to power plant safety regulations and equipment standard rules. These triggering conditions determine when the domain rule engine will be activated and how the text parsing process will be adjusted under different circumstances. When the parsing result violates power plant safety regulations or equipment standard rules, the domain rule engine can automatically trigger and correct the parsing result, ensuring that the parsing result meets the professional requirements and safety standards of the power plant domain.
[0058] For example, the trigger condition is a combination rule of "equipment number + fault type". When the text contains an equipment number and fault type that do not comply with the power plant safety regulations, the domain rule engine will be triggered to correct the parsing results or issue a warning.
[0059] Furthermore, the method also includes:
[0060] Based on the power plant domain knowledge graph, a text preprocessing buffer segment is marked;
[0061] In the text preprocessing buffer segment, a semantic similarity algorithm is used to simulate the semantic field distribution. When the local semantic association deviation within the text parsing window is detected to exceed the deviation threshold, the weight of the following text association between adjacent text segments is finely adjusted.
[0062] In this embodiment, firstly, based on a knowledge graph of the power plant domain, text preprocessing buffer segments are marked during text preprocessing. By marking regions in the text that may contain key information or semantic transitions, a reference can be provided for subsequent semantic analysis and association deviation detection.
[0063] Secondly, within the text preprocessing buffer, a semantic similarity algorithm is used to simulate the distribution of the semantic field. This algorithm quantifies the degree of semantic similarity between different text fragments. By simulating the distribution of the semantic field, the semantic relationships between different parts of the text can be intuitively understood.
[0064] When a local semantic association deviation within the text parsing window exceeds a preset deviation threshold, it indicates an anomaly in the semantic connection between the current text segment and its adjacent segments. The deviation is corrected by fine-tuning the context association weights of adjacent text segments. These context association weights reflect the degree of influence of the current text segment on its subsequent text content. By adjusting these weights, the model pays more attention to subsequent content that is semantically closely related to the current segment during parsing, thereby improving the accuracy and coherence of the parsing.
[0065] For example, in a power plant fault report text, if the semantic correlation deviation between the "fault phenomenon description" segment and the subsequent "fault cause analysis" segment exceeds a critical value, the system increases the weight of the subsequent association of the "fault phenomenon description" segment. This allows the model to focus more on capturing the potential logical connection between the two segments during parsing, avoiding parsing errors caused by semantic breaks. Simultaneously, the system verifies the fine-tuned association weights by combining them with the causal relationship chains in the power plant domain knowledge graph, ensuring that the correction direction aligns with power plant fault handling experience. For instance, when the association weight between the "line overload" phenomenon and the "equipment aging" cause is insufficient, the system automatically refers to the "overload-equipment load-aging" path in the knowledge graph to strengthen the semantic transmission strength between the two.
[0066] The method for determining text parsing information further includes:
[0067] Based on the text parsing information, the key information extraction completeness rate, ambiguous sentence elimination rate, and format compliance rate are obtained.
[0068] The deviation is evaluated by the completeness rate of key information extraction, the rate of ambiguous sentence elimination, and the rate of compliance with format specifications. When the deviation exceeds the dynamic deviation threshold, it is determined that the parsing is not up to standard, and the attention mechanism of the large language model is fine-tuned.
[0069] In this embodiment of the application, firstly, based on the parsed text information, indicators such as the completeness rate of key information extraction, the rate of elimination of ambiguous sentences, and the rate of compliance with format specifications are obtained, which respectively reflect the model's performance in extracting key information, eliminating sentence ambiguity, and ensuring the standardization of output format.
[0070] Among them, the key information extraction completeness rate measures the proportion of key information successfully extracted from the text by the model; the ambiguous sentence elimination rate reflects the model's ability to correctly parse ambiguous sentences; and the format specification compliance rate evaluates whether the format of the model's output conforms to the preset specifications.
[0071] Secondly, the deviation is assessed based on the acquired indicators. The deviation reflects the gap between the current analysis result and the ideal state, serving as the basis for determining whether the analysis meets the standards. By setting a dynamic deviation threshold, the judgment criteria are flexibly adjusted according to the analysis requirements in different scenarios. When the deviation exceeds the dynamic deviation threshold, the analysis is deemed unqualified.
[0072] Furthermore, if the parsing is deemed inadequate, the model will trigger the attention mechanism weight fine-tuning mechanism of the large language model. The attention mechanism weights determine the degree of attention the model pays to different parts when processing text. By fine-tuning the weights, the model can more accurately capture information in the text and improve the accuracy of parsing.
[0073] The fine-tuning process involves developing optimization strategies based on historical data or machine learning algorithms, such as neural networks, to ensure the scientific validity and effectiveness of weight adjustments.
[0074] Furthermore, the method further includes fine-tuning the attention mechanism weights of the large language model, triggering the following:
[0075] When the attention mechanism is triggered to fine-tune the weights, the amount of weight adjustment is determined based on the frequency of occurrence of the corresponding entity in the power plant dictionary.
[0076] The entity matching threshold is adjusted synchronously according to the weighted fine-tuning amount. At the same time, the recall rate of the text parsing information is monitored, and the entity matching threshold is dynamically compensated and optimized.
[0077] In this embodiment, when the attention mechanism of the large language model is triggered for weight fine-tuning, the weight fine-tuning amount is first determined based on the frequency of occurrence of each entity in the power plant entity dictionary. The power plant entity dictionary records professional terms and entities in the power plant field, and the frequency of entity occurrence reflects the importance of the entity in the text. Using the frequency of occurrence as a benchmark ensures that the weight fine-tuning amount conforms to the actual characteristics of the power plant text.
[0078] Secondly, the entity matching threshold is synchronously adjusted according to the determined weight fine-tuning amount. The entity matching threshold determines the strictness of the model in recognizing entities in the text, and the entity matching threshold is adjusted synchronously. For example, when the weight fine-tuning amount increases the attention to a certain important power plant entity, the matching threshold of that entity is correspondingly reduced.
[0079] Simultaneously, the recall rate of the parsed text information is monitored. Recall rate reflects the proportion of relevant information that the model successfully identifies in the text. If the recall rate is low, it indicates that the model may have missed some information. In this case, the entity matching threshold is dynamically compensated and optimized.
[0080] Dynamic compensation optimization automatically adjusts the entity matching threshold based on changes in recall rate, improving the model's ability to recognize text information and ensuring high parsing accuracy and completeness in different scenarios.
[0081] S30: Simultaneously, adjust the text input rate, monitor the entity matching frequency and text processing time of the text parsing window, and combine the text parsing information to collect large language model parameters, power plant entity dictionary and text segmentation granularity within a continuous parsing cycle to obtain an adaptive parsing parameter library, and configure parsing parameters for new input power plant text.
[0082] In this embodiment, different input rates affect the entity matching frequency and text processing time of the text parsing window. When the text input rate is fast, the entity matching frequency may increase, but the text processing time may also increase, as the model needs to process more text information in a shorter time. Conversely, when the text input rate is slow, the entity matching frequency may decrease, but the text processing time is relatively reduced, giving the model more time for parsing.
[0083] Secondly, by combining text parsing information, the parameters of the large language model, the power plant entity dictionary, and the text segmentation granularity are collected within consecutive parsing cycles. By collecting data over multiple consecutive parsing cycles, the model's performance in different scenarios is obtained. For example, under certain specific power plant text types, the parameters of the large language model may exhibit specific patterns, the frequency and relationships of entities in the power plant entity dictionary may differ, and the text segmentation granularity will also be adjusted according to the text characteristics.
[0084] Furthermore, the collected data is integrated to obtain an adaptive parsing parameter library. This library is dynamic and continuously updated based on actual conditions. It includes large language model parameters validated and optimized for different scenarios, a power plant entity dictionary, and text segmentation granularity.
[0085] Specifically, when new input text about power plants is received, an adaptive parsing parameter library is used to configure its parsing parameters. Based on the characteristics of the new text, such as text type and entity complexity, appropriate parameter combinations are selected from the library to provide the optimal configuration for parsing the new text. This ensures that the model can quickly and accurately complete the parsing task when processing new text, improving the adaptability and efficiency of the overall text parsing method.
[0086] For example, if the newly input power plant text is about a specific equipment fault, the parameter library can configure parameters for the text that focus more on equipment entity recognition and fault relationship analysis based on the parsing experience of similar texts in the past.
[0087] The method involves collecting large language model parameters, a power plant entity dictionary, and text segmentation granularity within a continuous parsing cycle to obtain an adaptive parsing parameter library. This method includes:
[0088] The adaptive parsing parameter library is stored in partitions according to the power plant text type, and each partition contains multiple sets of optimized parsing parameters.
[0089] The multiple sets of optimized analytical parameters corresponding to the newly input power plant text are classified, and the optimized analytical parameters with a deviation from the cluster center within the acceptable error range are merged and stored.
[0090] In this embodiment, the adaptive parsing parameter library is designed to be stored in partitions according to the power plant text type. Different types of power plant text correspond to independent storage areas, such as fault reports, operation instructions, and equipment parameters. Each partition contains multiple sets of optimized parsing parameters, which are formed through continuous accumulation and dynamic optimization of historical parsing data. For example, the fault report partition may contain parameter sets for specific fault types such as line overload and equipment aging, while the operation instruction partition stores parameter configurations related to switching operations and load adjustments.
[0091] When new power plant text is input into the system, it is first located to the corresponding parameter library partition based on the text type. Then, the system uses a clustering algorithm to classify and analyze multiple sets of optimized parsing parameters within the partition, calculating the deviation between each set of parameters and the cluster center. If the deviation of a certain set of parameters is less than a preset acceptable error range, such as a semantic similarity threshold or entity matching error rate, the parameter is merged with the cluster center parameters and stored to form a parameter set.
[0092] For example, if the deviations of the three sets of parameters related to transformer faults in terms of entity recognition accuracy, consistency of association logic, etc. are all less than 5%, the system will merge them into a set of optimized parameters and mark the applicable scenario as "transformer fault analysis".
[0093] Furthermore, during the merging and storage process, the applicable condition labels for parameters are dynamically updated, such as text length range and entity density threshold, to ensure that the merged parameters still accurately match the target text features. Simultaneously, frequently used parameters from historical parsing data are given higher weights and prioritized for parameter configuration in subsequent texts. This dynamic merging mechanism not only reduces redundancy in the parameter library but also improves parameter matching efficiency through clustering optimization, shortening the parameter configuration time for new text parsing by more than 30%.
[0094] Furthermore, the method further includes configuring parsing parameters for the newly input power plant text, and also includes:
[0095] Based on the adaptive parsing parameter library, a similarity comparison is performed on the new input power plant text. If the similarity comparison passes, the new input power plant text is treated as text of the same type, and multiple sets of optimized parsing parameters for the corresponding partition are called for configuration.
[0096] After the parsing parameters of the newly input power plant text are configured, a local verification parsing is performed. If the pass rate of the verification parsing exceeds the pass rate threshold, a parsing parameter confirmation command is issued.
[0097] In this embodiment, firstly, a similarity comparison is performed on the newly input power plant text based on an adaptive parsing parameter library. By calculating the semantic similarity and entity overlap rate between the new text and the text in each partition of the parameter library, it is determined whether it belongs to an existing text type. If the similarity comparison passes, the new text is directly classified as a text of the same type, and multiple pre-optimized parsing parameters within the corresponding partition are called for configuration, avoiding redundant parameter calculations. For example, when the similarity between the new text and the historical text in the "Equipment Inspection Record" partition exceeds 85%, the system automatically selects the parameter set optimized for equipment status description in that partition.
[0098] Secondly, after configuring the parsing parameters, a local verification parsing is performed on the new text. Representative segments of the text, such as fault descriptions and operation steps, are selected and parsed using the configured parameters. The verification parsing pass rate is then calculated. The pass rate is determined by comparing the parsing results with preset standards, such as entity recognition accuracy and relation extraction completeness. If the verification parsing pass rate exceeds a preset pass rate threshold (e.g., 90%), a parsing parameter confirmation command is issued, locking the current parameter combination as the final configuration. If the threshold is not met, a parameter rollback mechanism is triggered, allowing for the selection or adjustment of the parameter group.
[0099] For example, when processing a new substation operation instruction text, the system first compares it and finds that its similarity to the text in the "switching operation" section reaches 88%. It then calls the parameters optimized for operation instruction terminology in that section. During the local verification phase, the system parses the "disconnect 10kV bus" instruction in the text. If the entity recognition accuracy reaches 92% and the relationship extraction completeness reaches 95%, the parameters are confirmed to be valid. If entity recognition is missed, such as failing to recognize the "10kV" voltage level, the system rolls back to the parameter library to select another set of parameters for re-verification.
[0100] In summary, compared to existing technologies, this application achieves more accurate and efficient parsing of power plant text by introducing a knowledge graph of the power plant domain, a dynamic deviation evaluation mechanism, and an adaptive parsing parameter library. This method improves the completeness of key information extraction, the elimination of ambiguous sentences, and the compliance rate with formatting standards. Furthermore, by monitoring and dynamically adjusting parsing parameters in real time, it effectively addresses parsing challenges under different input rates and text types.
[0101] In summary, the embodiments of this application have at least the following technical effects:
[0102] This application provides a text parsing method based on a large language model. First, it configures the parameters of the large language model using fuzzy PID control logic to better adapt to the semantic diversity and ambiguity in power plant texts, handling newly emerging terms and expressions. Second, during parsing, it optimizes the attention mechanism weights of the large language model, the dynamic expansion threshold of the power plant entity dictionary, and the adaptive switching coefficient of the text segmentation granularity in real time, improving the accuracy and efficiency of text parsing. Finally, it adjusts the text input rate and monitors relevant indicators, constructing an adaptive parsing parameter library based on text parsing information. This achieves precise parsing parameter configuration for newly input power plant texts, enhancing the adaptive adjustment capability of the entire parsing system and solving the problems of low parsing efficiency, poor accuracy, and lack of adaptive adjustment capability in traditional text parsing methods. Through the above technical solutions, the text parsing method based on a large language model provided in this application can not only effectively handle the semantic diversity, ambiguity, and newly emerging terms and expressions in texts, but also improve the accuracy and efficiency of text parsing by dynamically adjusting the parameters of the large language model, the attention mechanism weights, the dynamic expansion threshold of the power plant entity dictionary, and the adaptive switching coefficient of the text segmentation granularity.
[0103] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this specification. Additionally, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are possible or may be advantageous.
[0104] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
[0105] This specification and accompanying drawings are merely illustrative examples of this application and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from its scope. Therefore, if such modifications and modifications fall within the scope of this application and its equivalents, this application intends to include such modifications and modifications.
Claims
1. A text parsing method based on a large language model, characterized in that, The method includes: Based on the preset text type and target parsing requirements, configure the parameters of the large language model using fuzzy PID control logic; Within the text parsing window, the large language model parameters, power plant entity dictionary, and text segmentation granularity are used for parsing to determine the text parsing information. If the target parsing requirements are met, structured data is output; otherwise, the system returns to the parameter dynamic calibration module to optimize the attention mechanism weights of the large language model, the dynamic expansion threshold of the power plant entity dictionary, and the adaptive switching coefficient of the text segmentation granularity. Simultaneously, the text input rate is adjusted, the entity matching frequency and text processing time of the text parsing window are monitored, and combined with the text parsing information, large language model parameters, power plant entity dictionary and text segmentation granularity are collected in the continuous parsing cycle to obtain an adaptive parsing parameter library, and parsing parameters are configured for new input power plant text.
2. The text parsing method based on a large language model as described in claim 1, characterized in that, The method for configuring large language model parameters based on fuzzy PID control logic further includes: Configure attention mechanism weights based on the density of text entities related to the power plant; Based on the matching degree between the context window length and the attention mechanism weights, output constraints are configured, wherein the context window length is an association adjustment index mapped under the average length of the power plant text.
3. The text parsing method based on a large language model as described in claim 2, characterized in that, Based on the matching degree between the context window length and the attention mechanism weights, the method further includes: The deviation between the preset text type and the target parsing requirements is divided into M fuzzy levels, and the M fuzzy levels are mapped one-to-one with the M fuzzy subsets of the large language model parameter adjustment amount. Based on the M fuzzy subsets of the large language model parameter adjustment, a fuzzy rule matrix is established, and the context window length is configured.
4. The text parsing method based on a large language model as described in claim 3, characterized in that, Within the text parsing window, the text is parsed using the large language model parameters, the power plant entity dictionary, and the text segmentation granularity to determine the text parsing information. The method includes: The text segmentation granularity can be adjusted within a preset control range, and the granularity index corresponding to the text segmentation granularity is positively correlated with the power plant text entity composite degree and sentence nesting depth; When the composite degree of the power plant text entities exceeds the preset density threshold, the amount of word segmentation granularity refinement adjustment is determined based on the entity matching accuracy. The text segmentation granularity refinement adjustment is dynamically driven by PID control, and at the same time, the text segmentation directory is configured with semantic field stability based on power plant domain rules.
5. The text parsing method based on a large language model as described in claim 4, characterized in that, The method for semantic field stabilization configuration of text segmentation directories based on power plant domain rules includes: Based on the power plant domain rules, the semantic fit between the text segmentation directory and the power plant domain knowledge graph is analyzed simultaneously. The semantic association logic is dynamically corrected based on the word segmentation granularity refinement adjustment amount. Then, the domain rule engine is set in the text parsing window. Configure the triggering conditions of the domain rule engine according to the power plant safety regulations and equipment standard rules.
6. The text parsing method based on a large language model as described in claim 5, characterized in that, The method further includes: Based on the power plant domain knowledge graph, a text preprocessing buffer segment is marked; In the text preprocessing buffer segment, a semantic similarity algorithm is used to simulate the semantic field distribution. When the local semantic association deviation within the text parsing window is detected to exceed the deviation threshold, the weight of the following text association between adjacent text segments is finely adjusted.
7. The text parsing method based on a large language model as described in claim 6, characterized in that, The method for determining text parsing information further includes: Based on the text parsing information, the key information extraction completeness rate, ambiguous sentence elimination rate, and format compliance rate are obtained. The deviation is evaluated by the completeness rate of key information extraction, the rate of ambiguous sentence elimination, and the rate of compliance with format specifications. When the deviation exceeds the dynamic deviation threshold, it is determined that the parsing is not up to standard, and the attention mechanism of the large language model is fine-tuned.
8. The text parsing method based on a large language model as described in claim 7, characterized in that, The method further includes triggering the attention mechanism weight fine-tuning of the large language model, and also includes: When the attention mechanism is triggered to fine-tune the weights, the amount of weight adjustment is determined based on the frequency of occurrence of the corresponding entity in the power plant dictionary. The entity matching threshold is adjusted synchronously according to the weighted fine-tuning amount. At the same time, the recall rate of the text parsing information is monitored, and the entity matching threshold is dynamically compensated and optimized.
9. The text parsing method based on a large language model as described in claim 1, characterized in that, The method involves collecting large language model parameters, a power plant entity dictionary, and text segmentation granularity within a continuous parsing cycle to obtain an adaptive parsing parameter library. The adaptive parsing parameter library is stored in partitions according to the power plant text type, and each partition contains multiple sets of optimized parsing parameters. The multiple sets of optimized analytical parameters corresponding to the newly input power plant text are classified, and the optimized analytical parameters with a deviation from the cluster center within the acceptable error range are merged and stored.
10. The text parsing method based on a large language model as described in claim 9, characterized in that, The method further includes parsing parameter configurations for newly input power plant text, and also includes: Based on the adaptive parsing parameter library, a similarity comparison is performed on the new input power plant text. If the similarity comparison passes, the new input power plant text is treated as text of the same type, and multiple sets of optimized parsing parameters for the corresponding partition are called for configuration. After the parsing parameters of the newly input power plant text are configured, a local verification parsing is performed. If the pass rate of the verification parsing exceeds the pass rate threshold, a parsing parameter confirmation command is issued.