Place name identification method for Chinese short text
By constructing a multi-source global Chinese place-name dictionary and an integrated neural network model, the problem of difficulty in identifying Chinese place names in social media texts is solved, and efficient recognition of place names in non-standardized texts is achieved.
Patent Information
- Application Number
- CN202411907282.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-01-21
AI Technical Summary
The prior art is difficult to effectively identify Chinese place names from non-standardized social media texts, mainly due to the lack of text information and the unique ambiguity of Chinese texts, character combination tightness, and semantic context-dependent problems.
Using a place name recognition method in Chinese translation text of foreign social media combined with a place name dictionary, a multi-source global Chinese place name dictionary is constructed by designing multiple place name data storage tables, and the preprocessed text data and place name candidate word sets are used to input into the integrated neural network identified in the model. The method includes multi-source text information embedding, Cross-Transformer Encoder's text information fusion encoding and information dynamic screening and decoding.
It effectively improves the recognition ability of Chinese place names in non-standardized social media texts, improves the recognition accuracy and efficiency, and adapts to the complexity and ambiguity of Chinese texts.
Smart Images

Figure CN119337884A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a method for identifying place names in Chinese short texts. Background Art
[0002] With the rapid development of Internet technology and the widespread popularity of smart mobile terminals, social media has spread rapidly in society with its characteristics of immediacy, openness, high participation and connectivity. In the global information exchange and cross-language environment, international social media platforms disseminate international social information in real time through various data types. In its multilingual and multilingual social media texts, explicit or implicit geographic location information related to users or events is included. This information is not only an important data source for studying the dynamics of the international community, but also the information basis for the analysis of global spatiotemporal big data.
[0003] Place names are a specific type of proper noun that accurately indicates a geographic location and carries key geographic information in natural language. In the field of natural language processing, Chinese named entity recognition is a basic task. Chinese place name recognition, as an important part of this task, focuses on the effective recognition and extraction of various Chinese place names contained in the text through in-depth analysis and processing of text information.
[0004] As a big data source with rich information resources, the massive amount of social media texts, in-depth data mining and analysis, especially in the identification and extraction of Chinese place names and geographical location information, not only provide key data support for improving the performance of social search engines, realizing personalized location service recommendations for users, accurately tracking the geographical location of hot events, optimizing intelligent navigation functions, and strengthening disaster emergency response management, but also have significant significance for the in-depth analysis of spatiotemporal big data and future trend prediction. However, social media texts are different from standardized texts such as news reports, summaries, and official resumes. Because their content comes from the daily life and personalized expression of users, they generally have non-standard word order, arbitrary punctuation, frequent vocabulary abbreviations and abbreviations, and possible expression errors. In addition, the unique characteristics of Chinese texts, such as polysemy, tight character combination, semantic dependence on context, and coexistence of simplified and traditional Chinese characters, make the previous methods have the problem of missing text information when identifying place names, which makes it difficult for previous methods to effectively identify Chinese place names from non-standard social media texts.
[0005] Therefore, it is urgent to provide a solution to improve the above problems. Summary of the invention
[0006] The purpose of the present invention is to provide a method for identifying place names in Chinese short texts, so as to improve the problem that the prior art is difficult to effectively identify Chinese place names from non-standardized social media texts.
[0007] In the first aspect, the method for identifying place names in Chinese translated texts of foreign social media combined with a place name dictionary provided by the present invention adopts the following technical solutions: Design multiple place name data storage tables based on OSM maps, GeoNames database and Amap, and extract Chinese place names from each place name data storage table to obtain a multi-source global Chinese place name dictionary; Acquire and preprocess text data from foreign social media, and match place names in the preprocessed text data based on the multi-source global Chinese place name dictionary to obtain a place name candidate word set; An integrated neural network model is constructed with multi-source text information embedding based on place name candidate word embedding, text information fusion encoding based on Cross-Transformer Encoder, and dynamic screening and decoding of fusion information as component units; The preprocessed text data and the place name candidate word set are input into the integrated neural network model to identify the real place names in the text data to obtain the recognition results.
[0008] The beneficial effect of a method for identifying place names in Chinese short texts provided by the present invention is that the present invention performs corresponding data preprocessing on foreign social media texts according to data characteristics and place name distribution characteristics; including constructing a multi-source global Chinese place name dictionary, acquiring and integrating Chinese place name data in open source maps and place name libraries Open Street Map, GeoNames and Gaode Map to construct the place name dictionary; including a Chinese place name candidate word matching algorithm based on the place name dictionary, using the multi-source global Chinese place name dictionary as a basis to form a Chinese place name candidate word algorithm, and matching place name candidate words on the preprocessed text; including constructing a hybrid dynamic integrated neural network model, using Cross-Transformer Encoder as a basis to construct a hybrid dynamic integrated neural network model that includes multi-source text information embedding that incorporates fused place name candidate word embedding, text information fusion encoding based on Cross-Transformer Encoder, and dynamic screening and decoding of fused information; using the preprocessed text and the place name candidate word set corresponding to the text as input, identifying real place names in foreign social media translation texts.
[0009] Optionally, the process of preprocessing text data of foreign language social media includes: Based on regular expressions, emoticons, the "@" symbol before the mention, and URL links are removed from the original tweets, and the actual content of the mention is retained to obtain the first foreign language social media file; Based on the regular expression, the “#” symbol before the hashtag at the beginning and in the sentence is replaced with an empty string “ ”, and the hashtag that appears at the end of the sentence is removed to obtain a second foreign language social media file; The first foreign language social media file and the second foreign language social media file are translated using the Google Translate API, missing words that are not translated are translated separately based on regular expressions, and the translation results are spliced with the original text.
[0010] Optionally, the embedding of multi-source text information of the place name candidate word embedding is to use a pre-trained model and word embedding to convert the input text and the place name candidate word corresponding to the input text into text semantic information, text character information and place name candidate word embedding information respectively; The text information fusion coding is composed of semantic and character information fusion coding and character and place name candidate information fusion coding. Based on the Cross-Transformer Encoder model, the text semantic information, text character information and place name candidate information are mutually fused to obtain semantic fusion character information, character fusion semantic information, place name candidate character information and character fusion place name candidate information respectively. The text character information and the place name candidate information are fused with each other to obtain semantically fused character information, semantically fused character information, character information of place name candidate words, and place name candidate word information of fused characters, respectively, wherein the Cross-Transformer Encoder model consists of a position encoding layer, a multi-head cross attention layer, a residual normalization layer, and a feedforward neural network layer.
[0011] Optionally, the position encoding layer is used to perform corresponding position encoding on the input text, and assign relevant position information to it to obtain the sequence of characters and words in the input text, wherein the mathematical expression of the position encoding is: ; ; ; in, is the position of the word in the sequence, is the index of the dimension, yes The input embedding of the position, is the final input representation with position information added, is the position encoding matrix The elements of the row, is the position encoding matrix Row, No. The elements of the column, Indicates Row, No. The elements of the column, is the input vector dimension; The multi-head cross attention layer is used to establish and explore the mutual information exchange between two different sequences so that the model can realize the exchange and integration of information at different data representation levels. The mathematical expression of multi-head cross attention is: ; ; ; ; ; in, and is the result of adding the two input sequences to the position code. , and are the query, key, and value matrices corresponding to the header, respectively. represents the weight matrix, For each head The output attention matrix, is the output multi-head attention matrix, express The transpose of represents the feature dimension of the input data, Indicates Query of the multi-head attention mechanism of the layer, Indicates The key of the multi-head attention mechanism of the layer, Indicates The value of the multi-head attention mechanism of the layer.
[0012] Optionally, the residual normalization layer is two layers, which are respectively configured in each multi-head cross attention layer and the subsequent stage of the feedforward neural network layer, wherein the mathematical expression of the residual normalization layer is: ; ; ; in, is the output from the residual network, and They are mean and standard deviation, and are learnable parameters used to rescale and shift the normalized data, Then The result of layer normalization; Z is the attention matrix obtained by the multi-head cross attention layer, For input The matrix after adding the position code, is the output of the feedforward neural network, and They are the outputs of the residual normalization layer after the multi-head attention layer and the feedforward neural network layer in the Cross-Transformer Encoder basic model; The feedforward neural network layer is a key component following the second residual normalization layer, and is used to perform independent processing operations on the feature vector at each position. The feedforward neural network structure includes two linear conversion processes, and the mathematical expression is: ; in, and is the weight matrix, and is the bias term; represent The activation function, which performs a non-linear transformation on each element of the input, is a trainable parameter.
[0013] Optionally, the mathematical expression of the semantic and character information fusion encoding is: ; ; in, They are the text semantic information and text character information in the first part respectively. It is the character information that integrates semantics. It is the semantic information of the fused characters. Indicates encoding operation; The calculation formula for the fusion coding of the character and place name candidate information is as follows: ; ; in, They are the place name candidate information and text character information in the first part, It is the character information of the candidate words of the fused place name. It is the candidate information of place names fused with characters.
[0014] Optionally, the fusion information dynamic screening and decoding consists of information dynamic screening and information decoding, wherein the information dynamic screening is to integrate the above text information using an information dynamic screening model based on a gated network, and screen the important information for Chinese place name recognition to obtain various types of screened text information; information decoding is used to decode the screened various types of text information according to the BiLSTM-CRF model to obtain the sequence annotation result of the input text, wherein, The calculation formula of the information dynamic screening model based on the gating network is as follows: ; in, is the global information input, is the local information of the input, represents the Sigmoid activation function, is the weight matrix, is the bias vector; represents the information dynamic screening model based on the gating network, Represents the convolution operation; The calculation formula for the various types of text information after screening is as follows: ; ; ; ; ; in, is the global fusion information, It is the various types of text information obtained after screening. It is the total text information obtained by filtering the information dynamic filtering model of the gating network.
[0015] Optionally, the process of obtaining a multi-source global Chinese place name dictionary includes: designing different place name data storage tables for different data sources such as OSM, GeoNames and Amap, and extracting and storing Chinese place names based on their respective data characteristics, specifically including: extracting Chinese place name data from OSM, extracting Chinese place name data from Amap, and extracting Chinese place name data from GeoNames, where: The process of extracting OSM Chinese place name data includes: reclassifying OSM data based on geographic element classification standards, extracting the reclassification results based on open source tools, storing the extracted data in tables with consistent table structures and table names of points_zh, lines_zh, routes_zh, boundaries_zh and polygons_zh, and obtaining OSM global Chinese place name data; The process of extracting Chinese place name data from Amap includes: obtaining the names of administrative regions and points of interest (POIs) at all levels in China based on the Amap API, and constructing an Amap Chinese place name dictionary based on the POIs. The specific process includes: API interface calling, data processing, construction and storage of the place name dictionary; The process of extracting GeoNames Chinese place name data includes three aspects: parsing and storing global geographic entity data, extracting global Chinese place names, and translating, supplementing and verifying English place names.
[0016] Optionally, the API interface call specifically includes: recursively querying the administrative division information based on the administrative area query API to obtain first place name data, retrieving place name information according to categories and keywords using the POI search API, adjusting the search parameters to obtain second place name data, and combining the first place name data and the second place name data to obtain combined data; The data processing specifically includes: data cleaning and data formatting, wherein data cleaning includes: removing repeated POI place name information in the combined data, correcting erroneous annotation content, and removing incomplete or erroneous annotation content to obtain processed data; data formatting includes: formatting the processed data based on a normalization operation to obtain formatted data, and the normalization operation includes: converting the place name data in the combined data into simplified and traditional Chinese characters; The construction and storage of the place name dictionary specifically includes: integrating and storing the formatted data based on the database table structure of Amap data to obtain multiple Chinese place name dictionaries, and deduplicating the Chinese place name dictionaries to obtain a global Chinese place name dictionary.
[0017] Optionally, the parsing and storing of global geographic entity data includes: acquiring global geographic entity data based on the GeoNames official website, creating a data storage table corresponding to the data content and data type in the global geographic entity data, and importing the parsed global geographic entity data into a local database for storage; The extracting of global Chinese place names includes: filtering the data in the data storage table based on the name field, the isolanguage field and the alternatename field to obtain the Chinese place names; The English place name translation supplement and verification includes: verifying and comparing the English place names in the data storage table with the English place names in the OSM place name database, and translating the English place names in the geoname table based on evaluation indicators and adding them to the GeoNames Chinese place name set, wherein the evaluation criteria include: the English place names in the geoname table are in the OSM place name database, and the distance between the English place names in the geoname table calculated based on longitude and latitude and the English place names in the OSM place name database is no more than 15 kilometers. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flow chart of a method for identifying place names in Chinese translated texts of foreign social media combined with a place name dictionary provided by the present invention; Figure 2 It is a flow chart of establishing an integrated neural network model provided by the present invention; Figure 3 It is a schematic diagram of a model structure based on Cross Transformer Encoder provided by the present invention; Figure 4 It is a schematic diagram of the model structure of a gated network-based information dynamic screening model provided by the present invention. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be understood by people with general skills in the field to which the present invention belongs. "Including" and similar words used in this article mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.
[0020] The embodiment of the present invention provides a method for identifying place names in Chinese short texts, comprising the following steps: S1. Design multiple place name data storage tables based on OSM maps, GeoNames database and Amap, and extract Chinese place names from each place name data storage table to obtain a multi-source global Chinese place name dictionary; S2, obtaining and preprocessing text data from foreign social media, and matching place names in the preprocessed text data based on the multi-source global Chinese place name dictionary to obtain a place name candidate word set; S3, build an integrated neural network model with multi-source text information embedding based on place name candidate word embedding, text information fusion encoding based on Cross-TransformerEncoder, and dynamic screening and decoding of fusion information as component units; S4. Input the preprocessed text data and the place name candidate word set into the integrated neural network model to identify the real place names in the text data to obtain recognition results.
[0021] See also Figure 1 ,Step 1: preprocess the social media translation text to obtain the preprocessed social media translation text data; Step 2: Build a multi-source global Chinese place name dictionary based on OSM, GeoNames and Amap; Step 3: Based on the preprocessed social media translation text data, a place name candidate word matching algorithm based on a place name dictionary is constructed to select a place name candidate word set; Step 4: Input the selected place name candidate word set into the hybrid dynamic ensemble neural network model to obtain Chinese place names.
[0022] In some embodiments, when executing step S1, the process of preprocessing the text data of the foreign language social media includes: S1-1, removing emoticons, "@" symbols before mentions, and URL links from the original tweets based on regular expressions, and retaining the actual content of the mentions to obtain a first foreign language social media file; S1-2, based on the regular expression, replace the “#” symbol before the topic tag at the beginning and in the sentence with an empty string “ ”, and remove the topic tag that appears at the end of the sentence, to obtain a second foreign language social media file; S1-3. Use the Google Translate API to translate the first foreign language social media file and the second foreign language social media file, translate the missing untranslated words separately based on regular expressions, and concatenate the translation results with the original text.
[0023] Specifically, when executing step S1-1, the emoticons and URL links usually do not have semantic meanings directly related to the main body of the text, so regular expressions are used to remove these contents from the original tweet. However, the @mentioned part needs to be treated differently, because it is usually associated with the name of an organization, institution or individual, and is closely related to the semantics of the main body of the text. If the entire @mentioned part is simply and roughly removed, the semantics of the text may be damaged or even incoherently understood. Therefore, the approach adopted by the present invention is to remove the "@" symbol before the mention, but retain the actual content of the mention to maintain the integrity and fluency of the text semantics.
[0024] Furthermore, when executing step S1-2, since the position of the topic tag in the text has a certain relationship with its relevance to the semantics of the main body of the text, specifically, the topic tags at the beginning and in the middle of a sentence are often closely related to the semantics of the main body of the text, while the topic tags at the end of a sentence often lack substantial semantic association. In order to ensure that the processed topic tag content can be better integrated into and associated with the semantics of the main body of the text, the present invention will use a regular expression method to replace the "#" symbol before the topic tags at the beginning and in the middle of a sentence with an empty string " " to facilitate subsequent translation processing. At the same time, removal measures will be taken for topic tags that appear at the end of a sentence.
[0025] Furthermore, when executing step S1-3 and using the Google Translate API to translate the first and second foreign language social media files, some words are often omitted from translation due to the uniqueness of their formats and contents. To solve this problem, the present invention uses regular expression technology to relocate and extract untranslated words, then performs separate translation processing on these words, and appropriately splices the translation results with the original text.
[0026] In some embodiments, when executing step S2, the process of obtaining a multi-source global Chinese place name dictionary includes: designing different place name data storage tables for different data sources such as OSM, GeoNames and Amap, and extracting and storing Chinese place names based on their respective data characteristics, specifically including: extracting Chinese place name data from OSM, extracting Chinese place name data from Amap, and extracting Chinese place name data from GeoNames, wherein: Specifically, the process of extracting OSM Chinese place name data includes: reclassifying OSM data based on the geographic element classification standard, as shown in Table 1.
[0027] Table 1 List of OSM data reclassification , The reclassification results were extracted based on open source tools, and the extracted data were stored in tables with consistent table structures and named points_zh, lines_zh, routes_zh, boundaries_zh, and polygons_zh, as shown in Table 2, to obtain the OSM global Chinese place name data.
[0028] Table 2 OSM data storage table structure
[0029] , Specifically, the process of extracting Chinese place name data from Amap includes: obtaining the names of administrative regions and points of interest (POIs) at all levels in China based on the Amap API, and constructing an Amap Chinese place name dictionary based on the POIs. The specific process includes: API interface calling, data processing, construction and storage of the place name dictionary; The API interface call specifically includes: recursively querying the administrative division information based on the administrative region query API to obtain first place name data, retrieving place name information according to categories and keywords using the POI search API, and adjusting the search parameters to obtain second place name data, and combining the first place name data and the second place name data to obtain combined data; The data processing specifically includes: data cleaning and data formatting, wherein data cleaning includes: removing repeated POI place name information in the combined data, correcting erroneous annotation content, and removing incomplete or erroneous annotation content to obtain processed data; data formatting includes: formatting the processed data based on a normalization operation to obtain formatted data, and the normalization operation includes: converting the place name data in the combined data into simplified and traditional Chinese characters; The construction and storage of the place name dictionary specifically includes: integrating and storing the formatted data based on the database table structure of Amap data to obtain multiple Chinese place name dictionaries, and deduplicating the Chinese place name dictionaries to obtain a global Chinese place name dictionary.
[0030] Among them, a total of 18,264,362 pieces of Chinese place name data from Amap were obtained, and the table structure is shown in Table 3.
[0031] Table 3 Structure of the Chinese Place Name Dictionary Table of Amap
[0032] , Specifically, the process of extracting GeoNames Chinese place name data includes three aspects: parsing and storing global geographic entity data, extracting global Chinese place names, and translating, supplementing and verifying English place names.
[0033] Specifically, the parsing and storing of global geographic entity data includes: obtaining global geographic entity data based on the GeoNames official website, creating a data storage table corresponding to the data content and data type in the global geographic entity data, and importing the global geographic entity data into a local database for storage. Different from the data storage of OSM, the table structure of the GeoNames data storage table is not consistent. The data storage table and its table structure are shown in Table 4, Table 5 and Table 6.
[0034] Table 4 geoname table
[0035] , Table 5 alternatename table
[0036] , Table 6 countryinfo table
[0037] , Specifically, the extracting of global Chinese place names includes: filtering data in the data storage table based on the name field, the isolanguage field, and the alternatename field to obtain the Chinese place names; Specifically, the translation, supplementation and verification of English place names include: verifying and comparing the English place names in the data storage table with the English place names in the OSM place name database, and translating the English place names in the geoname table based on evaluation indicators and adding them to the GeoNames Chinese place name set, wherein the evaluation criteria include: the English place names in the geoname table are in the OSM place name database, and the distance between the English place names in the geoname table calculated based on longitude and latitude and the English place names in the OSM place name database is no more than 15 kilometers.
[0038] In some embodiments, when executing step S3, the multi-source text information embedding of the place name candidate words utilizes a pre-trained model and word embedding to convert the input text and the place name candidate words corresponding to the input text into text semantic information, text character information and place name candidate word embedding information respectively.
[0039] In some embodiments, when executing step S3, the text information fusion code is composed of semantic and character information fusion code and character and place name candidate word information fusion code, see Figure 2 Based on the Cross-TransformerEncoder model, the text semantic information, the text character information and the place name candidate information are mutually integrated to obtain the character information of integrated semantics, the semantic information of integrated characters, the character information of integrated place name candidate words and the place name candidate word information of integrated characters respectively.
[0040] Further, in Figure 2 It includes: multi-source text information embedding combined with place name candidate word embedding, text information fusion encoding based on CrossTransformer Encoder, dynamic information screening based on gating network, and information encoding process based on BiLSTM-CRF.
[0041] The text data is respectively input into the Sentence Transformer pre-trained model and the RoBERTa pre-trained model to obtain text semantic information and text character information respectively. The place name candidate word set is input into the Chinese Wikipedia Wordembedding pre-trained word embedding to obtain the place name candidate word information. The text semantic information, text character information and place name candidate word information are input into Cross-TF-encoder1, Cross-TF-encoder2, Cross-TF-encoder3, and Cross-TF-encoder4 to generate semantically fused character information, character fused semantic information, character fused place name candidate word information and character fused place name candidate word information, and then superimposed and input into Gate1, Gate2, Gate3, and Gate4 for summation, and then pass through the Bi-LSTM layer composed of multiple Lstm cell units, and then pass through the conditional random field to obtain the text sequence labeling results (B-City, I-City, O).
[0042] See also Figure 3 The Cross-Transformer Encoder model consists of a position encoding layer, a multi-head cross-attention layer (Multi-Head Cross-Attention), a residual normalization layer (Add & Norm) and a feedforward neural network layer (FeedForward). Input A and input B are respectively input into the position encoding layer, the multi-head cross-attention layer, the residual and normalization layer, the feedforward neural network layer, the residual and normalization layer to obtain the output, which is B fused with A and A fused with B.
[0043] Specifically, the position encoding layer is used to perform corresponding position encoding on the input text, and assign relevant position information to it to obtain the sequence of characters and words in the input text, wherein the mathematical expression of the position encoding is: ; ; ; in, is the position of the word in the sequence, is the index of the dimension, yes The input embedding of the position, is the final input representation with position information added, is the position encoding matrix The elements of the row, is the position encoding matrix Row, No. The elements of the column, Indicates Row, No. The elements of the column, is the input vector dimension.
[0044] Furthermore, the multi-head cross attention layer is used to establish and explore the mutual information exchange between two different sequences so that the model can realize the exchange and integration of information at different data representation levels. The mathematical expression of multi-head cross attention is: ; ; ; ; ; in, and is the result of adding the two input sequences to the position code. , and are the query, key, and value matrices corresponding to the header, respectively. represents the weight matrix, For each head The output attention matrix, is the output multi-head attention matrix, express The transpose of represents the feature dimension of the input data, Indicates Query of the multi-head attention mechanism of the layer, Indicates The key of the multi-head attention mechanism of the layer, Indicates The value of the multi-head attention mechanism of the layer.
[0045] Furthermore, the residual normalization layer consists of two layers, which are respectively configured in each multi-head cross attention layer and the subsequent stage of the feedforward neural network layer, wherein the mathematical expression of the residual normalization layer is: ; ; ; in, is the output from the residual network, and They are mean and standard deviation, and are learnable parameters used to rescale and shift the normalized data, Then The result of layer normalization; Z is the attention matrix obtained by the multi-head cross attention layer, For input The matrix after adding the position code, is the output of the feedforward neural network, and They are the outputs of the residual normalization layer after the multi-head attention layer and the feedforward neural network layer in the Cross-Transformer Encoder basic model; Furthermore, the feedforward neural network layer is a key component following the second residual normalization layer, which is used to perform independent processing operations on the feature vector at each position, wherein the feedforward neural network structure includes two linear conversion processes, and the mathematical expression is: ; in, and is the weight matrix, and is the bias term; represent The activation function, which performs a non-linear transformation on each element of the input, is a trainable parameter.
[0046] Furthermore, the input and output of the text information fusion encoding based on the Cross-Transformer Encoder are summarized as the following formula: ; in, , They are the two inputs of the Cross-Transformer Encoder basic model. is the Q (query) of the Cross-Transformer Encoder, and It is K(key) and V(value) of Cross-Transformer Encoder. Fusion Informational Information matrix.
[0047] Furthermore, the mathematical expression of semantic and character information fusion encoding is: ; ; in, They are the text semantic information and text character information in the first part respectively. It is the character information that integrates semantics. It is the semantic information of the fused characters. Indicates encoding operation; The calculation formula for the fusion coding of character and place name candidate information is as follows: ; ; in, They are the place name candidate information and text character information in the first part, It is the character information of the candidate words of the fused place name. It is the candidate information of place names fused with characters.
[0048] In some embodiments, when executing step S3, the fusion information dynamic screening and decoding consists of information dynamic screening and information decoding, wherein the information dynamic screening is to integrate the above text information using the information dynamic screening model based on the gated network, and screen the important information for Chinese place name recognition to obtain various types of screened text information; information decoding is used to decode the various types of screened text information according to the BiLSTM-CRF model to obtain the sequence annotation result of the input text, wherein, The calculation formula of the information dynamic screening model based on the gating network is as follows: ; in, is the global information input, is the local information of the input, represents the Sigmoid activation function, is the weight matrix, is the bias vector; represents the information dynamic screening model based on the gating network, Represents the convolution operation; The calculation formula for the various types of text information after screening is as follows: ; ; ; ; ; in, is the global fusion information, It is the various types of text information obtained after screening. is the total text information obtained by the information dynamic screening model of the gated network. represents the convolution operation, , , , It is four types of text fusion information.
[0049] Specifically, The four types of text fusion information are concatenated to obtain the global fusion information. It is the total text information obtained by the dynamic information screening model of the gated network. and , the model can learn which information in the local fusion information is more important for the Chinese place name recognition task. Through such a gating mechanism, the model can adaptively adjust the flow of information and provide high-quality and targeted feature representation for the information decoding stage, thus helping to improve the accuracy of Chinese place name recognition.
[0050] The information decoding is to The BiLSTM-CRF model is used for decoding to obtain the sequence labeling result of the input text. The model diagram is as follows Figure 4 shown.
[0051] See also Figure 4 On the one hand, the input A is linearly transformed and input into the Sigmod activation function to obtain the first multiplication component. On the other hand, the input B is multiplied by the first multiplication component to obtain the output.
[0052] Specifically, for the BiLSTM model, assume that the input sequence is , the relevant calculation formula is as follows: ; ; ; in, yes time The values in the sequence, and They are respectively and The hidden state of the moment, and They are respectively and The hidden state of the moment; It is the concatenation of the forward and reverse hidden states, and is also the output of BiLSTM.
[0053] Furthermore, based on BiLSTM, the CRF layer takes the entire input sequence into consideration and optimizes the overall effect of sequence labeling by defining a specific transfer matrix. Assume that the label sequence is , the hidden state output of BiLSTM is , the maximum conditional probability of CRF The calculation formula is as follows: ; in, is in position Tag The emission score depends on ; From the tag Transfer to The transfer score is determined by the parameters of the CRF layer; the denominator is the sum of all possible label sequences The total score ensures is a valid probability distribution.
[0054] Furthermore, during the model training phase, the log-likelihood on the training data is maximized by adjusting the parameters of the BiLSTM and CRF layers, so that the BiLSTM layer learns how to generate effective hidden states that are helpful for label prediction, while the CRF layer learns how to optimally label sequences based on these states. The formula for the log-likelihood is as follows: ; in, is the number of training samples, and They are The hidden state sequence and corresponding label sequence of samples, For probability.
[0055] Although the embodiments of the present invention are described in detail above, it is obvious to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations are within the scope and spirit of the present invention as described in the claims. Moreover, the present invention described herein may have other embodiments and may be implemented or realized in a variety of ways.
Claims
1. A method for identifying place names in Chinese short texts, characterized in that: include: Design multiple place name data storage tables based on OSM maps, GeoNames database and Amap, and extract Chinese place names from each place name data storage table to obtain a multi-source global Chinese place name dictionary; Acquire and preprocess text data from foreign social media, and match place names in the preprocessed text data based on the multi-source global Chinese place name dictionary to obtain a place name candidate word set; An integrated neural network model is constructed with multi-source text information embedding based on place name candidate word embedding, text information fusion encoding based on Cross-Transformer Encoder, and dynamic screening and decoding of fusion information as component units; The preprocessed text data and the place name candidate word set are input into the integrated neural network model to identify the real place names in the text data to obtain the recognition results.
2. A method for identifying place names in Chinese short texts according to claim 1, characterized in that: The process of preprocessing text data of foreign social media includes: Based on regular expressions, emoticons, "@" symbols before mentions, and URL links are removed from the original tweets, and the actual content of the mentions is retained to obtain the first foreign language social media file; Based on the regular expression, replace the "#" symbol before the hashtag at the beginning and in the sentence with an empty string " ", and remove the hashtag that appears at the end of the sentence to obtain a second foreign language social media file; The first foreign language social media file and the second foreign language social media file are translated using the Google Translate API, missing words that are not translated are translated separately based on regular expressions, and the translation results are spliced with the original text.
3. A method for identifying place names in Chinese short texts according to claim 1, characterized in that: The multi-source text information embedding of the place name candidate word embedding uses a pre-trained model and word embedding to convert the input text and the place name candidate word corresponding to the input text into text semantic information, text character information and place name candidate word embedding information respectively; The text information fusion coding is composed of semantic and character information fusion coding and character and place name candidate information fusion coding. Based on the Cross-Transformer Encoder model, the text semantic information, text character information and place name candidate information are mutually fused to obtain semantic fusion character information, character fusion semantic information, place name candidate character information and character fusion place name candidate information respectively. The text character information and the place name candidate information are fused with each other to obtain semantically fused character information, semantically fused character information, character information of place name candidate words, and place name candidate word information of fused characters, respectively, wherein the Cross-Transformer Encoder model consists of a position encoding layer, a multi-head cross attention layer, a residual normalization layer, and a feedforward neural network layer.
4. A method for identifying place names in Chinese short texts according to claim 3, characterized in that: The position encoding layer is used to perform corresponding position encoding on the input text, and to give it relevant position information to obtain the sequence of characters and words in the input text, wherein the mathematical expression of the position encoding is: ; ; ; in, is the position of the word in the sequence, is the index of the dimension, yes The input embedding of the position, is the final input representation with position information added, is the position encoding matrix The elements of the row, is the position encoding matrix Row, No. The elements of the column, Indicates Row, No. The elements of the column, is the input vector dimension; The multi-head cross attention layer is used to establish and explore the mutual information exchange between two different sequences so that the model can realize the exchange and integration of information at different data representation levels. The mathematical expression of multi-head cross attention is: ; ; ; ; ; in, and is the result of adding the two input sequences to the position code. , and are the query, key, and value matrices corresponding to the header, respectively. represents the weight matrix, For each head The output attention matrix, is the output multi-head attention matrix, express The transpose of represents the feature dimension of the input data, Indicates Query of the multi-head attention mechanism of the layer, Indicates The key of the multi-head attention mechanism of the layer, Indicates The value of the multi-head attention mechanism of the layer.
5. A method for identifying place names in Chinese short texts according to claim 3, characterized in that: The residual normalization layer consists of two layers, which are respectively configured in each multi-head cross attention layer and the subsequent stage of the feedforward neural network layer. The mathematical expression of the residual normalization layer is: ; ; ; in, is the output from the residual network, and They are mean and standard deviation, and are learnable parameters used to rescale and shift the normalized data, Then The result of layer normalization; Z is the attention matrix obtained by the multi-head cross attention layer, For input The matrix after adding the position code, is the output of the feedforward neural network, and They are the outputs of the residual normalization layer after the multi-head attention layer and the feedforward neural network layer in the Cross-Transformer Encoder basic model; The feedforward neural network layer is a key component following the second residual normalization layer, and is used to perform independent processing operations on the feature vector at each position. The feedforward neural network structure includes two linear conversion processes, and the mathematical expression is: ; in, and is the weight matrix, and is the bias term, represent The activation function, which performs a non-linear transformation on each element of the input, is a trainable parameter.
6. A method for identifying place names in Chinese short texts according to claim 3, characterized in that: The mathematical expression of the semantic and character information fusion encoding is: ; ; in, They are the text semantic information and text character information in the first part respectively. It is the character information that integrates semantics. It is the semantic information of the fused characters. Indicates encoding operation; The calculation formula for the fusion coding of the character and place name candidate information is as follows: ; ; in, They are the place name candidate information and text character information in the first part, It is the character information of the candidate words of the fused place name. It is the candidate information of place names fused with characters.
7. A method for identifying place names in Chinese short texts according to claim 1, characterized in that: The fusion information dynamic screening and decoding is composed of information dynamic screening and information decoding, wherein the information dynamic screening is to integrate the above text information using the information dynamic screening model based on the gated network, and screen the important information for Chinese place name recognition to obtain various types of screened text information; information decoding is used to decode the screened text information according to the BiLSTM-CRF model to obtain the sequence annotation result of the input text, wherein, The calculation formula of the information dynamic screening model based on the gating network is as follows: ; in, is the global information input, is the local information of the input, represents the Sigmoid activation function, is the weight matrix, is the bias vector; represents the information dynamic screening model based on the gating network, Represents the convolution operation; The calculation formula for the various types of text information after screening is as follows: ; ; ; ; ; in, is the global fusion information, It is the various types of text information obtained after screening. It is the total text information obtained by filtering the information dynamic filtering model of the gating network.
8. A method for identifying place names in Chinese short texts according to claim 1, characterized in that: The process of obtaining a multi-source global Chinese place name dictionary includes: designing different place name data storage tables for different data sources such as OSM, GeoNames and Amap, and extracting and storing Chinese place names based on their respective data characteristics, including: extracting Chinese place name data from OSM, extracting Chinese place name data from Amap, and extracting Chinese place name data from GeoNames. The process of extracting OSM Chinese place name data includes: reclassifying OSM data based on geographic element classification standards, extracting the reclassification results based on open source tools, storing the extracted data in tables with consistent table structures and table names of points_zh, lines_zh, routes_zh, boundaries_zh and polygons_zh, and obtaining OSM global Chinese place name data; The process of extracting Chinese place name data from Amap includes: obtaining the names of administrative regions and points of interest (POIs) at all levels in China based on the Amap API, and constructing an Amap Chinese place name dictionary based on the POIs. The specific process includes: API interface calling, data processing, construction and storage of the place name dictionary; The process of extracting GeoNames Chinese place name data includes three aspects: parsing and storing global geographic entity data, extracting global Chinese place names, and translating, supplementing and verifying English place names.
9. A method for identifying place names in Chinese short texts according to claim 8, characterized in that: The API interface call specifically includes: recursively querying the administrative division information based on the administrative region query API to obtain first place name data, using the POI search API to retrieve place name information according to categories and keywords, and adjusting the search parameters to obtain second place name data, and combining the first place name data and the second place name data to obtain combined data; The data processing specifically includes: data cleaning and data formatting, wherein data cleaning includes: removing repeated POI place name information in the combined data, correcting erroneous annotation content, and removing incomplete or erroneous annotation content to obtain processed data; data formatting includes: formatting the processed data based on a normalization operation to obtain formatted data, and the normalization operation includes: converting the place name data in the combined data into simplified and traditional Chinese characters; The construction and storage of the place name dictionary specifically includes: integrating and storing the formatted data based on the database table structure of Amap data to obtain multiple Chinese place name dictionaries, and deduplicating the Chinese place name dictionaries to obtain a global Chinese place name dictionary.
10. The method for identifying place names in Chinese short texts according to claim 8, characterized in that: The parsing and storing of global geographic entity data includes: acquiring global geographic entity data based on the GeoNames official website, creating a data storage table corresponding to the data content and data type in the global geographic entity data, and importing the parsed global geographic entity data into a local database for storage; The extracting of global Chinese place names includes: filtering the data in the data storage table based on the name field, the isolanguage field and the alternatename field to obtain the Chinese place names; The English place name translation supplement and verification includes: verifying and comparing the English place names in the data storage table with the English place names in the OSM place name database, and translating the English place names in the geoname table based on evaluation indicators and adding them to the GeoNames Chinese place name set, wherein the evaluation criteria include: the English place names in the geoname table are in the OSM place name database, and the distance between the English place names in the geoname table calculated based on longitude and latitude and the English place names in the OSM place name database is no more than 15 kilometers.
Citation Information
Patent Citations
Multilingual place name and root Chinese translation method based on Transformer deep learning model
CN112084796A
Cited By
Automatic association processing method based on open source place name data
CN119558319A
An automatic association processing method based on open-source geographical name data
CN119558319B