A power transaction named entity recognition method based on term enhancement

CN122414182BActive Publication Date: 2026-10-16INNER MONGOLIA ELECTRIC POWER TRADING CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610825700.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-09
Publication Date
2026-10-16
Estimated Expiration
2046-06-09

AI Technical Summary

Technical Problem

然而,该类方法在电力交易领域应用中存在以下局限:通用预训练模型采用单字掩码策略,易割裂复合术语的整体语义,导致术语边界识别错误;序列标注模型受限于其解码机制,无法有效处理多层级嵌套实体;传统模型对跨句子、跨段落的长距离语义依赖捕捉能力不足;且现有模型缺乏针对电力交易领域的术语适配机制,直接应用时专业语义感知薄弱、领域适配性差

Benefits of technology

通过构建三级电力交易术语库并采用“术语优先掩码”策略对RoBERTa模型进行差异化微调,解决了复杂术语与原子术语的语义割裂问题,显著提升了术语边界识别精度与领域适配性;利用BiLSTM网络双向捕捉长距离语义依赖,并结合Global Pointer模型的多类型上三角矩阵并行解码,在统一框架下同时实现了核心实体与嵌套实体的高效识别,克服了嵌套结构丢失与长距离依赖捕捉不足的缺陷;通过后处理中的业务合理性验证机制,自动过滤不符合交易规则的错误实体,确保了输出结果的业务可信性。本发明有效克服了现有技术中术语识别精度低、嵌套处理弱、长距离依赖捕捉不足及领域适配性差的技术问题,可直接应用于电力交易知识图谱构建与合规监管分析。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122414182B_ABST
    Figure CN122414182B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on terminology enhancement electric power transaction named entity recognition method, belong to the field of data subject identification, including: first, unstructured text is preprocessed;Then build three-level electric power transaction terminology library, adopt terminology priority mask strategy fine-tune RoBERTa model, obtain terminology enhanced semantic coding sequence;Then the coding sequence is input into BiLSTM network to capture bidirectional long-distance semantic dependence, and output enhanced coding sequence;Again, the core entity and nested entity are uniformly identified by using Global Pointer model through multi-type upper triangular matrix;Finally, the structured result is output after post-processing.The application effectively improves the electric power transaction field terminology recognition precision and nested entity processing capacity, and can be applied to electric power transaction knowledge graph construction and compliance supervision analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data subject identification, and in particular relates to a method for identifying named entities in power transactions based on term enhancement. Background Technology

[0002] Currently, the power trading field contains a large amount of unstructured text data, including trading rule documents, medium- and long-term trading contracts, spot trading settlement reports, and regulatory audit documents. These texts contain rich core domain knowledge but exhibit significant domain characteristics: dense technical terms, frequent entity nesting, and prominent long-distance semantic dependencies (such as cross-sentence associations between trading entities and trading parameters). Existing named entity recognition technologies mainly use general pre-trained models (such as BERT and RoBERTa) combined with sequence labeling models (such as BiLSTM-CRF) for processing. However, this approach has the following limitations in the power trading field: general pre-trained models use single-word masking strategies, which easily fragment the overall semantics of complex terms, leading to errors in term boundary recognition; sequence labeling models are limited by their decoding mechanisms and cannot effectively handle multi-level nested entities; traditional models lack the ability to capture long-distance semantic dependencies across sentences and paragraphs; and existing models lack terminology adaptation mechanisms specific to the power trading field, resulting in weak professional semantic awareness and poor domain adaptability when directly applied.

