Nuclear power entity classification method and device, electronic equipment and storage medium

By introducing knowledge retrieval and multi-level text processing into the nuclear power entity classification method, combined with the pre-trained entity classification model, the problem of poor classification effect of nuclear power entity in the existing technology is solved, and more accurate entity recognition and classification is achieved.

CN120067326AActive Publication Date: 2025-05-30CHINA NUCLEAR POWER ENGINEERING COMPANY LTD +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510041877.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-05-30
Estimated Expiration
2045-01-10

AI Technical Summary

Technical Problem

The prior art has poor effect in the classification of nuclear power entities, and has failed to effectively consider the impact of special terms in the nuclear power field on the identification performance of entity classification models.

Method used

A nuclear power entity classification method is proposed. By obtaining the target nuclear power text and searching knowledge from the preset nuclear power knowledge base, entity edge detection and classification are carried out in combination with the pre-trained entity classification model, including text encoding layer, feature fusion layer, entity edge detection layer and entity classification layer.

Benefits of technology

The effect of classification of nuclear power entities is improved, and entities in the nuclear power field can be more accurately identified and classified, solving the problem of poor identification performance in the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067326A_ABST
    Figure CN120067326A_ABST
Patent Text Reader

Abstract

The invention relates to the field of nuclear power entity detection, in particular to a nuclear power entity classification method and device, electronic equipment and a storage medium. According to the nuclear power entity classification method provided by the embodiment of the invention, first coding is performed on a target nuclear power text and a retrieval nuclear power knowledge text to obtain a first nuclear power text feature and a first retrieval knowledge text feature; performing second coding on the target nuclear power text and the retrieval nuclear power knowledge text to obtain a second nuclear power text feature and a second retrieval knowledge text feature; fusing the first nuclear power text feature, the second nuclear power text feature, the first retrieval knowledge text feature and the second retrieval knowledge text feature to obtain a fused nuclear power text feature; performing entity edge detection on the fused nuclear power text features to obtain nuclear power entity edge features; and performing entity classification on the fused nuclear power text features according to the nuclear power entity edge features to obtain a target nuclear power entity category. Therefore, the nuclear power entity classification effect can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of nuclear power entity detection, and in particular to a nuclear power entity classification method and its device, electronic equipment, and storage medium. Background Art

[0002] Nuclear power entity classification is crucial for efficient management of nuclear power-related documentation at nuclear power plants. However, with the increasing number of different types of nuclear power-related documentation (such as nuclear reaction types, nuclear facilities and equipment, and safety measures in engineering projects), it is becoming increasingly difficult for nuclear power plant-related institutions, units, and individuals to organize and retrieve information. This can lead to the situation where nuclear power plant documentation becomes difficult to find or even lost.

[0003] Currently, entity classification typically uses deep learning models (such as Lattice Long Short-Term Memory (Lattice LSTM)) to identify entity categories in text. However, this approach fails to consider the impact of nuclear power-specific terminology in nuclear power-related text on the entity classification model's recognition performance, resulting in poor nuclear power entity classification results. Therefore, improving nuclear power entity classification performance remains a pressing challenge in the industry. Summary of the Invention

[0004] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a nuclear power entity classification method and its device, electronic equipment, and storage medium, which can improve the effect of nuclear power entity classification.

[0005] A nuclear power entity classification method according to an embodiment of the first aspect of the present application includes:

[0006] Acquire a target nuclear power text, and perform knowledge retrieval on the target nuclear power text from a preset nuclear power knowledge base to obtain a retrieved nuclear power knowledge text;

[0007] Obtaining a pre-trained entity classification model; wherein the entity classification model includes a first text encoding layer, a second text encoding layer, a feature fusion layer, an entity edge detection layer, and an entity classification layer;

[0008] Using the first text encoding layer to perform a first encoding on the target nuclear power text to obtain a first nuclear power text feature;

[0009] Using the first text encoding layer to perform a first encoding on the retrieved nuclear power knowledge text to obtain a first retrieved knowledge text feature;

[0010] Performing a second encoding on the target nuclear power text using the second text encoding layer to obtain a second nuclear power text feature;

[0011] Performing a second encoding on the retrieved nuclear power knowledge text using the second text encoding layer to obtain a second retrieved knowledge text feature;

[0012] The first nuclear power text feature, the second nuclear power text feature, the first search knowledge text feature and the second search knowledge text feature are fused through the feature fusion layer to obtain a fused nuclear power text feature;

[0013] Performing entity edge detection on the fused nuclear power text features through the entity edge detection layer to obtain nuclear power entity edge features;

[0014] In the entity classification layer, the fused nuclear power text features are entity classified according to the nuclear power entity edge features to obtain the target nuclear power entity category.

[0015] According to some embodiments of the present application, performing a first encoding on the target nuclear telegram text to obtain a first nuclear telegram text feature includes:

[0016] Segmenting the target nuclear power text to obtain target nuclear power characters;

[0017] Perform relative position encoding on the target nuclear power characters to obtain a relative position encoding table;

[0018] Performing character position embedding processing on the target nuclear power character based on a preset character encoding table and the relative position encoding table to obtain a nuclear power character position sequence;

[0019] Performing entity tagging on the target nuclear power character to obtain a nuclear power character entity;

[0020] Attention processing is performed on the target nuclear electric text according to the nuclear electric character position sequence and the nuclear electric character entity to obtain the first nuclear electric text feature.

[0021] According to some embodiments of the present application, performing attention processing on the target nuclear electronic text according to the nuclear electronic character position sequence and the nuclear electronic character entity to obtain the first nuclear electronic text feature includes:

[0022] Extract query features of the target nuclear power text according to the nuclear power character position sequence and a preset query parameter matrix to obtain nuclear power character query features;

[0023] Perform key feature extraction on the target nuclear power text according to the nuclear power character position sequence, the nuclear power character entity, a preset key parameter matrix and a preset entity coding table to obtain nuclear power character key features;

[0024] Perform value feature extraction on the target nuclear power text according to the nuclear power character position sequence, the nuclear power character entity, the preset value parameter matrix and the entity coding table to obtain the nuclear power character value feature;

[0025] The nuclear power character query feature, the nuclear power character key feature and the nuclear power character value feature are attention-weighted to obtain the first nuclear power text feature.

[0026] According to some embodiments of the present application, performing a second encoding on the target nuclear telegram text to obtain a second nuclear telegram text feature includes:

[0027] Converting the target nuclear power text into a nuclear power word sequence;

[0028] Performing word embedding processing on the nuclear power word-element sequence to obtain a nuclear power word-element vector;

[0029] Perform attention encoding on the nuclear power word element vector to obtain the second nuclear power text feature.

[0030] According to some embodiments of the present application, the first nuclear power text feature, the second nuclear power text feature, the first search knowledge text feature, and the second search knowledge text feature are fused to obtain the fused nuclear power text feature, including:

[0031] Performing cross-attention weighted processing on the first nuclear power text feature and the second nuclear power text feature to obtain an initial fused nuclear power text feature;

[0032] Splicing the initial fused nuclear power text feature and the first nuclear power text to obtain a spliced ​​nuclear power text feature;

[0033] Performing cross-attention weighted processing on the first search knowledge text feature and the second search knowledge text feature to obtain an initial fused knowledge text feature;

[0034] splicing the initial fused nuclear power knowledge text feature and the first nuclear power knowledge text to obtain a spliced ​​knowledge text feature;

[0035] Splicing the spliced ​​nuclear power text features and the spliced ​​knowledge text features to obtain spliced ​​nuclear power knowledge text features;

[0036] Performing a linear transformation on the spliced ​​nuclear power knowledge text features to obtain the fused nuclear power text features.

[0037] According to some embodiments of the present application, performing entity edge detection on the fused nuclear power text features to obtain nuclear power entity edge features includes:

[0038] Performing entity annotation prediction on the fused nuclear power text features to obtain a predicted nuclear power annotation entity label;

[0039] Calculating the label score of the predicted nuclear power labeled entity label using a preset transfer matrix and a preset emission matrix to obtain an entity label score;

[0040] The real nuclear power annotation entity label of the fused nuclear power text feature is obtained, and entity edge detection is performed on the fused nuclear power text feature according to the real nuclear power annotation entity label, the predicted nuclear power annotation entity label and the entity label score to obtain the nuclear power entity edge feature.

[0041] According to some embodiments of the present application, performing entity classification on the fused nuclear power text features according to the nuclear power entity edge features to obtain a target nuclear power entity category includes:

[0042] Performing character radical recognition on the fused nuclear power text feature to obtain nuclear power character radical features;

[0043] Entity category recognition is performed on the radical features of the nuclear power character according to the edge features of the nuclear power entity to obtain the target nuclear power entity category.

[0044] According to some embodiments of the present application, performing character radical recognition on the fused nuclear power text features to obtain nuclear power character radical features includes:

[0045] Performing character recognition on the fused nuclear power text features to obtain target nuclear power character features;

[0046] Performing radical recognition on the fused nuclear power text features to obtain target nuclear power radical features;

[0047] The target nuclear power character feature and the target nuclear power radical feature are spliced ​​to obtain the nuclear power character radical feature.

[0048] According to some embodiments of the present application, performing entity category recognition on the radical features of the nuclear power character according to the edge features of the nuclear power entity to obtain the target nuclear power entity category includes:

[0049] Splicing the nuclear power entity edge feature and the nuclear power character radical feature to obtain a spliced ​​nuclear power entity feature;

[0050] Performing entity category probability prediction on the spliced ​​nuclear power entity features to obtain nuclear power entity category probability;

[0051] The nuclear power entity category with the highest probability is selected as the target nuclear power entity category.

[0052] According to some embodiments of the present application, performing knowledge retrieval on the target nuclear power text from a preset nuclear power knowledge base to obtain the retrieved nuclear power knowledge text includes:

[0053] Obtaining the index category of the target nuclear power text;

[0054] Acquire candidate nuclear power knowledge texts from the nuclear power knowledge base according to the index category;

[0055] The text similarity between the candidate nuclear power knowledge text and the target nuclear power text is calculated, and the candidate nuclear power knowledge text with the highest text similarity is selected as the retrieved nuclear power knowledge text.

[0056] According to some embodiments of the present application, before obtaining the pre-trained entity classification model, the method further includes:

[0057] Obtaining the training nuclear power text and the original entity classification model, and obtaining the real entity category of the training nuclear power text;

[0058] Performing a first encoding on the training nuclear electronic text through the first text encoding layer to obtain a first training nuclear electronic text feature;

[0059] Performing a second encoding on the training nuclear electronic text through the second text encoding layer to obtain a second training nuclear electronic text feature;

[0060] The first training nuclear power text feature and the second training nuclear power text feature are fused through the feature fusion layer to obtain a fused training nuclear power text feature;

[0061] Performing entity edge detection on the fused training nuclear power text features through the entity edge detection layer to obtain training nuclear power entity edge features;

[0062] In the entity classification layer, entity classification prediction is performed on the fused training nuclear power text features according to the training nuclear power entity edge features to obtain a predicted entity category;

