Method and device for predicting geographical location of social media users based on large language model

Through the large language model, the explicit and implicit geographical features in social media text are extracted and processed, and the problem of insufficient utilization of explicit tags and data in the existing technology is solved, which improves the accuracy and automation of user geographic location prediction. Real-time analysis of diversified data.

CN118779396BActive Publication Date: 2024-12-10ONE NETWORK INTEROPERABILITY (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411258936.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2024-12-10
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

Existing social media user geolocation prediction algorithms rely on explicit labels, insufficient data utilization, and traditional models have limited performance and accuracy when processing large-scale diversified data.

Method used

The large language model is used to extract explicit and implicit geographical features from social media texts, and these features are processed through the aggregation degree function and the fusion function to calculate the similarity to determine the user's geographical location.

Benefits of technology

It improves the accuracy and automation of geolocation prediction, is suitable for diversified social media platform data, and realizes efficient real-time analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779396B_ABST
    Figure CN118779396B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method, device and electronic device for predicting the geographic location of social media users based on a large language model, which belongs to the field of data processing technology. The method includes: cleaning and formatting the collected social media data to obtain standard data; extracting an explicit geographic feature set GE and an implicit geographic feature set from the text content of the standard data using a large language model; calculating the aggregation value Jf of the explicit geographic feature set GE through an aggregation function J; performing a fusion operation R(K, GY) on the implicit geographic feature set GY; and determining the geographic location LS=GP(MF, MS) of the social media user through a calculation function GP, ​​a first target set MF and a second target set MS. The present invention can improve the accuracy of predicting the geographic location of social media users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method, device and electronic device for predicting the geographic location of social media users based on a large language model. Background Art

[0002] On social media platforms, users’ geolocation information is often shared by the users themselves. This information can be used for various purposes, such as personalized advertising, geolocation check-ins, or sharing current location with friends and family.

[0003] If users do not actively share their location information, it is usually difficult to determine the user's location information when posting content on social media. It is also difficult to classify and manage social media content based on location information, which leads to certain difficulties in social media content management. Therefore, it is necessary to set up a prediction algorithm to predict the location of social media users.

[0004] The existing technology has the following problems in predicting the geographical location of social media users:

[0005] 1. Reliance on explicit labels: Existing algorithms mainly rely on explicit geographic labels provided by users. When these labels are missing, the prediction effect decreases significantly.

[0006] 2. Insufficient data utilization: Insufficient mining of implicit geographic information in social media texts, and failure to fully utilize natural language processing technology for location prediction.

[0007] 3. Model performance limitations: Traditional geolocation prediction models have limited performance and accuracy when processing large-scale and diverse social media data.

[0008] The above problems become technical problems that need to be solved. Summary of the invention

[0009] In view of this, embodiments of the present invention provide a method, device and electronic device for predicting the geographic location of social media users based on a large language model, which at least partially solve the problems existing in the prior art.

[0010] In a first aspect, an embodiment of the present invention provides a method for predicting a social media user's geographic location based on a large language model, comprising:

[0011] Collect social media data posted by users from multiple social media platforms, and clean and format the collected social media data to obtain standard data;

[0012] Using a large language model, we extract the explicit geographic feature set GE={GE1,GE2,…GEn} and the implicit geographic feature set GY={GY1,GY2,…GYm} from the text content of the standard data;

[0013] By using the aggregation function J, the aggregation value Jf=J(GE) of the explicit geographic feature set GE is calculated. When the aggregation value Jf is greater than a first preset value J0, an aggregation operation is performed on the explicit geographic feature set GE={GE1, GE2, ...GEn} to obtain a first target set MF={MF1, MF2, ...MFp};

[0014] Based on the fusion function R and the pre-constructed fusion parameter K=[UG,DM,TS,HE], the implicit geographic feature set GY={GY1,GY2,…GYm} is subjected to a fusion operation R(K,GY) to obtain a second target set MS={MS1,MS2,…MSq}, where UG represents the user's social information, DM represents the location information, TS represents the time information, and HE represents the environmental information;

[0015] The first target set MF and the second target set MS are subjected to similarity calculation to obtain a similarity value DX. When the similarity value is greater than a second preset value DX0, the geographic location LS=GP(MF, MS) of the social media user is determined by calculating the function GP, ​​the first target set MF and the second target set MS.

[0016] According to a specific implementation of the embodiment of the present disclosure, the social media data posted by users from multiple social media platforms are collected, and the collected social media data are cleaned and formatted to obtain standard data, including:

[0017] Importing data collected from different social media platforms into a unified data storage system;

[0018] Check and remove duplicate data records by comparing unique identifiers. For data without unique identifiers, use a hash algorithm to generate a unique identifier.

[0019] Fill missing data with default values ​​and identify and handle outliers in the data;

[0020] Extract the publisher’s user name, content publishing time, user geographic location information, and user published content from social media content;

[0021] Through the pre-defined unified data format type, the data fields are standardized to form standard data.

[0022] According to a specific implementation of the embodiment of the present disclosure, the method of extracting an explicit geographic feature set GE={GE1, GE2, ...GEn} and an implicit geographic feature set GY={GY1, GY2, ...GYm} from the text content of the standard data using a large language model includes:

[0023] Let T represent the text set in the standard data, , where t i is the i-th sentence in the text;

[0024] For each sentence , apply large models To extract place name entities :

[0025]

[0026] gather Contains all place name entities in the sentence;

[0027] Set up a mapping function S to correct spelling errors in set E and map synonymous place name entities to standard names:

[0028] E'=S(E)

[0029] Aggregate the removed duplicate entities into the final set of explicit geographic features GE:

[0030]

[0031] Unique() represents the deduplication function.

[0032] According to a specific implementation of the embodiment of the present disclosure, the method of extracting an explicit geographic feature set GE={GE1, GE2, ...GEn} and an implicit geographic feature set GY={GY1, GY2, ...GYm} from the text content of the standard data using a large language model also includes:

[0033] Using a pre-trained language model Parse the contextual meaning of text in standard data:

[0034]

[0035] Where C represents each sentence The context representation vector of ;

[0036] Let K be the set of keywords, , l is the number of keywords, and the relevance score between keywords and context is calculated:

[0037] ,in , Calculate the function for correlation;

[0038] Select a threshold θ based on the relevance score, filter out keywords below the threshold θ, and obtain the filtered keyword set K':

[0039]

[0040] According to the filtered keyword set K', use the knowledge graph Determine the hidden geographic feature GY:

[0041] .

[0042] According to a specific implementation of the embodiment of the present disclosure, performing an aggregation operation on the explicit geographic feature set GE={GE1, GE2, ...GEn} to obtain a first target set MF={MF1, MF2, ...MFp} includes:

[0043] For the explicit geographic feature set GE and the preset document set DG, define the aggregation function J:

[0044]

[0045] Representation characteristics and Frequency of co-occurrence in document collection DG:

[0046]

[0047] in, is an indicator function. When document d contains and Returns 1 if yes, otherwise returns 0, |DG| is the size of the document collection;

[0048] Compute the sum of the co-occurrence frequencies of all feature pairs:

[0049]

[0050] Filter out geographic feature pairs with a degree of aggregation higher than the first preset value J0 and combine them with P:

[0051]

[0052] From the selected geographic feature pair set P, generate disjoint subsets, each subset represents a set of highly correlated geographic features;

[0053] Let C be the set of generated subsets, ,in , for all ;

[0054] Each subset Add as an element to the first target set MF:

[0055] .

[0056] According to a specific implementation of the embodiment of the present disclosure, the implicit geographic feature set GY={GY1, GY2, ...GYm} is subjected to a fusion operation R(K, GY) to obtain a second target set MS={MS1, MS2, ...MSq}, including:

[0057] Based on the implicit geographic feature set GY and the fusion parameter K, the fusion operation R is defined:

[0058] R(K,GY)=MS

[0059] For each hidden geographic feature Perform feature extraction to obtain latent feature vector , using the preset neural network model to calculate each latent feature vector Weight :

[0060]

[0061] in, is the true label of the kth training sample in the neural network module, is the predicted label, is the regression coefficient, is the weight of the regularization term;

[0062] The feature vectors are fused by weighted summation.

[0063]

[0064] is the integrated feature vector after fusion, all the integrated feature vectors Put them into the second target set MS, and get the second target set MS={MS1,MS2,…MSq}.

[0065] According to a specific implementation of the embodiment of the present disclosure, the similarity calculation of the first target set MF and the second target set MS to obtain the similarity value DX includes:

[0066] For each vector in MF and each vector in MS , calculate the similarity between them :

[0067]

[0068] nl is the dimension of the vectors in the first target set MF and the second target set MS, then the similarity value DX between the first target set MF and the second target set MS is expressed as:

[0069] .

[0070] According to a specific implementation of the embodiment of the present disclosure, determining the geographical location LS=GP(MF, MS) of the social media user by calculating the function GP, ​​the first target set MF, and the second target set MS includes:

[0071] Calculate each dominant geographic feature Weight And each implicit geographic feature Weight , then the geographical location LS of the social media user is expressed as:

[0072]

[0073] and Represents dominant geographical features and implicit geographic features The geographic location coordinates of The function is used to determine the user's final geographic location.

[0074] In a second aspect, an embodiment of the present invention provides a device for predicting a social media user's geographic location based on a large language model, comprising:

[0075] The collection module collects social media data posted by users from multiple social media platforms, and cleans and formats the collected social media data to obtain standard data;

[0076] The extraction module uses a large language model to extract the explicit geographic feature set GE={GE1,GE2,…GEn} and the implicit geographic feature set GY={GY1,GY2,…GYm} from the text content of the standard data;

[0077] an aggregation module, calculating the aggregation value Jf=J(GE) of the explicit geographic feature set GE by using the aggregation function J, and when the aggregation value Jf is greater than a first preset value J0, performing an aggregation operation on the explicit geographic feature set GE={GE1, GE2, ...GEn} to obtain a first target set MF={MF1, MF2, ...MFp};

[0078] A fusion module, based on a fusion function R and a pre-constructed fusion parameter K=[UG, DM, TS, HE], performs a fusion operation R(K, GY) on the implicit geographic feature set GY={GY1, GY2, ...GYm} to obtain a second target set MS={MS1, MS2, ...MSq}, where UG represents the user's social information, DM represents the location information, TS represents the time information, and HE represents the environmental information;

[0079] The determination module calculates the similarity between the first target set MF and the second target set MS to obtain a similarity value DX. When the similarity value is greater than a second preset value DX0, the geographic location LS=GP(MF, MS) of the social media user is determined by calculating the function GP, ​​the first target set MF and the second target set MS.

[0080] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0081] at least one processor; and,

