A method, medium and device for identifying place name entities based on spatial relationship perception

By building a corpus and building a place name entity recognition model framework, pre-training is performed using comparison learning and mask language modeling, the problem of poor place name entity recognition in the existing technology is solved, and more efficient place name entity recognition and geographic space are achieved The combination of information improves recognition accuracy and fine-grainedness.

CN119129600BActive Publication Date: 2025-02-18CENT SOUTH UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411603699.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-02-18
Estimated Expiration
2044-11-12

AI Technical Summary

Technical Problem

The prior art has a general effect in the recognition of place name entities, with low fine grain size, lack of understanding of the relationship between place names and integration of geospatial information, which makes it difficult to achieve the effective combination of place name entities and their geospatial information, and there are place name elimination and Ambiguity problem.

Method used

By constructing a corpus, using place name entities in the geographic dataset and natural language sentences collected in the network, the natural language processing model is pre-trained using contrast learning and masked language modeling. Build a framework for place name entity recognition model, including word vector transformation, natural language processing model, fusion embedding layer, two-way long and short-term memory network and conditional random field to realize place name entity recognition.

Benefits of technology

It improves the overall performance of the place name entity recognition model, improves the recognition accuracy and fine-grainedness of place name entities, and can more effectively combine place name entities with their geospatial information, reducing the problem of place name dissimilarity and ambiguity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119129600B_ABST
    Figure CN119129600B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of natural language processing technology, and in particular to a method, medium and device for identifying place name entities based on spatial relationship perception, the method comprising the following steps: constructing a corpus through natural language sentences of place name entities in the network and pseudo sentences constructed by processing geographic data sets, and further training a natural language model by using pseudo sentences and natural language sentences, contrastive learning and masked language modeling learning. The method builds a Chinese named entity recognition model based on a natural language model: character-level feature representation is learned through word vector conversion, word-level feature representation is learned through a natural language model, a fusion embedding layer integrates character-level feature representation and word-level feature representation to generate a new feature representation, a bidirectional long short-term memory network is used to extract text context semantic features, and a conditional random field is used to obtain a globally optimal label sequence to achieve place name entity recognition. The method of the present invention improves the overall performance of the place name entity recognition model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to a method, medium and device for identifying place name entities based on spatial relationship perception. Background Art

[0002] Place names are proprietary names given by people to specific place entities in the universe. They are an important part of location information and indispensable information for surveying and mapping digital products.

[0003] Text is a typical source of ubiquitous geographic big data. Its data size is getting larger and larger, and its connotation covers multiple fields and is more complex. Chinese text expression has the characteristics of unstructured, ambiguous, random, complex composition, and no obvious separators between words.

[0004] Existing named entity recognition models are generally ineffective and have low granularity in place name recognition. The meaning of place names is usually dependent on the context, and existing methods and models do not have a sufficient understanding of the relationship between place names in the text. Lacking geospatial information integration, existing technologies may fail to effectively combine place name entities with their geospatial information, thus failing to fully utilize the potential of geographic data. At the same time, applying existing technologies to perform named entity recognition on place name entities, place name disambiguation is still a problem. Place name ambiguity means that a place name may have multiple meanings or interpretations, resulting in uncertainty or ambiguity about the meaning of the place name.

[0005] In summary, there is an urgent need for a place name entity recognition method, medium and device based on spatial relationship perception to solve the problems in the existing technology. Summary of the invention

[0006] The present invention aims to provide a method, medium and device for identifying place name entities based on spatial relationship perception. The specific technical scheme is as follows:

[0007] A method for identifying place name entities based on spatial relationship perception includes the following steps:

[0008] Construct a corpus, obtain place name entities from the geographic data set, sort each place name entity and construct a pseudo sentence; for the place name entity obtained from the geographic data set, collect natural language sentences containing the place name entity on the Internet; construct a corpus based on pseudo sentences and natural language sentences;

[0009] Natural language processing model pre-training, based on pseudo-sentences and natural language sentences, using contrastive learning and masked language modeling learning to pre-train the natural language processing model;

[0010] Constructing a place name entity recognition model framework, wherein the place name entity recognition model framework includes word vector conversion, a natural language processing model, a fusion embedding layer, a bidirectional long short-term memory network, and a conditional random field;