[0063] Calculating loss values ​​of the predicted entity category and the real entity category according to a preset loss function;

[0064] Based on the loss value, the model parameters of the entity classification model are updated, and the first encoding of the training nuclear text is performed through the first text encoding layer again until the entity classification model meets the preset training conditions, thereby obtaining the pre-trained entity classification model.

[0065] According to some embodiments of the present application, calculating the loss values ​​of the predicted entity category and the real entity category according to a preset loss function includes:

[0066] Obtaining an edge detection loss function for training edge features of nuclear power entities, and obtaining an edge loss function weight of the edge detection loss function;

[0067] Obtaining a classification loss function of the predicted entity category and obtaining a classification loss function weight of the classification loss function;

[0068] The loss values ​​of the predicted entity category and the true entity category are calculated according to the edge detection loss function, the edge loss function weight, the classification loss function and the classification loss function weight.

[0069] According to the second embodiment of the present application, a nuclear power entity classification device includes:

[0070] A knowledge retrieval module is used to obtain a target nuclear power text and perform knowledge retrieval on the target nuclear power text from a preset nuclear power knowledge base to obtain a retrieved nuclear power knowledge text;

[0071] An entity classification model acquisition module is used to acquire a pre-trained entity classification model; wherein the entity classification model includes a first text encoding layer, a second text encoding layer, a feature fusion layer, an entity edge detection layer, and an entity classification layer;

[0072] A nuclear power text first encoding module, configured to perform a first encoding on the target nuclear power text using the first text encoding layer to obtain a first nuclear power text feature;

[0073] a nuclear power knowledge text first encoding module, configured to perform a first encoding on the retrieved nuclear power knowledge text using the first text encoding layer to obtain a first retrieved knowledge text feature;

[0074] A nuclear power text second encoding module, configured to perform a second encoding on the target nuclear power text using the second text encoding layer to obtain a second nuclear power text feature;

[0075] a nuclear power knowledge text second encoding module, configured to perform a second encoding on the retrieved nuclear power knowledge text using the second text encoding layer to obtain a second retrieved knowledge text feature;

[0076] A feature fusion module, configured to fuse the first nuclear power text feature, the second nuclear power text feature, the first search knowledge text feature, and the second search knowledge text feature through the feature fusion layer to obtain a fused nuclear power text feature;

[0077] An entity edge detection module, configured to perform entity edge detection on the fused nuclear power text features through the entity edge detection layer to obtain nuclear power entity edge features;

[0078] The entity classification module is used to perform entity classification on the fused nuclear power text features according to the nuclear power entity edge features in the entity classification layer to obtain the target nuclear power entity category.

[0079] In a third aspect, an embodiment of the present application provides an electronic device comprising: a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the nuclear power entity classification method as described in any one of the embodiments of the first aspect of the present application.

[0080] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement the nuclear power entity classification method as described in any one of the embodiments of the first aspect of the present application.

[0081] The nuclear power entity classification method and its device, electronic device, and storage medium according to the embodiment of the present application have at least the following beneficial effects: According to the nuclear power entity classification method according to the embodiment of the present application, it is necessary to obtain the target nuclear power text, and perform knowledge retrieval on the target nuclear power text from the preset nuclear power knowledge base to obtain the retrieved nuclear power knowledge text; obtain a pre-trained entity classification model; wherein the entity classification model includes a first text encoding layer, a second text encoding layer, a feature fusion layer, an entity edge detection layer, and an entity classification layer; use the first text encoding layer to perform a first encoding on the target nuclear power text to obtain a first nuclear power text feature; use the first text encoding layer to perform a first encoding on the retrieved nuclear power knowledge text to obtain To the first retrieval knowledge text feature; use the second text encoding layer to perform a second encoding on the target nuclear power text to obtain the second nuclear power text feature; use the second text encoding layer to perform a second encoding on the retrieved nuclear power knowledge text to obtain the second retrieval knowledge text feature; through the feature fusion layer, the first nuclear power text feature, the second nuclear power text feature, the first retrieval knowledge text feature and the second retrieval knowledge text feature are fused to obtain the fused nuclear power text feature; through the entity edge detection layer, entity edge detection is performed on the fused nuclear power text feature to obtain the nuclear power entity edge feature; in the entity classification layer, the fused nuclear power text feature is entity classified according to the nuclear power entity edge feature to obtain the target nuclear power entity category. In this way, the effect of nuclear power entity classification can be improved.

[0082] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become obvious from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0083] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0084] Figure 1A flow chart of a nuclear power entity classification method provided in an embodiment of the present application;

[0085] Figure 2 for Figure 1 Flowchart of step S101 in FIG.

[0086] Figure 3 Another flowchart of the nuclear power entity classification method provided in an embodiment of the present application;

[0087] Figure 4 for Figure 3 Flowchart of step S307 in FIG.

[0088] Figure 5 for Figure 1 Flowchart of step S103 in FIG.

[0089] Figure 6 for Figure 5 Flowchart of step S505 in FIG.

[0090] Figure 7 for Figure 1 Flowchart of step S105 in FIG.

[0091] Figure 8 for Figure 1 Flowchart of step S107 in FIG.

[0092] Figure 9 for Figure 1 Flowchart of step S108 in FIG.

[0093] Figure 10 for Figure 1 Flowchart of step S109 in FIG.

[0094] Figure 11 for Figure 10 Flowchart of step S1001 in FIG.

[0095] Figure 12 for Figure 10 Flowchart of step S1002 in FIG.

[0096] Figure 13 It is a structural schematic diagram of a nuclear power entity classification device provided in an embodiment of the present application;

[0097] Figure 14 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0098] The following describes in detail embodiments of the present application. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application and are not to be construed as limiting the present application.

[0099] In the description of this application, "several" means one or more, "many" means more than two, "greater than," "less than," and "exceed" are understood to exclude the number itself, while "above," "below," and "within" are understood to include the number itself. The terms "first" and "second" are used solely to distinguish technical features and are not to be construed as indicating or implying relative importance, or as implicitly specifying the number or order of the technical features indicated.

[0100] In the description of this application, it should be understood that descriptions involving orientations, such as up, down, left, right, front, and back, etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, they cannot be understood as limitations on this application.

[0101] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0102] In the description of this application, it should be noted that, unless otherwise explicitly defined, terms such as "set," "install," and "connect" should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in this application based on the specific content of the technical solution. In addition, the identification of specific steps below does not represent a limitation on the order of steps and execution logic. The execution order and execution logic between each step should be understood and inferred with reference to the content described in the embodiments.

[0103] Nuclear power entity classification is crucial for efficient management of nuclear power-related documentation at nuclear power plants. However, with the increasing number of different types of nuclear power-related documentation (such as nuclear reaction types, nuclear facilities and equipment, and safety measures in engineering projects), it is becoming increasingly difficult for nuclear power plant-related institutions, units, and individuals to organize and retrieve information. This can lead to the situation where nuclear power plant documentation becomes difficult to find or even lost.

[0104] Currently, entity classification typically uses deep learning models (such as Lattice Long Short-Term Memory (Lattice LSTM)) to identify entity categories in text. However, this approach fails to consider the impact of nuclear power-specific terms in nuclear power-related text on the entity classification model's recognition performance, resulting in poor nuclear power entity classification results. Therefore, improving nuclear power entity classification performance remains a pressing challenge in the industry.

[0105] Therefore, the entity classification model is used to classify the target nuclear power text to improve the effect of nuclear power entity classification. It can effectively consider the impact of nuclear power-related texts on the recognition performance of the entity classification model, which helps to improve the application effect of the entity classification model in the nuclear power field.

[0106] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a nuclear power entity classification method and its device, electronic equipment, and storage medium, which can improve the effect of nuclear power entity classification.

[0107] The following is a further explanation based on the accompanying drawings:

[0108] Reference Figure 1 The nuclear power entity classification method according to the embodiment of the present application may include, but is not limited to:

[0109] Step S101: acquiring a target nuclear power text, and performing knowledge retrieval on the target nuclear power text from a preset nuclear power knowledge base to obtain a retrieved nuclear power knowledge text;

[0110] Step S102: obtaining a pre-trained entity classification model; wherein the entity classification model includes a first text encoding layer, a second text encoding layer, a feature fusion layer, an entity edge detection layer, and an entity classification layer;

[0111] Step S103, performing a first encoding on the target nuclear power text using the first text encoding layer to obtain a first nuclear power text feature;

[0112] Step S104: performing a first encoding on the retrieved nuclear power knowledge text using a first text encoding layer to obtain a first retrieved knowledge text feature;

[0113] Step S105, performing a second encoding on the target nuclear power text using the second text encoding layer to obtain a second nuclear power text feature;

[0114] Step S106, performing a second encoding on the retrieved nuclear power knowledge text using a second text encoding layer to obtain a second retrieved knowledge text feature;

[0115] Step S107, fusing the first nuclear power text feature, the second nuclear power text feature, the first search knowledge text feature, and the second search knowledge text feature through a feature fusion layer to obtain a fused nuclear power text feature;

[0116] Step S108, performing entity edge detection on the fused nuclear power text features through the entity edge detection layer to obtain nuclear power entity edge features;

[0117] Step S109: In the entity classification layer, entity classification is performed on the fused nuclear power text features according to the nuclear power entity edge features to obtain the target nuclear power entity category.

[0118] The nuclear power entity classification method shown in steps S101 to S109 of the embodiment of the present application requires obtaining a target nuclear power text, and performing knowledge retrieval on the target nuclear power text from a preset nuclear power knowledge base to obtain a retrieved nuclear power knowledge text; obtaining a pre-trained entity classification model; wherein the entity classification model includes a first text encoding layer, a second text encoding layer, a feature fusion layer, an entity edge detection layer and an entity classification layer; using the first text encoding layer to perform a first encoding on the target nuclear power text to obtain a first nuclear power text feature; using the first text encoding layer to perform a first encoding on the retrieved nuclear power knowledge text to obtain a first retrieved knowledge text feature; using The second text encoding layer performs a second encoding on the target nuclear power text to obtain the second nuclear power text features. The second text encoding layer performs a second encoding on the retrieved nuclear power knowledge text to obtain the second retrieval knowledge text features. The feature fusion layer fuses the first nuclear power text features, the second nuclear power text features, the first retrieval knowledge text features, and the second retrieval knowledge text features to obtain the fused nuclear power text features. The entity edge detection layer performs entity edge detection on the fused nuclear power text features to obtain the nuclear power entity edge features. In the entity classification layer, the fused nuclear power text features are entity classified based on the nuclear power entity edge features to obtain the target nuclear power entity category. In this way, the effect of nuclear power entity classification can be improved.

[0119] In step S101 of some embodiments, specifically, the target nuclear power text may be a nuclear power plant's nuclear reaction type, nuclear facility and equipment-related maintenance logs, operating manuals, safety reports, and other document texts.

[0120] Specifically, the target nuclear power text can be text data extracted from the maintenance logs, operation manuals or safety reports of nuclear power plants, and these text data contain rich nuclear power field information, such as equipment names, operating procedures, technical parameters, etc.