[0082] a memory communicatively connected to the at least one processor; wherein,

[0083] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the social media user geographic location prediction method based on a large language model in any of the aforementioned first aspects or any of the implementations of the first aspect.

[0084] In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the social media user geographic location prediction method based on a large language model in the aforementioned first aspect or any implementation of the first aspect.

[0085] In a fifth aspect, an embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the method for predicting the geographic location of social media users based on a large language model in the aforementioned first aspect or any implementation of the first aspect.

[0086] The social media user geographic location prediction scheme based on a large language model in an embodiment of the present invention includes: collecting social media data posted by users from multiple social media platforms, and cleaning and formatting the collected social media data to obtain standard data; using the large language model to extract an explicit geographic feature set GE={GE1, GE2, ...GEn} and an implicit geographic feature set GY={GY1, GY2, ...GYm} from the text content of the standard data; calculating the aggregation value Jf=J(GE) of the explicit geographic feature set GE through an aggregation function J, and when the aggregation value Jf is greater than a first preset value J0, performing an aggregation operation on the explicit geographic feature set GE={GE1, GE2, ...GEn} to obtain a first target set MF={MF1, MF2,…MFp}; based on the fusion function R and the pre-constructed fusion parameter K=[UG,DM,TS,HE], the implicit geographic feature set GY={GY1,GY2,…GYm} is fused by R(K,GY) to obtain the second target set MS={MS1,MS2,…MSq}, where UG represents the user's social information, DM represents the location information, TS represents the time information, and HE represents the environmental information; the first target set MF and the second target set MS are similarly calculated to obtain a similarity value DX, and when the similarity value is greater than a second preset value DX0, the geographic location LS=GP(MF,MS) of the social media user is determined by calculating the function GP, ​​the first target set MF and the second target set MS.