[0003] To address the aforementioned shortcomings, existing improvement solutions primarily focus on enhancing general dictionaries or adjusting annotation strategies, but they still fail to resolve the following technical issues: First, there is a lack of a hierarchical terminology library covering the entire power trading process. General pre-trained models do not differentiate between complex and atomic terms during fine-tuning, making it difficult to simultaneously improve terminology boundary recognition accuracy and model domain adaptability. Second, existing model architectures cannot simultaneously handle parallel recognition of nested entities and long-distance bidirectional semantic dependency capture within a unified framework. Traditional serial processing methods result in low computational efficiency and a tendency to lose nested relationships. Third, the post-processing stage lacks a rationality verification mechanism based on power trading business logic, failing to automatically filter out erroneous entities that contradict trading rules, thus affecting the practical reliability of the structured output results. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention provides a term-enhanced method for naming entity recognition in power transactions, comprising: Preprocess unstructured text in the power trading field to obtain preprocessed text; Based on the constructed three-level power trading terminology database, a term-priority masking strategy is used to fine-tune the pre-trained model, and the pre-processed text is input into the fine-tuned pre-trained model for semantic feature encoding to obtain a term-enhanced semantic encoding sequence. The term-enhanced semantic coding sequence is input into a bidirectional long short-term memory network for long-distance semantic dependency capture to obtain the enhanced coding sequence. Based on the enhanced coding sequence, entity recognition is performed using the Global Pointer model. Core entities and nested entities are uniformly identified through multiple types of upper triangular matrices to obtain entity candidate results. The entity candidate results are post-processed to obtain the structured entity recognition results.

[0005] Optionally, the preprocessing includes: Noise removal is performed on the unstructured text to obtain cleaned text; The cleaned text is standardized to obtain standard format text; Based on the standardized terminology database for the power trading field, synonym mapping is performed on the business terms in the standard format text to obtain the standardized terminology text. The units of physical quantities in the terminology standardization text are uniformly converted, and the numerical expression format is standardized to obtain the standardized text of units and values. The unit and numerical standardized text is segmented according to the electricity trading terminology dictionary, and the integrity of the compound terms is forcibly preserved to obtain the preprocessed text.

[0006] Optionally, the step of obtaining the term-enhanced semantic encoding further includes: A three-level power trading terminology database, including atomic terms, compound terms, and complex terms, is constructed to cover the entire power trading process, and hierarchical labels are added to each type of term. Load the pre-trained RoBERTa-wwm-ext model and freeze the parameters of its underlying Transformer layers, then configure the fine-tuning parameters. The AC automaton algorithm is used to match the three-level terms in the preprocessed text, and mask objects are randomly selected according to a set ratio. The mask priority is complex terms higher than compound terms, compound terms higher than atomic terms, and atomic terms higher than ordinary words. Different masking methods are used for different priorities to fine-tune the pre-trained model. The preprocessed text is input into the fine-tuned RoBERTa-wwm-ext model, and encoded sequentially through its Transformer layer and term semantic fusion layer to obtain the term-enhanced semantic encoding sequence.

[0007] Optionally, the use of different masking methods for different priorities includes: using a whole mask for complex and compound terms, using a full-word mask for atomic terms, and using a random single-character mask for ordinary words.

[0008] Optionally, the step of inputting the term-enhanced semantic encoding sequence into a bidirectional long short-term memory network for long-distance semantic dependency capture and obtaining the enhanced encoding sequence further includes: Configure the parameters of the bidirectional long short-term memory network, including the input dimension, hidden layer dimension, and dropout rate; By traversing the semantic encoding sequence from left to right using a forward long short-term memory network, positive semantic dependencies are captured, and forward hidden states are obtained. By traversing the semantic encoding sequence from right to left using a backward long short-term memory network, reverse semantic dependencies are captured, and backward hidden states are obtained. The forward hidden state and the backward hidden state are concatenated to generate the enhanced coding sequence.

[0009] Optionally, the step of using the Global Pointer model for entity recognition further includes: Define multiple types of core entities for power trading and build a corresponding Global Pointer header for each type of entity; For each type of entity, based on the enhanced coding sequence, calculate the entity confidence score for all entities in the text that satisfy the token span where the start position is no greater than the end position; Set an entity determination threshold and filter out token spans with confidence scores greater than or equal to the threshold as candidate entities; By performing parallel computation with multiple Global Pointer heads, nesting relationships between entities are identified, and candidate entity results containing entity location, type, and score are obtained.

