A method for cattle breeding named entity recognition based on LERT multi-feature fusion

By constructing a multi-dimensional corpus and combining deep learning models with LERT, BiLSTM, IDCNN, and scaled dot product multi-head attention mechanisms, the problem of scarce corpus resources in the cattle breeding field is solved, the accuracy and recall rate of named entity recognition are improved, and intelligent breeding management is supported.

CN122113922APending Publication Date: 2026-05-29AGRI INFORMATION INST OF CHINESE ACAD OF AGRI SCI

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
AGRI INFORMATION INST OF CHINESE ACAD OF AGRI SCI
Filing Date
2026-02-25
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

The lack of high-quality named entity recognition corpus resources in the cattle breeding sector leads to a lack of scientific and standardized breeding management, affecting the level of health monitoring and management.

Method used

A multi-dimensional corpus was constructed, and a deep learning named entity recognition model with multi-feature fusion was established by combining the LERT pre-trained language model with BiLSTM and IDCNN, introducing a scaled dot product multi-head attention mechanism, and optimizing the label sequence through the CRF layer.

Benefits of technology

It improves the accuracy and recall rate of named entity recognition in cattle farming, enriches the corpus, provides key support for the construction of a knowledge graph for healthy cattle farming, and promotes the development of intelligent farming management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122113922A_ABST
    Figure CN122113922A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on LERT multi-feature fusion's cattle breeding named entity recognition method, it is related to cattle breeding field, including: collecting cattle breeding text data and pre-processing, data annotation is carried out and training corpus is constructed;The named entity recognition model based on LERT multi-feature fusion is constructed, and the corpus in training corpus is used to train model;The breeding text data to be identified is acquired, and the named entity recognition model trained is used to identify, and is added to cattle breeding named entity corpus.The application enriches the Chinese named entity recognition corpus in the field of cattle breeding, provides a new method with high precision for cattle breeding NER, provides key support for the construction of cattle health breeding knowledge graph, and is conducive to promoting the development of intelligent breeding management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cattle breeding technology, and more specifically to a named entity recognition method for cattle breeding based on LERT multi-feature fusion. Background Technology

[0002] With the expansion of breeding scale and the increase in the degree of production intensification, the challenges faced by healthy breeding of beef and dairy cattle are becoming increasingly prominent, and cattle breeding knowledge is an important foundation for intelligent decision-making on farms.

[0003] However, current professional knowledge on cattle breeding is mainly scattered in books, documents and related materials. The content is fragmented, the structure is complex, and there is a lack of systematic organization. There is a lack of Chinese textual data in the field of cattle breeding, especially a lack of high-quality named entity recognition (NER) data resources. This restricts the scientific and standardized management of breeding and seriously affects the improvement of cattle health monitoring, diagnosis and management.

[0004] Therefore, how to enrich the corpus resources for cattle breeding and provide technical support for scientific breeding management is an urgent problem that needs to be solved by those in the field. Summary of the Invention

[0005] In view of this, this invention provides a named entity recognition method for cattle farming based on LERT multi-feature fusion. First, a corpus covering multiple dimensions such as "farming environment—disease prevention—feed and water" is constructed to address the problems of scarce data resources, complex entity types, frequent proprietary entities, and numerous nested entities in farming texts. Then, LERT is selected as the pre-trained language model foundation in the model design to support Chinese tasks and capture the semantic context of long texts. Simultaneously, linguistic knowledge is explicitly introduced during the encoding process to enhance the ability to model complex semantics. In the feature extraction stage, a bidirectional long short-term memory network (BiLSTM) and an attenuated convolutional network (IDCNN) are jointly employed to ensure both global modeling of long sequences and extraction of local contextual features. Furthermore, a scaled dot product multi-head attention mechanism is introduced to improve the perception of long-distance dependencies and the accuracy of entity boundary and category recognition. Thus, a multi-feature fusion deep learning named entity recognition model is established, providing key support for the construction of a knowledge graph for healthy cattle farming and promoting the development of intelligent farming management.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: This invention discloses a named entity recognition method for cattle farming based on LERT multi-feature fusion, comprising: Collect and preprocess textual data on cattle breeding, annotate the data, and build a training corpus; A named entity recognition model based on LERT multi-feature fusion is constructed, and the model is trained using the corpus in the training corpus. The text data on livestock farming to be identified is obtained, and the trained named entity recognition model is used to identify it and add it to the cattle farming named entity corpus.