[0087] The solution of this application has the following beneficial effects:

[0088] High-precision prediction: By leveraging the powerful semantic understanding capabilities of large language models, we can extract rich implicit geographic information features from social media texts and improve the accuracy of geographic location prediction.

[0089] Wide applicability: Applicable to data of various social media platforms, able to process diverse text content, and achieve wide application.

[0090] High degree of automation: From data collection, feature extraction to location prediction, the entire process is highly automated, reducing manual intervention and improving efficiency.

[0091] Real-time analysis capabilities: Ability to quickly process and predict large-scale real-time social media data, and promptly discover and respond to geographic location-related information. BRIEF DESCRIPTION OF THE DRAWINGS

[0092] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments 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.

[0093] Figure 1 A schematic flow chart of a method for predicting the geographic location of social media users based on a large language model provided in an embodiment of the present invention;

[0094] Figure 2 A schematic flow chart of another method for predicting the geographic location of social media users based on a large language model provided by an embodiment of the present invention;

[0095] Figure 3 A schematic diagram of the structure of a device for predicting the geographical location of social media users based on a large language model provided by an embodiment of the present invention;

[0096] Figure 4 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0097] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0098] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.

[0099] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.

[0100] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0101] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.

[0102] The disclosed embodiment provides a method for predicting the geographical location of social media users based on a large language model. The method for predicting the geographical location of social media users based on a large language model provided in this embodiment can be executed by a computing device, which can be implemented as software, or as a combination of software and hardware, and which can be integrated in a server, terminal device, etc.