[0010] Optionally, the entity confidence score is calculated using the following formula: ; Where k is the entity category, and Tr(⋅) is the matrix trace operation. Let k be the query vector for the k-th type of entity. and These are the encodings of the i-th and j-th tokens in the enhanced encoding sequence, respectively. Elements in the relative position encoding matrix, This represents the confidence score of the token span from position i to j belonging to the k-th type of entity.

[0011] Optionally, the post-processing includes: In the case where the same token span is identified as multiple entity types in the entity candidate results, the entity type with the highest confidence score is retained to achieve entity deduplication; Based on the hierarchical tags of the three-level terminology database, parent-child hierarchical relationships are labeled for the identified nested entities; Check the consistency between entity types and power trading business logic, and filter out erroneous entities that do not conform to business rules; The processed entity information and its nesting relationships are generated as structured data in JSON format, which serves as the structured entity recognition result.

[0012] On the other hand, the present invention also provides an electronic device including a memory, a processor, and a computing program stored in the memory and executable on the processor, wherein the processor implements the method when executing the computing program.

[0013] On the other hand, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method.

[0014] Compared with the prior art, the present invention has the following advantages and technical effects: By constructing a three-level power trading terminology database and employing a "term priority masking" strategy to fine-tune the RoBERTa model, the semantic separation between complex and atomic terms is resolved, significantly improving the accuracy of term boundary recognition and domain adaptability. By utilizing a BiLSTM network to bidirectionally capture long-distance semantic dependencies and combining it with parallel decoding of multiple types of upper triangular matrices from the Global Pointer model, efficient identification of core and nested entities is achieved simultaneously within a unified framework, overcoming the shortcomings of lost nested structures and insufficient long-distance dependency capture. Through a business rationality verification mechanism in post-processing, erroneous entities that do not conform to trading rules are automatically filtered, ensuring the business credibility of the output results. This invention effectively overcomes the technical problems of low terminology recognition accuracy, weak nesting processing, insufficient long-distance dependency capture, and poor domain adaptability in existing technologies, and can be directly applied to the construction of power trading knowledge graphs and compliance regulatory analysis. Attached Figure Description

[0015] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a schematic diagram of the LSTM model according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the BiLSTM model according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the Ft-RoBGP model according to an embodiment of the present invention. Detailed Implementation

[0016] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0017] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0018] Example 1 This embodiment provides a term-enhanced method for naming entity recognition in power transactions, including: First, unstructured text in the field of electricity trading is preprocessed.