[0007] Preferably, the collection and preprocessing of cattle breeding text data specifically includes: Acquire several physical and / or electronic books on cattle breeding, collect the text content from the books using optical character recognition technology, convert the text format to obtain text data in a unified format, and then remove typos, garbled characters, and special symbols from the text data, as well as perform sentence segmentation on long texts.

[0008] Preferably, the step of data annotation and construction of a training corpus specifically includes: The preprocessed text data was labeled using the Docano annotation tool. The BIO three-segment sequence labeling method was used during the labeling process. The starting position of an entity was marked as B-entity label, the continuous part outside the starting position was marked as I-entity label, and the remaining non-entity parts were marked as O-entity label. After the data was labeled, fine-grained division was performed to classify the entities into 17 categories.

[0009] Preferably, the named entity recognition model based on LERT multi-feature fusion includes: a vector representation layer, a feature extraction layer, a feature fusion layer, and a prediction layer; The vector representation layer introduces the LERT model to convert the input text sequence into a vector representation; the feature extraction layer introduces the BILSTM and IDCNN models to extract features from the vectors output by the LERT model; the feature fusion layer introduces a multi-head attention mechanism to fuse the features extracted by the BILSTM and IDCNN models; and the prediction layer introduces the CRF model to determine the final output result based on the fused feature sequence.

[0010] Preferably, the BILSTM model captures local dependencies and position-sensitive features of the input through a bidirectional structure of forward and backward LSTM units. The forward propagation formula of the LSTM unit is as follows: ; ; ; ; ; ; in, To update the output of the Forgot Gate, It is the sigmoid activation function. Here is the weight matrix for the forget gate. for The hidden state before the moment, for Input at any time For the bias term of the forget gate; To update the output after the input gate, Here is the weight matrix of the input gate. This is the bias term for the input gate; For the candidate set, This is the weight matrix for the candidate cell states. This is a bias term for the candidate cell state; This represents the updated cell state. for The state of candidate cells at any given time; For the output gate of LSTM, This is the weight matrix of the output gate. This is the bias term for the output gate; Output the final hidden state; The IDCNN model uses dilated convolutions to gradually expand the receptive field without increasing computational cost, capturing long-distance dependencies and cross-entity contextual relationship features.

[0011] Preferably, the multi-head attention mechanism is a scaled dot product multi-head self-attention mechanism, which projects the query, key, and value vectors to multiple independent linear transformations. Subspaces, parallel computation attention formation Each attention head is assigned an attention head, and the outputs of each head are concatenated and integrated into a final representation through a fully connected layer. The calculation formula for a single attention head is: ; The output formula of the multi-head self-attention mechanism is: ; in, The output of the i-th attention head For activation function, , and These are the query vector, key vector, and value vector, respectively. , and These are the corresponding weight matrices; This serves as the identifier for the real number matrix space; For learnable parameters, and It is the space of real numbers.

[0012] Preferably, the CRF model is applicable to each input feature sequence. Each will generate a corresponding tag sequence. The score is then calculated to determine the final output. The formula for calculating the score is: ; in, The score representing the tag transfer. Representing the Each character is predicted as a label. The score value, This represents the total number of characters.

[0013] Preferably, the specific parameters during model training are as follows: The LERT word vector dimension is 768, the maximum length of the input sequence is 128, and the initial learning rate is set to... The training epochs are 40, the batch size is 32, the random kill rate is 0.4, and the learning rate decay coefficient is [missing value]. The gradient pruning threshold is set to 5, and the optimizer used is Adam.

[0014] Preferably, after the model is trained, the micro-mean value is used as the evaluation index for model performance, and the calculation formula is as follows: ; ; ; in, Indicates the micro-average precision. This represents the micro average recall rate. This represents the differential average F1 value. For category indexing, For sample index, Entity Category Positive samples that are predicted to be positive For entity category Negative samples that are predicted to be positive. For entity category Positive samples predicted as negative.