[0103] See also Figure 1 The present disclosure provides a method for predicting the geographical location of social media users based on a large language model, including:

[0104] S101, collecting social media data posted by users from multiple social media platforms, and cleaning and formatting the collected social media data to obtain standard data.

[0105] Data collected from different social media platforms can be imported into a unified data storage system, ensuring that the data can be easily accessed and processed.

[0106] Duplicate data records can be checked and removed by comparing unique identifiers (such as post IDs). For cases where there is no clear unique identifier, a hash algorithm can be used to generate a unique identifier.

[0107] For the acquired content, you can remove non-text information such as URL links, tags, emoticons, etc., convert data letters to lowercase, remove punctuation marks, remove numbers, etc. You can also extract the publisher's username, publishing time, user-provided geographic location information, extract the body content of the post, the number of comments, etc.

[0108] You can perform field standardization to ensure that all field names use the same naming convention, perform data type consistency operations to ensure that all data fields use the correct data type, and if a record is split into multiple data, merge them into a complete record to finally obtain standard data.

[0109] S102, using a large language model to extract an explicit geographic feature set GE={GE1, GE2, ...GEn} and an implicit geographic feature set GY={GY1, GY2, ...GYm} from the text content of the standard data.

[0110] Explicit geographic features refer to specific places, cities, countries and other geographical entities directly mentioned in the text. Extracting these features can identify place name entities from the text.

[0111] Let T represent the text set in the standard data, , where t i is the i-th sentence in the text;

[0112] For each sentence , apply large models To extract place name entities :

[0113]

[0114] gather Contains all place name entities in the sentence;

[0115] Set up a mapping function S to correct spelling errors in set E and map synonymous place name entities to standard names:

[0116] E'=S(E)

[0117] Aggregate the removed duplicate entities into the final set of explicit geographic features GE:

[0118]

[0119] Unique() represents the deduplication function.

[0120] Implicit geographic features refer to geographic information that is not directly mentioned in the text but can be inferred from the context.

[0121] You can use pre-trained language models Parse the contextual meaning of text in standard data:

[0122]

[0123] Where C represents each sentence The context representation vector of ;

[0124] Let K be the set of keywords, , l is the number of keywords, and the relevance score between keywords and context is calculated:

[0125] ,in , Calculate the function for correlation;

[0126] Select a threshold θ based on the relevance score, filter out keywords below the threshold θ, and obtain the filtered keyword set K':

[0127]

[0128] According to the filtered keyword set K', use the knowledge graph Determine the hidden geographic feature GY:

[0129] .

[0130] S103, calculate the aggregation value Jf=J(GE) of the explicit geographic feature set GE through the aggregation function J. When the aggregation value Jf is greater than the first preset value J0, perform an aggregation operation on the explicit geographic feature set GE={GE1, GE2,…GEn} to obtain the first target set MF={MF1, MF2,…MFp}.

[0131] A clustering function J can be defined to measure the clustering degree between explicit geographic features. The clustering degree can reflect the correlation or proximity between geographic features.

[0132] For the explicit geographic feature set GE and the preset document set DG, define the aggregation function J:

[0133]

[0134] Representation characteristics and Frequency of co-occurrence in document collection DG:

[0135]

[0136] in, is an indicator function. When document d contains and Returns 1 if yes, otherwise returns 0, |DG| is the size of the document collection;

[0137] Compute the sum of the co-occurrence frequencies of all feature pairs:

[0138]

[0139] Filter out geographic feature pairs with a degree of aggregation higher than the first preset value J0 and combine them with P:

[0140]

[0141] From the selected geographic feature pair set P, generate disjoint subsets, each subset represents a set of highly correlated geographic features;

[0142] Let C be the set of generated subsets, ,in , for all ;

[0143] Each subset Add as an element to the first target set MF:

[0144] .