[0121] Reference Figure 2 According to some embodiments of the present application, step S101 performs knowledge retrieval on the target nuclear power text from a preset nuclear power knowledge base to obtain the retrieved nuclear power knowledge text, which may include, but is not limited to:

[0122] Step S201, obtaining the index category of the target nuclear power text;

[0123] Step S202, obtaining candidate nuclear power knowledge texts from a nuclear power knowledge base according to the index category;

[0124] Step S203 , calculating the text similarity between the candidate nuclear power knowledge texts and the target nuclear power knowledge text, and selecting the candidate nuclear power knowledge text with the highest text similarity as the searched nuclear power knowledge text.

[0125] In step S101, the embodiment of the present application retrieves the target nuclear power text from a preset nuclear power knowledge base to obtain a retrieved nuclear power knowledge text. This process can find professional nuclear power knowledge related to the target nuclear power text, providing a nuclear power data foundation for subsequent entity classification. This process can include several sub-steps.

[0126] In step S201 of some embodiments, specifically, the index category may be a category determined based on the target nuclear power text content, such as nuclear power plant equipment, operating procedures, safety protocols, etc.

[0127] Specifically, by indexing the target nuclear power text, the search scope of the knowledge base can be effectively narrowed, which facilitates the subsequent improvement of the efficiency of knowledge retrieval.

[0128] In step S202 of some embodiments, specifically, the nuclear power knowledge base refers to a database that stores a large amount of professional knowledge in the nuclear power field. The nuclear power knowledge base includes equipment information, operating standards, historical events, technical specifications, etc. of nuclear power plants.

[0129] Specifically, the candidate nuclear power knowledge text refers to a document or record in the knowledge base that may be similar to the target nuclear power knowledge text.

[0130] Specifically, the index category of the target nuclear power text is used as a retrieval label, and the category label with the same retrieval category is retrieved in the nuclear power knowledge base, and all candidate nuclear power knowledge texts similar to the target nuclear power text in the knowledge base are obtained according to the category label.

[0131] Specifically, obtaining candidate nuclear power knowledge texts from the nuclear power knowledge base according to the index category can provide basic data for subsequent text similarity calculations.

[0132] In step S203 of some embodiments, specifically, the searched nuclear power knowledge text refers to the nuclear power database text with the highest similarity to the target nuclear power text.

[0133] Specifically, Word2Vec can be used to convert candidate and target nuclear power knowledge texts into vector representations. The text similarity between the candidate and target nuclear power knowledge texts can then be calculated using methods such as cosine similarity or Euclidean distance. Cosine similarity measures the similarity between texts by calculating the cosine of the angle between two vectors, with a value ranging from -1 (complete dissimilarity) to 1 (complete similarity). Euclidean distance determines similarity by measuring the distance between two vectors in Euclidean space; the smaller the distance, the higher the similarity.

[0134] Furthermore, by selecting the candidate nuclear power knowledge text with the highest text similarity as the retrieval nuclear power knowledge text, it is ensured that the final selected retrieval nuclear power knowledge text is most similar to the target nuclear power text in content. Since the retrieval nuclear power knowledge text contains the nuclear power field knowledge that is most relevant to the target nuclear power text, it provides key information for subsequent entity classification, which helps the subsequent model to better understand and classify the entities in the target nuclear power text, and effectively improves the accuracy of subsequent entity recognition.

[0135] The embodiment of the present application shown in steps S201 to S203 improves the efficiency of knowledge base retrieval by accurately matching candidate nuclear power knowledge texts with index categories, and finally selects the retrieval knowledge nuclear power text that is most relevant to the target nuclear power text by calculating the similarity between the candidate nuclear power knowledge texts and the target nuclear power text, providing a solid data foundation for subsequent entity classification and ensuring the accuracy of the retrieval results.

[0136] In step S102 of some embodiments, specifically, the pre-trained entity classification model includes a first text encoding layer, a second text encoding layer, a feature fusion layer, an entity edge detection layer, and an entity classification layer.

[0137] Specifically, the first text encoding layer can be a TENER network layer, which is used to perform relative position encoding on the target nuclear power text and the retrieved nuclear power knowledge text, thereby extracting the corresponding text features of the target nuclear power text and the retrieved nuclear power knowledge text respectively; the second text encoding layer can be a Llama-7B network layer, which is used to capture the contextual information of the target nuclear power text and the retrieved nuclear power knowledge text, thereby extracting the corresponding contextual text features of the target nuclear power text and the retrieved nuclear power knowledge text respectively; the feature fusion layer is implemented by a cross-attention mechanism, which is used to realize the fusion between the first nuclear power text feature, the second nuclear power text feature, the first retrieval knowledge text feature and the second retrieval knowledge text feature; the entity edge detection layer is implemented by a conditional random field sequence labeling model, which is used to perform entity edge detection on the fused nuclear power text features; the entity classification layer is implemented by a character-level convolutional neural network, which is used to perform entity classification on the fused nuclear power text features.

[0138] In step S102, the present embodiment obtains a pre-trained entity classification model and, through multi-level nuclear power text processing and feature extraction, accurately identifies and classifies entities in nuclear power text. Furthermore, the pre-trained entity classification model captures nuclear power text features and entity features specific to the nuclear power field, significantly improving the entity classification model's effectiveness in classifying nuclear power entities. This process may include several sub-steps, including training the entity classification model.

[0139] Reference Figure 3 According to some embodiments of the present application, before obtaining the pre-trained entity classification model in step S102, the nuclear power entity classification method may further include, but is not limited to:

[0140] Step S301: obtaining a training nuclear power text and an original entity classification model, and obtaining the real entity categories of the training nuclear power text;

[0141] Step S302: performing a first encoding on the training nuclear electronic text through a first text encoding layer to obtain a first training nuclear electronic text feature;

[0142] Step S303, performing a second encoding on the training nuclear electronic text through a second text encoding layer to obtain a second training nuclear electronic text feature;

[0143] Step S304: fusing the first training nuclear power text feature and the second training nuclear power text feature through a feature fusion layer to obtain a fused training nuclear power text feature;

[0144] Step S305, performing entity edge detection on the fused training nuclear power text features through the entity edge detection layer to obtain the training nuclear power entity edge features;

[0145] Step S306: In the entity classification layer, entity classification prediction is performed on the fused training nuclear power text features according to the training nuclear power entity edge features to obtain a predicted entity category;

[0146] Step S307, calculating the loss value of the predicted entity category and the real entity category according to a preset loss function;

[0147] Step S308, update the model parameters of the entity classification model based on the loss value, return to execute the first encoding of the training nuclear power text through the first text encoding layer, until the entity classification model meets the preset training conditions, and obtain the pre-trained entity classification model.

[0148] In step S301 of some embodiments, specifically, the training nuclear power text refers to text data related to the nuclear power field, which may include but is not limited to text data such as nuclear power technical documents, operation manuals, accident reports, maintenance records, etc.

[0149] Specifically, the real entity category refers to the correct nuclear power entity category that matches the training nuclear power text. The real entity category may include power plants (nuclear power plants in different regions), systems (various systems of nuclear power plants, such as reactor coolant systems and turbine bypass systems), equipment function identification (various equipment identifications inside nuclear power plants, such as the primary coolant valve of the reactor cooling system of Unit 3), monitoring and detection (various monitoring and detection activities of nuclear power plants, such as radiation level monitoring and equipment integrity detection), operating procedures (operation and maintenance procedures of nuclear power plants, such as startup procedures, shutdown procedures, maintenance and overhaul procedures), events (industrial events of nuclear power, such as changes in switching quantities), algorithms (industrial algorithms of nuclear power, such as transformer thermal life assessment calculations) and time series variables (signals generated by various sensors and actuators in nuclear power, such as the bus-side current signal of the No. 3 auxiliary transformer bay), etc.

[0150] In the training process of the entity classification model, obtaining the training nuclear power text and its real entity categories is the first step in building an effective entity classification model. The training nuclear power text is the basis of model learning, and the real entity category labels are the goals of model learning. By obtaining the real entity categories of the training nuclear power text, the necessary information and evaluation criteria for model prediction accuracy are provided for subsequent nuclear power text feature learning and entity prediction, ensuring that the model can achieve high-accuracy entity recognition and classification in actual nuclear power applications.

[0151] In step S302 of some embodiments, specifically, the first training text feature refers to a text feature containing the relative position and context information of the nuclear power text.

[0152] Specifically, the first training nuclear electronic text is first converted into a character sequence. In the first encoding layer TENER network, the training nuclear electronic text is encoded according to the character representation and relative position information in the training nuclear electronic text, so that each character is converted into a vector representation in a high-dimensional space. These vectors can capture the effective semantic information of the training nuclear electronic text, and by relative position encoding the training nuclear electronic text, it helps to enhance the entity classification model's perception of the direction of contextual feature information.

[0153] In step S303 of some embodiments, specifically, the second training core text feature refers to a text feature containing contextual semantic information.

[0154] Specifically, encoding the second training nuclear power text through the second text encoding layer Llama-7B network can extract text features different from the first text encoding layer, and effectively capture and parse the subtle semantics and structure in the training nuclear power text.

[0155] In some embodiments, step S304 specifically combines the first and second training nuclear power text features through the cross-attention mechanism of the feature fusion layer to obtain a fused training nuclear power text feature. After being processed by the feature fusion layer, the fused training nuclear power text feature forms a comprehensive feature representation, which not only contains the semantic information of the training nuclear power text vocabulary, but also contains the structure and context information of the nuclear power text, thereby integrating the features extracted by different coding layers to form a more comprehensive feature representation, providing richer nuclear power text information for subsequent entity edge detection and entity classification.

[0156] In step S305 of some embodiments, specifically, the entity edge detection layer performs entity prediction on each word or character in the fused training nuclear power text features through a sequence labeling model (such as a conditional random field) to determine whether the word or character belongs to the beginning or internal part of the nuclear power entity, and labels the word or character through the entity start label or the entity internal label to determine the boundary of the nuclear power entity. In this process, the entity edge detection takes into account the dependency between different nuclear power entity labels, ensuring the logical consistency and semantic correctness of the nuclear power entity boundary.

[0157] In step S306 of some embodiments, specifically, the predicted entity category refers to the nuclear power entity category predicted by the entity classification model that is most likely to match the training nuclear power text.

[0158] Specifically, the entity classification layer receives the trained nuclear power entity edge features from the entity edge detection layer. These features indicate the boundary positions of each nuclear power entity in the text. It also receives the fused trained nuclear power text features from the feature fusion layer. These features contain rich semantic and syntactic information, which provides the necessary context for nuclear power entity classification. The convolutional neural network processes the fused trained nuclear power text features and entity edge features, and outputs the category to which each nuclear power entity may belong. This process requires the entity classification model to have the ability to recognize specific entity categories in the nuclear power field. Therefore, the training data of the model needs to cover real entity category information so that the model can learn to distinguish different nuclear power entity categories, which helps to improve the accuracy of nuclear power entity classification.

[0159] In some embodiments, step S307 is referred to as Figure 4 According to some embodiments of the present application, step S307 calculates the loss value of the predicted entity category and the real entity category according to a preset loss function, which may include, but is not limited to:

[0160] Step S401, obtaining an edge detection loss function for training edge features of nuclear power entities, and obtaining an edge loss function weight of the edge detection loss function;

[0161] Step S402, obtaining a classification loss function for predicting the entity category, and obtaining a classification loss function weight of the classification loss function;

[0162] Step S403 , calculating the loss values ​​of the predicted entity category and the real entity category according to the edge detection loss function, the edge loss function weight, the classification loss function and the classification loss function weight.

[0163] In some embodiments of the present application, by calculating the loss values ​​of the predicted entity category and the real entity category according to a preset loss function, the difference between the model prediction output and the real entity category label can be measured, and by calculating the loss value and subsequently determining the model parameter gradient, the weight and bias update of the model is achieved to reduce the prediction error of the entity category, thereby improving the accuracy of nuclear power entity classification.

[0164] In step S307, this calculation process includes several key operations:

[0165] In step S401 of some embodiments, specifically, an edge detection loss function is used to evaluate the performance of the entity edge detection layer, that is, the accuracy of identifying entity boundaries. The edge detection loss function measures the difference between the predicted entity edge of the entity classification model and the actual entity edge.

[0166] Specifically, the edge loss function weight is a hyperparameter used to adjust the proportion of edge detection in the overall loss to ensure that the entity classification model pays enough attention to the identification of entity boundaries during training.

[0167] In step S402 of some embodiments, specifically, a classification loss function is used to evaluate the performance of the entity classification layer, that is, the accuracy of predicting entity categories. The classification loss function compares the difference between the category probability distribution predicted by the entity classification model and the probability distribution of the actual category.

[0168] Specifically, the classification loss function weight is also a hyperparameter. The classification loss function weight is used to adjust the proportion of the entity classification task in the overall loss calculation to ensure that the model pays appropriate attention to the prediction of entity categories during training.

[0169] In step S403 of some embodiments, specifically, the edge detection loss function and the classification loss function are combined through their weights to form a comprehensive loss function. This comprehensive loss function calculates the total loss value of the predicted entity category and the real entity category, reflecting the overall performance of the entity classification model in the two tasks of entity edge detection and entity classification.

[0170] Furthermore, the total loss value is the weighted sum of the edge detection loss and the classification loss, where each loss is multiplied by its corresponding weight. This helps the entity classification model optimize both the recognition of entity edges and the prediction of entity categories during training. By adjusting the weights, a balance can be achieved between the two tasks of entity edge detection and entity classification, thereby determining the optimal entity classification model.

[0171] Through the embodiments of the present application provided by steps S401 to S403, the entity classification model can be continuously adjusted and optimized during the training process, reducing prediction errors and improving the accuracy of nuclear power entity recognition. The use of this comprehensive loss function enables the entity classification model to more comprehensively learn to identify entity categories from nuclear power text, improving the accuracy of nuclear power entity classification.

[0172] In some more specific embodiments of the present application, the edge detection loss function can be expressed by the following formula:

[0173]

[0174] Among them, loss B represents the edge detection loss function, Indicates that the nuclear text features are trained by fusion given input The real nuclear power annotated entity labels that match the fusion training nuclear power text features are shown in the figure below. score; represents the fusion training nuclear power text features; N represents the number of fusion training nuclear power text features; Represents the real nuclear power annotation entity label corresponding to the fusion training nuclear power text feature; Indicates that the nuclear text features are trained by fusion given input All possible predicted nuclear power annotated entity labels that match the fusion training nuclear power text features score; Represents all possible predicted nuclear power annotation entity labels that match the fused training nuclear power text features.

[0175]

[0176] Among them, loss f represents the classification loss function, x i represents the i-th fusion training nuclear power text feature, yi represents the i-th real entity category corresponding to xi, Represents the angle between the i-th fusion training nuclear power text feature and the weight vector of its corresponding i-th real entity category yi, j≠y i represents the predicted entity category that does not belong to the true entity category, represents a function for adjusting the angle θ, which can enhance the entity classification model's ability to distinguish entity categories. Represents the correction function for the angle corresponding to the true entity category.

[0177] Specifically, the final loss function is as follows:

[0178] Loss = α loss B +β·loss F

[0179] Among them, Loss represents the loss value of the final loss function, α represents the weight of the edge loss function, β represents the weight of the classification loss function, and loss B Represents the edge detection loss function, loss F represents the classification loss function.

[0180] In step S308 of some embodiments, specifically, based on the loss value, the entity classification model parameters will be updated as a backpropagation process of model learning. In this way, the entity classification model can learn how to reduce prediction errors and gradually improve the accuracy of predictions.

[0181] Furthermore, after updating the entity classification model parameters, the entity classification model will again encode the training nuclear power text through the first text encoding layer, repeating the entire encoding, fusion, detection and classification process until the entity classification model meets the preset training conditions, such as reaching a certain accuracy rate or the loss value is less than the preset loss threshold. After meeting the training conditions, a pre-trained entity classification model is obtained, which can be used for actual nuclear power text entity classification tasks. Through the entity classification model parameter update process, the entity classification model not only learns how to extract useful features from nuclear power text, but also learns how to accurately classify entities based on these features, thereby improving the classification effect of the entity classification model for entity classification in the nuclear power field.

[0182] In the embodiment of the present application provided through steps S301 to S308, the entire model training process is an iterative deep learning training process. Through continuous learning and adjustment, the model gradually learns how to accurately identify and classify nuclear power entities from nuclear power texts, providing a powerful nuclear power text data foundation for entity classification tasks, and helping to achieve efficient and accurate nuclear power entity recognition.

[0183] Reference Figure 5 According to some embodiments of the present application, step S103 uses the first text encoding layer to perform a first encoding on the target nuclear electronic text to obtain the first nuclear electronic text features, which may include, but are not limited to:

[0184] Step S501, segmenting the target nuclear power text to obtain target nuclear power characters;

[0185] Step S502, performing relative position coding on the target nuclear power character to obtain a relative position coding table;

[0186] Step S503, performing character position embedding processing on the target nuclear power character based on a preset character encoding table and a relative position encoding table to obtain a nuclear power character position sequence;

[0187] Step S504, performing entity tagging on the target nuclear power character to obtain the nuclear power character entity;

[0188] Step S505: Perform attention processing on the target nuclear power text according to the nuclear power character position sequence and the nuclear power character entity to obtain the first nuclear power text feature.

[0189] In step S501 of some embodiments, specifically, the target nuclear power character can be represented as a nuclear power character sequence c={c1, c2, ..., c n}, where c1 represents the first target nuclear power character and cn represents the nth target nuclear power character.

[0190] Token segmentation of the target nuclear power text is the initial step. Token segmentation breaks the continuous target nuclear power text into individual characters or words, forming a target nuclear power character sequence. This step breaks the target black egg text into smaller, manageable units through the model, which is crucial for the entity classification model to understand the target nuclear power text structure.

[0191] In some embodiments, step S502 specifically performs relative position encoding on these target nuclear power characters to generate a relative position encoding table corresponding to the nuclear power characters, that is, the relative position information between characters is encoded through a combination of sine and cosine functions, thereby enhancing the entity classification model's ability to perceive the direction of contextual feature information. Relative position encoding helps the entity classification model capture the relative distance and direction between characters or words, and provides a basis for understanding long-distance dependencies in the target nuclear power text.

[0192] In some embodiments, step S503, specifically, after obtaining the relative position coding of the nuclear power characters, the TENER network performs character position embedding processing on the target nuclear power characters based on the preset character coding table and relative position coding table, and maps each character to a vector in a high-dimensional space through the character coding table, and provides the position information of the character or word in the nuclear power character sequence in combination with the relative position coding. By combining these two character codings with the relative coding information, a nuclear power character position sequence is generated, which contains rich feature representations of the nuclear power character semantics and relative position information, so as to facilitate the subsequent extraction of more accurate first nuclear power text features.

[0193] In step S504 of some embodiments, specifically, entity tagging can be performed by using a nuclear power-related entity dictionary extracted from the training nuclear power text and a maximum entity matching algorithm to obtain a corresponding entity tag e = {e1, e2, ..., e n}, mark each nuclear power character with the index of the longest entity containing the character in the entity dictionary, and mark the nuclear power characters without entity matching as 0; where e1 represents the entity label that matches the first target nuclear power character, and en represents the entity label that matches the nth target nuclear power character.

[0194] In step S505 of some embodiments, specifically, the TENER network performs attention processing on the target nuclear power text according to the nuclear power character position sequence and the nuclear power character entity. When processing the target nuclear power text through the attention mechanism, different levels of attention can be given to different nuclear power characters, especially higher attention can be given to characters related to nuclear power entity recognition, so that the entity classification model can focus on the key feature information in the nuclear power text, thereby extracting the first nuclear power text feature that is most important for subsequent entity classification. The first nuclear power text feature is obtained after an in-depth analysis of the nuclear power text by the nuclear power model, and contains rich nuclear power text semantics and structural information, providing a data basis for the subsequent entity classification of the model.

[0195] The embodiment of the present application provided through steps S501 to S505 converts the original nuclear power text into a rich representation of a series of quantitative features by performing word segmentation, relative position encoding, character position embedding, entity tagging and attention processing on the target nuclear power text. These representations can be used by the entity classification model to perform accurate entity classification, significantly enhancing the model's ability to identify and classify nuclear power entities in nuclear power professional field texts.

[0196] In some more specific embodiments of the present application, the relative position encoding can be expressed by the following formula:

[0197]

[0198] Among them, R t,-t The relative position coding table representing the target nuclear power character is used to capture the relative position information between different positions of the target nuclear power character. It is generated through a combination of sine and cosine functions to enhance the entity classification model's perception of relative position information. t represents the current position of the target nuclear power character; -t represents the opposite position of the current position of the target nuclear power character; c0 represents the frequency scaling factor, which is used to adjust the period of sine and cosine; d represents the feature dimension.

[0199] Specifically, the nuclear power character sequence can be expressed by the following formula

[0200]

[0201] in, represents the nuclear power character position sequence of the nth target nuclear power character after being processed by the first layer of TENER network. The nuclear power character position sequence contains the semantic information and position information of the target nuclear power character; E c Character encoding table representing target nuclear power character c; c n Indicates the nth target nuclear power character; R t,-t Represents the relative position coding table of the target nuclear power characters; n represents the number of target nuclear power characters.

[0202] Reference Figure 6 According to some embodiments of the present application, step S505 performs attention processing on the target nuclear text according to the nuclear character position sequence and the nuclear character entity to obtain the first nuclear text feature, which may include, but is not limited to:

[0203] Step S601: extract query features from the target nuclear power text based on the nuclear power character position sequence and a preset query parameter matrix to obtain nuclear power character query features;

[0204] Step S602: extract key features of the target nuclear power text according to the nuclear power character position sequence, the nuclear power character entity, the preset key parameter matrix, and the preset entity coding table to obtain the nuclear power character key features;

[0205] Step S603: extracting value features of the target nuclear power text according to the nuclear power character position sequence, nuclear power character entity, preset value parameter matrix and entity coding table to obtain nuclear power character value features;