[0015] As can be seen from the above technical solution, compared with the prior art, this invention provides a named entity recognition method for cattle breeding based on LERT multi-feature fusion. It uses LERT as the foundation of a pre-trained language model and combines BiLSTM and IDCNN for feature vector extraction. Simultaneously, it introduces a scaled dot product multi-head attention mechanism to enhance the model's ability to capture long-distance dependencies and improve the accuracy of entity boundary segmentation and category discrimination. Finally, it optimizes the label sequence through a CRF layer, enabling the model to achieve excellent performance in precision, recall, and F1 score. This invention enriches the Chinese named entity recognition corpus in the field of cattle breeding, provides a new high-precision method for cattle breeding NER, provides key support for the construction of a knowledge graph for healthy cattle breeding, and is conducive to promoting the development of intelligent breeding management. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0017] Figure 1 This is a schematic diagram of the overall process of the present invention.

[0018] Figure 2 This is a schematic diagram of the model framework provided by the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] This invention discloses a named entity recognition method for cattle farming based on LERT multi-feature fusion, such as... Figure 1 As shown, it includes: Collect and preprocess textual data on cattle breeding, annotate the data, and build a training corpus; A named entity recognition model based on LERT multi-feature fusion was constructed, and the model was trained using the corpus in the training corpus. The text data on livestock farming to be identified is obtained, and the trained named entity recognition model is used to identify it and add it to the cattle farming named entity corpus.

[0021] In one specific embodiment, collecting and preprocessing textual data on cattle farming includes: Acquire several physical and / or electronic books on cattle breeding, collect the text content from the books using optical character recognition technology, convert the text format to obtain uniformly formatted text data, and remove typos, garbled characters, and special symbols from the text data, as well as perform sentence segmentation on long texts.

[0022] Specifically, the data primarily comes from unstructured text in agricultural academic service platforms, relevant research literature, and professional books on healthy cattle breeding. Based on recommendations from cattle breeding experts, several representative books on cattle breeding were selected, searched and downloaded from e-book websites in PDF format. Several high-quality academic papers on cattle breeding were also downloaded from research literature websites (such as CNKI). The text content from the books was then collected and processed using Optical Character Recognition (OCR) technology. Additionally, domestic professional websites were selected as supplementary data. After merging the data, the text format was converted. Since the initial corpus generally contains noise and non-standard expressions, directly using it would affect the model training effect. Therefore, operations such as correcting typos, garbled characters, and other special symbols in the text data, removing invalid data, and segmenting long texts were performed to ensure the corpus's standardization in language expression and effectiveness in semantic content.

[0023] In one specific embodiment, data annotation and construction of a training corpus include: Under the guidance of experts in the field of cattle breeding, and combining the characteristics of text corpora on healthy cattle breeding, potential knowledge was systematically mined. The preprocessed text data was then annotated using the Doccano annotation tool. The BIO three-stage sequence annotation method was employed: the starting position of an entity was marked as B-entity label, the continuous portion beyond the starting position was marked as I-entity label, and the remaining non-entity portions were marked as O-entity label. After data annotation, fine-grained segmentation was performed, classifying entities into 17 categories, as shown in Table 1. The number of entities varies across different categories; therefore, comprehensive coverage and accurate annotation should be achieved during data construction. Ultimately, the corpus annotated 4531 text data entries, accumulating 14599 annotated entities, thus providing high-quality data support for subsequent model training and evaluation.

[0024] Table 1. Entity Categories in the Cattle Health Farming Sector

[0025] In a specific embodiment, such as Figure 2 As shown, the named entity recognition model based on LERT multi-feature fusion includes: a vector representation layer, a feature extraction layer, a feature fusion layer, and a prediction layer; Figure 2In the diagram, Scaled Dot-Product Multi-Head Attention represents the feature fusion layer of the multi-head self-attention mechanism; B represents the starting position of an entity, I represents the middle or ending position of an entity, O represents that the character does not belong to any entity, B-DIS represents the starting point of disease symptom entities, and B-ALI represents the starting point of disease alias entities.

[0026] The vector representation layer introduces the LERT model to convert the input text sequence into a vector representation; the feature extraction layer introduces the BILSTM and IDCNN models to extract features from the vectors output by the LERT model; the feature fusion layer introduces a multi-head attention mechanism to fuse the features extracted by the BILSTM and IDCNN models; and the prediction layer introduces the CRF model to determine the final output result based on the fused feature sequence.