[0145] S104, based on the fusion function R and the pre-constructed fusion parameters K=[UG,DM,TS,HE], the implicit geographic feature set GY={GY1,GY2,…GYm} is subjected to a fusion operation R(K,GY) to obtain a second target set MS={MS1,MS2,…MSq}, where UG represents the user's social information, DM represents location information, TS represents time information, and HE represents environmental information.

[0146] Based on the implicit geographic feature set GY and the fusion parameter K, the fusion operation R is defined:

[0147] R(K,GY)=MS

[0148] For each hidden geographic feature Perform feature extraction to obtain latent feature vector , using the preset neural network model to calculate each latent feature vector Weight :

[0149]

[0150] in, is the true label of the kth training sample in the neural network module, is the predicted label, is the regression coefficient, is the weight of the regularization term;

[0151] The feature vectors are fused by weighted summation.

[0152]

[0153] is the integrated feature vector after fusion, all the integrated feature vectors Put them into the second target set MS, and get the second target set MS={MS1,MS2,…MSq}.

[0154] S105, calculating the similarity between the first target set MF and the second target set MS to obtain a similarity value DX. When the similarity value is greater than a second preset value DX0, determining the geographic location LS=GP(MF, MS) of the social media user by calculating the function GP, ​​the first target set MF and the second target set MS.

[0155] For each vector in MF and each vector in MS , calculate the similarity between them :

[0156]

[0157] nl is the dimension of the vectors in the first target set MF and the second target set MS, then the similarity value DX between the first target set MF and the second target set MS is expressed as:

[0158] .

[0159] Calculate each dominant geographic feature Weight And each implicit geographic feature Weight , then the geographical location LS of the social media user is expressed as:

[0160]

[0161] and Represents dominant geographical features and implicit geographic features The geographic location coordinates of The function is used to determine the user's final geographic location.

[0162] The solution of this application has the following beneficial effects:

[0163] High-precision prediction: By leveraging the powerful semantic understanding capabilities of large language models, we can extract rich implicit geographic information features from social media texts and improve the accuracy of geographic location prediction.

[0164] Wide applicability: Applicable to data of various social media platforms, able to process diverse text content, and achieve wide application.

[0165] High degree of automation: From data collection, feature extraction to location prediction, the entire process is highly automated, reducing manual intervention and improving efficiency.

[0166] Real-time analysis capabilities: Ability to quickly process and predict large-scale real-time social media data, and promptly discover and respond to geographic location-related information.

[0167] According to a specific implementation of the embodiment of the present disclosure, the social media data posted by users from multiple social media platforms are collected, and the collected social media data are cleaned and formatted to obtain standard data, including:

[0168] Importing data collected from different social media platforms into a unified data storage system;

[0169] Check and remove duplicate data records by comparing unique identifiers. For data without unique identifiers, use a hash algorithm to generate a unique identifier.

[0170] Fill missing data with default values ​​and identify and handle outliers in the data;

[0171] Extract the publisher’s user name, content publishing time, user geographic location information, and user published content from social media content;

[0172] Through the pre-defined unified data format type, the data fields are standardized to form standard data.

[0173] According to a specific implementation of the embodiment of the present disclosure, the method of extracting an explicit geographic feature set GE={GE1, GE2, ...GEn} and an implicit geographic feature set GY={GY1, GY2, ...GYm} from the text content of the standard data using a large language model includes:

[0174] Let T represent the text set in the standard data, , where t i is the i-th sentence in the text;

[0175] For each sentence , apply large models To extract place name entities :

[0176]

[0177] gather Contains all place name entities in the sentence;

[0178] Set up a mapping function S to correct spelling errors in set E and map synonymous place name entities to standard names:

[0179] E'=S(E)

[0180] Aggregate the removed duplicate entities into the final set of explicit geographic features GE:

[0181]

[0182] Unique() represents the deduplication function.

[0183] According to a specific implementation of the embodiment of the present disclosure, the method of extracting an explicit geographic feature set GE={GE1, GE2, ...GEn} and an implicit geographic feature set GY={GY1, GY2, ...GYm} from the text content of the standard data using a large language model also includes:

[0184] Using a pre-trained language model Parse the contextual meaning of text in standard data:

[0185]

[0186] Where C represents each sentence The context representation vector of ;

[0187] Let K be the set of keywords, , l is the number of keywords, and the relevance score between keywords and context is calculated:

[0188] ,in , Calculate the function for correlation;

[0189] Select a threshold θ based on the relevance score, filter out keywords below the threshold θ, and obtain the filtered keyword set K':

