Dynamic social network connection graph generation method based on NLP keyword extraction, storage medium and equipment
Through the dynamic social network connection graph generation method based on NLP keyword extraction, the limitations of the existing technology when processing multi-source heterogeneous data and dynamic data are solved, and high-precision and real-time social network connection graph generation is realized, which is suitable for complex large-scale social network analysis.
Patent Information
- Application Number
- CN202411897827.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-05-02
AI Technical Summary
The existing social network connection graph generation method has limitations when processing multi-source heterogeneous data and dynamic data, and cannot effectively integrate multi-source data and realize real-time updates, resulting in the low quality of the generated connection graph.
The dynamic social network connection graph generation method based on NLP keyword extraction is adopted, and the multi-source data is automatically processed, keywords are extracted using NLP technology, and the weight of edges between nodes is calculated in combination with Word2Vec model and attention mechanism, and the initial connection graph is generated through a force-oriented layout algorithm, and the graph structure is dynamically updated to reflect the latest social relationship.
It significantly improves the accuracy and real-timeness of social network connection graphs, enhances the processing capability of multi-source heterogeneous data, ensures the accuracy and consistency of generated graphs, and is suitable for complex large-scale social network analysis scenarios.
Smart Images

Figure CN119917719A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of social network analysis, and in particular to a method, storage medium and device for generating a dynamic social network connection graph based on NLP keyword extraction. Background Art
[0002] Social network analysis through social network connection graphs can intuitively display the interaction relationships and community distribution between users, providing key support for precision marketing, user behavior analysis, etc. Existing social network connection graph generation methods mainly include rule-based static generation methods and generation methods implemented through simple graph databases. These methods usually rely on manual configuration or predefined static rules to generate connection graphs. Although these methods are feasible when processing social network data with a single data source or fixed topology, they expose obvious limitations in complex practical scenarios:
[0003] (1) Limitations of processing multi-source heterogeneous data:
[0004] In modern application scenarios, social network data often comes from different formats and types, such as JSON files output by API data, table structured data in databases, XML configuration files, etc. Existing methods usually lack effective multi-source data fusion capabilities and require a lot of manual operations for data preprocessing, which not only increases the workload, but also easily causes information loss and errors in data processing, thus affecting the quality of social network connection graph generation;
[0005] (2) Limitations of processing dynamic data:
[0006] When user relationships in social networks are dynamically adjusted, existing methods usually rely on static rules to generate graph structures and cannot achieve real-time updates, resulting in the generated social network connection graph failing to accurately reflect the latest social relationship structure, which in turn affects the decision-making efficiency of downstream tasks. Summary of the invention
[0007] In view of the deficiencies in the prior art, the present invention provides a method, storage medium and device for generating a dynamic social network connection graph based on NLP keyword extraction. By automatically processing multi-source data, the scope of social network data is expanded. Through the NLP keyword extraction technology, the keyword extraction process is made more accurate and efficient, and the important concepts and relationships in the text can be better captured. The social network connection graph is generated through keywords, which significantly improves the accuracy and real-time performance of the social network connection graph, and can dynamically update the social network connection graph.
[0008] To achieve the above object, the present invention adopts the following technical solution: a method for generating a dynamic social network connection graph based on NLP keyword extraction, which specifically includes the following steps:
[0009] Step S1: Obtain multi-source social network data from social media, convert it into a unified format, and then perform data cleaning;
[0010] Step S2: extract keywords from the cleaned social network data based on NLP keyword extraction technology;
[0011] Step S3: taking the extracted keywords as nodes, calculating the weights of the edges between nodes according to the semantic relevance and co-occurrence frequency between nodes, and generating an initial social network connection graph through a force-directed layout algorithm;
[0012] Step S4, deleting edges with weights lower than a dynamic threshold in the social network connection graph, and deleting isolated nodes to form a social network connection graph;
[0013] Step S5: for newly added social network data in social media, repeat steps S1-S2 to obtain keywords, match the obtained keywords with nodes in the social network connection graph, use the newly added keywords as newly added nodes, repeat steps S3-S4 to dynamically update the social network connection graph, and record the update frequency of the social network connection graph;
[0014] Step S6: If the update frequency of the social network connection graph exceeds the update frequency threshold, repeat steps S1-S4 to regenerate the social network connection graph.
[0015] Furthermore, the data cleaning in step S1 includes: screening the social network data in a unified format for field integrity, value range, and string length, marking abnormal social network data, and removing or repairing the abnormal social network data according to business needs.
[0016] Furthermore, step S2 includes the following sub-steps:
[0017] Step S2.1, calculate the term frequency TF(w) and inverse document frequency IDF(w) of each word in the cleaned social network data, and generate the weight of each word TF-IDF(w)=TF(w)×IDF(w);
[0018] Step S2.2, using the Word2Vec model, map each word to a high-dimensional semantic space, obtain a word embedding vector, and calculate the context relevance ContextScore(w) of each word;
[0019] Step S2.3, according to the weight TF-IDF(w) of each word and the context relevance ContextScore(w) of the corresponding word, the context relevance score of each word Score(w) = TF-IDF(w) × (1 + α × ContextScore(w)), where α is the weight coefficient controlling the influence of context relevance;
[0020] Step S2.4, dynamically adjust the context relevance score of each word in combination with the global weight of the corresponding word to obtain the final score of each word;
[0021] Step S2.5: Use the words whose final scores are higher than the set threshold as keywords of the social network data.
[0022] Furthermore, step S2.2 includes the following sub-steps:
[0023] Step S2.2.1: Calculate the cosine similarity between each word and all words in its context window to generate a semantic relevance score Where, Emb(w) represents the word embedding vector of word w, Context represents the context window of word w, and c represents the word in Context;
[0024] Step S2.2.2: Input the word embedding vector into the attention mechanism to generate attention weights Among them, Q and K represent the query and key vectors respectively, and d k Represents the dimension of the word embedding vector;
[0025] Step S2.2.3, perform weighted fusion of the semantic relevance score of each word and the attention weight to obtain the context relevance of each word ContextScore(w) = β1·SemanticScore(w) + β2·Attention(w), where β1 represents the weight of SemanticScore(w) and β2 represents the weight of Attention(w).
[0026] Furthermore, the weight coefficient α controlling the influence of the context relevance is dynamically adjusted according to the average sentence length and semantic consistency:
[0027]
[0028] Among them, α min Indicates the minimum value of the weight coefficient that controls the influence of context relevance, α max represents the maximum value of the weight coefficient that controls the influence of context relevance, L represents the average sentence length, and L max Indicates the preset maximum average sentence length, w Lrepresents the weight of the average sentence length, S represents the semantic consistency score, and S max represents the maximum value of semantic consistency score, w s represents the weight of semantic consistency, w L +w s =1.
[0029] Furthermore, step S2.4 includes the following sub-steps:
[0030] Step S2.4.1: Determine the global weight of each word based on the word frequency distribution of all social network data after cleaning Where N represents the total number of words in all social network data, and f(w) represents the number of occurrences of word w in all social network data;
[0031] Step S2.4.2: Dynamically adjust the context relevance score of each word in combination with the global weight of the corresponding word to obtain the final score of each word: OptimizedScore(w)=Score(w)×GlobalAdjust(w).
[0032] Furthermore, the calculation process of the weight of the edge between the nodes is:
[0033] W i =cos(Emb(w1),Emb(w2))×Co-ccurrence(w1,w2)
[0034] Among them, W i represents the weight of the edge between node w1 and node w2, Emb(w1) and Emb(w2) represent the word embedding vectors of node w1 and node w2 respectively, cos(Emb(w1), Emb(w2)) represents the cosine similarity of Emb(w1) and Emb(w2), and Co-ccurrence(w1, w2) represents the frequency of co-occurrence of node w1 and node w2 in social network data.
[0035] Furthermore, the calculation process of the dynamic threshold θ in step S4 is:
[0036]
[0037] Among them, n represents the total number of edges, i represents the index of n, and γ represents the adjustable coefficient.
[0038] Furthermore, the present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the method for generating a dynamic social network connection graph based on NLP keyword extraction.
[0039] Furthermore, the present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for generating a dynamic social network connection graph based on NLP keyword extraction is implemented.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] (1) The method for generating a dynamic social network connection graph based on NLP keyword extraction can unify the format of multi-source social network data, enhance the automatic processing capability and efficiency of multi-source social network data, expand the acquisition scope of social network data, and ensure the accuracy and consistency of social network data through data cleaning;
[0042] (2) The method for generating a dynamic social network connection graph based on NLP keyword extraction of the present invention combines the Word2Vec model and the attention mechanism on the basis of the traditional TF-IDF algorithm which only considers word frequency information. Through the Word2Vec model, words are mapped to a high-dimensional semantic space, thereby capturing the deep semantic association between words and contexts. It is no longer limited to word frequency statistics, and significantly improves the accurate judgment of the semantic relevance of words. The attention mechanism can dynamically adjust the weight according to the importance of the word in the context, so that the extraction result is more in line with the specific context. At the same time, through the combination of semantic optimization and attention weight, redundant information and low-value words are effectively filtered out, the semantic understanding ability of keyword extraction is improved, and the core keywords are accurately located. In addition, the keyword weight can be automatically adjusted according to the context of social network data, and the accuracy of keyword extraction can be ensured regardless of short text or long text. Through the NLP keyword extraction technology of the present invention, the situation where high-frequency words dominate or low-frequency words are ignored is avoided, and the high reliability and wide applicability of keyword extraction are achieved;
[0043] (3) The method for generating a dynamic social network connection graph based on NLP keyword extraction in the present invention adjusts the edges in the social network connection graph through a dynamic threshold. The dynamic threshold can dynamically remove low-correlation or noise edges according to the weight distribution characteristics of the edges in the social network, and only retain high-quality edges, thereby significantly improving the accuracy of the social network connection graph; in addition, the dynamic threshold adjustment avoids the overhead of regenerating the graph, and significantly reduces the processing time and computing resource consumption through real-time calculation and fast edge adjustment. In the process of generating the social network connection graph, after the weakly correlated edges are removed, the graph structure is clearer, and the strong correlation relationship between nodes is more intuitive, further improving the readability and display effect of the social network connection graph. For high-frequency data update scenarios, the dynamic threshold can quickly respond to changes in new data, maintain the high quality and accuracy of the generated social network connection graph, and is suitable for analysis and visualization tasks of large-scale dynamic social networks;
[0044] (4) The method for generating a dynamic social network connection graph based on NLP keyword extraction of the present invention can perform local dynamic updates on the social network connection graph according to the newly added social network data in social media. Through the local dynamic update mechanism, only incremental adjustments are made to the newly added or changed nodes and edges to avoid full graph reconstruction, thereby significantly reducing computational overhead; when the update frequency threshold is exceeded, the social network connection graph is regenerated to ensure that the generated connection graph can always maintain accuracy and consistency in high-frequency data update scenarios. The present invention combines local dynamic updates and global updates of the social network connection graph, while efficiently responding to real-time data changes, greatly saving computing resources, and is suitable for complex large-scale social network analysis scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flow chart of a method for generating a dynamic social network connection graph based on NLP keyword extraction according to the present invention;
[0046] Figure 2 It is a flowchart of keyword extraction in the present invention. DETAILED DESCRIPTION
[0047] The technical solution of the present invention will be further described in detail below in conjunction with the accompanying drawings.
[0048] like Figure 1 The flowchart of the method for generating a dynamic social network connection graph based on NLP keyword extraction of the present invention is as follows:
[0049] Step S1, obtaining multi-source social network data from social media, converting it into a unified format, enhancing the automatic processing capability and efficiency of multi-source social network data, expanding the acquisition scope of social network data, and performing data cleaning on the social network data in a unified format, including: screening the social network data in a unified format for field integrity, value range and string length, marking abnormal social network data, removing or repairing the abnormal social network data according to business needs, ensuring the accuracy and consistency of social network data, and providing a unified standard for subsequent keyword extraction.
[0050] Step S2: extract keywords from the cleaned social network data based on NLP keyword extraction technology, which improves the accuracy and efficiency of keyword extraction and significantly enhances the adaptability to diversified text data; Figure 2 , specifically including the following sub-steps:
[0051] Step S2.1, calculate the term frequency TF(w) and inverse document frequency IDF(w) of each word in the cleaned social network data, and generate the weight of each word TF-IDF(w)=TF(w)×IDF(w);
[0052] Step S2.2: Use the Word2Vec model to map each word to a high-dimensional semantic space, obtain a word embedding vector, and calculate the context relevance ContextScore(w) of each word, thereby improving the semantic understanding ability of keyword extraction; specifically, the following sub-steps are included:
[0053] Step S2.2.1: Calculate the cosine similarity between each word and all words in its context window to generate a semantic relevance score Among them, Emb(w) represents the word embedding vector of word w, Context represents the context window of word w, and c represents the word in Context. The Word2Vec model embeds words into a high-dimensional semantic space to capture the deep semantic associations between words and context words. It can not only identify the explicit associations between words and context words, such as the co-occurrence relationship of words, but also the implicit associations between words and context words, such as words that are not directly co-occurring but semantically related, which greatly broadens the semantic understanding ability of keyword extraction.
[0054] Step S2.2.2: Input the word embedding vector into the attention mechanism to generate attention weights Among them, Q and K represent the query and key vectors respectively, and d k Represents the dimension of the word embedding vector; the attention mechanism dynamically assigns weights to context words, ensuring that highly correlated words occupy a larger proportion in the context correlation calculation, while the influence of low-correlation or noise words is weakened, thereby improving the accuracy of the calculation.
[0055] Step S2.2.3, weighted fusion of the semantic relevance score of each word and the attention weight to obtain the context relevance of each word ContextScore(w) = β1·SemanticScore(w) + β2·Attention(w), where β1 represents the weight of SemanticScore(w), and β2 represents the weight of Attention(w). The present invention generates a more accurate context relevance score ContextScore by weighted fusion of semantic relevance and attention weight, based on the combination of global semantic information and local context characteristics. This method is particularly suitable for multi-source heterogeneous data, and can handle sparse semantic scenarios of short texts in social media, as well as complex context changes in long texts. In addition, the mechanism of combining semantic enhancement and attention optimization can effectively filter noise words, ensuring that the generated context relevance has higher stability and robustness, thereby providing efficient keyword extraction capabilities.
[0056] Step S2.3: According to the weight TF-IDF(w) of each word and the context relevance ContextScore(w) of the corresponding word, the context relevance score of each word Score(w) = TF-IDF(w) × (1 + α × ContextScore(w)) is obtained, where α is the weight coefficient that controls the influence of context relevance, and is dynamically adjusted according to the average sentence length and semantic consistency:
[0057]
[0058] Among them, α min Indicates the minimum value of the weight coefficient that controls the influence of context relevance, α max represents the maximum value of the weight coefficient that controls the influence of context relevance, L represents the average sentence length, and L max Indicates the preset maximum average sentence length, w L represents the weight of the average sentence length, S represents the semantic consistency score, and S max represents the maximum value of semantic consistency score, w s represents the weight of semantic consistency, w L +w s=1. The weight coefficient α that controls the influence of context relevance can effectively improve the flexibility and adaptability of keyword extraction. In short text scenarios such as social media dynamics, due to the lack of context information, α is dynamically adjusted to a lower value to reduce the dependence on limited context information; while in long text scenarios such as professional articles or long comments, α will be adjusted to a higher value to make full use of rich context information to strengthen semantic association. In addition, α can balance the influence of TF-IDF weight and context relevance, weaken the interference of context relevance in texts with low semantic consistency, and enhance the utilization of context information in texts with high semantic consistency, thereby improving the accuracy of keyword extraction. By combining the dynamic adjustment mechanism of average sentence length and semantic consistency, the system adapts to the characteristics of multi-source heterogeneous data, and can accurately extract keywords regardless of short text, long text or content in different fields. Especially in the processing scenario of real-time dynamic data, the dynamic adjustment of α can quickly respond to the changes of new data and maintain the efficiency and stability of the extraction results. At the same time, the dynamic adjustment of α optimizes the weight distribution of context information and avoids the waste of resources caused by fixed parameters.
[0059] Step S2.4: dynamically adjust the context relevance score of each word in combination with the global weight of the corresponding word to obtain the final score of each word; including the following sub-steps:
[0060] Step S2.4.1: Determine the global weight of each word based on the word frequency distribution of all social network data after cleaning Dynamically suppress the influence of high-frequency words to prevent function words or noise words from interfering with the extraction results, while improving the importance compensation of domain-specific low-frequency words, where N represents the total number of words in all social network data, and f(w) represents the number of occurrences of word w in all social network data, effectively balancing the importance of high-frequency and low-frequency words;
[0061] Step S2.4.2, dynamically adjust the context relevance score of each word in combination with the global weight of the corresponding word, and obtain the final score of each word OptimizedScore(w)=Score(w)×GlobalAdjust(w), and combine the global weight with the context relevance, so that the keyword extraction result can not only reflect the semantic relevance of the local context, but also be representative in the global scope. The present invention combines the context relevance score of each word, i.e., local information, and the word frequency distribution, i.e., global information, through dynamic adjustment of the global weight, and significantly improves the accuracy and semantic consistency of keyword extraction by comprehensively balancing the local semantic relevance and global importance; at the same time, dynamically adjust the weight distribution according to the data scale and distribution characteristics, reduce the interference of noise words in large-scale data, and enhance the diversity of keywords in small-scale data; in addition, the global weight dynamic adjustment mechanism can adapt to the needs of multi-source heterogeneous data and dynamic scenarios, and quickly adjust the weight in real-time data update to ensure that the extraction results always reflect the latest status of the data, with strong robustness and interpretability.
[0062] Step S2.5: Use the words whose final scores are higher than the set threshold as keywords of the social network data.
[0063] Step S3: Take the extracted keywords as nodes, calculate the weights of the edges between nodes according to the semantic relevance and co-occurrence frequency between nodes, and generate an initial social network connection graph through a force-directed layout algorithm.
[0064] The calculation process of the weight of the edge between nodes in the present invention is:
[0065] W i =cos(Emb(w1),Emb(w2))×Co-ccurrence(w1,w2)
[0066] Among them, W irepresents the weight of the edge between node w1 and node w2, Emb(w1) and Emb(w2) represent the word embedding vectors of node w1 and node w2 respectively, cos(Emb(w1), Emb(w2)) represents the cosine similarity between Emb(w1) and Emb(w2), and Co-ccurrence(w1,w2) represents the frequency of co-occurrence of node w1 and node w2 in social network data. Calculating the weight of the edge between nodes based on the semantic relevance and co-occurrence frequency between nodes can simultaneously reflect the semantic relationship and actual co-occurrence characteristics between keywords. The semantic relevance is based on the word vector model and captures the deep semantic association between keywords. Even keywords that are semantically related but not directly co-occurring can establish connections through high semantic relevance, thereby enhancing the semantic richness of the connection graph. At the same time, the co-occurrence frequency directly quantifies the co-occurrence intensity of keywords in the data, reflecting their actual relevance, ensuring that the connection graph not only reflects semantic logic, but also has real statistical support. The combination of the two can effectively filter out noise edges with low semantic relevance or low co-occurrence frequency, thereby improving the overall accuracy and semantic consistency of the connection graph. In social network data, this combination allows the connection graph to take into account both implicit and explicit associations, especially in different scenarios of short or long texts, and can adapt to diverse data characteristics and generate connection graphs with strong robustness and credibility. In addition, the edge weight definition that combines semantic relevance with co-occurrence frequency also provides a guarantee for the interpretability of the connection graph.
[0067] Step S4: Delete the edges whose weights are lower than the dynamic threshold in the social network connection graph, and delete the isolated nodes to form a social network connection graph; wherein the calculation process of the dynamic threshold θ is:
[0068]
[0069] Where n represents the total number of edges, i represents the index of n, and γ represents the adjustable coefficient. By adjusting γ, the size of the dynamic threshold can be flexibly controlled and the sensitivity of denoising can be changed. A larger γ will increase the dynamic threshold and tend to retain more significant edges and nodes; a smaller γ will tend to remove more noise. Therefore, users can adjust the dynamic threshold according to the actual application scenario.
[0070] Step S5: For the newly added social network data in social media, repeat steps S1-S2, obtain keywords, match the obtained keywords with the nodes in the social network connection graph, use the newly added keywords as new nodes, repeat steps S3-S4, and dynamically update the social network connection graph, which can quickly reflect the latest changes in the social network and record the update frequency of the social network connection graph. Since social media data is updated frequently, the newly added data needs to be quickly integrated into the existing social network connection graph, and the full reconstruction efficiency is low and resources are wasted. The present invention adopts a local update strategy, which only updates the newly added and affected areas, which can significantly improve efficiency and save resources, while maintaining the overall stability of the social network connection graph.
[0071] Step S6: If the update frequency of the social network connection graph exceeds the update frequency threshold, the newly added data may have significantly changed the overall structure of the connection graph, and local adjustments are difficult to maintain the optimal state of the global semantic consistency and topological structure. Repeat steps S1-S4 to regenerate the social network connection graph, recalculate the weights of all nodes and edges, comprehensively optimize the structure of the graph, adapt to changes in data distribution, eliminate redundancy or deviation caused by local adjustments, and ensure that the generated social network connection graph can accurately reflect the current network status.
[0072] The present invention combines global dynamic adjustment with local dynamic adjustment of social network connection graphs, dynamically adapts to data changes of different scales and frequencies, maintains the real-time nature of the graph, and ensures global semantic consistency and topological balance. In addition, the dynamic social network connection graph generation method based on NLP keyword extraction of the present invention can extract its interactive relationship with key users from the social network connection graph, providing a reference for formulating appropriate marketing strategies.
[0073] In a technical solution of the present invention, a computer-readable storage medium is also provided, storing a computer program, wherein the computer program enables a computer to execute the method for generating a dynamic social network connection graph based on NLP keyword extraction.
[0074] In a technical solution of the present invention, an electronic device is also provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for generating a dynamic social network connection graph based on NLP keyword extraction is implemented.
[0075] In the embodiments disclosed in the present application, the computer storage medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. The computer storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the above. More specific examples of computer storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0076] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0077] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.
Claims
1. A method for generating a dynamic social network connection graph based on NLP keyword extraction, characterized in that: The specific steps include: Step S1: Obtain multi-source social network data from social media, convert it into a unified format, and then perform data cleaning; Step S2: extract keywords from the cleaned social network data based on NLP keyword extraction technology; Step S3: taking the extracted keywords as nodes, calculating the weights of the edges between nodes according to the semantic relevance and co-occurrence frequency between nodes, and generating an initial social network connection graph through a force-directed layout algorithm; Step S4, deleting edges with weights lower than a dynamic threshold in the social network connection graph, and deleting isolated nodes to form a social network connection graph; Step S5: for newly added social network data in social media, repeat steps S1-S2 to obtain keywords, match the obtained keywords with nodes in the social network connection graph, use the newly added keywords as newly added nodes, repeat steps S3-S4 to dynamically update the social network connection graph, and record the update frequency of the social network connection graph; Step S6: If the update frequency of the social network connection graph exceeds the update frequency threshold, repeat steps S1-S4 to regenerate the social network connection graph.
2. According to the method for generating a dynamic social network connection graph based on NLP keyword extraction according to claim 1, it is characterized in that: The data cleaning in step S1 includes: screening the social network data in a unified format for field integrity, value range, and string length, marking abnormal social network data, and removing or repairing the abnormal social network data according to business needs.
3. A method for generating a dynamic social network connection graph based on NLP keyword extraction according to claim 2, characterized in that: Step S2 includes the following sub-steps: Step S2.1, calculate the term frequency TF(w) and inverse document frequency IDF(w) of each word in the cleaned social network data, and generate the weight of each word TF-IDF(w)=TF(w)×IDF(w); Step S2.2, using the Word2Vec model, map each word to a high-dimensional semantic space, obtain a word embedding vector, and calculate the context relevance ContextScore(w) of each word; Step S2.3, according to the weight TF-IDF(w) of each word and the context relevance ContextScore(w) of the corresponding word, the context relevance score of each word Score(w) = TF-IDF(w) × (1 + α × ContextScore(w)), where α is the weight coefficient controlling the influence of context relevance; Step S2.4, dynamically adjust the context relevance score of each word in combination with the global weight of the corresponding word to obtain the final score of each word; Step S2.5: Use the words whose final scores are higher than the set threshold as keywords of the social network data.
4. The method for generating a dynamic social network connection graph based on NLP keyword extraction according to claim 3, characterized in that: Step S2.2 includes the following sub-steps: Step S2.2.1: Calculate the cosine similarity between each word and all words in its context window to generate a semantic relevance score Where, Emb(w) represents the word embedding vector of word w, Context represents the context window of word w, and c represents the word in Context; Step S2.2.2: Input the word embedding vector into the attention mechanism to generate attention weights Among them, Q and K represent the query and key vectors respectively, and d k Represents the dimension of the word embedding vector; Step S2.2.3, perform weighted fusion of the semantic relevance score of each word and the attention weight to obtain the context relevance of each word ContextScore(w) = β1·SemanticScore(w) + β2·Attention(w), where β1 represents the weight of SemanticScore(w) and β2 represents the weight of Attention(w).
5. The method for generating a dynamic social network connection graph based on NLP keyword extraction according to claim 3, characterized in that: The weight coefficient α controlling the influence of context relevance is dynamically adjusted according to the average sentence length and semantic consistency: Among them, α min Indicates the minimum value of the weight coefficient that controls the influence of context relevance, α max represents the maximum value of the weight coefficient that controls the influence of context relevance, L represents the average sentence length, and L max Indicates the preset maximum average sentence length, w L represents the weight of the average sentence length, S represents the semantic consistency score, and S max represents the maximum value of semantic consistency score, w s represents the weight of semantic consistency, w L +w s =1.
6. The method for generating a dynamic social network connection graph based on NLP keyword extraction according to claim 3, characterized in that: Step S2.4 includes the following sub-steps: Step S2.4.1: Determine the global weight of each word based on the word frequency distribution of all social network data after cleaning Where N represents the total number of words in all social network data, and f(w) represents the number of occurrences of word w in all social network data; Step S2.4.2: Dynamically adjust the context relevance score of each word in combination with the global weight of the corresponding word to obtain the final score of each word: OptimizedScore(w)=Score(w)×GlobalAdjust(w).
7. The method for generating a dynamic social network connection graph based on NLP keyword extraction according to claim 3, characterized in that: The calculation process of the weight of the edge between the nodes is: W i =cos(Emb(w1),Emb(w2))×Co-ccurrence(w1,w2) Among them, W i represents the weight of the edge between node w1 and node w2, Emb(w1) and Emb(w2) represent the word embedding vectors of node w1 and node w2 respectively, cos(Emb(w1), Emb(w2)) represents the cosine similarity of Emb(w1) and Emb(w2), and Co-ccurrence(w1, w2) represents the frequency of co-occurrence of node w1 and node w2 in social network data.
8. The method for generating a dynamic social network connection graph based on NLP keyword extraction according to claim 7, characterized in that: The calculation process of the dynamic threshold θ in step S4 is: Among them, n represents the total number of edges, i represents the index of n, and γ represents the adjustable coefficient.
9. A computer-readable storage medium storing a computer program, characterized in that: The computer program enables a computer to execute the method for generating a dynamic social network connection graph based on NLP keyword extraction as described in any one of claims 1 to 8.
10. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for generating a dynamic social network connection graph based on NLP keyword extraction as described in any one of claims 1 to 8 is implemented.