[0027] The Named Entity Recognition (L-BISC) model, based on LERT multi-feature fusion, uses LERT as a pre-trained language model, which is well-suited to the characteristics of Chinese corpora and effectively captures contextual dependencies in long texts. For feature extraction, Bidirectional Long Short-Term Memory (BiLSTM) networks have the advantage of modeling global dependencies, while Dilated Convolutional Neural Networks (IDCNN) excel in parallel computation and local pattern extraction. The combined use of these two technologies enhances the expressive power of sequence features while addressing both local and global semantic modeling needs. To further enhance the model's ability to perceive long-distance dependencies and entity boundaries, the framework introduces a Scaled Dot Product Multi-Head Attention (SDPMHA) mechanism. This mechanism weights and integrates semantic information from different locations and captures various semantic relationships through multi-head parallel computation, thereby achieving dynamic feature fusion and improving the accuracy of boundary discrimination. Finally, CRF is used for global optimization of the predicted label sequence to ensure consistency and reasonableness of the results.

[0028] In a specific embodiment, the BILSTM model captures local dependencies and position-sensitive features of the input through a bidirectional structure of forward and backward LSTM units. The forward propagation formula of the LSTM unit is as follows: ; ; ; ; ; ; in, To update the output of the Forgot Gate, It is the sigmoid activation function. Here is the weight matrix for the forget gate. for The hidden state before the moment, for Input at any time For the bias term of the forget gate; To update the output after the input gate, Here is the weight matrix of the input gate. This is the bias term for the input gate; For the candidate set, This is the weight matrix for the candidate cell states. This is a bias term for the candidate cell state; This represents the updated cell state. for The state of candidate cells at any given time; For the output gate of LSTM, This is the weight matrix of the output gate. This is the bias term for the output gate; Output the final hidden state; The IDCNN model uses dilated convolutions to progressively expand the receptive field without increasing computational cost, capturing long-distance dependencies and contextual relationship features across entities.

[0029] Specifically, although LERT's Transformer-based self-attention mechanism can effectively capture global contextual features, its relative positional encoding still has certain limitations in fine-grained sequence modeling. BiLSTM, relying on the bidirectional structure of forward and backward LSTM units, can comprehensively model contextual information and effectively capture the local dependencies and position-sensitive features of text, thus supplementing LERT's shortcomings in sequence modeling.

[0030] Text corpora related to cattle farming are often semantically complex, and relying solely on a single BiLSTM model is insufficient to fully capture global features. Therefore, this invention introduces IDCNN, which employs dilated convolutions (also known as attenuated convolutions) in its convolutional operations to progressively expand the receptive field without increasing computational cost, thereby effectively capturing long-distance dependencies and cross-entity contextual relationships. Compared to traditional CNNs, IDCNN not only boasts higher computational efficiency but also avoids the overfitting problem common in deep convolutions through multiple dilated convolution operations, enabling the model to perceive a wider range of contextual information.

[0031] The joint design of BiLSTM and IDCNN enables complementary modeling of local sequential features and global contextual dependencies. BiLSTM enhances the perception of location information and temporal relationships, while IDCNN strengthens the modeling of global semantics and cross-entity dependencies. Together, they compensate for the shortcomings of the LERT model in modeling relative position and sequence order, making the model perform better in named entity recognition tasks in the field of healthy cattle farming.

[0032] In one specific embodiment, the multi-head attention mechanism is a scaled dot product multi-head self-attention mechanism, which projects the query, key, and value vectors to multiple independent linear transformations. Subspaces, parallel computation attention formation Each attention head is assigned an attention head, and the outputs of each head are concatenated and integrated into a final representation through a fully connected layer. The calculation formula for a single attention head is: ; The output formula of the multi-head self-attention mechanism is: ; in, The output of the i-th attention head For activation function, , and These are the query vector, key vector, and value vector, respectively. , and These are the corresponding weight matrices; This serves as the identifier for the real number matrix space; For learnable parameters, and It is the space of real numbers.

