Cross-domain chinese named entity recognition method and system applied to forest field
By constructing dictionaries for the agricultural and forestry domains, and performing sentence concatenation, vectorization, and multi-task learning, the problem of poor Chinese named entity recognition performance in the forestry domain was solved, achieving efficient cross-domain knowledge transfer and named entity recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG UNIV OF TECH
- Filing Date
- 2023-02-15
- Publication Date
- 2026-04-21
AI Technical Summary
Existing cross-domain named entity recognition technologies cannot be effectively applied to the forestry field, resulting in poor performance of Chinese named entity recognition. This is mainly due to the lack of large-scale labeled corpora and professional knowledge required in the forestry field. Existing technologies ignore the influence of the source domain's unique named entity semantics on the target domain.
We construct Chinese agricultural and forestry domain dictionaries in key-value pair form. By splicing the latent word set at the end of the sentence, we perform vectorization and positional encoding. Combined with context feature extraction and entity boundary recognition models, we utilize a cross-domain named entity recognition model based on multi-task learning to transfer knowledge from the agricultural domain to the forestry domain and integrate entity boundary information to limit the influence of the source domain.
Without relying on a large amount of high-quality forestry domain labeled corpus, it significantly improves the performance of Chinese named entity recognition in the forestry domain, enhances the degree of semantic extraction, and alleviates the phenomenon of knowledge forgetting.
Smart Images

