Case space positioning method based on pinyin Embedding address matching
Through the address matching method based on pinyin Embedding, the patient's living address is not standardized and information security problems are solved, and high-accurate case spatial positioning is achieved, with good noise immunity and data security.
Patent Information
- Application Number
- CN202510387853.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-05-02
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When obtaining the geographical coordinates of the patient's residential address, the prior art faces problems such as irregular address, typos, and aliasing of words, which leads to difficulty in address conversion and it is difficult to ensure the security of patient information when using Internet map services.
The address matching method based on pinyin Embedding is adopted to collect and standardize address information, generate Chinese pinyin addresses, and use the fastText Embedding model to vectorize the address, so as to search for the closest standard address in the standard address library and obtain its geographical coordinates.
It effectively reduces the impact of Chinese homophones, alias, and typos on address matching, improves the accuracy of case spatial positioning, and does not require a large amount of preliminary data preprocessing, saves manpower and computing power, and ensures the security of patient information.
Smart Images

Figure CN119917548A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the cross-technical field of health big data and spatiotemporal big data processing, and in particular relates to a case spatial positioning method based on pinyin embedding address matching. Background Art
[0002] In recent years, spatial information technology has played an important role in the field of human health research. Using geographic information technology to analyze the spatial distribution of disease cases can, on the one hand, intuitively understand the distribution of cases in geographic space and further analyze geographical factors related to the disease; on the other hand, for some epidemics, based on the spatial distribution of cases and their evolutionary status, the geographical change patterns of the disease can be obtained, which plays an important role in disease control.
[0003] Using the patient's residential address in the medical record to obtain the precise geographic coordinates of the patient's residence has become the primary and key link in case spatial analysis. In the field of geographic information technology, geocoding technology can convert address text into geographic coordinates, but directly using this method to obtain the geographic coordinates of the patient's residential address has the following problems:
[0004] (1) The patient's residential address is usually entered based on the oral information of the patient or his / her family. The registered patient's residential address is usually not standardized and contains typos, misspellings, extra words, and missing words, which makes it very difficult to convert the address into geographic coordinates.
[0005] (2) Most of the existing geocoding tools are provided by Internet map service organizations (such as Baidu, AutoNavi, etc.). When using these tools, the case address must be uploaded to the Internet server, so this method is difficult to ensure the security of patient information. Summary of the invention
[0006] In order to solve the above technical problems, the present invention proposes a case space positioning method based on pinyin embedding address matching, which can effectively reduce the influence of homophones, misspellings and wrong characters in Chinese on address text matching, and improve the accuracy of case space positioning.
[0007] To achieve the above object, the present invention provides a case spatial positioning method based on pinyin embedding address matching, comprising:
[0008] Collect address information of the research area, establish a standard address database, and obtain Chinese phonetic addresses;
[0009] Segment all Chinese Pinyin into single letters, combine them with the numbers in the Chinese Pinyin address to generate a training corpus, train the training corpus, and obtain a fastText Embedding model;
[0010] Vectorize the Chinese Pinyin addresses using the fastText Embedding model, and store the vector of each address in a standard address library;
[0011] The address information of patients in the area to be studied is converted into Chinese pinyin addresses, stop words are removed, and the vector of the Chinese pinyin address is obtained using the fastTextEmbedding model. The standard address with the closest cosine distance to the vector of the patient's Chinese pinyin address is searched from the standard address library, and the geographic coordinates of the corresponding standard address are obtained to complete the spatial positioning of the case.
[0012] Optionally, the address information includes address ID, Chinese address text, longitude coordinates and latitude coordinates.
[0013] Optionally, obtain the Chinese Pinyin address including:
[0014] The Chinese characters in the address information are converted into Chinese pinyin, and the stop words and punctuation marks in the Chinese pinyin are removed, and the Chinese pinyin address is formed with the numbers in the address information.
[0015] Optionally, the stop words include province, city, district, county, town, street, road, lane, village, community, group, number, building, unit, floor and room.
[0016] Optionally, generating a training corpus includes:
[0017] Separate the letters and numbers of each Chinese Pinyin address and convert the address into an address entry combination;
[0018] The address term combinations of all addresses are stored in the training corpus, and each row stores a term combination of an address.
[0019] Optionally, get the fastText Embedding model including:
[0020] Create a fastText instance and set training parameters;
[0021] The training corpus is trained using fastText to obtain a fastText Embedding model.
[0022] Optionally, vectorizing the Chinese Pinyin address includes:
[0023] S1. Read the word combination of an address and use the fastText Embedding model to calculate the vector of each word combination.
[0024] S2, calculate the maximum value vector, minimum value vector and average value vector of the vectors of the word combination, and merge them into a Chinese pinyin vector;
[0025] S3, repeat S1 and S2 until all Chinese Pinyin addresses complete vector calculation.
[0026] Optionally, the vector cosine distance refers to the distance between the Chinese phonetic vectors corresponding to the two addresses calculated by the distance formula, which is calculated as follows:
[0027] ;
[0028] where θ is the cosine distance; x i and i The i-th component values of two Chinese pinyin vectors respectively, and n is the vector length.
[0029] Technical effect of the present invention: The present invention discloses a case spatial positioning method based on Pinyin Embedding address matching, which converts the Chinese standard address text into Chinese Pinyin address text, then segments the Chinese Pinyin text to obtain address entries, and stores all address entries as a training corpus, uses the Embedding tool to train the corpus, obtains the Embedding model, and then uses the Embedding model to calculate the vector of the standard address; finally, converts the case Chinese address into Chinese Pinyin, uses the Embedding model to calculate the vector of the case address, and searches for the standard address with the smallest distance to the case address vector from the standard address library to obtain the corresponding spatial coordinates. Compared with the currently commonly used address matching method based on deep learning, the present invention has a simple algorithm, does not require a large amount of preliminary data preprocessing work such as address text annotation, and saves manpower and computing power; in addition, the case address matching and positioning method disclosed by the present invention can effectively reduce the influence of homophones, misspellings, and wrong characters in Chinese on address text matching, and has good noise resistance. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0031] Figure 1 A schematic diagram of a process of a case spatial positioning method based on pinyin embedding address matching according to an embodiment of the present invention;
[0032] Figure 2 Schematic diagram of the relationship curve between the vector dimension and the case address space positioning accuracy in an embodiment of the present invention;
[0033] Figure 3 Schematic diagram of the relationship curve between address noise ratio and case address space positioning accuracy in an embodiment of the present invention;
[0034] Figure 4 A schematic diagram of a calculation process for vectorizing a Chinese phonetic phonetic address according to an embodiment of the present invention;
[0035] Figure 5 A schematic diagram of a training corpus obtained by using the lexeme segmentation method for the Chinese Pinyin address example data in Table 2 of an embodiment of the present invention;
[0036] Figure 6 This is a schematic diagram of a training corpus obtained using the ngram segmentation method with n=3 according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0038] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0039] like Figure 1 As shown, this embodiment provides a case spatial positioning method based on pinyin embedding address matching, including:
[0040] Collect address information of the research area, establish a standard address database, and obtain Chinese phonetic addresses;
[0041] Segment all Chinese Pinyin into single letters, combine them with the numbers in the Chinese Pinyin address to generate a training corpus, train the training corpus, and obtain a fastText Embedding model;
[0042] Vectorize the Chinese Pinyin addresses using the fastText Embedding model, and store the vector of each address in a standard address library;
[0043] The address information of patients in the area to be studied is converted into Chinese pinyin addresses, stop words are removed, and the vector of the Chinese pinyin address is obtained using the fastTextEmbedding model. The standard address with the closest cosine distance to the vector of the patient's Chinese pinyin address is searched from the standard address library, and the geographic coordinates of the corresponding standard address are obtained to complete the spatial positioning of the case.
[0044] Furthermore, the address information includes an address ID, a Chinese address text, a longitude coordinate, and a latitude coordinate. An example of a Chinese standard address in this embodiment is shown in Table 1.
[0045] Table 1
[0046]
[0047] Furthermore, obtaining the Chinese Pinyin address includes:
[0048] The Chinese characters in the address information are converted into Chinese Pinyin, and the stop words and punctuation marks in the Chinese Pinyin are removed, and the Chinese Pinyin address is formed with the numbers in the address information; wherein the stop words include province, city, district, county, town, street, road, lane, village, community, group, number, building, unit, floor and room. The Chinese Pinyin address example of this embodiment is shown in Table 2.
[0049] Table 2
[0050]
[0051] Furthermore, generating a training corpus includes:
[0052] Separate the letters and numbers of each Chinese Pinyin address and convert the address into an address entry combination;
[0053] The address term combinations of all addresses are stored in the training corpus, and each row stores a term combination of an address.
[0054] Specifically, the Chinese Pinyin address text is segmented. Commonly used methods for segmenting Chinese Pinyin address text include lexeme segmentation and ngram segmentation. The lexeme segmentation method is to separate the pinyin corresponding to each Chinese character in the Chinese address separately to form an entry of the address, in which continuous house numbers, room numbers and other numbers are also a separate entry. For example, using the lexeme method to segment the Chinese Pinyin address text "hu nan chang sha ning xiang heng shi zhen jin feng 8" is hu, nan, chang, sha, ning, xiang, heng, shi, zhen, jin, feng, 8, a total of 12 entries. The ngram segmentation method is to use a sliding window of size n in the Chinese Pinyin address text with spaces removed, slide from left to right in sequence, and obtain a series of entries consisting of strings of length n in order. For example, using the ngram method with n=3, the Chinese pinyin address text of "hu nan chang sha yu hua ren min zhong 168" is segmented into hun, una, nan, anc, nch, cha, han, ang, ngs, gsh, sha, hay, ayh, yuh, uhu, hua, uar, are, ren, enm, nmi, min, inz, nzh, zho, hon, ong, ng1, g16, 168, a total of 30 entries.
[0055] All the segmented Chinese Pinyin address entries are stored as training corpus by line, and the entries of the same address are separated by spaces and saved as one line. For example, the training corpus obtained by using the lexeme segmentation method for the Chinese Pinyin address sample data in Table 2 is as follows Figure 5 As shown in Figure 2, the training corpus obtained using the ngram segmentation method with n=3 is as follows: Figure 6 shown.
[0056] Furthermore, the fastText Embedding model is obtained including:
[0057] Create a fastText instance and set training parameters; the parameter settings of this embodiment are shown in Table 3;
[0058] Table 3
[0059]
[0060] The training corpus is trained using fastText to obtain a fastText Embedding model.
[0061] Furthermore, vectorizing the Chinese Pinyin address includes:
[0062] S1. Read the word combination of an address and use the fastText Embedding model to calculate the vector of each word combination.
[0063] S2, calculate the maximum value vector, minimum value vector and average value vector of the vectors of the word combination, and merge them into a Chinese pinyin vector;
[0064] S3, repeat S1 and S2 until all Chinese phonetic addresses complete vector calculation. The calculation process is as follows: Figure 4 As shown, where w i is the i-th entry of the address Chinese Pinyin, v i,j is the jth element of the i-th term vector, m is the number of address Chinese pinyin terms, and n is the vector dimension.
[0065] Specifically, in this embodiment, the vector of the term "nan" is [0.46752617, 0.47931778, 0.03945057, -0.0506415, 0.7307171, ... ... -0.1551808 ], with a dimension of 100. The Embedding model training parameter dim=100, so each term vector is 100-dimensional, and the corresponding address vector is 300-dimensional. The maximum value vector is a vector composed of the maximum values of the corresponding dimensions of all term vectors, the minimum value vector is a vector composed of the minimum values of the corresponding dimensions of all term vectors, and the average value vector is a vector composed of the mean values of the corresponding dimensions of all term vectors.
[0066] Furthermore, the vector cosine distance refers to the distance between the Chinese phonetic vectors corresponding to the two addresses calculated by the distance formula, which is calculated as follows:
[0067] ;
[0068] where θ is the cosine distance; x i and i The i-th component values of two Chinese pinyin vectors respectively, and n is the vector length.
[0069] Furthermore, obtaining the geographic coordinates corresponding to the standard address includes:
[0070] (1) S1, read the Chinese address of a case, convert the Chinese address into Chinese Pinyin address text, and remove stop words and punctuation marks in the Chinese Pinyin;
[0071] S2. Segment the case Chinese Pinyin address text into address term combinations, and use the Embedding model to calculate each term vector; this embodiment uses the ngram method with n=3 to segment the Chinese Pinyin address text, and then uses the Embedding model to calculate each term vector;
[0072] S3, calculating the maximum value vector, minimum value vector and average value vector of the address entries, and merging these vectors to form a case address vector;
[0073] S4. Searching for the standard address vector with the smallest distance to the case address vector in the standard address library, and then obtaining the coordinates of the standard address;
[0074] S5. Repeat S1-S4 to obtain the coordinates corresponding to all case addresses and complete case location.
[0075] In order to verify the feasibility of the case address space positioning method of the present invention, two groups of experiments were designed:
[0076] Experiment 1: This group of experiments uses 1,000 medical records from a hospital to analyze the relationship between vector dimension and the accuracy of spatial location of patient addresses. The experimental results are as follows: Figure 2 Experiment 1 not only verifies the feasibility of the method of the present invention, but also analyzes the relationship between vector dimension and spatial positioning accuracy. Figure 2 It shows that when the vector dimension is larger, the accuracy is also higher.
[0077] Experiment 2: This group of experiments adds noise to the patient addresses of 1,000 medical records of a hospital at a certain ratio to analyze the noise resistance of the method of the present invention. The relationship curve between the address noise ratio and the case address spatial positioning accuracy obtained by the experiment is shown in the figure below: Figure 3 As shown, the experiment shows that when the case address noise ratio is as high as 0.1, the case address spatial positioning accuracy can still reach 62.1%.
[0078] The present invention discloses a case spatial positioning method based on pinyin Embedding address matching, converting Chinese standard address text into Chinese pinyin address text, then segmenting the Chinese pinyin text to obtain address entries, and storing all address entries as a training corpus, using the Embedding tool to train the corpus, obtaining an Embedding model, and then using the Embedding model to calculate the vector of the standard address; finally, converting the case Chinese address into Chinese pinyin, using the Embedding model to calculate the vector of the case address, and searching for the standard address with the smallest distance from the case address vector from the standard address library to obtain the corresponding spatial coordinates. Compared with the current commonly used address matching method based on deep learning, the present invention has a simple algorithm, does not require a large amount of preliminary data preprocessing work such as address text annotation, and saves manpower and computing power; in addition, the case address matching and positioning method disclosed by the present invention can effectively reduce the influence of homophones, mispronunciations, and wrong characters in Chinese on address text matching, and has good noise resistance.
[0079] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A case spatial positioning method based on pinyin embedding address matching, characterized in that: include: Collect address information of the research area, establish a standard address database, and obtain Chinese phonetic addresses; Segment all Chinese Pinyin into single letters, combine them with the numbers in the Chinese Pinyin address to generate a training corpus, train the training corpus, and obtain a fastText Embedding model; Vectorize the Chinese Pinyin addresses using the fastText Embedding model, and store the vector of each address in a standard address library; The address information of patients in the area to be studied is converted into Chinese pinyin addresses, stop words are removed, and the vector of the Chinese pinyin address is obtained using the fastTextEmbedding model. The standard address with the closest cosine distance to the vector of the patient's Chinese pinyin address is searched from the standard address library, and the geographic coordinates of the corresponding standard address are obtained to complete the spatial positioning of the case.
2. The case spatial positioning method based on pinyin embedding address matching as claimed in claim 1, characterized in that: The address information includes address ID, Chinese address text, longitude coordinates and latitude coordinates.
3. The case spatial positioning method based on pinyin embedding address matching as claimed in claim 1, characterized in that: Obtaining the Chinese Pinyin address includes: The Chinese characters in the address information are converted into Chinese pinyin, and the stop words and punctuation marks in the Chinese pinyin are removed, and the Chinese pinyin address is formed with the numbers in the address information.
4. The case spatial positioning method based on pinyin embedding address matching as claimed in claim 3 is characterized in that: The stop words include province, city, district, county, town, street, road, lane, village, community, group, number, building, unit, floor and room.
5. The case spatial positioning method based on pinyin embedding address matching as claimed in claim 1, characterized in that: Generating a training corpus includes: Separate the letters and numbers of each Chinese Pinyin address and convert the address into an address entry combination; The address term combinations of all addresses are stored in the training corpus, and each row stores a term combination of an address.
6. The case spatial positioning method based on pinyin embedding address matching as claimed in claim 1, characterized in that: Obtaining the fastText Embedding model includes: Create a fastText instance and set training parameters; The training corpus is trained using fastText to obtain a fastText Embedding model.
7. The case spatial positioning method based on pinyin embedding address matching as claimed in claim 1, characterized in that: Vectorizing the Chinese Pinyin address includes: S1. Read the word combination of an address and use the fastText Embedding model to calculate the vector of each word combination. S2, calculate the maximum value vector, minimum value vector and average value vector of the vectors of the word combination, and merge them into a Chinese pinyin vector; S3, repeat S1 and S2 until all Chinese Pinyin addresses complete vector calculation.
8. The case spatial positioning method based on pinyin embedding address matching as claimed in claim 7, characterized in that: The vector cosine distance refers to the distance between the Chinese phonetic vectors corresponding to the two addresses calculated by the distance formula, which is calculated as follows: ; where θ is the cosine distance; x i and i The i-th component values of two Chinese pinyin vectors respectively, and n is the vector length.
Citation Information
Patent Citations
Address matching method and device
CN109800280A
Inquiry information processing method and device, storage medium and computer equipment
CN111415740A
Address auditing method and device based on artificial intelligence, equipment and storage medium
CN113822049A
Chinese character statement classification method based on semantic information enhancement
CN115203422A
Noise identification method, device and equipment and computer storage medium
CN116959434A