[0033] Specifically, the Scaled Dot Product Multi-Head Self-Attention (SDPMHA) mechanism has advantages in computational efficiency and stability. It quickly calculates the correlation between query, key, and value vectors through dot product operations and introduces a scaling factor to avoid gradient instability caused by excessively large dot products of high-dimensional vectors. Simultaneously, the multi-head structure can learn sequence features in parallel across different representation subspaces, thus capturing semantic associations more comprehensively. This invention introduces SDPMHA on top of the BiLSTM and IDCNN dual-channel feature extraction layers to fully integrate the two types of features and model global dependencies, ensuring both computational efficiency and improving the model's performance in long-distance semantic modeling and feature representation.

[0034] In one specific embodiment, Conditional Random Fields (CRFs) are sequence labeling models, particularly suitable for tasks such as word segmentation and named entity recognition. Unlike classification methods that rely solely on local predictions, CRFs effectively capture global dependencies between labels in a sequence by modeling transition probabilities, thus ensuring global consistency and optimality of the labeling results. This invention utilizes a multi-head self-attention mechanism to extract sequence features, and then introduces a CRF layer to impose conditional constraints on them to achieve the decoding of the optimal label sequence. The CRF model, for each input feature sequence... Each will generate a corresponding tag sequence. The score is then calculated to determine the final output. The formula for calculating the score is: ; in, The score representing the tag transfer. Representing the Each character is predicted as a label. The score value, This represents the total number of characters.

[0035] In one specific embodiment, the computer hardware environment used for model training included an Intel i7-13650HX processor, an NVIDIA RTX 4070 graphics card, and 32GB of RAM. The software environment used in the experiment included Python 3.8 and PyTorch framework version 1.7.1+cu110. Specific parameters during model training are as follows: The LERT word vector dimension is 768, the maximum length of the input sequence is 128, and the initial learning rate is set to... The training epochs are 40, the batch size is 32, the random kill rate is 0.4, and the learning rate decay coefficient is [missing value]. The gradient pruning threshold is set to 5, and the optimizer used is Adam.

[0036] The effectiveness of the L-BISC model on the dataset was verified through model comparison experiments. The evaluation index results of different model training are shown in Table 2.

[0037] Table 2 Training results of different models

[0038] In model comparison experiments, the traditional BiLSTM-CRF showed relatively limited performance on specialized texts, while the overall performance significantly improved after incorporating the BERT pre-trained model. Building upon this, integrating bidirectional LSTM encoding into the BERT-CRF structure improved Precision, Recall, and F1 scores by 3.00%, 2.84%, and 2.82%, respectively, demonstrating the crucial role of deep encoding of sequence features in enhancing the model's feature representation capabilities. Further introduction of the IDCNN layer further improved model performance. IDCNN, through the concatenation of multiple dilated convolutions, effectively enhanced the extraction of local pattern features, achieving more accurate entity recognition in complex text environments. In comparisons of different pre-trained language models, the experimental results of BERT-CRF, RoBERTa-CRF, and LERT-CRF show that LERT outperforms BERT due to the incorporation of Chinese language features. Meanwhile, RoBERTa exhibits stronger general contextual representation capabilities within the basic CRF framework. However, when the model is further combined with BiLSTM, IDCNN and Scaled Dot Product Multi-Head Attention (SDPA), LERT’s Chinese contextual advantages are fully utilized, especially in semantic capture of long texts and long entities, outperforming RoBERTa.

[0039] In one specific embodiment, after model training, the micro-mean value is used as an evaluation metric for model performance, and the calculation formula is as follows: ; ; ; in, Indicates the micro-average precision. This represents the micro average recall rate. This represents the differential average F1 value. For category indexing, For sample index, Entity Category Positive samples that are predicted to be positive For entity category Negative samples that are predicted to be positive. For entity category Positive samples predicted as negative.

[0040] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0041] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A named entity recognition method for cattle farming based on LERT multi-feature fusion, characterized in that, include: Collect and preprocess textual data on cattle breeding, annotate the data, and build a training corpus; A named entity recognition model based on LERT multi-feature fusion is constructed, and the model is trained using the corpus in the training corpus. The text data on livestock farming to be identified is obtained, and the trained named entity recognition model is used to identify it and add it to the cattle farming named entity corpus.

2. The method for named entity recognition in cattle farming based on LERT multi-feature fusion according to claim 1, characterized in that, The collection and preprocessing of textual data on cattle farming specifically includes: Acquire several physical and / or electronic books on cattle breeding, collect the text content from the books using optical character recognition technology, convert the text format to obtain text data in a unified format, and then remove typos, garbled characters, and special symbols from the text data, as well as perform sentence segmentation on long texts.