Figure CN116341547B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing, and more specifically, to a cross-domain Chinese named entity recognition method and system applied to the field of forestry. Background Technology
[0002] In the context of my country's rapid development in the information technology industry, information extraction technology can effectively realize the systematic and integrated operation and development of China's forestry production and creation. Accelerating the informatization process of forestry is of significant practical importance for promoting the economic development of forestry in the new era, increasing the income of forest farmers, enhancing the competitiveness of forestry products, and coordinating urban and rural economic development. Information extraction technology can permeate all aspects of the forestry field, such as data mining of forestry texts to explore valuable forestry information. The timber sector, as an important area of forestry, has a wealth of textual data; however, due to a lack of informatization processing, this data is difficult to utilize effectively. Applying information extraction technology to the timber sector is of great significance to the development of the forestry industry.
[0003] Named entity recognition (NER) is a fundamental task in information extraction, aiming to automatically identify desired entities from unstructured text and label them as predefined categories, such as names of people, places, and organizations. This task was first proposed at the 6th MUC conference in 1995. Currently, much research focuses on extracting named entities from English text. For example, Huang et al. extracted named entities by fusing English spelling features and contextual features into a Long Short-Term Memory (LSTM) neural network and a Conditional Random Field (CRF); Ma et al. extracted English named entities by fusing character-level and word-level features from English text using convolutional neural networks and LSM, respectively. Significant progress has been made in named entity extraction models for English text, but the development of Chinese named entity recognition models remains slow. Compared to English named entity recognition models, English sentences have spaces as natural separators between words, and English words have features such as roots and affixes; however, Chinese text lacks obvious separators, making it difficult to determine the boundaries of Chinese named entities. To address the aforementioned challenges, existing mainstream Chinese named entity recognition models employ end-to-end sequence labeling based on characters. However, these models rely on a certain scale of annotated Chinese corpora, identifying named entities by assigning specific labels to each Chinese character. However, existing large-scale annotated Chinese corpora are mainly concentrated in general, medical, and agricultural fields, while large-scale annotated Chinese corpora in the forestry field are relatively scarce. The effectiveness of these models heavily depends on a large amount of high-quality annotated data. Annotating a large amount of high-quality data requires significant human resources, and compared to general fields, annotating the same amount of high-quality forestry data requires strong forestry expertise, consuming even more resources and presenting greater challenges.
[0004] To address the decline in named entity recognition (NER) performance due to the scarcity of forest tree annotation data, a promising approach is to apply NER knowledge learned from high-resource domains to low-resource domains, a concept known as cross-domain NER. Current cross-domain NER models primarily focus on news, healthcare, and social media. For example, Jia et al. trained language models using large amounts of unlabeled news and healthcare texts, respectively, and designed parameter generation networks to achieve cross-domain and cross-task knowledge transfer. He and Sun used social media as the source domain and a general domain as the target domain, training multiple NER models with shared parameters using their labeled corpora, and adjusting the learning rate of sentences based on the similarity between source and target domain sentences during training. Lee et al. first trained an NER model using labeled medical corpora, then fine-tuned the model using a small amount of labeled biomedical corpora. In summary, while cross-domain named entity recognition (NAME) technology has seen some research, primarily focusing on fields such as news, healthcare, and social media, Chinese descriptive texts in the agricultural and forestry fields are quite long. Directly extracting semantic information from characters and words can lead to knowledge loss or insufficient semantic extraction. Furthermore, existing technologies ignore the impact of name entity semantics specific to the source domain on the performance of Chinese entity recognition in the target domain. Since Chinese descriptive texts in the forestry field are highly specialized, knowledge transfer during cross-domain NAME recognition can negatively affect the performance of Chinese NAME recognition in the forestry field. Therefore, existing cross-domain NAME recognition technologies cannot be directly applied to cross-domain Chinese NAME recognition in the forestry field.
[0005] Existing technology discloses a named entity recognition method based on multi-task learning, comprising: generating a main task and one or more sub-tasks based on the original task of named entity recognition, wherein the main task is consistent with the original task, and the sub-tasks are tasks that assist in realizing the main task; inputting training text into a named entity recognition network model to train the named entity recognition network model, wherein the named entity recognition network model includes at least a main task network and a sub-task network, the sub-task network is used to execute the sub-tasks and output sub-task prediction information to the main task network, the main task network combines the sub-task prediction information to execute the main task, and outputs the main task prediction result; inputting the text to be recognized into the named entity recognition network model, and determining the recognition result based on the output of the main task network. This method is applied to the news field, but when used in the forestry field where the text has a high degree of specialization, the Chinese named entity recognition performance is poor. Summary of the Invention
[0006] To overcome the shortcomings of the existing technology in the field of forestry, which has poor Chinese named entity recognition performance, this invention provides a cross-domain Chinese named entity recognition method and system for the forestry field, which effectively improves the Chinese named entity recognition performance in the forestry field.
[0007] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:
[0008] This invention provides a cross-domain Chinese named entity recognition method applied to the forestry field, comprising:
[0009] S1: Construct a Chinese dictionary for the agricultural field and a Chinese dictionary for the forestry field in key-value pair format;
[0010] S2: Obtain the original sentence in the agricultural field, search for the potential word set in the Chinese agricultural field dictionary, and append the potential word set to the end of the original sentence in the agricultural field to obtain the concatenated sentence in the agricultural field; Obtain the original sentence in the forestry field, search for the potential word set in the Chinese forestry field dictionary, and append the potential word set to the end of the original sentence in the forestry field to obtain the concatenated sentence in the forestry field.
[0011] S3: Perform vectorization and position encoding on the concatenated sentences in the agricultural domain and the concatenated sentences in the forestry domain respectively to obtain the concatenated vectors in the agricultural domain and the concatenated vectors in the forestry domain;
[0012] S4: Input the spliced vectors from the agricultural domain and the forestry domain into the constructed context feature extraction model to obtain the context feature vectors from the agricultural domain and the forestry domain;
[0013] S5: Input the context feature vectors of the agricultural domain and the forestry domain into the constructed entity boundary recognition model to obtain the entity boundary information feature vector of the agricultural domain-forestry domain.
[0014] S6: Input the context feature vectors of the agricultural domain, the context feature vectors of the forestry domain, and the entity boundary information feature vectors of the agricultural domain and the forestry domain into the constructed multi-task cross-domain named entity recognition model to obtain the named entity label sequence of the agricultural domain and the named entity label sequence of the forestry domain.
[0015] Since the descriptive texts in the agricultural and forestry fields are highly similar, both containing descriptive information such as family, genus, species, name, distribution area, and characteristics, and there is a large amount of Chinese named entity recognition corpus in the agricultural field, we will take the agricultural field as the source field and the forestry field as the target field, and transfer the named entity recognition knowledge in the agricultural field to the forestry field.
[0016] Preferably, step S1 is specifically a method as follows:
[0017] Using existing agricultural and forestry terminology databases, a standardized Chinese dictionary for agriculture and a standardized Chinese dictionary for forestry are constructed. The agricultural dictionary includes standardized Chinese terms related to agriculture, and the forestry dictionary includes standardized Chinese terms related to forestry. Then, national and industry standards are used to supplement the standardized Chinese dictionaries for agriculture and forestry with synonyms and variants, forming key-value pairs. The keys are standardized Chinese terms related to agriculture or forestry, and the values are supplementary lists of synonyms and / or variants for those terms.
[0018] Preferably, step S3 is specifically a method as follows:
[0019] S3.1: Vectorize the sentences concatenated in the agricultural field and the forestry field respectively to obtain the content vectors of the sentences concatenated in the agricultural field and the forestry field.
[0020] S3.2: Perform position encoding on the concatenated sentences in the agricultural field and the concatenated sentences in the forestry field respectively, and then perform vectorization processing to obtain the position encoding vectors of the concatenated sentences in the agricultural field and the concatenated sentences in the forestry field.
[0021] S3.3: Concatenate the sentence content vector of the agricultural domain with the sentence position encoding vector of the agricultural domain to obtain the concatenated vector of the agricultural domain; concatenate the sentence content vector of the forestry domain with the sentence position encoding vector of the forestry domain to obtain the concatenated vector of the forestry domain.
[0022] Preferably, in step S3.1, the specific method for obtaining the content vectors of the concatenated sentences in the agricultural field and the forestry field is as follows:
[0023] The first Sentences pieced together from the agricultural field are denoted as follows: The set of sentences in the agricultural field is as follows: ; will the first The sentence composed of elements from the forestry sector is denoted as: The set of sentences in the forestry field is as follows: Vectorization was performed on the sets of concatenated sentences from the agricultural and forestry fields.
[0024]
[0025]
[0026] In the formula, This represents a set of concatenated sentence content vectors in the agricultural field. , Indicates the first A vector of sentence content from various agricultural fields; This represents a set of concatenated sentence content vectors representing the forest domain. , Indicates the first A vector of sentence content spliced from each forestry domain; Represents a word vector mapping table.
[0027] Preferably, in step S3.2, the specific method for obtaining the positional encoding vectors of the concatenated sentences in the agricultural field and the forestry field is as follows:
[0028] Assign a positional code to each word in a sentence constructed from agricultural or forestry data. Each positional code consists of a start and an end, with the start and end values being equal for each word. The start value of each word is the start value corresponding to the first character of the word, and the end value of each word is the end value corresponding to the last character of the word. For the first word... The positional encoding of sentences concatenated from the agricultural field is vectorized:
[0029]
[0030]
[0031]
[0032] In the formula, Indicates the first The character is relative to the first The distance between individual words or potential words, Indicates the first The starting position encoding of each character, Indicates the first Encoding the end position of a single character or potential word; Indicates the first The character is relative to the first Positional encoding of individual characters or potential words; Indicates the first A concatenated sentence position encoding vector for agricultural fields;
[0033] The same processing is applied to all concatenated sentences in the agricultural and forestry domains to obtain positional encoding vectors for the agricultural and forestry domains, which are then combined to form a set of positional encoding vectors for the agricultural domain. Forestry domain concatenated sentence position encoding vector set .
[0034] Preferably, in step S4, the context feature extraction model is: Feature extraction model; inputting the concatenated vectors from the agricultural domain and the forestry domain. In the feature extraction model, contextual feature vectors for the agricultural domain and the forestry domain are obtained:
[0035]
[0036]
[0037] In the formula, This represents a set of contextual feature vectors in the agricultural field. , Indicates the first Agricultural domain context feature vectors This indicates a context feature extraction operation; This represents the set of contextual feature vectors for the forest domain. , Indicates the first Each forestry domain context feature vector.
[0038] Because descriptive texts in the agricultural and forestry fields are generally quite long, therefore... In addition to extracting semantic information from concatenated sentences in the agricultural and forestry fields, the feature extraction model also incorporates the positional information of words in the concatenated sentences into the feature extraction process. This comprehensively considers the impact of word positional information on semantics in Chinese, ultimately obtaining contextual feature vectors for the agricultural and forestry fields. This alleviates the phenomenon of knowledge forgetting that occurs after semantic extraction from long texts in the agricultural and forestry fields and enhances the degree of semantic extraction.
[0039] Preferably, in step S5, the specific method for obtaining the feature vector of the entity boundary information between the agricultural and forestry sectors is as follows:
[0040] The constructed entity boundary recognition model consists of a first Bi-LSTM layer, a linear normalization layer, and an activation layer connected in sequence;
[0041] The context feature vectors from the agricultural domain and the forestry domain are input into the first Bi-LSTM layer to obtain context feature vectors related to entity boundary information in the agricultural domain and the forestry domain. These context feature vectors are then combined to form the context feature vectors related to entity boundary information. The calculation formula is as follows:
[0042]
[0043]
[0044]
[0045] In the formula, This represents a set of contextual feature vectors related to entity boundary information in the agricultural field. Contextual feature vectors representing the boundary information of entities in the forest domain. This represents a contextual feature vector related to entity boundary information. Indicates the first Bi-LSTM layer;
[0046] The contextual feature vectors related to entity boundary information are sequentially passed through a linear normalization layer and an activation layer to obtain the entity boundary information feature vectors for the agricultural-forestry domain. The calculation formula is as follows:
[0047]
[0048] In the formula, This represents the feature vector representing the entity boundary information between the agricultural and forestry sectors. This represents the activation function. This indicates a normalization operation.
[0049] Traditional cross-domain named entity recognition (NAME) technologies often train NAME recognition models in two domains simultaneously. This frequently results in source domain-specific NAME semantics affecting the target domain's NAME recognition model, leading to poor NAME recognition performance in the target domain. To prevent the severe impact of agricultural domain-specific NAME semantics on the forestry domain's NAME recognition performance, an entity boundary recognition model was constructed. This model dynamically identifies entity boundary information between the agricultural and forestry domains, limiting the influence of agricultural domain-specific NAME semantics on the forestry domain's NAME recognition model, while also providing a foundation for domain transfer.
[0050] Preferably, in step S6, the constructed multi-task cross-domain named entity recognition model includes a named entity recognition sub-model for the agricultural domain and a named entity recognition sub-model for the forestry domain, which are set up in parallel. The named entity recognition sub-model for the agricultural domain and the named entity recognition sub-model for the forestry domain have the same structure, both including a second Bi-LSTM layer, a fusion layer and a CRF layer connected in sequence.
[0051] Multi-task learning is a joint learning method in which multiple tasks are learned in parallel and their results influence each other. Due to the similarity between named entity recognition tasks in the agricultural and forestry domains, and the abundance of training resources in the agricultural domain, named entity recognition sub-models in both the agricultural and forestry domains are trained simultaneously. In addition to extracting the unique semantic information of sentences in either the agricultural or forestry domain, the entity boundary information of the agricultural-forestry domain obtained using the entity boundary recognition model is fused into the semantic information of the sentences. This enables the transfer of named entity recognition knowledge learned from the resource-rich agricultural domain to the forestry domain.
[0052] Preferably, in step S6, the specific method for obtaining the named entity tag sequence in the agricultural field and the named entity tag sequence in the forestry field is as follows:
[0053] The context feature vector of the agricultural domain is input into the named entity recognition sub-model for the agricultural domain, and through the corresponding second Bi-LSTM layer, the context feature vector related to Chinese named entity information in the agricultural domain is obtained; the context feature vector of the forestry domain is input into the named entity recognition sub-model for the forestry domain, and through the corresponding second Bi-LSTM layer, the context feature vector related to Chinese named entity information in the forestry domain is obtained; the calculation formula is:
[0054]
[0055]
[0056] In the formula, This represents a set of context feature vectors representing Chinese named entity task information in the agricultural field. This represents the set of context feature vectors related to Chinese named entity information in the forestry field. Indicates the second Bi-LSTM layer;
[0057] The context feature vectors related to Chinese named entity information in the agricultural domain and the feature vectors of entity boundary information between the agricultural and forestry domains are jointly input into the corresponding fusion layer to obtain the context feature vectors of fused entity boundaries and naming in the agricultural domain; the context feature vectors related to Chinese named entity information in the forestry domain and the feature vectors of entity boundary information between the agricultural and forestry domains are jointly input into the corresponding fusion layer to obtain the context feature vectors of fused entity boundaries and naming in the forestry domain; the calculation formula is:
[0058]
[0059]
[0060] In the formula, This represents a set of contextual feature vectors that integrate entity boundaries and naming in the agricultural domain. This represents a set of contextual feature vectors that integrate entity boundaries and naming within the forest domain. This represents the element-wise product of matrices;
[0061] The agricultural domain's name entity label sequence is obtained by inputting the fused entity boundary and named context feature vectors into the corresponding CRF layer; the forestry domain's name entity label sequence is obtained by inputting the fused entity boundary and named context feature vectors into the corresponding CRF layer; the calculation formula is as follows:
[0062]
[0063]
[0064] In the formula, This represents a sequence of named entity tags in the agricultural field. This represents a sequence of named entity tags in the forestry domain.
[0065] This invention also provides a cross-domain Chinese named entity recognition system applied to the forestry field, comprising:
[0066] The dictionary building module is used to build Chinese agricultural dictionaries and Chinese forestry dictionaries in key-value pair format;
[0067] The latent word lookup and splicing module is used to obtain original sentences in the agricultural field, search for a set of latent words in a Chinese agricultural dictionary, and splice the set of latent words to the end of the original agricultural sentence to obtain a spliced sentence in the agricultural field; it also obtains original sentences in the forestry field, searches for a set of latent words in a Chinese forestry dictionary, and splices the set of latent words to the end of the original forestry sentence to obtain a spliced sentence in the forestry field.
[0068] The sentence splicing processing module is used to perform vectorization and position encoding on spliced sentences in the agricultural field and spliced sentences in the forestry field respectively, to obtain spliced vectors in the agricultural field and spliced vectors in the forestry field.
[0069] The feature extraction module is used to input the spliced vectors from the agricultural domain and the forestry domain into the constructed context feature extraction model to obtain the context feature vectors from the agricultural domain and the forestry domain.
[0070] The entity boundary recognition module is used to input the context feature vectors of the agricultural domain and the forestry domain into the constructed entity boundary recognition model to obtain the entity boundary information feature vector of the agricultural domain-forestry domain.
[0071] The cross-domain named entity recognition module is used to input context feature vectors from the agricultural domain, context feature vectors from the forestry domain, and entity boundary information feature vectors from the agricultural and forestry domains into a constructed multi-task cross-domain named entity recognition model to obtain named entity label sequences from the agricultural domain and named entity label sequences from the forestry domain.
[0072] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:
[0073] This invention first constructs Chinese agricultural and forestry dictionaries, searching for latent word sets in original sentences from the agricultural and forestry domains. These latent word sets are then concatenated at the end of sentences to form concatenated sentences from the agricultural and forestry domains. Next, these concatenated sentences are vectorized and positionally encoded to obtain concatenated vectors from the agricultural and forestry domains. These vectors are then input into a context feature extraction model to obtain context feature vectors from the agricultural and forestry domains, taking into account both the semantic information of the sentences and the positional information of words in Chinese. Next, these vectors are input into a constructed entity boundary recognition model to obtain entity boundary information feature vectors from the agricultural and forestry domains, limiting the influence of specific named entity semantics from the agricultural domain on the named entity recognition model from the forestry domain. Finally, the entity boundary information feature vectors from the agricultural and forestry domains are fused into the context feature vectors from the agricultural and forestry domains. A multi-task cross-domain named entity recognition model is then used to obtain named entity label sequences from the agricultural and forestry domains. This invention does not rely on a large amount of high-quality forestry-related labeled corpus, and can effectively improve the Chinese named entity recognition performance in the forestry field. Attached Figure Description
[0074] Figure 1 This is a flowchart of a cross-domain Chinese named entity recognition method applied to the forestry field, as described in Example 1.
[0075] Figure 2 This is a flowchart illustrating the process of obtaining contextual feature vectors for the agricultural domain and the forestry domain as described in Example 2.
[0076] Figure 3 This is a flowchart illustrating the process of obtaining the feature vector of entity boundary information in the agricultural and forestry fields as described in Example 2.
[0077] Figure 4 This is a flowchart of the named entity tag sequence for the agricultural field and the named entity tag sequence for the forestry field as described in Example 2.
[0078] Figure 5 This is a schematic diagram of the structure of a cross-domain Chinese named entity recognition system applied to the forestry field, as shown in Example 3. Detailed Implementation
[0079] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this patent.
[0080] To better illustrate this embodiment, some parts in the accompanying drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions;
[0081] It will be understood by those skilled in the art that certain well-known structures and their descriptions may be omitted in the accompanying drawings.
[0082] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0083] Example 1
[0084] This invention provides a cross-domain Chinese named entity recognition method applied to the forestry field, such as... Figure 1 As shown, it includes:
[0085] S1: Construct a Chinese dictionary for the agricultural field and a Chinese dictionary for the forestry field in key-value pair format;
[0086] S2: Obtain the original sentence in the agricultural field, search for the potential word set in the Chinese agricultural field dictionary, and append the potential word set to the end of the original sentence in the agricultural field to obtain the concatenated sentence in the agricultural field; Obtain the original sentence in the forestry field, search for the potential word set in the Chinese forestry field dictionary, and append the potential word set to the end of the original sentence in the forestry field to obtain the concatenated sentence in the forestry field.
[0087] S3: Perform vectorization and position encoding on the concatenated sentences in the agricultural domain and the concatenated sentences in the forestry domain respectively to obtain the concatenated vectors in the agricultural domain and the concatenated vectors in the forestry domain;
[0088] S4: Input the spliced vectors from the agricultural domain and the forestry domain into the constructed context feature extraction model to obtain the context feature vectors from the agricultural domain and the forestry domain;
[0089] S5: Input the context feature vectors of the agricultural domain and the forestry domain into the constructed entity boundary recognition model to obtain the entity boundary information feature vector of the agricultural domain-forestry domain.
[0090] S6: Input the context feature vectors of the agricultural domain, the context feature vectors of the forestry domain, and the entity boundary information feature vectors of the agricultural domain and the forestry domain into the constructed multi-task cross-domain named entity recognition model to obtain the named entity label sequence of the agricultural domain and the named entity label sequence of the forestry domain.
[0091] In the specific implementation process, this embodiment first constructs a Chinese agricultural domain dictionary and a Chinese forestry domain dictionary, searches for the latent word sets of original sentences in the agricultural domain and the forestry domain, and concatenates them at the end of the sentences to form concatenated sentences in the agricultural domain and forestry domain. Then, the concatenated sentences in the agricultural domain and the forestry domain are vectorized and positionally encoded to obtain concatenated vectors in the agricultural domain and the forestry domain, respectively. These vectors are then input into a context feature extraction model to obtain context feature vectors in the agricultural domain and the forestry domain, taking into account both the influence of sentence semantic information and the influence of word position information in Chinese. Next, the input is input into a constructed entity boundary recognition model to obtain entity boundary information feature vectors in the agricultural domain and the forestry domain, thus limiting the influence of specific named entity semantics in the agricultural domain on the named entity recognition model in the forestry domain. Finally, the entity boundary information feature vectors in the agricultural domain and the forestry domain are fused into the context feature vectors in the agricultural domain and the forestry domain, and the constructed multi-task cross-domain named entity recognition model is used to obtain named entity label sequences in the agricultural domain and the forestry domain. This embodiment does not rely on a large amount of high-quality forestry-related labeled corpus, and can effectively improve the Chinese named entity recognition performance in the forestry field.
[0092] Example 2
[0093] This embodiment provides a cross-domain Chinese named entity recognition method applied to the forestry field, including:
[0094] S1: Construct a key-value pair dictionary for the Chinese agricultural domain and a Chinese dictionary for the forestry domain; specifically:
[0095] like Figure 2 As shown, a standardized Chinese dictionary for agriculture and a standardized Chinese dictionary for forestry are constructed using existing terminology databases for the agricultural and forestry fields. The agricultural dictionary includes standardized Chinese terms related to agriculture, and the forestry dictionary includes standardized Chinese terms related to forestry. Then, synonyms and synonyms are added to the agricultural and forestry dictionaries using national and industry standards, forming key-value pairs. The keys are the standardized Chinese terms for agriculture or forestry, and the values are supplementary lists of synonyms and / or synonyms for those terms.
[0096] S2: Obtain the original sentence in the agricultural field, search for the potential word set in the Chinese agricultural field dictionary, and append the potential word set to the end of the original sentence in the agricultural field to obtain the concatenated sentence in the agricultural field; Obtain the original sentence in the forestry field, search for the potential word set in the Chinese forestry field dictionary, and append the potential word set to the end of the original sentence in the forestry field to obtain the concatenated sentence in the forestry field.
[0097] S3: Vectorize and positionally encode the concatenated sentences from the agricultural and forestry domains respectively to obtain concatenated vectors for the agricultural and forestry domains; the specific method is as follows:
[0098] S3.1: Vectorize the sentences concatenated in the agricultural field and the forestry field respectively to obtain the content vectors of the sentences concatenated in the agricultural field and the forestry field.
[0099] The first Sentences pieced together from the agricultural field are denoted as follows: The set of sentences in the agricultural field is as follows: ; will the first The sentence composed of elements from the forestry sector is denoted as: The set of sentences in the forestry field is as follows: Vectorization was performed on the sets of concatenated sentences from the agricultural and forestry fields.
[0100]
[0101]
[0102] In the formula, This represents a set of concatenated sentence content vectors in the agricultural field. , Indicates the first A vector of sentence content from various agricultural fields; This represents a set of concatenated sentence content vectors representing the forest domain. , Indicates the first A vector of sentence content spliced from each forestry domain; Represents a word vector mapping table;
[0103] S3.2: Perform position encoding on the concatenated sentences in the agricultural field and the concatenated sentences in the forestry field respectively, and then perform vectorization processing to obtain the position encoding vectors of the concatenated sentences in the agricultural field and the concatenated sentences in the forestry field.
[0104] Assign a positional code to each word in a sentence constructed from agricultural or forestry data. Each positional code consists of a start and an end, with the start and end values being equal for each word. The start value of each word is the start value corresponding to the first character of the word, and the end value of each word is the end value corresponding to the last character of the word. For the first word... The positional encoding of sentences concatenated from the agricultural field is vectorized:
[0105]
[0106]
[0107]
[0108] In the formula, Indicates the first The word is relative to the first The distance between individual words or potential words, Indicates the first The starting position encoding of each character, Indicates the first Encoding the end position of a single character or potential word; Indicates the first The word is relative to the first Positional encoding of individual characters or potential words; Indicates the first A concatenated sentence position encoding vector for agricultural fields;
[0109] The same processing is applied to all concatenated sentences in the agricultural and forestry domains to obtain positional encoding vectors for the agricultural and forestry domains, which are then combined to form a set of positional encoding vectors for the agricultural domain. Forestry domain concatenated sentence position encoding vector set ;
[0110] S3.3: Concatenate the sentence content vector of the agricultural domain with the sentence position encoding vector of the agricultural domain to obtain the concatenated vector of the agricultural domain; concatenate the sentence content vector of the forestry domain with the sentence position encoding vector of the forestry domain to obtain the concatenated vector of the forestry domain.
[0111] S4: Input the concatenated vectors from the agricultural domain and the forestry domain into the constructed context feature extraction model to obtain the context feature vectors from the agricultural domain and the forestry domain.
[0112] The feature extraction model below is Feature extraction model; inputting the spliced vectors from the agricultural domain and the forestry domain. In the feature extraction model, contextual feature vectors for the agricultural domain and the forestry domain are obtained:
[0113]
[0114]
[0115] In the formula, This represents a set of contextual feature vectors in the agricultural field. , Indicates the first Agricultural domain context feature vectors This indicates a context feature extraction operation; This represents the set of contextual feature vectors for the forest domain. , Indicates the first Individual forestry domain context feature vectors;
[0116] S5: Input the context feature vectors of the agricultural domain and the forestry domain into the constructed entity boundary recognition model to obtain the entity boundary information feature vector of the agricultural domain-forestry domain.
[0117] like Figure 3 As shown, the constructed entity boundary recognition model includes a first Bi-LSTM layer, a linear normalization layer, and an activation layer connected in sequence.
[0118] The context feature vectors from the agricultural domain and the forestry domain are input into the first Bi-LSTM layer to obtain context feature vectors related to entity boundary information in the agricultural domain and the forestry domain. These context feature vectors are then combined to form the context feature vectors related to entity boundary information. The calculation formula is as follows:
[0119]
[0120]
[0121]
[0122] In the formula, This represents a set of contextual feature vectors related to entity boundary information in the agricultural field. Contextual feature vectors representing the boundary information of entities in the forest domain. This represents a contextual feature vector related to entity boundary information. Indicates the first Bi-LSTM layer;
[0123] The contextual feature vectors related to entity boundary information are passed sequentially through a linear normalization layer and an activation layer to obtain the entity boundary information feature vectors for the agricultural-forestry domain. The calculation formula is as follows:
[0124]
[0125] In the formula, This represents the feature vector representing the entity boundary information between the agricultural and forestry sectors. This represents the activation function. This indicates a normalization operation.
[0126] S6: Input the context feature vectors of the agricultural domain, the context feature vectors of the forestry domain, and the entity boundary information feature vectors of the agricultural domain and the forestry domain into the constructed multi-task cross-domain named entity recognition model to obtain the named entity label sequence of the agricultural domain and the named entity label sequence of the forestry domain.
[0127] like Figure 4 As shown, the constructed multi-task cross-domain named entity recognition model includes a parallel agricultural domain named entity recognition sub-model and a forestry domain named entity recognition sub-model. The agricultural domain named entity recognition sub-model and the forestry domain named entity recognition sub-model have the same structure, both including a second Bi-LSTM layer, a fusion layer and a CRF layer connected in sequence.
[0128] The context feature vector of the agricultural domain is input into the named entity recognition sub-model for the agricultural domain, and through the corresponding second Bi-LSTM layer, the context feature vector related to Chinese named entity information in the agricultural domain is obtained; the context feature vector of the forestry domain is input into the named entity recognition sub-model for the forestry domain, and through the corresponding second Bi-LSTM layer, the context feature vector related to Chinese named entity information in the forestry domain is obtained; the calculation formula is:
[0129]
[0130]
[0131] In the formula, This represents a set of context feature vectors representing Chinese named entity task information in the agricultural field. This represents the set of context feature vectors related to Chinese named entity information in the forestry field. Indicates the second Bi-LSTM layer;
[0132] The context feature vectors related to Chinese named entity information in the agricultural domain and the feature vectors of entity boundary information between the agricultural and forestry domains are jointly input into the corresponding fusion layer to obtain the context feature vectors of fused entity boundaries and naming in the agricultural domain; the context feature vectors related to Chinese named entity information in the forestry domain and the feature vectors of entity boundary information between the agricultural and forestry domains are jointly input into the corresponding fusion layer to obtain the context feature vectors of fused entity boundaries and naming in the forestry domain; the calculation formula is:
[0133]
[0134]
[0135] In the formula, This represents a set of contextual feature vectors that integrate entity boundaries and naming in the agricultural domain. This represents a set of contextual feature vectors that integrate entity boundaries and naming within the forest domain. This represents the element-wise product of matrices;
[0136] The agricultural domain's name entity label sequence is obtained by inputting the fused entity boundary and named context feature vectors into the corresponding CRF layer; the forestry domain's name entity label sequence is obtained by inputting the fused entity boundary and named context feature vectors into the corresponding CRF layer; the calculation formula is as follows:
[0137]
[0138]
[0139] In the formula, This represents a sequence of named entity tags in the agricultural field. This represents a sequence of named entity tags in the forestry domain.
[0140] Example 3
[0141] This embodiment provides a cross-domain Chinese named entity recognition system applied to the forestry field, such as... Figure 5 As shown, it includes:
[0142] The dictionary building module is used to build Chinese agricultural dictionaries and Chinese forestry dictionaries in key-value pair format;
[0143] The latent word lookup and splicing module is used to obtain original sentences in the agricultural field, search for a set of latent words in a Chinese agricultural dictionary, and splice the set of latent words to the end of the original agricultural sentence to obtain a spliced sentence in the agricultural field; it also obtains original sentences in the forestry field, searches for a set of latent words in a Chinese forestry dictionary, and splices the set of latent words to the end of the original forestry sentence to obtain a spliced sentence in the forestry field.
[0144] The sentence splicing processing module is used to perform vectorization and position encoding on spliced sentences in the agricultural field and spliced sentences in the forestry field respectively, to obtain spliced vectors in the agricultural field and spliced vectors in the forestry field.
[0145] The feature extraction module is used to input the spliced vectors from the agricultural domain and the forestry domain into the constructed context feature extraction model to obtain the context feature vectors from the agricultural domain and the forestry domain.
[0146] The entity boundary recognition module is used to input the context feature vectors of the agricultural domain and the forestry domain into the constructed entity boundary recognition model to obtain the entity boundary information feature vector of the agricultural domain-forestry domain.
[0147] The cross-domain named entity recognition module is used to input context feature vectors from the agricultural domain, context feature vectors from the forestry domain, and entity boundary information feature vectors from the agricultural and forestry domains into a constructed multi-task cross-domain named entity recognition model to obtain named entity label sequences from the agricultural domain and named entity label sequences from the forestry domain.
[0148] The same or similar labels correspond to the same or similar parts;
[0149] The terms used to describe positional relationships in the accompanying drawings are for illustrative purposes only and should not be construed as limiting this patent.
[0150] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A cross-domain Chinese named entity recognition method applied to the forestry field, characterized in that, Includes the following steps: S1: Construct a key-value pair dictionary for the Chinese agricultural domain and a Chinese dictionary for the forestry domain. The specific method is as follows: Using existing agricultural and forestry terminology databases, a standardized Chinese dictionary for agriculture and a standardized Chinese dictionary for forestry are constructed. The agricultural dictionary includes standardized Chinese terms related to agriculture, and the forestry dictionary includes standardized Chinese terms related to forestry. Then, national and industry standards are used to supplement the standardized Chinese dictionaries for agriculture and forestry with synonyms and synonyms, forming key-value pairs. Here, the key is a standardized Chinese term in agriculture or forestry, and the value is a list of synonyms and / or synonyms for that term. S2: Obtain the original sentence in the agricultural field, search for the potential word set in the Chinese agricultural field dictionary, and append the potential word set to the end of the original sentence in the agricultural field to obtain the concatenated sentence in the agricultural field; Obtain the original sentence in the forestry field, search for the potential word set in the Chinese forestry field dictionary, and append the potential word set to the end of the original sentence in the forestry field to obtain the concatenated sentence in the forestry field. S3: Perform vectorization and position encoding on the concatenated sentences in the agricultural domain and the concatenated sentences in the forestry domain respectively to obtain the concatenated vectors in the agricultural domain and the concatenated vectors in the forestry domain; S4: Input the concatenated vectors from the agricultural domain and the forestry domain into the constructed context feature extraction model to obtain the context feature vectors from the agricultural domain and the forestry domain. S5: Input the context feature vectors of the agricultural domain and the forestry domain into the constructed entity boundary recognition model to obtain the entity boundary information feature vector of the agricultural domain-forestry domain. S6: Input the context feature vectors of the agricultural domain, the context feature vectors of the forestry domain, and the entity boundary information feature vectors of the agricultural domain and the forestry domain into the constructed multi-task cross-domain named entity recognition model to obtain the named entity label sequence of the agricultural domain and the named entity label sequence of the forestry domain.
2. The cross-domain Chinese named entity recognition method applied to the forestry field according to claim 1, characterized in that, The specific method for step S3 is as follows: S3.1: Vectorize the sentences concatenated in the agricultural field and the forestry field respectively to obtain the content vectors of the sentences concatenated in the agricultural field and the forestry field. S3.2: Perform position encoding on the concatenated sentences in the agricultural field and the concatenated sentences in the forestry field respectively, and then perform vectorization processing to obtain the position encoding vectors of the concatenated sentences in the agricultural field and the concatenated sentences in the forestry field. S3.3: Concatenate the sentence content vector of the agricultural domain with the sentence position encoding vector of the agricultural domain to obtain the concatenated vector of the agricultural domain; concatenate the sentence content vector of the forestry domain with the sentence position encoding vector of the forestry domain to obtain the concatenated vector of the forestry domain.
3. The cross-domain Chinese named entity recognition method applied to the forestry field according to claim 2, characterized in that, In step S3.1, the specific method for obtaining the concatenated sentence content vectors for the agricultural domain and the forestry domain is as follows: The first Sentences pieced together from the agricultural field are denoted as follows: The set of sentences in the agricultural field is as follows: ; will the first The sentence composed of elements from the forestry sector is denoted as: The set of sentences in the forestry field is as follows: Vectorization was performed on the sets of concatenated sentences from the agricultural and forestry fields. In the formula, This represents a set of concatenated sentence content vectors in the agricultural field. , Indicates the first A vector of sentence content from various agricultural fields; This represents a set of concatenated sentence content vectors representing the forest domain. , Indicates the first A vector of sentence content spliced from each forestry domain; Represents a word vector mapping table.
4. The cross-domain Chinese named entity recognition method applied to the forestry field according to claim 3, characterized in that, In step S3.2, the specific methods for obtaining the positional encoding vectors of the concatenated sentences in the agricultural field and the forestry field are as follows: Assign a positional code to each word in a sentence constructed from agricultural or forestry data. Each positional code consists of a start and an end, with the start and end values being equal for each word. The start value of each word is the start value corresponding to the first character of the word, and the end value of each word is the end value corresponding to the last character of the word. For the first word... The positional encoding of sentences concatenated from the agricultural field is vectorized: In the formula, Indicates the first The word is relative to the first The distance between individual words or potential words, Indicates the first The starting position encoding of each character, Indicates the first Encoding the end position of a single character or potential word; Indicates the first The word is relative to the first Positional encoding of individual characters or potential words; Indicates the first A concatenated sentence position encoding vector for agricultural fields; The above processing is performed on all concatenated sentences in the agricultural and forestry fields to obtain positional encoding vectors for concatenated sentences in the agricultural and forestry fields, and these vectors are then combined to form a set of positional encoding vectors for concatenated sentences in the agricultural field. Forestry domain concatenated sentence position encoding vector set .
5. The cross-domain Chinese named entity recognition method applied to the forestry field according to claim 4, characterized in that, In step S4, the context feature extraction model is... Feature extraction model; Input the splicing vectors from the agricultural sector and the forestry sector. In the feature extraction model, contextual feature vectors for the agricultural domain and the forestry domain are obtained: In the formula, This represents a set of contextual feature vectors in the agricultural field. , Indicates the first Each agricultural domain context feature vector This indicates a context feature extraction operation; This represents the set of contextual feature vectors for the forest domain. , Indicates the first Each forestry domain context feature vector.
6. The cross-domain Chinese named entity recognition method applied to the forestry field according to claim 5, characterized in that, In step S5, the specific method for obtaining the feature vector of entity boundary information between the agricultural and forestry sectors is as follows: The constructed entity boundary recognition model consists of a first Bi-LSTM layer, a linear normalization layer, and an activation layer connected in sequence; The context feature vectors from the agricultural domain and the forestry domain are input into the first Bi-LSTM layer to obtain context feature vectors related to entity boundary information in the agricultural domain and the forestry domain. These context feature vectors are then combined to form the context feature vectors related to entity boundary information. The calculation formula is as follows: In the formula, This represents a set of contextual feature vectors related to entity boundary information in the agricultural field. Contextual feature vectors representing the boundary information of entities in the forest domain. This represents a contextual feature vector related to entity boundary information. Indicates the first Bi-LSTM layer; The contextual feature vectors related to entity boundary information are passed sequentially through a linear normalization layer and an activation layer to obtain the entity boundary information feature vectors for the agricultural-forestry domain. The calculation formula is as follows: In the formula, This represents the feature vector representing the entity boundary information between the agricultural and forestry sectors. This represents the activation function. This indicates a normalization operation.
7. The cross-domain Chinese named entity recognition method applied to the forestry field according to claim 5, characterized in that, In step S6, the constructed multi-task cross-domain named entity recognition model includes a parallel agricultural domain named entity recognition sub-model and a forestry domain named entity recognition sub-model. The agricultural domain named entity recognition sub-model and the forestry domain named entity recognition sub-model have the same structure, both including a second Bi-LSTM layer, a fusion layer and a CRF layer connected in sequence.
8. The cross-domain Chinese named entity recognition method applied to the forestry field according to claim 7, characterized in that, In step S6, the specific method for obtaining the named entity tag sequence for the agricultural domain and the named entity tag sequence for the forestry domain is as follows: The context feature vector of the agricultural domain is input into the named entity recognition sub-model of the agricultural domain, and the context feature vector related to the Chinese named entity information of the agricultural domain is obtained through the corresponding second Bi-LSTM layer; the context feature vector of the forestry domain is input into the named entity recognition sub-model of the forestry domain, and the context feature vector related to the Chinese named entity information of the forestry domain is obtained through the corresponding second Bi-LSTM layer. The calculation formula is: In the formula, This represents a set of context feature vectors representing Chinese named entity task information in the agricultural field. This represents the set of context feature vectors related to Chinese named entity information in the forestry field. Indicates the second Bi-LSTM layer; The context feature vectors related to Chinese named entity information in the agricultural domain and the feature vectors of entity boundary information between the agricultural and forestry domains are input into the corresponding fusion layer to obtain the context feature vectors of the fused entity boundary and naming in the agricultural domain; the context feature vectors related to Chinese named entity information in the forestry domain and the feature vectors of entity boundary information between the agricultural and forestry domains are input into the corresponding fusion layer to obtain the context feature vectors of the fused entity boundary and naming in the forestry domain. The calculation formula is: In the formula, This represents a set of contextual feature vectors that integrate entity boundaries and naming in the agricultural domain. This represents a set of contextual feature vectors that integrate entity boundaries and naming within the forest domain. This represents the element-wise product of matrices; The agricultural domain's name entity label sequence is obtained by inputting the fused entity boundary and named context feature vectors into the corresponding CRF layer; the forestry domain's name entity label sequence is obtained by inputting the fused entity boundary and named context feature vectors into the corresponding CRF layer; the calculation formula is as follows: In the formula, This represents a sequence of named entity tags in the agricultural field. This represents a sequence of named entity tags for the forestry domain.
9. A cross-domain Chinese named entity recognition system applied to the forestry field, characterized in that, include: The dictionary building module is used to build Chinese agricultural and forestry dictionaries in key-value pair format, including: Using existing agricultural and forestry terminology databases, a standardized Chinese dictionary for agriculture and a standardized Chinese dictionary for forestry are constructed. The agricultural dictionary includes standardized Chinese terms related to agriculture, and the forestry dictionary includes standardized Chinese terms related to forestry. Then, national and industry standards are used to supplement the standardized Chinese dictionaries for agriculture and forestry with synonyms and synonyms, forming key-value pairs. Here, the key is a standardized Chinese term in agriculture or forestry, and the value is a list of synonyms and / or synonyms for that term. The latent word lookup and splicing module is used to obtain original sentences in the agricultural field, search for a set of latent words in a Chinese agricultural dictionary, and splice the set of latent words to the end of the original agricultural sentence to obtain a spliced sentence in the agricultural field; it also obtains original sentences in the forestry field, searches for a set of latent words in a Chinese forestry dictionary, and splices the set of latent words to the end of the original forestry sentence to obtain a spliced sentence in the forestry field. The sentence splicing processing module is used to perform vectorization and position encoding on spliced sentences in the agricultural field and spliced sentences in the forestry field respectively, to obtain spliced vectors in the agricultural field and spliced vectors in the forestry field. The feature extraction module is used to input the spliced vectors from the agricultural domain and the forestry domain into the constructed context feature extraction model to obtain the context feature vectors from the agricultural domain and the forestry domain. The entity boundary recognition module is used to input the context feature vectors of the agricultural domain and the forestry domain into the constructed entity boundary recognition model to obtain the entity boundary information feature vector of the agricultural domain-forestry domain. The cross-domain named entity recognition module is used to input the context feature vectors of the agricultural domain, the context feature vectors of the forestry domain, and the entity boundary information feature vectors of the agricultural domain and the forestry domain into the constructed multi-task cross-domain named entity recognition model to obtain the named entity label sequence of the agricultural domain and the named entity label sequence of the forestry domain.
Citation Information
Patent Citations
Deep neural network-based legal language named entity identification method
CN109871535A
Chinese named entity recognition method based on graph network integrated dictionary
CN111046671A