[0011] Place name entity recognition: input unlabeled natural language text into the place name entity recognition model framework to achieve place name entity recognition.

[0012] Preferably, the process of sorting each place name entity and constructing a pseudo sentence is as follows:

[0013] According to the geographic spatial neighbors of each place name entity, a comprehensive score is calculated according to the distance, topological relationship and label relationship, the place name entities are sorted based on the comprehensive score, and adjacent place name entities are connected to construct a pseudo sentence.

[0014] Preferably, the word vector is converted into a pre-trained character embedding matrix, which is used to convert a word in a word sequence into an embedding vector.

[0015] Preferably, the natural language processing model includes sentence tagging, spatial coordinate embedding, integrated embedding layer and contrastive learning;

[0016] Sentence tagging: The BERT tagger is used to embed tokens on pseudo sentences, form token embeddings based on the position and name of the place-name entity, and generate sequence position embeddings and segment embeddings. The sequence position is used to describe the index position of the token in the sentence, and the segment is used to indicate the source of the input token.

[0017] Spatial coordinate embedding: Based on the tokens within the name range of the place name entity sharing the same X coordinate and Y coordinate, a spatial coordinate embedding is formed;

[0018] Integrated embedding layer: It is used to add token embedding, sequence position embedding, segment embedding and spatial coordinate embedding and input them into the encoder, and output the integrated embedding;

[0019] Contrastive learning: used to pair and concatenate natural language sentences and pseudo-sentences according to place name entities.

[0020] Preferably, the natural language processing model also includes a self-attention mechanism and a feedforward network, the self-attention mechanism is used to consider the relationship between all words in the sequence and calculate the representation of each word, and the feedforward network is used to perform a nonlinear transformation on the output of the self-attention layer.

[0021] Preferably, the fused embedding layer is used to concatenate the output of the word vector conversion and the natural language processing model to obtain a fused embedding.

[0022] Preferably, a bidirectional long short-term memory network is used to capture the forward information and backward information of the fused embedding.

[0023] Preferably, the conditional random field is used to perform sequence labeling and global optimal path search on the output of the bidirectional long short-term memory network to realize place name entity recognition. The process is as follows:

[0024] Calculate the score vector of the sentence;

[0025] The log-likelihood function is used as the loss function to normalize the score vector for training;

[0026] The Viterbi algorithm is used to label the network model and obtain the optimal recognition label sequence to achieve place name entity recognition.

[0027] Additionally, a computer device includes a memory and a processor;

[0028] The memory is used to store a computer program executable on the processor;

[0029] The processor is used to implement the steps of the above-mentioned method for identifying place name entities when executing the computer program.

[0030] In addition, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned method for identifying place name entities are implemented.

[0031] The application of the technical solution of the present invention has the following beneficial effects:

[0032] The present invention constructs a corpus through natural language sentences of place name entities in the network and pseudo sentences constructed by processing geographic data sets, and further trains the natural language model by using pseudo sentences and natural language sentences, adopting contrastive learning and masked language modeling learning. The method of the present invention builds a Chinese named entity recognition model for the geographical field based on the above-mentioned pre-trained natural language model: character-level feature representation is learned through word vector conversion, word-level feature representation is learned by natural language model, character-level feature representation and word-level feature representation are integrated by fusion embedding layer to generate new feature representation, text context semantic features are extracted through bidirectional long short-term memory network, and conditional random field obtains the globally optimal label sequence to realize place name entity recognition. The method of the present invention improves the overall performance of the place name entity recognition model.

[0033] In addition to the above-described objects, features and advantages, the present invention has other objects, features and advantages. The present invention will be further described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0035] Figure 1 is a flowchart of the steps of the method for identifying place name entities in a preferred embodiment of the present invention;

[0036] Figure 2 It is a schematic diagram of the geographic information input format in the preferred embodiment of the present invention. DETAILED DESCRIPTION

[0037] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0038] like Figure 1 As shown, this embodiment discloses a method for identifying place name entities based on spatial relationship perception, comprising the following steps:

[0039] S1: Build a corpus, obtain place name entities from geographic data sets, sort each place name entity and construct pseudo sentences; collect place name entities on the Internet, and convert the collected place name entities into natural language sentences; build a corpus based on pseudo sentences and natural language sentences.

[0040] Specifically, the process of sorting each place name entity and constructing a pseudo-sentence is as follows:

[0041] According to the geographic spatial neighbors of each place name entity, a comprehensive score is calculated according to the distance, topological relationship and label relationship, the place name entities are sorted based on the comprehensive score, and adjacent place name entities are connected to construct a pseudo sentence.

[0042] Furthermore, the comprehensive score function is as follows:

[0043] ;

[0044] in, Represents the weighted sum of distance, topological relationship and label relationship, that is, the comprehensive score; Represent the weight coefficients of distance, topological relationship and label relationship respectively; , and Respectively represent the distance function, topological relationship function and label relationship function, the distance function is used to calculate the target place name entity and candidate place names The distance between the target place name entities is calculated by the topological relationship function. and candidate place names The topological association between the target place name entities is calculated by the label relationship function. and candidate place names The label similarity between .

[0045] Furthermore, in this embodiment, the place name entities are sorted based on the comprehensive scores, and neighbor nodes are selected and connected to construct a pseudo sentence. In this embodiment, a pseudo sentence reflecting the geographic spatial relationship is constructed in the above manner, and multiple factors in the geographic spatial context are comprehensively considered to effectively select the neighbor place names most relevant to the target place name entity.

[0046] In a specific embodiment, for a place name entity obtained from a geographic data set, a process of collecting natural language sentences containing the place name entity on the network is as follows:

[0047] For Wikipedia first crawl All Wikipedia links pointed to in the annotations are used to locate articles describing the place-name entity. These articles are then broken down into individual sentences and The phrase matching method of the tree is used to identify Sentence of the name of the geographical entity.

[0048] based on The phrase matching process of the tree is as follows:

[0049] Build a Tree, used for storage (Place name entity name collection) Place name entity name, and in the sentence collection Identify sentences containing these names.

[0050] Build Tree:

[0051] ;

[0052] In the sentence collection Medium Match Tree:

[0053] ;

[0054] in, is a set containing the sentences Matching them Place name entity name .

[0055] Identify Contains Sentences for place name entities:

[0056] For each match , recognize sentences As including the corresponding sentences with names of geographical entities;

[0057] ;

[0058] in, Indicates the final identified inclusion A collection of sentences containing names of geographical entities.

[0059] S2: Natural language processing model pre-training, based on pseudo-sentences and natural language sentences, the natural language processing model is pre-trained using contrastive learning and masked language modeling learning.

[0060] Natural language processing models include sentence tagging, spatial coordinate embedding, integrated embedding layers, and contrastive learning;

[0061] Sentence tagging: The BERT tagger is used to embed tokens on pseudo sentences, form token embeddings based on the position and name of the place-name entity, and generate sequence position embeddings and segment embeddings. The sequence position is used to describe the index position of the token in the sentence, and the segment is used to indicate the source of the input token. Figure 2 As shown, the sequence position is Figure 2 Location IDs in NL and geospatial input all start at zero; Figure 2 The segment ID in is 0 if the token belongs to the natural language input and 1 otherwise.

[0062] Spatial coordinate embedding: Based on the tokens in the name range of the place name entity sharing the same X coordinate and Y coordinate, a spatial coordinate embedding is formed; Figure 2 As shown, since the NL token has no associated geographic coordinate information, in this embodiment, the X coordinate and Y coordinate of the NL token are set to DSEP, which is a constant value used as a distance filler.

[0063] The spatial coordinate embedding encodes each location dimension separately to capture the relative distance and orientation between place-name entities. Specifically, for two-dimensional space, the normalized distance is generated for each adjacent place-name entity in the pseudo-sentence using the following equation: and :

[0064] ;

[0065] ;

[0066] in, is the normalization factor, , Pivot and neighboring entities It should be noted that tokens belonging to the same place name entity have the same and In addition, SPABERT uses DSEP, which takes all neighboring entities greater than Constant values ​​are used to distinguish special tokens from entity name tokens;

[0067] ;

[0068] in, yes No. Quantity; Represents the spatial coordinates embedded in the horizontal and vertical directions respectively and .

[0069] Integrated embedding layer: used to add token embedding, sequence position embedding, segment embedding and spatial coordinate embedding and input them into the encoder, and output integrated embedding; the natural language processing model in this embodiment is an improved ALBERT model, which calculates an output embedding for each token, and then averages the token-level embeddings of the pivot words to produce a fixed-length embedding of the contextualized representation of the pivot words.