[0206] Step S604, perform attention weighting on the nuclear power character query feature, the nuclear power character key feature and the nuclear power character value feature to obtain the first nuclear power text feature.

[0207] In some embodiments of the present application, attention processing is performed on the target nuclear power text based on the nuclear power character position sequence and nuclear power character entities. This not only enables the model to focus on the key information in the target nuclear power text, but also extracts rich semantic and positional information containing the target nuclear power text, providing a basis for subsequent entity classification tasks. This process is performed in step S505 and may include the following sub-steps.

[0208] In some embodiments, step S601, specifically, in the TENER network, feature extraction of the target nuclear power text is a multi-step process involving the extraction of query, key, and value features. First, the TENER network extracts query features from the text based on the nuclear power character position sequence and a preset query parameter matrix. In this step, the model uses character position information and the query parameter matrix to generate query features. These features can capture the semantic information of each character in the target nuclear power text and provide a basis for the attention mechanism.

[0209] In step S602 of some embodiments, specifically, the TENER network extracts key features based on the nuclear power character position sequence, nuclear power character entities, a preset key parameter matrix, and an entity coding table. During the key feature extraction process, the TENER network not only considers the position information of the nuclear power characters, but also combines the entity information of the nuclear power characters. This enables the TENER network to identify characters related to nuclear power entities in the text, and further, through the combined use of the key parameter matrix and the entity coding table, it can also identify and distinguish different nuclear power entities.

[0210] In step S603 of some embodiments, specifically, the TENER network performs value feature extraction based on the nuclear power character position sequence, nuclear power character entity, preset value parameter matrix and entity coding table. The purpose of value feature extraction is to provide relevant value information for the attention mechanism, and combine the value information with the key feature to determine the part that the TENER network should focus on when processing the target text, providing the TENER network with a more comprehensive understanding of the target nuclear power text content.

[0211] In step S604 of some embodiments, the TENER network performs attention weighting on the query features, key features, and value features. This step involves calculating the similarity between the query features and the key features to determine the attention weight of each nuclear power character. These weights are used to weight the value features to generate the final first nuclear power text features. These first nuclear power text features not only contain the semantic and positional information of the nuclear power characters, but also incorporate relevant information about the entity, enabling the TENER network to more accurately identify and classify nuclear power characters related to nuclear power entities.

[0212] Through the embodiments of the present application provided by steps S601 to S604, the TENER network can extract rich nuclear power text features from the target nuclear power text, providing a solid data foundation for subsequent entity edge recognition and entity classification, and through the introduction of the attention mechanism, the TENER network can dynamically adjust the focus of the TENER network according to the context of the nuclear power text content, thereby improving the accuracy of the TENER network in processing complex nuclear power texts.

[0213] In some more specific embodiments of the present application, the nuclear power character query feature can be expressed by the following formula:

[0214]

[0215] in, represents the nuclear power character query feature of the nth target nuclear power character after being processed by the lth layer TENER network; represents the nuclear power character position sequence of the nth target nuclear power character after being processed by the l-1th layer TENER network; The query parameter matrix represents the nuclear power character query feature q and the nuclear power character position sequence h after being processed by the l-th layer TENER network.

[0216] Furthermore, the nuclear power character key characteristics can be expressed by the following formula:

[0217]

[0218] in, Represents the nuclear power character key features of the nth target nuclear power character after being processed by the lth layer of TENER network; represents the nuclear power character position sequence of the nth target nuclear power character after being processed by the l-1th layer TENER network; represents the key parameter matrix of the nuclear power character key feature k and the nuclear power character position sequence h after processing by the l-th layer TENER network; Eent represents the entity encoding table; e n Indicates the entity tag that matches the nth target nuclear power character; represents the entity parameter matrix of the entity label and the core character key feature k after processing by the l-th layer TENER network; T represents the matrix transpose.

[0219] Specifically, the nuclear power character value feature can be expressed by the following formula:

[0220]

[0221] in, Represents the nuclear power character value feature of the nth target nuclear power character after being processed by the lth layer TENER network; represents the nuclear power character position sequence of the nth target nuclear power character after being processed by the l-1th layer TENER network; represents the key parameter matrix of the nuclear power character value feature v and the nuclear power character position sequence h after processing by the l-th layer TENER network; Eent represents the entity encoding table; e n Indicates the entity tag that matches the nth target nuclear power character; It represents the entity parameter matrix of entity labels and nuclear character value features v after processing by the l-th layer TENER network; T represents matrix transpose.

[0222] Furthermore, the logic of this formula is that if the entity tag e n If there is no corresponding target nuclear power character matching, then e n = 0, at this time, the nuclear power character key feature is only determined by the nuclear power character position sequence and key parameter matrix of the target nuclear power character, and the nuclear power character value feature is only determined by the nuclear power character position sequence and value parameter matrix of the target nuclear power character; if the entity tag e n If there is a corresponding target nuclear power character that matches, the nuclear power character key feature or the nuclear power character value feature is determined by the nuclear power character position sequence and the entity coding table and its corresponding parameter matrix.

[0223] Specifically, through the above-mentioned attention weighted processing, if the TENER network is stacked with 12 layers of attention mechanisms, the final TENER network can output a 77×768-dimensional first-core electric text feature vector.

[0224] In step S104 of some embodiments, specifically, the first search knowledge text feature refers to a text feature containing relative position and context information of the search knowledge text.

[0225] Specifically, the method of using the first text encoding layer to perform the first encoding on the retrieved nuclear power knowledge text to obtain the first retrieved knowledge text feature is consistent with the method of using the first text encoding layer to perform the first encoding on the target nuclear power text to obtain the first nuclear power text feature, and will not be repeated here.

[0226] Specifically, by converting the retrieved nuclear power knowledge text into a character sequence, the retrieved nuclear power knowledge text is encoded in the first encoding layer TENER network according to the character representation and relative position information in the retrieved nuclear power knowledge text, so that each character is converted into a vector representation in a high-dimensional space. These vectors can capture the effective semantic information of the retrieved nuclear power knowledge text, and by encoding the relative position of the retrieved nuclear power knowledge text, it helps to enhance the TENER network's perception of the direction of contextual feature information.

[0227] Reference Figure 7 According to some embodiments of the present application, step S105 performs a second encoding on the target nuclear text to obtain a second nuclear text feature, which may include, but is not limited to:

[0228] Step S701, converting the target nuclear power text into a nuclear power word sequence;

[0229] Step S702, performing word embedding processing on the nuclear power word-gram sequence to obtain a nuclear power word-gram vector;

[0230] Step S703, perform attention encoding on the nuclear power word element vector to obtain the second nuclear power text feature.

[0231] In some embodiments of the present application, by performing a second encoding on the target nuclear power text, the contextual characteristics of the target nuclear power text can be effectively captured, further providing a nuclear power field data foundation for subsequent nuclear power entity classification. This process is performed in step S105 and may include the following sub-steps.

[0232] In some embodiments, step S701, specifically, converting the target nuclear power text into a sequence of nuclear power tokens is the first step in text encoding by the Llama-7B network. This process involves breaking down the continuous target nuclear power text string into discrete tokens. These tokens can be words, characters, or word units based on nuclear power terminology. For text in the nuclear power field, tokens may include technical terms, equipment names, chemical substance names, and so on.

[0233] Specifically, the purpose of converting the target nuclear power text into a nuclear power word sequence is to convert the target nuclear power text into a form that can be processed by the Llama-7B network so that the Llama-7B network can perform subsequent feature extraction.

[0234] In some embodiments, step S702, specifically, word embedding processing is performed on the nuclear power word sequence. This step is achieved by embedding the nuclear power word sequence. By performing the embedding operation on the nuclear power word sequence, each word can be mapped to a point in a high-dimensional vector space. This vector captures the semantic and grammatical features of the word. For nuclear power text, word embedding processing can enable the Llama-7B network to learn the representation of professional terms related to the nuclear power field. These representations are crucial for the Llama-7B network to understand the content of the target nuclear power text.

[0235] In step S106 of some embodiments, the second retrieval knowledge text feature is a feature obtained by encoding the retrieval nuclear power knowledge text through the Llama-7B network.

[0236] Specifically, the method of using the second text encoding layer to perform a second encoding on the retrieved nuclear power knowledge text to obtain the second retrieved knowledge text features is consistent with the method of using the second text encoding layer to perform a second encoding on the target nuclear power text to obtain the second nuclear power text features, and will not be repeated here.

[0237] Specifically, the second text encoding layer is used to perform a second encoding on the retrieved nuclear power knowledge text. These vectors can capture the long-distance dependencies of the retrieved nuclear power knowledge text, thereby extracting context-related retrieved knowledge text features, which is convenient for providing further data basis for subsequent entity classification model.

[0238] In some embodiments, step S703 specifically inputs the nuclear power word element vector into the Transformer encoder, which consists of a self-attention mechanism and a feedforward neural network. The self-attention mechanism enables the Llama-7B network to take other tokens in the sequence into consideration when processing the current token, thereby capturing the long-distance dependencies between words. The feedforward network further processes the tokens, enhancing the Llama-7B network's detailed understanding of the target nuclear power text features and improving the accuracy of the second nuclear power text feature extraction.

[0239] In the embodiment of the present application shown in steps S701 to S703, the nuclear power word element vectors that have been encoded with attention are integrated into the second nuclear power text features. These features contain deep information of the text, such as the contextual relationship of the text, thereby providing a data basis for subsequent entity classification tasks, enabling the entity classification model to more accurately identify and classify nuclear power entities in nuclear power texts.

[0240] In some more specific embodiments of the present application, if the character sequence c of the target nuclear power text is {c1, c2, ..., c n}Then the character sequence is input into the Llama-7B model, which converts the character sequence into a high-dimensional feature vector of 77×1280.

[0241] Reference Figure 8 According to some embodiments of the present application, step S107 fuses the first nuclear power text feature, the second nuclear power text feature, the first search knowledge text feature, and the second search knowledge text feature to obtain a fused nuclear power text feature, which may include, but is not limited to:

[0242] Step S801, performing cross-attention weighted processing on the first nuclear power text feature and the second nuclear power text feature to obtain an initial fused nuclear power text feature;

[0243] Step S802, splicing the initial fused nuclear power text feature and the first nuclear power text to obtain a spliced ​​nuclear power text feature;

[0244] Step S803, performing cross-attention weighting processing on the first search knowledge text feature and the second search knowledge text feature to obtain an initial fusion knowledge text feature;

[0245] Step S804: splicing the initial fused nuclear power knowledge text features and the first nuclear power knowledge text to obtain spliced ​​knowledge text features;

[0246] Step S805, splicing the spliced ​​nuclear power text features and the spliced ​​nuclear power knowledge text features to obtain the spliced ​​nuclear power knowledge text features;

[0247] Step S806: performing linear transformation on the concatenated nuclear power knowledge text features to obtain fused nuclear power text features.

[0248] In some embodiments of this application, the nuclear power text features and retrieval knowledge text features at different coding levels are integrated to enhance data retrieval of nuclear power text using knowledge in the database, effectively alleviating the data scarcity problem of the model for nuclear power entity classification and improving the entity classification model's ability to understand professional text in the nuclear power field. In step S107, this calculation process includes several key operations:

[0249] In some embodiments, step S801 specifically performs cross-attention weighting on the first nuclear electronic text feature and the second nuclear electronic text feature. This step involves calculating the correlation between the two sets of features to determine the importance of each feature in the final representation. By performing attention weighting, the subsequent entity classification model can identify which features are more important in representing the nuclear electronic text.

[0250] Specifically, the core task of cross-attention is to combine the query vector (Q) and the key-value vector (K, V) to generate an aligned feature vector. To achieve cross-attention, the key and value need to be projected to the same dimension as the query. The key and value vectors can be projected to the same dimension as the query vector through the projection matrix. Finally, the query vector, key vector, and value vector are weighted and summed according to the attention weight to obtain the initial fused nuclear power text feature with the same dimension as the first nuclear power text feature. Among them, the first nuclear power text feature is used as the query vector, and the second nuclear power text feature is used as the key vector and value vector.

[0251] In some embodiments, step S802 specifically involves concatenating the initial fused nuclear power text features with the first nuclear power text features to form a concatenated nuclear power text feature. This step integrates the advantages of the features of both coding layers, merging feature information from different network layers. This allows for a more comprehensive perception of the location information and subtle changes in the nuclear power text, effectively addressing issues such as poor comprehension of complex text and unclear expression of specialized terms in the nuclear power field, which can lead to poor subsequent entity category recognition.

[0252] In step S803 of some embodiments, specifically, the initial fused knowledge text feature is obtained by weighted summation of the retrieved knowledge text features, which combines the feature advantages of the outputs of the first text encoding layer and the second text encoding layer to form a richer and more balanced feature representation. This feature not only contains the semantic information of the text, but also incorporates the evaluation information of the importance of different parts of the nuclear power text by the entity classification model.

[0253] Specifically, the method of performing cross-attention weighted processing on the first retrieval knowledge text feature and the second retrieval knowledge text feature to obtain the initial fused knowledge text feature is consistent with the method of performing cross-attention weighted processing on the first nuclear power text feature and the second nuclear power text feature to obtain the initial fused nuclear power text feature, and will not be repeated here.

[0254] In step S804 of some embodiments, specifically, the feature extraction layer splices the initial fused nuclear power knowledge text feature with the first nuclear power knowledge text feature, merges the feature vectors from different sources along the feature dimension, and forms a new feature vector, so that the spliced ​​knowledge text feature contains all the information of the initial fused feature and the first nuclear power knowledge text feature, thereby merging the nuclear power text features obtained at different levels and different angles, so that the entity classification model can understand the knowledge text from a more comprehensive perspective.

[0255] Specifically, the method of splicing the initial fused nuclear power knowledge text features and the first nuclear power knowledge text to obtain the spliced ​​knowledge text features is the same as the method of splicing the initial fused nuclear power text features and the first nuclear power text to obtain the spliced ​​nuclear power text features, which will not be repeated here.

[0256] In some embodiments, step S805 specifically involves concatenating the nuclear power text features and the nuclear power knowledge text features to form a concatenated nuclear power knowledge text feature. This step combines the nuclear power text features and the retrieval knowledge features to form a more comprehensive feature representation that not only encompasses the inherent information of the nuclear power text but also incorporates the rich nuclear power corpus from an external knowledge base. This enables the retrieval enhancement of nuclear power texts using knowledge data extracted from a preset prior knowledge database, effectively alleviating the problem of nuclear power data scarcity in nuclear power entity classification and facilitating subsequent improvements in nuclear power entity classification effectiveness.

[0257] In step S806 of some embodiments, specifically, linear transformation typically involves a fully connected layer. Since the concatenated feature vectors are high-dimensional, directly using these high-dimensional features may introduce redundant information and noise. The fully connected layer fuses and compresses these high-dimensional features through linear transformation, allowing the model to retain important information while reducing unnecessary redundancy. Furthermore, the fully connected layer can introduce nonlinear mapping through activation functions, enhancing the model's understanding of complex semantic relationships and improving the expressiveness of text features.

[0258] Through steps S801 to S806 shown in the embodiment of the present application, the retrieved knowledge text features are combined with the nuclear power text features to form a comprehensive feature representation. This helps the model to more accurately capture key text information in the nuclear power field in subsequent entity classification tasks, and achieve more effective use of nuclear power field knowledge, thereby improving the accuracy and robustness of subsequent model nuclear power entity classification.

[0259] In some more specific embodiments of the present application, the core task of cross attention is to combine the query vector (Q) and the key-value vector (K, V) to generate an aligned feature vector. The feature fusion layer receives the 77x768 first core text features output by the TENER network and the 77x1280 second core text features output by the LLaMA-7B network, and uses the 77x1280 dimensional features as key and value vectors and 77x768 as the query vector to achieve the fusion of different vector dimensions. It is necessary to project the key and value vectors into the same 768 dimension as the query vector.

[0260] Furthermore, the projection matrix WK for the key vector is 1280x768, the projection matrix WV for the value vector is 1280x768, and the projection matrix WQ for the query vector is 768x768. By projecting the query, key, and value vectors with projection matrices WK, WV, and WQ, we obtain query, key, and value vectors with dimensions of 77x768.

[0261] Furthermore, the query vector and the key vector are dot-producted to obtain an attention weight matrix of 77x77 dimensions. The dot product of the attention weight matrix and the value vector is further calculated to output an initial fused nuclear power text feature of 77x768 dimensions. The 77x768-dimensional initial fused nuclear power text feature is concatenated with the 77x768-dimensional first nuclear power text feature vector to obtain a concatenated nuclear power text feature of 77×1536 dimensions f. n .

[0262] Similarly, the 77x768-dimensional initial fusion nuclear power knowledge text feature is concatenated with the 77x768-dimensional first nuclear power knowledge text to obtain the 77x1536-dimensional concatenated knowledge text feature f L .

[0263] Reference Figure 9 According to some embodiments of the present application, step S108 performs entity edge detection on the fused nuclear power text features to obtain nuclear power entity edge features, which may include, but are not limited to:

[0264] Step S901: Entity annotation prediction is performed on the fused nuclear power text features to obtain a predicted nuclear power annotation entity label;

[0265] Step S902: Calculate the label score of the predicted nuclear power entity label using a preset transfer matrix and a preset emission matrix to obtain an entity label score;

[0266] Step S903: obtain the real nuclear power annotation entity label of the fused nuclear power text feature, and perform entity edge detection on the fused nuclear power text feature according to the real nuclear power annotation entity label, the predicted nuclear power annotation entity label and the entity label score to obtain the nuclear power entity edge feature.

[0267] In some embodiments of the present application, entity edge detection for fusion nuclear power text features involves identifying the boundaries of entities in the text and assigning correct boundary category labels to these entities. In step S108, this process includes several key operations:

[0268] In step S901 of some embodiments, specifically, the predicted nuclear power annotated entity labels refer to all possible nuclear power entity boundary labels associated with the fused nuclear power text features, including a B (Begin) label, which indicates the beginning of a nuclear power entity; an I (Inside) label, which indicates the internal portion of the same nuclear power entity following a B label; and an E (End) label, which indicates the end of a nuclear power entity. Furthermore, a B label should only be followed by an I label or another B label (if a new nuclear power entity is being started). In other words, an I label should not appear without a preceding B label, as the I label indicates the middle of an entity, not the beginning.

[0269] Specifically, the conditional random field of the entity edge detection layer is used to predict the entity boundary annotation of the fused nuclear power text features. This step utilizes the rich information in the fused features to predict the entity boundary category to which each character or word in the nuclear power text may belong, thereby achieving preliminary recognition of the entity edge.

[0270] In step S902 of some embodiments, the transition matrix is ​​used to measure the transition probability between two consecutive entity labels, helping the entity edge detection layer understand the sequential relationship between entity labels. The emission matrix is ​​used to measure the degree of match between the fused nuclear power text features and the predicted nuclear power annotated entity labels. The two matrices work together to calculate a score for each predicted nuclear power annotated entity label, reflecting its appropriateness in a given context.

[0271] In some embodiments, step S903 specifically involves obtaining, through an entity edge detection layer, real nuclear power annotated entity labels for the fused nuclear power text features. These real labels are the annotation information used to train the conditional random field model, providing the conditional random field model with correct entity edge information. The conditional random field model then performs entity edge detection on the fused nuclear power text features based on the real nuclear power annotated entity labels, the predicted nuclear power annotated entity labels, and the entity label scores. Specifically, the predicted nuclear power annotated entity label with the highest score is selected as the nuclear power entity edge feature by comparing the scores of the predicted label with the real label.

[0272] Through steps S901 to S903 shown in the embodiment of the present application, not only can the precise edges of the entity be identified, but the selection of the entire entity boundary label sequence can also be optimized by considering the dependencies in the fused nuclear power text features, thereby improving the accuracy and efficiency of the overall entity edge recognition.

[0273] According to some more specific embodiments of the present application, the optimization goal of the conditional random field model is to increase the score ratio of the real nuclear electricity annotated entity label in the total score of all annotated entity labels.

[0274] Specifically, the predicted nuclear power entity label can be expressed by the following formula:

[0275]

[0276] in, Indicates that the nuclear text features are trained by fusion given input Possible predicted nuclear power annotation entity labels that match the fusion training nuclear power text features score; represents the fusion training nuclear power text features; N represents the number of fusion training nuclear power text features; A represents the possible predicted nuclear power annotation entity label that matches the fusion training nuclear power text features; [i]n-1,[i]n Represents the transfer matrix, which is used to measure the relationship between two continuous labels [i] n-1 with[i] n The transition probability between n-1Denote the predicted nuclear power annotation entity label corresponding to the (n - 1)-th fused training nuclear power text feature; [i] n Denote the predicted nuclear power annotation entity label corresponding to the n-th fused training nuclear power text feature; Denote the emission matrix, which is used to measure the n-th fused training nuclear power text feature n and the predicted nuclear power annotation entity label [i] corresponding to the n-th fused training nuclear power text feature

[0277] Specifically, entity edge detection can be represented by the following formula:

[0278]

[0279] where, Denote the true nuclear power annotation entity label under the given input fused training nuclear power text feature with respect to all possible predicted nuclear power annotation entity labels matched with the fused training nuclear power text feature; Denote the fused training nuclear power text feature; N denotes the number of fused training nuclear power text features; Denote the true nuclear power annotation entity label corresponding to the fused training nuclear power text feature; Denote all possible predicted nuclear power annotation entity labels matched with the fused training nuclear power text feature; Denote the score of the true nuclear power annotation entity label matched with the fused training nuclear power text feature under the given input fused training nuclear power text feature; Denote the score of all possible predicted nuclear power annotation entity labels matched with the fused training nuclear power text feature under the given input fused training nuclear power text feature.

[0280] Refer to Figure 10 , according to some embodiments of the present application, in step S109, entity classification is performed on the fused nuclear power text feature according to the nuclear power entity edge feature to obtain the target nuclear power entity category, which may include, but is not limited to:

[0281] Step S1001, perform character radical recognition on the fused nuclear power text feature to obtain the nuclear power character radical feature;

[0282] Step S1002, perform entity category recognition on the nuclear power character radical feature according to the nuclear power entity edge feature to obtain the target nuclear power entity category.

[0283] Refer to Figure 11According to some embodiments of the present application, in step S1001, character radicals are recognized on the fused nuclear power text features to obtain nuclear power character radical features, which may include, but are not limited to:

[0284] Step S1101, performing character recognition on the fused nuclear power text features to obtain target nuclear power character features;

[0285] Step S1102, performing radical recognition on the fused nuclear power text features to obtain target nuclear power radical features;

[0286] Step S1103, concatenating the target nuclear power character feature and the target nuclear power radical feature to obtain the nuclear power character radical feature.

[0287] In some embodiments of the present application, Chinese characters are composed of radicals and strokes, and radicals and strokes contain a lot of semantic information. The character-level convolutional neural network of the entity classification layer consists of two parts: the character vector of the enhanced entity and the character vector considering the radical. Different convolution kernels of the character-level convolutional neural network are used to extract different radicals or stroke information, and the radical and stroke features of the nuclear power character can be obtained. These features help to reveal the potential meaning and category attributes of the nuclear power character. In step S1001, this process includes several key operations:

[0288] In some embodiments, step S1101, specifically, performs convolution pooling processing on the fused nuclear power text features through the character vector part of the enhanced entity of the character-level convolutional neural network to convert each character stroke in the text into a numerical feature that can be processed by the model, namely, the target nuclear power character features. These features may include semantic information, grammatical information of the character strokes, and contextual information of the characters in the nuclear power text, which helps to improve the accuracy of entity category recognition subsequently.

[0289] In some embodiments, step S1102, specifically, performs convolution pooling processing on the fused nuclear power text features according to the 768-dimensional vector of Word2Vec of the Chinese dictionary through the character vector part of the radical considered by the character-level convolutional neural network to extract the radical feature information of each Chinese character, that is, the target nuclear power radical feature. These features help to reveal the potential meaning and category attributes of the characters, so as to facilitate further improvement of the accuracy of entity category recognition.

[0290] In some embodiments, step S1103, specifically, by splicing the target nuclear power character features and the target nuclear power radical features, a new feature vector containing radical and stroke information, and the nuclear power character radical features are formed, which provides richer character information for the entity classification layer, so that when performing subsequent entity category recognition tasks, the entity boundaries and category information in the nuclear power text can be more accurately captured.

[0291] Through steps S1101 to S1103 shown in the embodiments of the present application, the entity classification layer can combine the semantic information of character strokes and the semantic information of radicals to form a comprehensive feature representation, which helps to improve the accuracy and robustness of entity category recognition in nuclear power field texts by the entity classification layer.

[0292] Refer to Figure 12 , according to some embodiments of the present application, step S1002 performs entity category recognition on the nuclear power character radical features according to the nuclear power entity edge features to obtain the target nuclear power entity category, which may include, but is not limited to:

[0293] Step S1201, splice the nuclear power entity edge features and the nuclear power character radical features to obtain spliced nuclear power entity features;

[0294] Step S1202, perform entity category probability prediction on the spliced nuclear power entity features to obtain nuclear power entity category probabilities;

[0295] Step S1203, select the nuclear power entity category with the highest nuclear power entity category probability as the target nuclear power entity category.

[0296] In some embodiments of the present application, the nuclear power entity edge features provide the boundary information of entities in nuclear power texts, indicating the start and end positions of nuclear power entities in the text, providing basic positioning information for the entity classification model to identify entities, while the nuclear power character radical features provide rich semantic information for the entity classification model by identifying the radicals of each character in nuclear power texts. By performing entity category recognition on the nuclear power character radical features according to the nuclear power entity edge features, the entity classification model can more accurately identify nuclear power entities in nuclear power texts. In step S1002, this process includes several key operations:

[0297] In step S1201 of some embodiments, specifically, splicing the nuclear power entity edge features and the nuclear power character radical features is a key step, which can integrate two different types of feature information. The nuclear power entity edge features provide detailed information about the entity boundaries in the text, while the nuclear power character radical features contain the semantic information of character strokes and radicals. By splicing these two features, the entity classification model can obtain a more comprehensive nuclear power entity feature representation, which integrates the boundary information of nuclear power entities and the semantic meaning of nuclear power characters, helping to improve the effect of nuclear power entity classification subsequently.

[0298] In step S1202 of some embodiments, specifically, the entity category probability prediction of the spliced nuclear power entity features can be performed through the Model A-Softmax algorithm, that is, calculating the probability that each spliced nuclear power entity feature vector belongs to a possible entity category, so as to realize the prediction of the possibility that the spliced nuclear power entity features belong to each entity category. These probabilities reflect the confidence level of the model in different entity categories and are the basis for the model to predict entity categories.

[0299] In step S1203 of some embodiments, specifically, the entity classification model selects the category with the highest nuclear power entity category probability as the target nuclear power entity category. This decision-making process is based on probability values. Selecting the category with the highest probability means that the entity classification model believes that this category best matches the spliced nuclear power entity features. This probability-based decision-making method enables the entity classification model to select the most likely correct entity category when facing uncertainty, thereby improving the accuracy of nuclear power entity classification.

[0300] Through steps S1201 to S1203 provided by the embodiments of the present application, the target nuclear power entity category is based on the comprehensive analysis result of entity edges and character radicals. Through the entity category prediction of the spliced nuclear power entity features, the entity classification model can improve the recognition ability of nuclear power entities in the text of the nuclear power field. Moreover, the entity category prediction method combining entity edges and character radicals makes the nuclear power entity classification more accurate and reliable, which helps to improve the effect of nuclear power entity classification for the text in the nuclear power field.

[0301] Through steps S1001 to S1002 provided by the embodiments of the present application, the model can combine nuclear power character radical recognition and nuclear power entity edge features for entity category prediction, effectively solving the problem that the influence of special terms in the nuclear power field in the text related to nuclear power on the recognition performance of the entity classification model is not considered, and significantly improving the effect of nuclear power entity classification.

[0302] According to some more specific embodiments of the present application, in the nuclear power field, "氵" (water radical) is commonly used in nuclear power plants for equipment or processes involving water and other liquids, such as "cooling tower", "steam generator", "drainage system". These terms involve key operations such as cooling, evaporation, and water treatment. And the "金" radical in the nuclear power field is related to components and materials related to metals or metal materials, such as "copper", "iron", "lead", etc., which are commonly seen in discussions about reactor structural materials, shielding materials, etc. Based on the radical, nuclear power characters can be accurately assigned to the correct entity categories.

[0303] It should be noted that the embodiment of the present application first obtains the retrieved nuclear power knowledge text by performing knowledge retrieval on the target nuclear power text from the preset nuclear power knowledge base, and can enhance the learning ability of the entity classification model for the professional text in the nuclear power field by combining the professional knowledge corpus in the nuclear power field, and realizes the extraction of features containing semantic, structural, and contextual information of the nuclear power field related text based on the dual encoder by performing the first encoding and the second encoding on the target nuclear power text and the retrieved nuclear power knowledge text; secondly, by fusing the first nuclear power text feature, the second nuclear power text feature, the first retrieval knowledge text feature and the second retrieval knowledge text feature, it can realize the fusion of the text, semantic, structural and contextual information of the nuclear power field, providing rich information for subsequent entity edge detection and entity classification; finally, by performing entity edge detection on the fused nuclear power text feature, the starting and ending positions of the entity in the nuclear power text are indicated, and the entity boundary basis is provided for the entity classification of the fused nuclear power text feature, which effectively solves the problem of not considering the influence of the nuclear power field-specific terms in the nuclear power-related text on the recognition performance of the entity classification model, and significantly improves the effect of nuclear power entity classification.

[0304] Reference Figure 13 The nuclear power entity classification device according to the second embodiment of the present application may include, but is not limited to:

[0305] The knowledge retrieval module 1301 is used to obtain a target nuclear power text and perform knowledge retrieval on the target nuclear power text from a preset nuclear power knowledge base to obtain a retrieved nuclear power knowledge text;

[0306] The entity classification model acquisition module 1302 is used to acquire a pre-trained entity classification model; wherein the entity classification model includes a first text encoding layer, a second text encoding layer, a feature fusion layer, an entity edge detection layer, and an entity classification layer;

[0307] The nuclear power text first encoding module 1303 is used to perform a first encoding on the target nuclear power text using the first text encoding layer to obtain a first nuclear power text feature;

[0308] The nuclear power knowledge text first encoding module 1304 is configured to perform a first encoding on the retrieved nuclear power knowledge text using a first text encoding layer to obtain a first retrieved knowledge text feature;

[0309] The nuclear power text second encoding module 1305 is used to perform a second encoding on the target nuclear power text using the second text encoding layer to obtain a second nuclear power text feature;

[0310] The nuclear power knowledge text second encoding module 1306 is used to perform a second encoding on the retrieved nuclear power knowledge text using a second text encoding layer to obtain a second retrieved knowledge text feature;

[0311] The feature fusion module 1307 is used to fuse the first nuclear power text feature, the second nuclear power text feature, the first search knowledge text feature, and the second search knowledge text feature through a feature fusion layer to obtain a fused nuclear power text feature;

[0312] Entity edge detection module 1308, configured to perform entity edge detection on the fused nuclear power text features through an entity edge detection layer to obtain nuclear power entity edge features;

[0313] The entity classification module 1309 is used to perform entity classification on the fused nuclear power text features according to the nuclear power entity edge features in the entity classification layer to obtain the target nuclear power entity category.

[0314] It can be seen that the contents of the above-mentioned nuclear power entity classification method embodiment are all applicable to the embodiment of this nuclear power entity classification device. The functions specifically implemented by this nuclear power entity classification device embodiment are the same as those in the above-mentioned nuclear power entity classification method embodiment, and the beneficial effects achieved are also the same as those achieved by the above-mentioned nuclear power entity classification method embodiment.

[0315] Reference Figure 14 , Figure 14 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:

[0316] The processor 1401 can be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0317] The memory 1402 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1402 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program codes are stored in the memory 1402 and are called by the processor 1401 to execute the nuclear power entity classification method of the embodiments of this application.

[0318] Input / output interface 1403, used to implement information input and output;

[0319] Communication interface 1404, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, Wi-Fi, Bluetooth, etc.);

[0320] Bus 1405 , which transmits information between various components of the device (e.g., processor 1401 , memory 1402 , input / output interface 1403 , and communication interface 1404 );

[0321] The processor 1401 , the memory 1402 , the input / output interface 1403 and the communication interface 1404 are connected to each other in communication within the device via a bus 1405 .

[0322] The embodiment of the present application further provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, so that the computer device executes and implements the above-mentioned nuclear power entity classification method.

[0323] The terms "first," "second," "third," "fourth," and the like (if any) in the specification of the present disclosure and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present disclosure described herein, for example, can be implemented in orders other than those illustrated or described herein. In addition, the terms "comprises" and "comprising," and any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product, or apparatus.