[0190]

[0191] According to the filtered keyword set K', use the knowledge graph Determine the hidden geographic feature GY:

[0192] .

[0193] According to a specific implementation of the embodiment of the present disclosure, performing an aggregation operation on the explicit geographic feature set GE={GE1, GE2, ...GEn} to obtain a first target set MF={MF1, MF2, ...MFp} includes:

[0194] For the explicit geographic feature set GE and the preset document set DG, define the aggregation function J:

[0195]

[0196] Representation characteristics and Frequency of co-occurrence in document collection DG:

[0197]

[0198] in, is an indicator function. When document d contains and Returns 1 if yes, otherwise returns 0, |DG| is the size of the document collection;

[0199] Compute the sum of the co-occurrence frequencies of all feature pairs:

[0200]

[0201] Filter out geographic feature pairs with a degree of aggregation higher than the first preset value J0 and combine them with P:

[0202]

[0203] From the selected geographic feature pair set P, generate disjoint subsets, each subset represents a set of highly correlated geographic features;

[0204] Let C be the set of generated subsets, ,in , for all ;

[0205] Each subset Add as an element to the first target set MF:

[0206] .

[0207] According to a specific implementation of the embodiment of the present disclosure, the implicit geographic feature set GY={GY1, GY2, ...GYm} is subjected to a fusion operation R(K, GY) to obtain a second target set MS={MS1, MS2, ...MSq}, including:

[0208] Based on the implicit geographic feature set GY and the fusion parameter K, the fusion operation R is defined:

[0209] R(K,GY)=MS

[0210] For each hidden geographic feature Perform feature extraction to obtain latent feature vector , using the preset neural network model to calculate each latent feature vector Weight :

[0211]

[0212] in, is the true label of the kth training sample in the neural network module, is the predicted label, is the regression coefficient, is the weight of the regularization term;

[0213] The feature vectors are fused by weighted summation.

[0214]

[0215] is the integrated feature vector after fusion, all the integrated feature vectors Put them into the second target set MS, and get the second target set MS={MS1,MS2,…MSq}.

[0216] According to a specific implementation of the embodiment of the present disclosure, the similarity calculation of the first target set MF and the second target set MS to obtain the similarity value DX includes:

[0217] For each vector in MF and each vector in MS , calculate the similarity between them :

[0218]

[0219] nl is the dimension of the vectors in the first target set MF and the second target set MS, then the similarity value DX between the first target set MF and the second target set MS is expressed as:

[0220] .

[0221] According to a specific implementation of the embodiment of the present disclosure, determining the geographical location LS=GP(MF, MS) of the social media user by calculating the function GP, ​​the first target set MF, and the second target set MS includes:

[0222] Calculate each dominant geographic feature Weight And each implicit geographic feature Weight , then the geographical location LS of the social media user is expressed as:

[0223]

[0224] and Represents dominant geographical features and implicit geographic features The geographic location coordinates of The function is used to determine the user's final geographic location.

[0225] Corresponding to the above method embodiment, see Figure 3 The embodiment of the present invention further discloses a social media user geographic location prediction device 30 based on a large language model, comprising:

[0226] A collection module 301 collects social media data posted by users from multiple social media platforms, and cleans and formats the collected social media data to obtain standard data;

[0227] Extraction module 302, extracting explicit geographic feature set GE={GE1, GE2, ...GEn} and implicit geographic feature set GY={GY1, GY2, ...GYm} from the text content of standard data using a large language model;

[0228] Aggregation module 303, calculates the aggregation value Jf=J(GE) of the explicit geographic feature set GE through the aggregation function J, and when the aggregation value Jf is greater than the first preset value J0, performs an aggregation operation on the explicit geographic feature set GE={GE1, GE2, ...GEn} to obtain a first target set MF={MF1, MF2, ...MFp};

[0229] The fusion module 304 performs a fusion operation R(K, GY) on the implicit geographic feature set GY={GY1, GY2, ... GYm} based on the fusion function R and the pre-constructed fusion parameter K=[UG, DM, TS, HE] to obtain a second target set MS={MS1, MS2, ... MSq}, where UG represents the user's social information, DM represents the location information, TS represents the time information, and HE represents the environment information;

[0230] The determination module 305 calculates the similarity between the first target set MF and the second target set MS to obtain a similarity value DX. When the similarity value is greater than a second preset value DX0, the geographic location LS=GP(MF, MS) of the social media user is determined by calculating the function GP, ​​the first target set MF and the second target set MS.