[0070] Contrastive learning: It is used to pair and concatenate natural language sentences and pseudo-sentences according to place name entities. The process is as follows:

[0071] By comparing the place-name entity features extracted from the two modalities, this loss encourages the improved ALBERT to generate similar representations for the same place-name entity. At the same time, the improved ALBERT learns to distinguish place-name entities that share the same name by maximizing their representation distance in the embedding space.

[0072] The contrast loss function is as follows:

[0073] ;

[0074] Among them, the training data By paired samples composition, is a language sample (a natural sentence or a verbalized relation from a knowledge base), are pseudo sentences created from geographic data. Both examples mention the same place name entity, To improve the ALBERT model, it also and As input, it generates entity-level representations and , is the temperature coefficient, Represents cosine similarity.

[0075] Furthermore, this embodiment further trains the model using a masked language modeling task. Using the masked language modeling task, the natural language sentences and geographic pseudo sentences for pairing are concatenated, prompting the improved ALBERT to recover masked vocabulary using text and geographic information.

[0076] S3: Construct a place name entity recognition model framework, which includes word vector conversion, natural language processing model, fusion embedding layer, bidirectional long short-term memory network and conditional random field.

[0077] In a specific embodiment, the word vector is converted into a pre-trained character embedding matrix for embedding word sequences. Words in Convert to an embedding vector . ,in is the character embedding matrix, Represents indexing characters from the embedding matrix The corresponding vector process is as follows:

[0078] Use convolutional neural networks to process character embeddings to capture local structural information at the character level;

[0079] ;

[0080] in, represents the convolution operation, is the weight matrix of the convolution kernel, is the bias term, Is a character The embedding vector of is the hyperbolic tangent function.

[0081] Apply a max pooling operation to obtain word-level representations;

[0082] ;

[0083] in, Represents the number of features output by the convolutional layer.

[0084] Combine context information to generate the final word embedding :

[0085] ;

[0086] in, Represent context-dependent embeddings, including parts of speech, syntactic roles, etc. Represents a concatenation operation.

[0087] Furthermore, the natural language processing model also includes a self-attention mechanism and a feedforward network. The self-attention mechanism is used to consider the relationship between all words in the sequence and calculate the representation of each word. The feedforward network is used to perform nonlinear transformation on the output of the self-attention layer.

[0088] In natural language processing models, the input sequence It consists of a series of word indices, each of which From the word embedding matrix Retrieve the corresponding embedding vector from

[0089] ;

[0090] in, Indicates The embedding vectors of words, is the length of the sequence.

[0091] The self-attention mechanism computes a representation for each word, taking into account the relationship between all words in the sequence:

[0092] ;

[0093] in, The function is calculated as follows: For each attention head , calculate the query (Query), key (Key) and value (Value):

[0094] ;

[0095] ;

[0096] ;

[0097] Calculate the attention weight and apply it to the value:

[0098] ;

[0099] Concatenate the outputs of all heads and transform them linearly:

[0100] ;

[0101] in, represents the number of attention heads, is the dimension of the key vector, and are the output weights and biases.

[0102] FeedForward Network:

[0103] The feedforward network performs further nonlinear transformation on the output of the self-attention layer;

[0104] ;

[0105] in, The function is calculated as follows:

[0106] The first layer of linear transformation and nonlinear activation function:

[0107] ;

[0108] The second layer of linear transformation obtains the output representation of the natural language model :

[0109] ;

[0110] is the weight matrix of the first linear transformation, is the bias vector of the first linear transformation, which adds a learnable offset to the second linear transformation. It is the output of the first linear transformation and the input of the activation function. This intermediate representation is transformed nonlinearly and provides input for the next linear layer. is the weight matrix of the second linear transformation. This matrix maps the output of the activation function back to the original dimension space or the target dimension space. is the bias vector for the second linear transformation. Similar to the first linear layer, the bias vector adds a learnable offset to the second linear transformation. It is the final output of the feedforward network. It is the result of the second linear transformation and represents the feature representation of the input sequence after being processed by the feedforward network.

[0111] In a specific embodiment, the fusion embedding layer is used to concatenate the output of the word vector conversion and the natural language processing model to obtain a fusion embedding. The calculation process is as follows:

[0112] ;

[0113] in, represents fused embedding.