[0019] The preprocessing process includes the following operations: (1) Noise Removal: Use regular expression matching to delete garbled characters (such as " " Repeated paragraphs and redundant information (such as page numbers "Pages 3-5" and headers "Document from a Power Trading Center").

[0020] (2) Format standardization: unify the text converted from Word documents and PDFs into plain text format, removing... 、 HTML tags and tabs should be used to merge three or more consecutive spaces into a single space, and "\n" should be used as the paragraph separator.

[0021] (3) Terminology standardization: Based on the pre-built standard terminology library in the field of power trading, the term "monthly competitive bidding transaction" in the text is uniformly mapped to "monthly centralized competitive bidding transaction", "power purchase and sale contract" is uniformly mapped to "power sales transaction unit contract", and "deviation power settlement" is uniformly mapped to "deviation power settlement rules".

[0022] (4) Unit and numerical standardization: Convert "500 megawatt-hours" and "0.3000 kilowatt-hours" in the text to "500000 kilowatt-hours" and "3000 kilowatt-hours", and standardize the numerical values ​​to two decimal places.

[0023] (5) Word segmentation optimization: Load the three-level power trading term dictionary into the Jieba word segmentation tool, and force the preservation of the integrity of compound terms such as "node marginal electricity price", "three-part settlement" and "cross-regional and cross-provincial transaction electricity", avoiding splitting into single characters or irrelevant phrases, and finally obtain the preprocessed text.

[0024] Secondly, based on the constructed three-level power trading terminology database, the RoBERTa-wwm-ext pre-trained model is fine-tuned using a "term priority masking" strategy, and semantic feature encoding is performed on the pre-processed text.

[0025] Specifically, a three-tiered power trading terminology database is constructed: This database covers the entire power trading process, including transaction organization, contract signing, performance settlement, and regulatory auditing. It includes 50 atomic terms (such as "traded electricity volume," "power generation enterprise," "trading cycle," and "spot trading"), 200 composite terms (such as "monthly centralized bidding price," "inter-regional and inter-provincial traded electricity volume," and "pumped storage ancillary services"), and 150 complex terms (such as "2024 bilateral negotiated inter-regional and inter-provincial traded electricity volume" and "monthly centralized bidding spot market declared price"). Each terminology is labeled with a hierarchical tag: T1, T2, and T3.

[0026] Model initialization and parameter configuration: Load the pre-trained RoBERTa-wwm-ext model (RoBERTat in the original text is a typo, it should be RoBERTa-wwm-ext), freeze the parameters of its bottom 6 Transformer layers, and train only the top 6 layers and pooling layers; fine-tune the optimizer using AdamW, set the learning rate to 5e-5, the batch size to 16, the number of training epochs to 4, the weight decay to 0.01, and use the masked language model loss as the loss function.

[0027] Term-priority masking strategy implementation: The AC automaton algorithm is used to match terms in the preprocessed text, and the output of each term is a quadruple of [start position, end position, level label, term content]. Masking objects are randomly selected at a ratio of 15%. Complex terms (such as "2024 annual bilateral negotiation inter-regional and inter-provincial electricity trading") are masked as a whole (replaced with [MASK]), compound terms (such as "inter-regional and inter-provincial electricity trading") are masked as a whole, atomic terms (such as "trading electricity") are masked as whole words (replaced with [MASK][MASK]), and ordinary words (such as "organization") are masked as single characters (replaced with "group [MASK]").

[0028] Semantic encoding generation: The masked text is input into the fine-tuned RoBERTa-wwm-ext model. First, the Transformer layer of the model performs contextual semantic encoding to capture the association between the basic semantics of the text and domain terms. Then, a terminology semantic fusion layer is used to enhance the professional features. This layer uses a linear transformation formula. (in This is the weight matrix. (This outputs semantic vectors for the Transformer), ultimately producing a term-enhanced semantic encoding sequence. , where L is the length of the text sequence and 768 is the vector dimension.

[0029] Then, the above semantic encoding sequence is input into the BiLSTM network to capture the bidirectional long-distance semantic dependencies in the power trading text.

[0030] BiLSTM parameter configuration: input dimension is set to 768 (consistent with the output dimension of the RoBERTa-wwm-ext model), hidden layer dimension is set to 1024 (1024 dimensions each for forward LSTM and backward LSTM), dropout rate is set to 0.5, and a single-layer bidirectional LSTM structure is adopted.

[0031] Bidirectional encoding computation: Taking the sentence "In the monthly centralized bidding organized by the Beijing Power Exchange Center in November 2024, a photovoltaic company submitted an electricity application of 300 million kWh" from the preprocessed text as an example, the forward LSTM traverses the semantic encoding sequence from left to right to capture the positive semantic dependency of "Beijing Power Exchange Center → November 2024 → Monthly centralized bidding → A photovoltaic company → Submitted electricity application → 300 million kWh"; the backward LSTM traverses the sequence from right to left to capture the negative semantic dependency; the forward hidden state is then... With backward hidden state Concatenate the sequences to generate an enhanced coded sequence. .

[0032] Next, the Global Pointer model is used to identify entities in the enhanced coded sequence, and core entities and nested entities are identified uniformly through multiple types of upper triangular matrices.

[0033] Entity type configuration: Define 9 core entities for power trading, including trading entities (power generation companies, users, trading institutions), trading parameters (trading volume, trading price, trading period), and trading products (medium- and long-term trading, spot trading, and ancillary service trading), and build a corresponding Global Pointer header for each type of entity.

[0034] Model parameter initialization: query vector for each Global Pointer header Construct a relative position encoding matrix ,satisfy To capture the relative positional relationships between tokens.

[0035] Entity Span Score Calculation: For each entity class, calculate all entities that satisfy the following criteria. The entity confidence score of the Token Span is calculated using the following formula: ; in, For entity categories, For matrix trace operations, The encoding of the i-th token output by BiLSTM. Indicates position The confidence level of Span belonging to the k-th type of entity.

[0036] Entity identification and nested entity recognition: An entity identification threshold of 0.8 is set, retaining only Spans with a confidence score of at least 0.8 as candidate entities. For example, "Beijing Power Exchange Center" (positions 0-6) scores 0.95 as a "trading institution" entity, "declared electricity volume" (positions 27-30) scores 0.91 as a "trading parameter" entity, and "300 million kWh" (positions 32-36) scores 0.96 as a "trading parameter value" entity. Nested entity relationships are identified through parallel computation using multiple Global Pointer headers. For example, "2024 Bilateral Negotiated Inter-regional and Inter-provincial Electricity Transaction Volume" (T3 level, score 0.92) nests "Inter-regional and Inter-provincial Electricity Transaction Volume" (T2 level, score 0.90) and "Transaction Volume" (T1 level, score 0.88), outputting a candidate entity list containing [start position, end position, entity type, score].

[0037] Finally, the candidate entity results are post-processed to output the structured entity recognition results.

[0038] Post-processing includes the following steps: (1) Entity deduplication: When the same Token Span is recognized by multiple Global Pointer headers, the entity type with the highest confidence score is retained. For example, if the "Transaction Electricity" Span in the text is recognized by both the "Transaction Parameters" header and the "Atomic Terminology" header, the "Transaction Parameters" type with the higher score is retained.

[0039] (2) Nested hierarchical labeling: Based on the hierarchical labels of the three-level terminology library, the hierarchical relationship of nested entities is labeled to clarify the correspondence between "parent entity and child entity". For example, label "parent entity: 2024 bilateral negotiation cross-regional and cross-provincial transaction volume (T3) → child entity: cross-regional and cross-provincial transaction volume (T2)" and "parent entity: cross-regional and cross-provincial transaction volume (T2) → child entity: transaction volume (T1)".

[0040] (3) Business rationality verification: Check the consistency between entity type and power trading business logic. For example, verify whether the "300 million kWh" unit corresponding to the "trading electricity" entity is compliant, confirm that the "trading institution" entity "Beijing Power Exchange Center" conforms to the business definition, and filter out erroneous entities that do not conform to the business logic.

[0041] (4) Structured output: Generates a JSON-formatted structured result containing the original text, entity details (location, type, level, score) and nesting relationships.

[0042] This completes the entire process of transforming raw unstructured text into structured entity recognition results in this embodiment.

[0043] Example 2 This embodiment provides a term-enhanced method for naming entity recognition in power transactions, including: First, the input unstructured text is preprocessed. Specifically, the "2024 Electricity Medium and Long-Term Trading Work Plan" issued by the National Energy Administration and the "Inter-provincial and Inter-regional Electricity Spot Trading Settlement Rules" issued by a provincial electricity trading center are selected as input texts. Training set, validation set and test set are constructed in a 4:1:1 ratio, and the length of each text is controlled between 50 and 500 characters.

[0044] During preprocessing, regular expressions are used to match and remove garbled characters (such as "") from the text. Noise removal is achieved by removing "□", repeated paragraphs, and redundant information (such as page numbers "Pages 3-5" and headers "Document from a Power Trading Center").

[0045] Next, standardize the format: unify the text from Word documents and PDF conversions into plain text format, removing... 、 HTML tags and tabs should be used to merge three or more consecutive spaces into a single space, and "\n" should be used as the paragraph separator.

[0046] Then, terminology standardization is carried out: based on the pre-built three-level power trading terminology library, "monthly competitive bidding transaction" in the text is uniformly mapped to "monthly centralized competitive bidding transaction", "power purchase and sale contract" is uniformly mapped to "power sales transaction unit contract", and "deviation power settlement" is uniformly mapped to "deviation power settlement rules".

[0047] Subsequently, the units and values ​​were standardized: "500 megawatt-hours" and "0.3000 kilowatt-hours" in the text were uniformly converted to "500,000 kilowatt-hours" and "3,000 kilowatt-hours", and the values ​​were standardized to retain two decimal places.

[0048] Finally, word segmentation optimization is performed: the three-level electricity trading terminology dictionary is loaded into the Jieba word segmentation tool, and the integrity of compound terms such as "node marginal electricity price", "three-part settlement" and "cross-regional and cross-provincial electricity trading volume" is forcibly preserved to avoid splitting them into single characters or irrelevant phrases, thus obtaining preprocessed text.

[0049] After data preprocessing is completed, terminology-enhanced semantic encoding is performed.

[0050] First, a three-level power trading terminology database is constructed: This database includes 50 atomic terms (such as "traded electricity volume", "power generation enterprise", "trading cycle", "spot trading"), 200 composite terms (such as "monthly centralized bidding price", "inter-regional and inter-provincial traded electricity volume", "pumped storage ancillary services"), and 150 complex terms (such as "2024 annual bilateral negotiated inter-regional and inter-provincial traded electricity volume", "monthly centralized bidding spot market declared price"), and is labeled with hierarchical tags T1, T2, and T3 respectively.

[0051] Next, model initialization and parameter configuration are performed: the pre-trained RoBERTa-wwm-ext model is loaded (RoBERTa is a generic term in the original text, and is uniformly referred to as RoBERTa-wwm-ext here), its bottom 6 layer parameters are frozen, and the fine-tuning parameters are set as follows: AdamW optimizer, learning rate 5e-5, batch size 16, training epochs 4, weight decay 0.01, and the loss function is the masked language model loss.

[0052] Next, term priority masking is performed: the AC automaton algorithm is used to match terms in the preprocessed text, and the [start position, end position, level label, term content] quadruple is output for each term; masking objects are randomly selected at a ratio of 15%, and the complex term "2024 annual bilateral negotiation inter-regional and inter-provincial electricity trading volume" (T3) is masked as a whole (replaced with [MASK]), the compound term "inter-regional and inter-provincial electricity trading volume" (T2) is masked as a whole, the atomic term "trading volume" (T1) is masked as a whole word (replaced with [MASK][MASK]), and the common word "organization" is masked as a single character (replaced with "group [MASK]").

[0053] Finally, semantic encoding is generated: the masked text is input into the fine-tuned RoBERTa-wwm-ext model, encoded by the Transformer layer and enhanced by the term semantic fusion layer, and outputs a 768-dimensional term-enhanced semantic encoding sequence.

[0054] After obtaining the term-enhanced semantic encoding sequence, long-distance semantic dependency capture is performed.

[0055] Specifically, configure the BiLSTM parameters as follows: set the input dimension to 768, the hidden layer dimension to 1024, and the dropout rate to 0.5 to construct a single-layer bidirectional LSTM network.

[0056] Taking the text "In the monthly centralized bidding organized by Beijing Power Exchange Center in November 2024, a photovoltaic company submitted an electricity application of 300 million kWh" as an example, the forward LSTM traverses the semantic coding sequence from left to right to capture the positive semantic dependency of "Beijing Power Exchange Center → November 2024 → monthly centralized bidding → a photovoltaic company → submitted electricity application → 300 million kWh"; the backward LSTM traverses the sequence from right to left to capture the negative semantic dependency; the forward hidden state and the backward hidden state are concatenated to output a 2048-dimensional enhanced coding sequence.

[0057] Next, the Global Pointer model is used to perform entity recognition on the enhanced coded sequence.

[0058] First, configure the Global Pointer parameters: construct 9 Global Pointer headers for 9 core entity types, set the query vector dimension to 2048, and use the relative position encoding matrix. (Adapts to a maximum sequence length of 256).

[0059] Then, calculate the entity Span score: calculate the confidence score for all TokenSpans in the text where the starting position i is not greater than the ending position j. For example, "Beijing Power Exchange Center" (positions 0-6) scores 0.95 as an entity of the "trading institution" category, "declared electricity volume" (positions 27-30) scores 0.91 as an entity of the "trading parameters" category, and "300 million kWh" (positions 32-36) scores 0.96 as an entity of the "trading parameter value" category.

[0060] Finally, entity identification and nesting recognition were performed: a threshold of 0.8 was set to filter out all candidate entities with a confidence score of not less than 0.8. The complex term "2024 Bilateral Negotiation Inter-regional and Inter-provincial Electricity Transaction Volume" (T3, score 0.92) was identified, nested with the compound term "Inter-regional and Inter-provincial Electricity Transaction Volume" (T2, score 0.90) and the atomic term "Transaction Volume" (T1, score 0.88), forming a nested relationship.

[0061] After obtaining the candidate entity results, post-processing is performed.

[0062] First, entity deduplication is performed: the "transaction electricity" span in the text is simultaneously recognized by the "transaction parameter" header and the "atomic term" header, and the "transaction parameter" type with the higher score is retained.

[0063] Then, nested hierarchical annotations are performed: annotate the hierarchical relationship of "parent entity: 2024 bilateral negotiated inter-regional and inter-provincial transaction volume (T3) → child entity: inter-regional and inter-provincial transaction volume (T2)" and "parent entity: inter-regional and inter-provincial transaction volume (T2) → child entity: transaction volume (T1)".

[0064] Next, business rationality verification was performed: the "300 million kWh" unit corresponding to the "trading electricity" entity was checked for compliance, and the "trading institution" entity "Beijing Power Exchange Center" was confirmed to be in accordance with the business definition. No erroneous entities were found.

[0065] Finally, the structured results are output in JSON format, completing the entire process of this embodiment.

[0066] On the other hand, this embodiment also provides an electronic device, including a memory, a processor, and a computing program stored in the memory and executable on the processor, wherein the processor implements the method when executing the computing program.

[0067] On the other hand, this embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method.

[0068] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for naming entity recognition in power transactions based on term enhancement, characterized in that, include: Preprocess unstructured text in the power trading field to obtain preprocessed text; Based on the constructed three-level power trading terminology database, a term-priority masking strategy is used to fine-tune the pre-trained model, and the pre-processed text is input into the fine-tuned pre-trained model for semantic feature encoding to obtain a term-enhanced semantic encoding sequence. The term-enhanced semantic coding sequence is input into a bidirectional long short-term memory network for long-distance semantic dependency capture to obtain the enhanced coding sequence. Based on the enhanced coding sequence, entity recognition is performed using the Global Pointer model. Core entities and nested entities are uniformly identified through multiple types of upper triangular matrices to obtain entity candidate results. The entity candidate results are post-processed to obtain the structured entity recognition results; The step of obtaining the term-enhanced semantic encoding further includes: A three-level power trading terminology database, including atomic terms, compound terms, and complex terms, is constructed to cover the entire power trading process, and hierarchical labels are added to each type of term. Load the pre-trained RoBERTa-wwm-ext model and freeze the parameters of its underlying Transformer layers, then configure the fine-tuning parameters. The AC automaton algorithm is used to match the three-level terms in the preprocessed text, and mask objects are randomly selected according to a set ratio. The mask priority is complex terms higher than compound terms, compound terms higher than atomic terms, and atomic terms higher than ordinary words. Different masking methods are used for different priorities to fine-tune the pre-trained model. The preprocessed text is input into the fine-tuned RoBERTa-wwm-ext model, and encoded sequentially through its Transformer layer and term semantic fusion layer to obtain the term-enhanced semantic encoding sequence. The step of using the Global Pointer model for entity recognition further includes: Define multiple types of core entities for power trading and build a corresponding Global Pointer header for each type of entity; For each type of entity, based on the enhanced coding sequence, calculate the entity confidence score for all entities in the text that satisfy the token span where the start position is no greater than the end position; Set an entity determination threshold and filter out token spans with confidence scores greater than or equal to the threshold as candidate entities; By performing parallel computation with multiple Global Pointer heads, nesting relationships between entities are identified, and candidate entity results containing entity location, type, and score are obtained.

2. The method according to claim 1, characterized in that, The preprocessing includes: Noise removal is performed on the unstructured text to obtain cleaned text; The cleaned text is standardized to obtain standard format text; Based on the standardized terminology database for the power trading field, synonym mapping is performed on the business terms in the standard format text to obtain the standardized terminology text. The units of physical quantities in the terminology standardization text are uniformly converted, and the numerical expression format is standardized to obtain the standardized text of units and values. The unit and numerical standardized text is segmented according to the electricity trading terminology dictionary, and the integrity of the compound terms is forcibly preserved to obtain the preprocessed text.

3. The method according to claim 1, characterized in that, The different masking methods for different priorities include: using a whole mask for complex and compound terms, using a full-word mask for atomic terms, and using a random single-character mask for ordinary words.

4. The method according to claim 1, characterized in that, The step of inputting the term-enhanced semantic coding sequence into a bidirectional long short-term memory network for long-distance semantic dependency capture, and obtaining the enhanced coding sequence, further includes: Configure the parameters of the bidirectional long short-term memory network, including the input dimension, hidden layer dimension, and dropout rate; By traversing the semantic encoding sequence from left to right using a forward long short-term memory network, positive semantic dependencies are captured, and forward hidden states are obtained. By traversing the semantic encoding sequence from right to left using a backward long short-term memory network, reverse semantic dependencies are captured, and backward hidden states are obtained. The forward hidden state and the backward hidden state are concatenated to generate the enhanced coding sequence.

5. The method according to claim 1, characterized in that, The entity confidence score is calculated using the following formula: ; Where k is the entity category, and Tr(⋅) is the matrix trace operation. Let k be the query vector for the k-th type of entity. and These are the encodings of the i-th and j-th tokens in the enhanced encoding sequence, respectively. Elements in the relative position encoding matrix, This represents the confidence score of the token span from position i to j belonging to the k-th type of entity.

6. The method according to claim 1, characterized in that, The post-processing includes: In the case where the same token span is identified as multiple entity types in the entity candidate results, the entity type with the highest confidence score is retained to achieve entity deduplication; Based on the hierarchical tags of the three-level terminology database, parent-child hierarchical relationships are labeled for the identified nested entities; Check the consistency between entity types and power trading business logic, and filter out erroneous entities that do not conform to business rules; The processed entity information and its nesting relationships are generated as structured data in JSON format, which serves as the structured entity recognition result.

7. An electronic device comprising a memory, a processor, and a computing program stored in the memory and executable on the processor, characterized in that, When the processor executes the computing program, it implements the method of any one of claims 1-6.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Power dispatching information language-to-text error correction method and system based on bert model

    CN121072474A

  • Dynamic knowledge enhanced multi-granularity Chinese medical named entity identification method and system

    CN121724015A