3. The method for named entity recognition in cattle farming based on LERT multi-feature fusion according to claim 1, characterized in that, The process of data annotation and construction of a training corpus specifically includes: The preprocessed text data was labeled using the Docano annotation tool. The BIO three-segment sequence labeling method was used during the labeling process. The starting position of an entity was marked as B-entity label, the continuous part outside the starting position was marked as I-entity label, and the remaining non-entity parts were marked as O-entity label. After the data was labeled, fine-grained division was performed to classify the entities into 17 categories.

4. The method for named entity recognition in cattle farming based on LERT multi-feature fusion according to claim 1, characterized in that, The named entity recognition model based on LERT multi-feature fusion includes: a vector representation layer, a feature extraction layer, a feature fusion layer, and a prediction layer; The vector representation layer introduces the LERT model to convert the input text sequence into a vector representation; the feature extraction layer introduces the BILSTM and IDCNN models to extract features from the vectors output by the LERT model; the feature fusion layer introduces a multi-head attention mechanism to fuse the features extracted by the BILSTM and IDCNN models; and the prediction layer introduces the CRF model to determine the final output result based on the fused feature sequence.

5. The method for named entity recognition in cattle farming based on LERT multi-feature fusion according to claim 4, characterized in that, The BILSTM model captures local dependencies and position-sensitive features of the input through a bidirectional structure of forward and backward LSTM units. The forward propagation formula of the LSTM unit is as follows: ; ; ; ; ; ; in, To update the output of the Forgot Gate, It is the sigmoid activation function. Here is the weight matrix for the forget gate. for The hidden state before the moment, for Input at any time For the bias term of the forget gate; To update the output after the input gate, Here is the weight matrix of the input gate. This is the bias term for the input gate; For the candidate set, This is the weight matrix for the candidate cell states. This is a bias term for the candidate cell state; This represents the updated cell state. for The state of candidate cells at any given time; For the output gate of LSTM, This is the weight matrix of the output gate. This is the bias term for the output gate; Output the final hidden state; The IDCNN model uses dilated convolutions to gradually expand the receptive field without increasing computational cost, capturing long-distance dependencies and cross-entity contextual relationship features.

6. The method for named entity recognition in cattle farming based on LERT multi-feature fusion according to claim 4, characterized in that, The multi-head attention mechanism is a scaled dot product multi-head self-attention mechanism, which projects the query, key, and value vectors onto multiple independent linear transformations. Subspaces, parallel computation attention formation Each attention head is assigned an attention head, and the outputs of each head are concatenated and integrated into a final representation through a fully connected layer. The calculation formula for a single attention head is: ; The output formula of the multi-head self-attention mechanism is: ; in, The output of the i-th attention head For activation function, , and These are the query vector, key vector, and value vector, respectively. , and These are the corresponding weight matrices; This serves as the identifier for the real number matrix space; For learnable parameters, and It is the space of real numbers.

7. The method for named entity recognition in cattle farming based on LERT multi-feature fusion according to claim 4, characterized in that, The CRF model takes each input feature sequence as an example. Each will generate a corresponding tag sequence. The score is then calculated to determine the final output. The formula for calculating the score is: ; in, The score representing the tag transfer. Representing the Each character is predicted as a label. The score value, This represents the total number of characters.

8. The method for named entity recognition in cattle farming based on LERT multi-feature fusion according to claim 1, characterized in that, The specific parameters during model training are as follows: The LERT word vector dimension is 768, the maximum length of the input sequence is 128, and the initial learning rate is set to... The training epochs are 40, the batch size is 32, the random kill rate is 0.4, and the learning rate decay coefficient is [missing value]. The gradient pruning threshold is set to 5, and the optimizer used is Adam.

9. The method for named entity recognition in cattle farming based on LERT multi-feature fusion according to claim 1, characterized in that, After the model is trained, the micro-mean value is used as the evaluation metric for model performance, and the calculation formula is as follows: ; ; ; in, Indicates the micro-average precision. This represents the micro average recall rate. This represents the differential average F1 value. For category indexing, For sample index, Entity Category Positive samples that are predicted to be positive For entity category Negative samples that are predicted to be positive. For entity category Positive samples predicted as negative.