[0114] In a specific embodiment, a bidirectional long short-term memory network (BLSTM) is used to capture the forward information and backward information of the fused embedding, and the process is as follows:

[0115] For each time step , calculate the forward and reverse LSTM outputs respectively;

[0116] ;

[0117] ;

[0118] in, and Represent the forward LSTM unit and the reverse LSTM unit respectively, Represents the weights and biases of the forward LSTM unit; denote the weight and bias of the reverse LSTM unit, respectively.

[0119] Concatenate the forward and backward hidden states:

[0120] ;

[0121] in, represents the bidirectional LSTM output at each time step, Represents a concatenation operation along the feature dimension.

[0122] The bidirectional LSTM output contains the forward and backward information of each position in the sequence;

[0123] ;

[0124] in, represents the set of bidirectional LSTM outputs, Represents the number of bidirectional LSTM outputs.

[0125] In a specific embodiment, the conditional random field (CRF layer) is used to perform sequence labeling and global optimal path search on the output of the bidirectional long short-term memory network to achieve place name entity recognition. The process is as follows:

[0126] Calculate the score vector of the sentence;

[0127] The log-likelihood function is used as the loss function to normalize the score vector for training;

[0128] The Viterbi algorithm is used to label the network model and obtain the optimal recognition label sequence to achieve place name entity recognition.

[0129] Specifically, the model input of the conditional random field is , the CRF layer considers the migration characteristics between annotations and obtains the dependency between adjacent labels. .

[0130] CRF score vector of the sentence It can be calculated by the following formula:

[0131] ;

[0132] in, is the value of each observation in the observation sequence Corresponding label The sum of the probabilities of . Indicates that in the observation sequence In the observation The label that appears and corresponds to it is This probability is usually determined by a feature function that captures the relationship between the observation value and the label. is a pair of adjacent labels in the label sequence The sum of the transition probabilities. is an element in the transition probability matrix, indicating that in the label sequence, from label Transfer to label This transition probability usually reflects the linguistic or statistical laws in the label sequence.

[0133] The CRF score vector is normalized and trained using the log-likelihood function as the loss function. The result represents the given observation sequence When the label sequence The log probability of The formula is as follows:

[0134] ;

[0135] in, is the observation sequence and tag sequence The score, Represents the logarithm of the sum of the exponentials of the scores of all possible label sequences. This term is normalized from all possible label sequences to ensure that the sum of the probabilities of all label sequences is 1.

[0136] The conditional random field (CRF) model is used to sequence the output of BLSTM. The CRF model accurately identifies place name entities through global optimal path search. The CRF model is a discriminative probability model that is used to model the conditional probability distribution of another set of output random variables under the condition of a given set of random variables. In the entity recognition task, the CRF model can capture the dependency between labels.

[0137] In the prediction stage, the Viterbi algorithm is used to label the network model and obtain the optimal sequence, that is, to obtain the final recognition label for the input text;

[0138] ;

[0139] in, is a maximum operator that returns the parameter that maximizes the subsequent function. Here, it is looking for the score function in all possible label sequences. The largest sequence. is a given observation sequence is the set of all possible tag sequences. is one of the possible tag sequences, which is An element in is the optimal label sequence predicted by the model, that is, the most likely to produce the observation sequence Tag sequence.

[0140] S4: Place name entity recognition, input unlabeled natural language text into the place name entity recognition model framework to realize place name entity recognition.

[0141] In addition, this embodiment also discloses a computer device, including a memory and a processor;

[0142] The memory is used to store a computer program executable on the processor;

[0143] The processor is used to implement the steps of the above-mentioned place name entity recognition method when executing the computer program.

[0144] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the computer device.

[0145] The computer device may be a computing device such as a mobile phone, a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may include, but is not limited to, a processor and a memory. For example, the computer device may also include an input / output device, a network access device, a bus, etc.

[0146] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the computer device, and uses various interfaces and lines to connect various parts of the entire computer device.

[0147] The memory can be used to store the computer program and / or module, and the processor implements the computer program by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0148] Wherein, if the module / unit integrated in the computer device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0149] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned place name entity recognition method are implemented.

