Document parameter accurate positioning and intelligent marking method based on large language model
By using a document parameter localization and tagging method based on a large language model, the problems of low parameter localization accuracy, single tagging strategy and insufficient context awareness in the existing technology are solved. This method achieves high-precision parameter localization and tagging, and improves the interpretability and user trust of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- POWERCHINA HUADONG ENG CORP LTD
- Filing Date
- 2026-04-22
- Publication Date
- 2026-07-31
AI Technical Summary
Existing document parameter location and marking methods suffer from problems such as low parameter location accuracy, lack of traceability, single marking strategy, difficulty in marking multiple instances, weak ability to handle marking conflicts, and insufficient context awareness.
A large language model-based approach is adopted to establish a mapping relationship between sentences and document locations through sentence identifier generation. Parameter localization and labeling are performed by combining rule matching and the large language model, including multi-instance filtering, label error correction, conflict handling and tracing mechanisms, and recording label source information.
It improves the accuracy of parameter positioning and the accuracy of labeling, reduces mislabeling and omissions, enhances the interpretability and user trust of the system, and reduces the workload of manual review.
Smart Images

Figure CN122221816B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of document parameter localization and tagging, specifically relating to a method for precise localization and intelligent tagging of document parameters based on a large language model. Background Technology
[0002] Existing document parameter location and tagging methods mainly rely on simple text matching or single-strategy tagging systems, which have the following technical problems: Low parameter location accuracy and lack of traceability: Existing systems often only provide rough paragraph or chapter information when locating the specific position of parameters in a document. When it is necessary to verify the accuracy of the extraction results or to conduct manual review, it is difficult to quickly locate the exact position of the parameter in the document. At the same time, the lack of an effective traceability mechanism makes it impossible to establish a clear correlation between the extraction results and the original position in the document, resulting in insufficient interpretability and credibility of the extraction results.
[0003] The existing parameter tagging methods often employ a single rule-based matching strategy (such as regular expressions or keyword matching), which is prone to mis-tags, over-tags, or omissions when encountering complex scenarios. For example, when the same parameter value appears multiple times in a document, rule matching cannot distinguish which are the correct tag positions; when the parameter value appears in different semantic contexts, rule matching may incorrectly tag non-target content as the target parameter. Existing systems lack intelligent tagging correction mechanisms and cannot automatically identify and correct tagging errors.
[0004] Multi-instance parameter tagging difficulty: When the same parameter value appears in multiple locations in a document, existing systems have difficulty accurately determining which locations should be tagged.
[0005] Weak conflict handling capability: When multiple parameters overlap or conflict in the document, the existing system lacks an effective conflict detection and handling mechanism.
[0006] Insufficient context awareness: Existing labeling systems often focus only on the parameter values themselves when labeling parameters, ignoring the surrounding contextual information. This lack of deep understanding of the context results in low labeling accuracy. Summary of the Invention
[0007] This invention provides a method for precise document parameter localization and intelligent tagging based on a large language model to solve the aforementioned technical problems, specifically adopting the following technical solution: A method for precise document parameter localization and intelligent tagging based on a large language model includes the following steps: Sentence identifiers are generated from the document content, and identifiers are added to each sentence to establish a mapping relationship between sentences and document locations; Based on the sentence identifier, the target sentence is located from the parameter extraction results, and contextual information is extracted; The target sentence is initially marked using a rule-matching method, and the marking status is detected. When the status indicates that multiple instances exist, the large language model is invoked to filter multiple instances based on contextual semantics, and a list of correct instance numbers is output. Based on the judgment results of the large language model, mark and correct errors, remove incorrect marks and retain correct marks; Detect positional overlap between markers with different parameters and handle marker conflicts according to priority rules; The parameter record for each tag includes sentence identifier, document location, context information, and source information of the tagging method, establishing a traceability chain from the extraction result to the document location.
[0008] Furthermore, the sentence identifier generation includes paragraph-level identifier generation and chapter-level identifier generation. The paragraph-level identifier format is sentence number, and the chapter-level identifier format is a combination of paragraph number and sentence number. The system maintains the mapping relationship between identifiers and document content and supports automatic conversion between paragraph-level identifiers and chapter-level identifiers.
[0009] Furthermore, the step of locating the target sentence based on sentence identifiers includes: extracting sentence identifier information from the parameter extraction results, locating the corresponding sentence in the original document according to the paragraph number and sentence number in the identifier; verifying the accuracy of the location result, relocating the sentence by fuzzy matching through parameter values when the identifier is invalid, and marking the sentence as awaiting manual review when the location fails.
[0010] Furthermore, the rule matching preliminary marking uses keyword matching or regular expressions to search for parameter values in the target sentence and uses XML tags for marking; the marking status includes three cases: not present, present one, and present multiple.
[0011] Furthermore, when the label state is non-existent and the parameter importance is high, the large language model is invoked for intelligent labeling. When a field-specific rule detects a potential risk of mislabeling, it invokes the large language model for semantic verification. When the large language model call fails, it falls back to a rule-based judgment strategy or is marked as pending manual review.
[0012] Furthermore, the invocation of the large language model for multi-instance filtering includes: Add a number to each instance; Construct inputs that include tagged text, parameter types, parameter values, context information, and field-specific rules; The large language model outputs the judgment results in JSON format, including a list of correct instance numbers and the reason for the judgment.
[0013] Furthermore, a placeholder mechanism is used to protect correctly marked areas. Existing XML tags are replaced with temporary placeholders, and a placeholder mapping table is maintained to record the correspondence between placeholders and original XML tags. After marking is completed, the placeholders are restored to the original tags according to the mapping table.
[0014] Furthermore, it supports configuring an exclusion keyword list for specific parameter types, skipping the marker at that position when the parameter value is immediately followed by an exclusion keyword; By combining the semantic understanding capabilities of large language models, contextual semantic checks are performed on the marked positions to ensure that the marked positions meet the semantic requirements of the parameters.
[0015] Furthermore, the marker conflict detection adopts an interval overlap judgment method. For the marker position range of two parameters, when the larger value between the starting position of the first parameter and the starting position of the second parameter is less than or equal to the smaller value between the ending position of the first parameter and the ending position of the second parameter, it is determined that there is an overlap. The priority rules include a priority retention strategy, a longest matching retention strategy, and a semantic importance retention strategy. The parameter with higher priority retains the marker, and the parameter with lower priority removes the marker of the overlapping part.
[0016] Furthermore, the source information includes sentence identifier, document character position range, context information, marking method, marking status, and processing timestamp; it supports forward tracing to query document position by parameter value and reverse tracing to query parameter information by document position; it is visualized based on XML tags, and users can view detailed source information of parameters by clicking on tags.
[0017] The advantage of this invention lies in the document parameter accurate positioning and intelligent tagging method based on a large language model. Through a hybrid tagging strategy that combines rule matching and large language model collaboration, the system ensures both processing efficiency and tagging accuracy. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of the document parameter precise location and intelligent tagging method based on a large language model according to this application; Figure 2 This is a schematic diagram of the workflow of the hybrid tagging strategy that combines rule matching and large language model collaboration in this application. Detailed Implementation
[0020] Embodiments of the present invention are described in detail below. Examples of these embodiments are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0021] In the description of this application, it should be noted that, unless otherwise specified and limited, the terms "installation", "connection" and "linkage" should be interpreted broadly, and can refer to mechanical or electrical connections, or internal connections between two components, or direct connections. "Up", "down", "left", "right", etc., are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may change.
[0022] The accompanying drawings of the embodiments disclosed in this invention only involve structures relevant to the embodiments disclosed in this invention. Other structures can be referred to with common designs. Unless otherwise specified, the same embodiment and different embodiments of this invention can be combined with each other.
[0023] like Figure 1The diagram illustrates a document parameter precise localization and intelligent tagging method based on a large language model, comprising the following steps: S1: Generate sentence identifiers for the document content, adding identifiers to each sentence to establish a mapping relationship between sentences and document positions. S2: Locate the target sentence from the parameter extraction results based on the sentence identifiers and extract contextual information. S3: Perform preliminary tagging of the target sentence using a rule-based matching method and detect the tagging status. S4: When the tagging status indicates the existence of multiple instances, call the large language model and combine it with contextual semantics to perform multi-instance filtering, outputting a list of correct instance numbers. S5: Perform tagging correction based on the judgment results of the large language model, removing erroneous tags and retaining correct tags. S6: Detect positional overlap between different parameter tags and handle tagging conflicts according to priority rules. S7: Record the parameter information for each tag, including sentence identifier, document position, contextual information, and source information of the tagging method, establishing a traceability chain from the extraction results to the document position. This application presents a document parameter precise location and intelligent tagging method based on a large language model. Through a sentence identification mechanism, it achieves precise parameter location. Compared to traditional character position index-based location methods, even if the document format changes, the tagging remains valid as long as the sentence content remains the same, exhibiting stronger robustness. Through a hybrid tagging strategy combining rule matching and the large language model, the system ensures both processing efficiency and tagging accuracy. The large language model, combined with contextual semantics, can accurately distinguish the same parameter values in different scenarios, effectively reducing mis-tags, multiple tags, and missed tags. Through tag conflict detection and priority handling mechanisms, the system can automatically detect and handle positional overlaps between different parameters, ensuring the accuracy and completeness of the tagging results. Through a complete traceability mechanism, the system constructs a two-way traceability chain from the extraction results to the document location, providing complete source information records, significantly improving the system's interpretability and user trust, reducing manual review workload, and increasing processing efficiency. The following details the above steps.
[0024] For step S1: Generate sentence identifiers for the document content, and add identifiers to each sentence to establish a mapping relationship between the sentence and the document position.
[0025] In the embodiments of this application, sentence identifier generation includes paragraph-level identifier generation and chapter-level identifier generation. The paragraph-level identifier format is sentence number, and the chapter-level identifier format is a combination of paragraph number and sentence number. The system maintains the mapping relationship between identifiers and document content and supports automatic conversion between paragraph-level identifiers and chapter-level identifiers.
[0026] Specifically, the system first preprocesses the document, adding paragraph-level tags to sentences in each paragraph according to the paragraph order.
[0027] For document content processed at the paragraph level, the identifier format is sentence number, such as [1], [2], [3], etc., where the number indicates the order of the sentence in the paragraph. The system first divides the paragraph text into sentences according to sentence ending marks such as period, exclamation mark, and question mark, and then adds corresponding identifiers to each sentence. Special cases need to be handled during the sentence division process. For numbers containing decimal points, such as 3.5MW, the decimal point is not used as a sentence ending mark; for content within quotation marks, the period within the quotation marks is not used as a sentence ending mark; for common abbreviations such as etc., i.e., such as etc., the period following them is not used as a sentence ending mark. The system maintains a special rule list to identify these boundary cases, and at the same time maintains the mapping relationship between identifiers and document content, recording the original text, paragraph or chapter to which each identifier belongs, and its position in the document.
[0028] For document content processed at the chapter level, the system adds a chapter-level identifier to each sentence according to the hierarchical structure of chapters and paragraphs. The identifier format is a combination of paragraph number and sentence number, such as [2-1], [2-2], [3-5], etc., where the first number represents the paragraph number and the second number represents the sentence's order within the paragraph. This identifier method can simultaneously reflect the sentence's position within both chapters and paragraphs, providing more precise location information.
[0029] The system maintains a mapping between identifiers and document content, recording information such as the original text, paragraph or chapter to which each identifier belongs, and its position in the document. The system also supports automatic conversion between paragraph-level and chapter-level identifiers. When converting a chapter-level identifier to a paragraph-level identifier, the system extracts the sentence number from the identifier; when converting a paragraph-level identifier to a chapter-level identifier, the system adds the paragraph number based on the paragraph information. This conversion mechanism ensures identifier compatibility under different processing strategies.
[0030] By employing both paragraph-level and chapter-level tagging hierarchies, the system can adapt to different granularity processing needs. Paragraph-level tags are suitable for simple documents, while chapter-level tags are suitable for complex, structured documents. A tag format conversion mechanism ensures compatibility under different processing strategies, enabling the system to flexibly handle various document types. Maintaining the mapping relationship between tags and document content provides a foundation for subsequent parameter location and tracing. Even if the document format changes, as long as the sentence content remains the same, the tags remain valid, significantly improving the system's robustness and adaptability.
[0031] For step S2: Locate the target sentence from the parameter extraction results based on the sentence identifier and extract the context information.
[0032] In the embodiments of this application, locating a target sentence based on sentence identifiers includes: extracting sentence identifier information from the parameter extraction results, and locating the corresponding sentence in the original document according to the paragraph number and sentence number in the identifier. The accuracy of the location results is verified; when the identifier is invalid, fuzzy matching is performed to relocate the sentence using the parameter value; when the location fails, it is marked for manual review. The system extracts sentence identifier information from the parameter extraction results and locates the corresponding sentence in the original document according to the paragraph number and sentence number in the identifier. The system also verifies the accuracy of the location results, ensuring that the sentence content corresponding to the identifier matches the parameter value in the extraction results. The exception handling mechanism includes three cases: when the sentence identifier cannot find a corresponding sentence in the document, the system records an identifier invalidation exception and attempts to relocate the sentence using fuzzy matching in the document using the parameter value; when the sentence located based on the identifier does not contain the parameter value, the system records a location failure exception and marks it for manual review; when the parameter value appears multiple times in the located sentence, the system records a multi-match exception and calls a large language model for intelligent judgment.
[0033] Specifically, the system extracts sentence identification information from the parameter extraction results. The extraction results usually contain parameter values and their corresponding sentence identification lists. For example, `{"Project Name": {"Tangfeng X City Wind Farm Project": [1, 2, 3]}}` means that the value of the "Project Name" parameter "Tangfeng X City Wind Farm Project" appears in the sentences identified by [1], [2], and [3].
[0034] Based on the sentence identifier, the system locates the corresponding sentence in the original document. For paragraph-level identifiers, the system searches for the sentence number in the corresponding paragraph based on the number in the identifier. For chapter-level identifiers, the system first locates the corresponding paragraph based on the paragraph number, and then locates the corresponding sentence based on the sentence number.
[0035] After locating the target sentence, the system extracts its contextual information, including the preceding and following sentences, as well as the title of the paragraph or chapter it belongs to. This contextual information is used for subsequent tagging operations and semantic understanding. The system also verifies the accuracy of the location results, ensuring that the sentence content corresponding to the tag matches the parameter values in the extraction results. When the tag fails, it relocates the sentence through fuzzy matching in the document using the parameter values. If the location fails, it is marked for manual review.
[0036] By verifying the accuracy of the positioning results, the system can promptly detect anomalies such as invalid identifiers and positioning failures, avoiding erroneous labeling. The fuzzy matching repositioning mechanism provides fault tolerance when identifiers fail, improving the system's robustness. Marking positioning failures as requiring manual review ensures labeling quality and avoids automatic erroneous labeling. Multi-match anomaly detection provides triggering conditions for intelligent judgment by the large language model, achieving synergy between rules and intelligence.
[0037] For step S3: Use rule matching method to initially mark the target sentence and detect the marking status.
[0038] like Figure 2 As shown, in the embodiments of this application, the initial rule matching marker uses keyword matching or regular expressions to search for parameter values in the target sentence and uses XML tags for marking. The marker status includes three cases: not present, present one, and present multiple.
[0039] The system first uses rule-based matching for initial tagging. For simple parameter types, the system uses keyword matching or regular expressions to search for parameter values in the target sentence. If a match is found, it is marked using XML tags in the format `<parameter name>parameter value`. Rule-based matching is fast and can quickly handle most simple scenarios.
[0040] The system detects the tag status of rule matching, including three cases: none (no tag found), one tag found (one tag found), and multiple tags found (multiple tags with the same parameter value found). The system employs different processing strategies based on the different tag statuses.
[0041] Keyword matching and regular expressions provide flexible and efficient initial tagging capabilities, enabling rapid processing of most simple scenarios and ensuring system efficiency. Standardized XML tag format facilitates subsequent processing and visualization. The classification of three tagging states provides a clear decision path for the system, allowing it to adopt the optimal processing strategy for different situations, avoiding the limitations of a single strategy and laying the foundation for the implementation of hybrid tagging strategies.
[0042] For step S4: When the marked state is that multiple instances exist, the large language model is called to filter multiple instances by combining contextual semantics, and a list of correct instance numbers is output.
[0043] like Figure 2 As shown, in the embodiments of this application, calling the large language model for multi-instance filtering includes: adding a number to each instance; constructing an input containing tag text, parameter type, parameter value, context information, and field-specific rules; and the large language model outputting a judgment result in JSON format, including a list of correct instance numbers and the reason for the judgment.
[0044] Specifically, when multiple flags exist, the system invokes a large language model for intelligent judgment. The input to the large language model includes the flagged text, parameter types and values, contextual information, and field-specific rules. The flagged text contains the complete text of all numbered instances; the parameter types and values explicitly identify the parameters to be judged; the contextual information indicates the preceding and following sentences, paragraph headings, etc.; and the field-specific rules represent the special judgment rules for that parameter type.
[0045] The system uses a specialized prompt template to guide the large language model in determining whether the parameter values marked as parameter name numbers in the text are correctly labeled. Combining contextual semantic understanding, the large language model can distinguish the same parameter values in different scenarios, such as differentiating the same parameter values in wind turbine foundation types and offshore substation foundation types. The large language model outputs the judgment results in JSON format, including a list of correct instance numbers and the reasoning behind the judgment.
[0046] In the embodiments of this application, when the labeling status is non-existent and the parameter importance is high, a large language model is invoked for intelligent labeling. When a field-specific rule detects a potential risk of mislabeling, a large language model is invoked for semantic verification. If the large language model invocation fails, it falls back to a rule-based judgment strategy or is marked as requiring manual review.
[0047] Specifically, besides invoking the large language model when multiple markers are present, the system also invokes the large language model for intelligent supplementation when the marker is absent and the parameter is of high importance, ensuring that no important parameters are missed. When a field-specific rule detects a potential risk of mislabeling, the large language model is invoked for semantic verification. For example, for a voltage level parameter of a substation, if it is followed by keywords such as "distribution device" or "switchgear," it may not be the target parameter and requires verification by the large language model. The fallback mechanism for when the large language model call fails includes: falling back to a rule-based judgment strategy and performing simple judgment using predefined rules; or directly marking it as requiring manual review to avoid automatic erroneous labeling and ensure system reliability.
[0048] Extended triggering conditions ensure the application of the large language model in critical scenarios, intelligent auto-negotiation reduces the omission of important parameters, and semantic verification improves tagging accuracy. A fallback mechanism guarantees continuous system operation when the large language model is unavailable, rule-based judgment strategies provide basic processing capabilities, and tagging to be manually reviewed ensures tagging quality. This design balances intelligence and reliability, fully utilizing the capabilities of the large language model while avoiding over-reliance on it.
[0049] For step S5: Based on the judgment results of the large language model, mark and correct errors, remove incorrect marks and retain correct marks.
[0050] Based on the judgment results of the large language model, the system removes erroneous tags and retains correct tags. For cases where tags are not present, the system can also call the large language model for intelligent tag replacement, but to control costs, this is usually only used when necessary. When the large language model API call fails or times out, the system records the call exception, reverts to the rule-based judgment strategy, or marks it as awaiting manual review. When the large language model output format does not meet expectations, the system attempts to parse the output content; if it cannot parse it, it records the exception and marks it as awaiting manual review.
[0051] In the embodiments of this application, a placeholder mechanism is used to protect the correctly marked areas, the existing XML tags are replaced with temporary placeholders, a placeholder mapping table is maintained to record the correspondence between placeholders and original XML tags, and after marking is completed, the placeholders are restored to the original tags according to the mapping table.
[0052] Specifically, the system uses a placeholder mechanism to protect correctly marked areas. Before performing a new marking operation, it first identifies all existing XML tags and replaces these marked areas with temporary placeholders. The placeholder format is a combination of PROTECTED and a sequence number, such as PROTECTED0, PROTECTED1, etc., with the sequence number starting from 0 and incrementing. The system maintains a placeholder mapping table, recording the original XML tag content corresponding to each placeholder and its position in the document. Then, marking operations are performed on the unmarked areas. After marking is complete, the system restores the placeholders to their original XML tag areas according to the placeholder mapping table. If a placeholder is found to be lost or corrupted during the restoration process, the system logs the exception and attempts to restore it from backup.
[0053] The placeholder mechanism effectively protects correctly marked areas, preventing duplicate marking or erroneous overwriting and ensuring the integrity of the marking results. The mapping table maintains the correspondence between placeholders and original marks, ensuring the accuracy of recovery. The sequence number increment mechanism guarantees the uniqueness of placeholders, avoiding conflicts. Anomaly handling and backup recovery mechanisms improve system reliability, maximizing the protection of existing marking results even if problems occur during processing.
[0054] In the embodiments of this application, it is supported to configure an exclusion keyword list for specific parameter types, and the marker at that position is skipped when the parameter value is immediately followed by an exclusion keyword. The semantic understanding capabilities of a large language model are combined to perform contextual semantic checks on the marker positions to ensure that the marker positions meet the semantic requirements of the parameters.
[0055] Specifically, the system supports configuring exclusion keyword lists for specific parameter types. By configuring these lists for specific parameter types, the system automatically skips the marking at a position when an exclusion keyword immediately follows the parameter value. For example, for the collector line voltage level parameter, the system's exclusion keyword list includes terms like "Section I," "Section II," "Switchgear," and "Distribution Equipment." When "35kV" is immediately followed by these keywords, the system does not mark the value, avoiding mismarking. Contextual semantic checks use a large language model to perform semantic analysis on the context surrounding the marked position, ensuring that the marked position meets the semantic requirements of the parameter. For example, for the "hub height" parameter, the system checks whether the context involves easily confused concepts such as "wind measurement height" or "wind measurement tower height," ensuring the accuracy of the marking.
[0056] The exclusion keyword list provides a lightweight mislabeling prevention mechanism, filtering out a large number of obvious mislabeling scenarios through simple keyword matching, reducing unnecessary computational resource consumption. Contextual semantic inspection leverages the deep understanding capabilities of large language models to identify complex semantic traps, significantly improving labeling accuracy. The combination of these two mechanisms ensures both processing efficiency and enhances the level of intelligence, achieving an organic integration of rules and intelligence.
[0057] For step S6: detect positional overlap between markers with different parameters and handle marker conflicts according to priority rules.
[0058] In the embodiments of this application, the marker conflict detection adopts an interval overlap judgment method. For the marker position range of two parameters, if the larger of the starting position of the first parameter and the starting position of the second parameter is less than or equal to the smaller of the ending position of the first parameter and the ending position of the second parameter, it is determined that there is an overlap. The priority rules include a priority preservation strategy, a longest match preservation strategy, and a semantic importance preservation strategy. The parameter with higher priority retains the marker, and the parameter with lower priority removes the marker of the overlapping part.
[0059] The system detects whether the positions of different parameters overlap in a document. For each parameter's marked position, the system calculates its character position range in the document, i.e., the start and end positions. Then, it compares the position ranges of different parameters to determine if overlap exists. The overlap detection algorithm uses an interval overlap judgment method. For the position ranges of two parameters, if the larger of the start positions of the first and second parameters is less than or equal to the smaller of the end positions of the first and second parameters, it is determined that overlap exists. For example, for the position ranges of two parameters `[start1, end1]` and `[start2, end2]`, if the condition `max(start1, start2) <= min(end1, end2)` is satisfied, then it is determined that overlap exists.
[0060] When overlap is detected, the system processes it according to predefined priority rules. Parameters with higher priority retain their tags, while parameters with lower priority remove the tags from the overlapping parts. Priority rules include priority retention strategies, longest match retention strategies, and semantic importance retention strategies.
[0061] The system implements a priority processing mechanism. For overlapping parameters, they are processed according to predefined priority rules. For example, when "Project Name," "Project Owner," and "Project Location" overlap, they are retained or removed according to the priority order of "Project Name > Project Owner > Project Location." Parameters with higher priority retain their markers, while parameters with lower priority have their overlapping markers removed.
[0062] Conflict resolution strategies: The system supports a variety of conflict resolution strategies, including priority preservation, longest match preservation, and semantic importance preservation.
[0063] Priority retention strategy: Retain the markers of parameters with higher priority according to the predefined parameter priority order, and remove the markers of parameters with lower priority.
[0064] Longest match retention strategy: Compare the tag lengths of overlapping parameters and retain the parameter with the longer tag length.
[0065] Semantic importance preservation strategy: Call the large language model to determine the semantic importance of overlapping parameters and retain the parameter labels with higher semantic importance.
[0066] The system automatically selects the most suitable conflict resolution strategy based on parameter type and conflict situation. If anomalies persist after conflict resolution, the system records the anomaly and marks it for manual review. The system records all conflict detection and processing results, including conflict parameter pairs, conflict locations, processing strategies, and processing results. This information provides data support for subsequent analysis and optimization.
[0067] The interval overlap detection method can accurately detect various overlap situations. Three priority rules provide flexible conflict resolution strategies: the priority preservation strategy is suitable for parameters with clear priority relationships, the longest match preservation strategy is suitable for scenarios with significant length differences, and the semantic importance preservation strategy is suitable for complex semantic judgments. The automatic selection mechanism enables the system to adopt the optimal strategy according to specific situations, ensuring the accuracy and rationality of conflict handling and avoiding the limitations of simple strategies.
[0068] For step S7: The parameter record for each tag includes sentence identifier, document location, context information, and source information of the tagging method, establishing a traceability chain from the extraction result to the document location.
[0069] In the embodiments of this application, the source information includes sentence identifier, document character position range, context information, tagging method, tagging status, and processing timestamp. It supports forward tracing to query document position by parameter value and reverse tracing to query parameter information by document position. Visualization is based on XML markup, allowing users to view detailed source information of parameters by clicking on tags.
[0070] Complete source information records provide comprehensive metadata for each tag, making the tagging results completely transparent and traceable. The two-way traceability mechanism offers flexible query methods, allowing users to query locations from parameters or vice versa, meeting the needs of different scenarios. Visual displays and click-to-view functions significantly enhance the user experience, making complex traceability information intuitive and easy to use. This design greatly improves the system's interpretability and user trust, facilitating manual review and result verification, and lowering the barrier to entry.
[0071] The following examples demonstrate how to accurately locate and mark parameters in a feasibility study report for a wind power project based on the method of this application.
[0072] The system receives a DOCX file of a feasibility study report for a wind power project. After document preprocessing, it obtains structured JSON content. For fields processed at the paragraph level (such as "project name"), the system adds paragraph-level identifiers to sentences within each paragraph. Paragraph 1: [1] The name of this project is Tangfeng X City Wind Farm Project. [2] The project is located in X City, X Province.
[0073] For fields processed at the chapter level (such as "dynamic investment in engineering projects"), the system adds a chapter-level identifier to each sentence: Chapter 3, paragraph 5: [3-5] The dynamic investment of the project is 500 million yuan.
[0074] The system retrieves information about the "Project Name" parameter from the parameter extraction results: Parameter value: "Tangfeng X City Wind Farm Project".
[0075] Sentence identifier: [1].
[0076] The system locates the corresponding sentence in the original document based on the sentence identifier [1]: "The name of this project is Tangfeng X City Wind Farm Project."
[0077] The system uses keyword matching to search for "Tangfeng X City Wind Farm Project" in the target sentence. After finding a match, it marks it with XML tags: The text after the tag reads: "The name of this project is 'Project Name' Tangfeng X City Wind Farm Project." The system detects that the tagging status is "One exists," indicating successful tagging.
[0078] For the "installed capacity" parameter, the extraction results are as follows: Parameter value: 100MW Sentence identifiers: [5, 8, 12] The system matched "100MW" in all three sentences, resulting in three tag instances after rule matching. The system detected that the tag status was "multiple instances exist" and invoked a large language model for intelligent judgment.
[0079] The system adds a number to each instance: [5] The installed capacity of this project is “Installed capacity_1” 100MW.
[0080] [8] Referring to the xxx15MW project, the installed capacity of this project is “Installed capacity_2”100MW.
[0081]
[12] According to calculation, the installed capacity of “installed capacity_3” 100MW meets the requirements.
[0082] The system inputs the numbered text into the large language model, which then makes a semantic judgment based on the context: Example 1: Correct (clearly mentions "installed capacity of this project") Example 2: Error (occurred in the project name "xxx15MW project" and should not be marked) Example 3: Correct (explicitly mentions "installed capacity") Based on the judgment results of the large language model, the system removes the tag for instance 2 and retains the tags for instance 1 and instance 3.
[0083] For the parameter "collector line voltage level", the extraction result is as follows: Parameter value: "35kV" Sentence markers: [10, 15] The system found "35kV" in both sentences
[10] and
[15] . The system checked the context:
[10] The voltage level of the collector line is 35kV.
[0084]
[15] The collector line adopts a voltage level of 35kV.
[0085] The system found that "35kV" in sentence
[10] was immediately followed by "power distribution equipment" (in the exclusion keyword list), so it skipped marking that position. "35kV" in sentence
[15] met the marking requirements, so the system marked it.
[0086] Suppose that the "Project Name" and "Project Location" overlap in the document: Project Name: "Tangfeng X City Wind Farm Project" (Location: Characters 100-110) Project Location: "City X" (Location: Characters 105-107) The system detected location overlap and, based on the priority rule (project name > project location), retained the "project name" tag and removed the tag for the overlapping part of the "project location" tag.
[0087] The system records complete source information for the parameters of each tag: Parameter name: "Project Name" Parameter value: "Tangfeng X City Wind Farm Project" Sentence identifier: "[1]" Document position: 50-65 characters Tagging method: "rule matching" XML tag location: Tagged as "'Project Name' Tangfeng X City Wind Farm Project" in the original document. Users can find the location of a parameter in a document by its parameter value, and they can also find the corresponding parameter information by its location in the document, thus achieving complete two-way traceability.
[0088] For the "installed capacity" parameter, the system detected a flag indicating "multiple exist," requiring the use of a large language model for determination. System construction input: The marked text reads: "The installed capacity of this project is 'Installed Capacity_1' 100MW. Referring to the xxx15MW project, the installed capacity of this project is 'Installed Capacity_2' 100MW." Parameter type: "Installed capacity" Parameter value: "100MW" Contextual information: "Previous sentence: Project overview. Next sentence: Project investment analysis." The system called the large language model API but encountered a network timeout exception. The system logged the exception information and reverted to a rule-based judgment strategy: check if instance 2 appears in the project name (judged by the keyword "project"). If so, remove the tag for instance 2. If the rule judgment also fails to determine the cause, the system marks it as awaiting manual review.
[0089] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the above embodiments do not limit the present invention in any way, and all technical solutions obtained by equivalent substitution or equivalent transformation fall within the protection scope of the present invention.
Claims
1. A large language model-based document parameter accurate positioning and intelligent marking method, characterized in that, Includes the following steps: Sentence identifiers are generated from the document content, and identifiers are added to each sentence to establish a mapping relationship between sentences and document locations; Based on the sentence identifier, the target sentence is located from the parameter extraction results, and contextual information is extracted; The target sentence is initially marked using a rule-matching method, and the marking status is detected. When the status indicates that multiple instances exist, the large language model is invoked to filter multiple instances based on contextual semantics, and a list of correct instance numbers is output. Based on the judgment results of the large language model, mark and correct errors, remove incorrect marks and retain correct marks; Detect positional overlap between markers with different parameters and handle marker conflicts according to priority rules; The parameter record for each tag includes sentence identifier, document location, context information, and source information of the tagging method, establishing a traceability chain from the extraction result to the document location; When the label state is non-existent and the parameter is of high importance, the large language model is invoked for intelligent labeling. When a field-specific rule detects a potential risk of mislabeling, it invokes the large language model for semantic verification. When the large language model fails to be invoked, it will fall back to a rule-based judgment strategy or be marked as awaiting manual review. The process of calling a large language model for multi-instance filtering includes: Add a number to each instance; Construct inputs that include tagged text, parameter types, parameter values, context information, and field-specific rules; The large language model outputs the judgment results in JSON format, including a list of correct instance numbers and the reason for the judgment.
2. The document parameter precise location and intelligent tagging method based on a large language model according to claim 1, characterized in that, The sentence identifier generation includes paragraph-level identifier generation and chapter-level identifier generation. The paragraph-level identifier format is sentence number, and the chapter-level identifier format is a combination of paragraph number and sentence number. The system maintains the mapping relationship between identifiers and document content and supports automatic conversion between paragraph-level identifiers and chapter-level identifiers.
3. The document parameter precise location and intelligent tagging method based on a large language model according to claim 1, characterized in that, The sentence identification-based target sentence location method includes: extracting sentence identification information from the parameter extraction results, locating the corresponding sentence in the original document according to the paragraph number and sentence number in the identification; verifying the accuracy of the location results, relocating the sentence by fuzzy matching through parameter values when the identification is invalid, and marking the sentence as awaiting manual review when the location fails.
4. The document parameter precise location and intelligent tagging method based on a large language model according to claim 1, characterized in that, The rule matching initial marking uses keyword matching or regular expressions to search for parameter values in the target sentence and uses XML tags to mark them; the marking status includes three cases: not present, present one, and present multiple.
5. The document parameter precise location and intelligent tagging method based on a large language model according to claim 1, characterized in that, A placeholder mechanism is used to protect correctly marked areas. Existing XML tags are replaced with temporary placeholders. A placeholder mapping table is maintained to record the correspondence between placeholders and original XML tags. After marking is completed, the placeholders are restored to the original tags according to the mapping table.
6. The document parameter precise location and intelligent tagging method based on a large language model according to claim 1, characterized in that, It supports configuring an exclusion keyword list for specific parameter types, and skips the marker at that position when the parameter value is immediately followed by an exclusion keyword; By combining the semantic understanding capabilities of large language models, contextual semantic checks are performed on the marked positions to ensure that the marked positions meet the semantic requirements of the parameters.
7. The document parameter precise location and intelligent tagging method based on a large language model according to claim 1, characterized in that, The marker conflict detection adopts the interval overlap judgment method. For the marker position range of two parameters, when the larger value between the starting position of the first parameter and the starting position of the second parameter is less than or equal to the smaller value between the ending position of the first parameter and the ending position of the second parameter, it is determined that there is an overlap. The priority rules include priority preservation strategy, longest matching preservation strategy, and semantic importance preservation strategy. The parameter with higher priority retains the marker, and the parameter with lower priority removes the marker of the overlapping part.
8. The document parameter precise location and intelligent tagging method based on a large language model according to claim 1, characterized in that, The source information includes sentence identifier, document character position range, context information, marking method, marking status, and processing timestamp; it supports forward tracing to query document position by parameter value and reverse tracing to query parameter information by document position; it is visualized based on XML tags, and users can view detailed source information of parameters by clicking on tags.