[0231] See also Figure 4 The embodiment of the present invention further provides an electronic device 60, the electronic device comprising:

[0232] at least one processor; and,

[0233] a memory communicatively connected to the at least one processor; wherein,

[0234] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the social media user geographic location prediction method based on a large language model in the aforementioned method embodiment.

[0235] An embodiment of the present invention further provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the aforementioned method embodiment.

[0236] An embodiment of the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the social media user geographic location prediction method based on a large language model in the aforementioned method embodiment.

[0237] Reference below Figure 4 , which shows a schematic diagram of the structure of an electronic device 60 suitable for implementing the embodiment of the present disclosure. The electronic device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0238] like Figure 4As shown, the electronic device 60 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 60 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0239] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, a gage, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 60 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 60 is shown with various devices, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have instead.

[0240] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0241] The above is only a specific embodiment of the present invention, but the protection scope of the present invention 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 by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A method for predicting the geographical location of social media users based on a large language model, characterized in that: include: Collect social media data posted by users from multiple social media platforms, and clean and format the collected social media data to obtain standard data; Using a large language model, we extract the explicit geographic feature set GE={GE1,GE2,…GEn} and the implicit geographic feature set GY={GY1,GY2,…GYm} from the text content of the standard data; By using the aggregation function J, the aggregation value Jf=J(GE) of the explicit geographic feature set GE is calculated. When the aggregation value Jf is greater than a first preset value J0, an aggregation operation is performed on the explicit geographic feature set GE={GE1, GE2, ...GEn} to obtain a first target set MF={MF1, MF2, ...MFp}; Based on the fusion function R and the pre-constructed fusion parameter K=[UG,DM,TS,HE], the implicit geographic feature set GY={GY1,GY2,…GYm} is subjected to a fusion operation R(K,GY) to obtain a second target set MS={MS1,MS2,…MSq}, where UG represents the user's social information, DM represents the location information, TS represents the time information, and HE represents the environmental information; The first target set MF and the second target set MS are similarly calculated to obtain a similarity value DX. When the similarity value is greater than a second preset value DX0, the geographical location LS=GP(MF,MS) of the social media user is determined by calculating the function GP, ​​the first target set MF and the second target set MS. The method of extracting an explicit geographic feature set GE={GE1, GE2, ...GEn} and an implicit geographic feature set GY={GY1, GY2, ...GYm} from the text content of the standard data using a large language model includes: Let T represent the text set in the standard data, , where t i is the i-th sentence in the text; For each sentence , apply large models To extract place name entities : gather Contains all place name entities in the sentence; Set up a mapping function S to correct spelling errors in set E and map synonymous place name entities to standard names: E'=S(E) Aggregate the removed duplicate entities into the final set of explicit geographic features GE: Unique() represents the deduplication function; Using a pre-trained language model Parse the contextual meaning of text in standard data: Where C represents each sentence The context representation vector of ; Let K be the set of keywords, , l is the number of keywords, and the relevance score between keywords and context is calculated: ,in , Calculate the function for correlation; Select a threshold θ based on the relevance score, filter out keywords below the threshold θ, and obtain the filtered keyword set K': According to the filtered keyword set K', use the knowledge graph Determine the hidden geographic feature GY: ; The determining the geographical location LS=GP(MF,MS) of the social media user by calculating the function GP, ​​the first target set MF and the second target set MS comprises: Calculate each dominant geographic feature Weight And each implicit geographic feature Weight , then the geographical location LS of the social media user is expressed as: and Represents dominant geographical features and implicit geographic features The geographic location coordinates of Function is used to determine the user's final geographic location.

2. The method according to claim 1, characterized in that The social media data posted by users are collected from multiple social media platforms, and the collected social media data are cleaned and formatted to obtain standard data, including: Importing data collected from different social media platforms into a unified data storage system; Check and remove duplicate data records by comparing unique identifiers. For data without unique identifiers, use a hash algorithm to generate a unique identifier. Fill missing data with default values ​​and identify and handle outliers in the data; Extract the publisher’s user name, content publishing time, user geographic location information, and user published content from social media content; Through the pre-defined unified data format type, the data fields are standardized to form standard data.