[0324] It should be understood that in the present disclosure, "at least one (item)" refers to one or more, and "plurality" refers to two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can represent: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, and may include, but is not limited to, any combination of single items or plural items. For example, at least one of a, b or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0325] It should be understood that in the description of the embodiments of the present application, multiple (or multiple items) means more than two, greater than, less than, exceed, etc. are understood to exclude the number itself, and above, below, within, etc. are understood to include the number itself.

[0326] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0327] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0328] In addition, the functional units in the various embodiments of the present disclosure may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0329] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and may include, but is not limited to, a number of instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other media that can store program codes.

[0330] It should also be understood that the various implementation methods provided in the embodiments of the present application can be combined arbitrarily to achieve different technical effects.

[0331] The above is a specific description of the implementation methods of the present disclosure, but the present disclosure is not limited to the above implementation methods. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present disclosure. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present disclosure.

Claims

1. A nuclear power entity classification method, characterized in that: include: Acquire a target nuclear power text, and perform knowledge retrieval on the target nuclear power text from a preset nuclear power knowledge base to obtain a retrieved nuclear power knowledge text; Obtaining a pre-trained entity classification model; wherein the entity classification model includes a first text encoding layer, a second text encoding layer, a feature fusion layer, an entity edge detection layer and an entity classification layer; Using the first text encoding layer to perform a first encoding on the target nuclear power text to obtain a first nuclear power text feature; Using the first text encoding layer to perform a first encoding on the retrieved nuclear power knowledge text to obtain a first retrieved knowledge text feature; Performing a second encoding on the target nuclear power text using the second text encoding layer to obtain a second nuclear power text feature; Performing a second encoding on the retrieved nuclear power knowledge text using the second text encoding layer to obtain a second retrieved knowledge text feature; The first nuclear power text feature, the second nuclear power text feature, the first search knowledge text feature and the second search knowledge text feature are fused through the feature fusion layer to obtain a fused nuclear power text feature; Perform entity edge detection on the fused nuclear power text features through the entity edge detection layer to obtain nuclear power entity edge features; In the entity classification layer, the fused nuclear power text features are entity classified according to the nuclear power entity edge features to obtain the target nuclear power entity category.

2. The method according to claim 1, characterized in that The first encoding of the target nuclear power text to obtain the first nuclear power text feature includes: Segmenting the target nuclear power text to obtain target nuclear power characters; Relative position encoding is performed on the target nuclear power characters to obtain a relative position encoding table; Based on the preset character encoding table and the relative position encoding table, the target nuclear power character is subjected to character position embedding processing to obtain a nuclear power character position sequence; Performing entity marking on the target nuclear power character to obtain a nuclear power character entity; Attention processing is performed on the target nuclear electric text according to the nuclear electric character position sequence and the nuclear electric character entity to obtain the first nuclear electric text feature.

3. The method according to claim 2, characterized in that The attention processing of the target nuclear electric text according to the nuclear electric character position sequence and the nuclear electric character entity to obtain the first nuclear electric text feature includes: Extract query features of the target nuclear power text according to the nuclear power character position sequence and a preset query parameter matrix to obtain nuclear power character query features; According to the nuclear power character position sequence, the nuclear power character entity, the preset key parameter matrix and the preset entity coding table, the key feature of the target nuclear power text is extracted to obtain the nuclear power character key feature; According to the nuclear power character position sequence, the nuclear power character entity, the preset value parameter matrix and the entity coding table, the value feature of the target nuclear power text is extracted to obtain the nuclear power character value feature; The nuclear electricity character query feature, the nuclear electricity character key feature and the nuclear electricity character value feature are attention-weighted to obtain the first nuclear electricity text feature.

4. The method according to claim 1, characterized in that: The second encoding of the target nuclear power text to obtain the second nuclear power text feature includes: Converting the target nuclear power text into a nuclear power word sequence; Performing word embedding processing on the nuclear power word element sequence to obtain a nuclear power word element vector; Attention encoding is performed on the nuclear electricity word element vector to obtain the second nuclear electricity text feature.

5. The method according to claim 1, characterized in that The step of fusing the first nuclear power text feature, the second nuclear power text feature, the first search knowledge text feature, and the second search knowledge text feature to obtain a fused nuclear power text feature includes: Performing cross-attention weighted processing on the first nuclear power text feature and the second nuclear power text feature to obtain an initial fused nuclear power text feature; Splicing the initial fused nuclear power text feature and the first nuclear power text to obtain a spliced ​​nuclear power text feature; Performing cross-attention weighted processing on the first search knowledge text feature and the second search knowledge text feature to obtain an initial fused knowledge text feature; Splicing the initial fused nuclear power knowledge text features and the first nuclear power knowledge text to obtain a spliced ​​knowledge text feature; Splicing the spliced ​​nuclear power text features and the spliced ​​knowledge text features to obtain spliced ​​nuclear power knowledge text features; The concatenated nuclear power knowledge text features are linearly transformed to obtain the fused nuclear power text features.

6. The method according to claim 1, characterized in that The performing entity edge detection on the fused nuclear power text features to obtain nuclear power entity edge features includes: Performing entity annotation prediction on the fused nuclear power text features to obtain a predicted nuclear power annotation entity label; Calculating the label score of the predicted nuclear power label entity label through a preset transfer matrix and a preset emission matrix to obtain an entity label score; The real nuclear power annotation entity label of the fused nuclear power text feature is obtained, and entity edge detection is performed on the fused nuclear power text feature according to the real nuclear power annotation entity label, the predicted nuclear power annotation entity label and the entity label score to obtain the nuclear power entity edge feature.

7. The method according to claim 1, characterized in that The entity classification of the fused nuclear power text features according to the nuclear power entity edge features to obtain the target nuclear power entity category includes: Performing character radical recognition on the fused nuclear power text features to obtain nuclear power character radical features; The entity category is identified by using the nuclear power entity edge features and the nuclear power character radical features to obtain the target nuclear power entity category.

8. The method according to claim 7, characterized in that The character radical recognition is performed on the fused nuclear power text feature to obtain the nuclear power character radical feature, including: Performing character recognition on the fused nuclear power text features to obtain target nuclear power character features; Perform radical recognition on the fused nuclear power text features to obtain target nuclear power radical features; The target nuclear power character feature and the target nuclear power radical feature are concatenated to obtain the nuclear power character radical feature.

9. The method according to claim 7, characterized in that: The step of performing entity category recognition on the nuclear power character radical features according to the nuclear power entity edge features to obtain the target nuclear power entity category includes: Splicing the nuclear power entity edge feature and the nuclear power character radical feature to obtain a spliced ​​nuclear power entity feature; Performing entity category probability prediction on the spliced ​​nuclear power entity features to obtain nuclear power entity category probability; The nuclear power entity category with the highest probability is selected as the target nuclear power entity category.

10. The method according to claim 1, characterized in that The step of performing knowledge retrieval on the target nuclear power text from a preset nuclear power knowledge base to obtain the retrieved nuclear power knowledge text includes: Obtaining the index category of the target nuclear power text; Acquire candidate nuclear power knowledge texts of the nuclear power knowledge base according to the index category; The text similarity between the candidate nuclear power knowledge text and the target nuclear power text is calculated, and the candidate nuclear power knowledge text with the highest text similarity is selected as the retrieved nuclear power knowledge text.

11. The method according to claim 1, characterized in that: Before obtaining the pre-trained entity classification model, the method further includes: Obtaining the training nuclear power text and the original entity classification model, and obtaining the real entity category of the training nuclear power text; Performing a first encoding on the training nuclear electronic text through the first text encoding layer to obtain a first training nuclear electronic text feature; Performing a second encoding on the training nuclear electronic text through the second text encoding layer to obtain a second training nuclear electronic text feature; The first training nuclear power text feature and the second training nuclear power text feature are fused through the feature fusion layer to obtain a fused training nuclear power text feature; Perform entity edge detection on the fused training nuclear power text features through the entity edge detection layer to obtain training nuclear power entity edge features; In the entity classification layer, entity classification prediction is performed on the fused training nuclear power text features according to the training nuclear power entity edge features to obtain a predicted entity category; Calculating the loss values ​​of the predicted entity category and the real entity category according to a preset loss function; The model parameters of the entity classification model are updated based on the loss value, and the first encoding of the training nuclear text is returned to be performed through the first text encoding layer until the entity classification model meets the preset training conditions, thereby obtaining the pre-trained entity classification model.

12. The method according to claim 1, characterized in that The calculating the loss value of the predicted entity category and the real entity category according to a preset loss function includes: Obtaining an edge detection loss function for training edge features of nuclear power entities, and obtaining an edge loss function weight of the edge detection loss function; Obtaining a classification loss function of the predicted entity category, and obtaining a classification loss function weight of the classification loss function; The loss values ​​of the predicted entity category and the real entity category are calculated according to the edge detection loss function, the edge loss function weight, the classification loss function and the classification loss function weight.

13. A nuclear power entity classification device, characterized in that: include: A knowledge retrieval module is used to obtain a target nuclear power text and perform knowledge retrieval on the target nuclear power text from a preset nuclear power knowledge base to obtain a retrieved nuclear power knowledge text; An entity classification model acquisition module, used to acquire a pre-trained entity classification model; wherein the entity classification model includes a first text encoding layer, a second text encoding layer, a feature fusion layer, an entity edge detection layer and an entity classification layer; A first nuclear power text encoding module, used for performing a first encoding on the target nuclear power text using the first text encoding layer to obtain a first nuclear power text feature; A first nuclear power knowledge text encoding module, used for performing a first encoding on the retrieved nuclear power knowledge text using the first text encoding layer to obtain a first retrieved knowledge text feature; A second nuclear power text encoding module, used for performing a second encoding on the target nuclear power text using the second text encoding layer to obtain a second nuclear power text feature; A nuclear power knowledge text second encoding module, used for performing a second encoding on the retrieved nuclear power knowledge text using the second text encoding layer to obtain a second retrieved knowledge text feature; A feature fusion module, used for fusing the first nuclear power text feature, the second nuclear power text feature, the first search knowledge text feature and the second search knowledge text feature through the feature fusion layer to obtain a fused nuclear power text feature; An entity edge detection module, used for performing entity edge detection on the fused nuclear power text features through the entity edge detection layer to obtain nuclear power entity edge features; The entity classification module is used to perform entity classification on the fused nuclear power text features according to the nuclear power entity edge features in the entity classification layer to obtain the target nuclear power entity category.

14. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program, and the processor implements the nuclear power entity classification method as described in any one of claims 1 to 12 when executing the computer program.

15. A computer-readable storage medium, characterized in that: The storage medium stores a program, and the program is executed by a processor to implement the nuclear power entity classification method as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Text processing method and device, model training method and device, computer equipment and storage medium

    CN112084331A

  • Text processing method and device, electronic equipment and storage medium

    CN114064894A

  • Named entity identification method and device, equipment and medium

    CN114139541A

  • Task execution method and device based on constructed nuclear fusion knowledge graph

    CN117494800A

  • False news detection method and device

    CN118820485A