[0150] The embodiment of the present invention discloses a method for identifying place name entities based on spatial relationship perception. A corpus is constructed by natural language sentences of place name entities in the network and pseudo sentences constructed by processing geographic data sets. The pseudo sentences and natural language sentences are used to further train the natural language model by contrastive learning and masked language modeling. The method of the present invention builds a Chinese named entity recognition model for the geographical field based on the above-mentioned pre-trained natural language model: character-level feature representation is learned through word vector conversion, word-level feature representation is learned by natural language model, character-level feature representation and word-level feature representation are integrated by fusion embedding layer to generate new feature representation, text context semantic features are extracted by bidirectional long short-term memory network, and the conditional random field obtains the globally optimal label sequence to realize place name entity recognition. The method of the present invention improves the overall performance of the place name entity recognition model.

[0151] It should be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0152] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for identifying place name entities based on spatial relationship perception, characterized in that: The steps include: Construct a corpus, obtain place name entities from the geographic data set, sort each place name entity and construct a pseudo sentence; for the place name entity obtained from the geographic data set, collect natural language sentences containing the place name entity on the Internet; construct a corpus based on pseudo sentences and natural language sentences; Natural language processing model pre-training, based on pseudo-sentences and natural language sentences, using contrastive learning and masked language modeling learning to pre-train the natural language processing model; Constructing a place name entity recognition model framework, wherein the place name entity recognition model framework includes word vector conversion, a natural language processing model, a fusion embedding layer, a bidirectional long short-term memory network, and a conditional random field; Place name entity recognition: input unlabeled natural language text into the place name entity recognition model framework to achieve place name entity recognition.

2. The method for identifying place name entities according to claim 1, characterized in that: The process of sorting each place name entity and constructing a pseudo sentence is as follows: According to the geographic spatial neighbors of each place name entity, a comprehensive score is calculated according to the distance, topological relationship and label relationship, the place name entities are sorted based on the comprehensive score, and adjacent place name entities are connected to construct a pseudo sentence.

3. The method for identifying place name entities according to claim 2, characterized in that: The word vector is converted into a pre-trained character embedding matrix, which is used to convert the words in the word sequence into an embedding vector.

4. The method for identifying place name entities according to claim 3, characterized in that: Natural language processing models include sentence tagging, spatial coordinate embedding, integrated embedding layers, and contrastive learning; Sentence tagging: The BERT tagger is used to embed tokens on pseudo sentences, form token embeddings based on the position and name of the place-name entity, and generate sequence position embeddings and segment embeddings. The sequence position is used to describe the index position of the token in the sentence, and the segment is used to indicate the source of the input token. Spatial coordinate embedding: Based on the tokens within the name range of the place name entity sharing the same X coordinate and Y coordinate, a spatial coordinate embedding is formed; Integrated embedding layer: It is used to add token embedding, sequence position embedding, segment embedding and spatial coordinate embedding and input them into the encoder, and output the integrated embedding; Contrastive learning: used to pair and concatenate natural language sentences and pseudo-sentences according to place name entities.

5. The method for identifying place name entities according to claim 4, characterized in that: The natural language processing model also includes a self-attention mechanism and a feedforward network. The self-attention mechanism is used to consider the relationship between all words in the sequence and calculate the representation of each word. The feedforward network is used to perform nonlinear transformation on the output of the self-attention layer.

6. The method for identifying place name entities according to claim 5, characterized in that: The fused embedding layer is used to concatenate the output of the word vector conversion and the natural language processing model to obtain a fused embedding.

7. The method for identifying place name entities according to claim 6, characterized in that: Bidirectional LSTM networks are used to capture the forward and backward information of the fused embedding.

8. The method for identifying place name entities according to claim 7, characterized in that: The conditional random field is used to perform sequence labeling and global optimal path search on the output of the bidirectional long short-term memory network to realize place name entity recognition. The process is as follows: Calculate the score vector of the sentence; The log-likelihood function is used as the loss function to normalize the score vector for training; The Viterbi algorithm is used to label the network model and obtain the optimal recognition label sequence to achieve place name entity recognition.

9. A computer device, characterized in that: including memory and processor; The memory is used to store a computer program executable on the processor; The processor is used to implement the steps of the method for identifying place-name entities according to any one of claims 1 to 8 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for identifying place-name entities according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Small sample text classification method based on knowledge contrast enhancement prompt

    CN116881457A

  • Method for identifying named entities in field of rice diseases and insect pests

    CN117094325A