3. The method according to claim 1, characterized in that The performing of aggregation operation on the explicit geographic feature set GE={GE1, GE2, ...GEn} to obtain a first target set MF={MF1, MF2, ...MFp} comprises: For the explicit geographic feature set GE and the preset document set DG, define the aggregation function J: Representation characteristics and Frequency of co-occurrence in document collection DG: in, is an indicator function. When document d contains and Returns 1 if yes, otherwise returns 0, |DG| is the size of the document collection; Compute the sum of the co-occurrence frequencies of all feature pairs: Filter out geographic feature pairs with a degree of aggregation higher than the first preset value J0 and combine them with P: From the selected geographic feature pair set P, generate disjoint subsets, each subset represents a set of highly correlated geographic features; Let C be the set of generated subsets, ,in , for all ; Each subset Add as an element to the first target set MF: 。 4. The method according to claim 3, characterized in that The fusion operation R(K,GY) is performed on the implicit geographic feature set GY={GY1,GY2,…GYm} to obtain a second target set MS={MS1,MS2,…MSq}, including: Based on the implicit geographic feature set GY and the fusion parameter K, the fusion operation R is defined: R(K,GY)=MS For each hidden geographic feature Perform feature extraction to obtain latent feature vector , using the preset neural network model to calculate each latent feature vector Weight : in, is the true label of the kth training sample in the neural network module, is the predicted label, is the regression coefficient, is the weight of the regularization term; Fusion of feature vectors by weighted summation: is the integrated feature vector after fusion, all the integrated feature vectors Put them into the second target set MS, and get the second target set MS={MS1,MS2,…MSq}.

5. The method according to claim 4, characterized in that The calculating the similarity between the first target set MF and the second target set MS to obtain the similarity value DX includes: For each vector in MF And each vector in MS , calculate the similarity between them : nl is the dimension of the vectors in the first target set MF and the second target set MS, then the similarity value DX between the first target set MF and the second target set MS is expressed as: 。 6. A device for predicting the geographical location of social media users based on a large language model, characterized in that: include: The collection module collects social media data posted by users from multiple social media platforms, and cleans and formats the collected social media data to obtain standard data; The extraction module uses a large language model to extract the explicit geographic feature set GE={GE1,GE2,…GEn} and the implicit geographic feature set GY={GY1,GY2,…GYm} from the text content of the standard data; an aggregation module, calculating the aggregation value Jf=J(GE) of the explicit geographic feature set GE by using the aggregation function J, and when the aggregation value Jf is greater than a first preset value J0, performing an aggregation operation on the explicit geographic feature set GE={GE1, GE2, ...GEn} to obtain a first target set MF={MF1, MF2, ...MFp}; A fusion module, based on a fusion function R and a pre-constructed fusion parameter K=[UG, DM, TS, HE], performs a fusion operation R(K, GY) on the implicit geographic feature set GY={GY1, GY2, ...GYm} to obtain a second target set MS={MS1, MS2, ...MSq}, where UG represents the user's social information, DM represents the location information, TS represents the time information, and HE represents the environmental information; a determination module, performing similarity calculation on the first target set MF and the second target set MS to obtain a similarity value DX, and when the similarity value is greater than a second preset value DX0, determining the geographic location LS=GP(MF,MS) of the social media user by calculating a function GP, ​​the first target set MF and the second target set MS; The method of extracting an explicit geographic feature set GE={GE1, GE2, ...GEn} and an implicit geographic feature set GY={GY1, GY2, ...GYm} from the text content of the standard data using a large language model includes: Let T represent the text set in the standard data, , where t i is the i-th sentence in the text; For each sentence , apply large models To extract place name entities : gather Contains all place name entities in the sentence; Set up a mapping function S to correct spelling errors in set E and map synonymous place name entities to standard names: E'=S(E) Aggregate the removed duplicate entities into the final set of explicit geographic features GE: Unique() represents the deduplication function; Using a pre-trained language model Parse the contextual meaning of text in standard data: Where C represents each sentence The context representation vector of ; Let K be the set of keywords, , l is the number of keywords, and the relevance score between keywords and context is calculated: ,in , Calculate the function for correlation; Select a threshold θ based on the relevance score, filter out keywords below the threshold θ, and obtain the filtered keyword set K': According to the filtered keyword set K', use the knowledge graph Determine the hidden geographic feature GY: ; The determining the geographical location LS=GP(MF,MS) of the social media user by calculating the function GP, ​​the first target set MF and the second target set MS comprises: Calculate each dominant geographic feature Weight And each implicit geographic feature Weight , then the geographical location LS of the social media user is expressed as: and Represents dominant geographical features and implicit geographic features The geographic location coordinates of Function is used to determine the user's final geographic location.

7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the social media user geographic location prediction method based on a large language model as described in any one of claims 1 to 5.