A large language model-based dynamic multi-dimensional public opinion analysis theme generation method

CN122903683APending Publication Date: 2026-10-13NORTH CHINA INSTITUTE OF SCIENCE & TECHNOLOGY (NATIONAL SAFETY TRAINING CENTER OF COAL MINES)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510329036.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

大语言模型具有强大的语言理解和生成能力,能够处理各种复杂的自然语言任务,但在实际应用中,也面临着计算资源消耗大、大规模数据处理耗时长等问题

Benefits of technology

[0040]本发明提供一种基于大语言模型动态多维度舆情分析主题生成方法,首先,通过文本簇簇内结构分析与多中心点确定,一个文本簇可能并非围绕单一中心点聚集,而是可能存在多个子中心,代表不同的主题维度。通过在簇内寻找多个代表性的中心点,以捕捉更丰富的语义信息。然后,基于Qwen的主题多维语义权重分配与动态抽样,结合多中心距离和文本信息量,动态选择具有代表性的文本集合。进一步,基于Qwen的多维度主题抽象与概括,利用Qwen大模型的强大理解和生成能力,通过两条独立的路径分别生成主题和描述,对选取的代表性文本进行多维度的主题抽象和概括,分别生成主题和描述。最后,联合语义约束与动态优化,通过定义双重对齐损失函数,对主题生成路和描述生成路的结果进行约束,使得生成的主题和描述在语义上更加匹配和一致。在保证主题生成质量的同时,显著提升了分析效率,能够快速从海量数据中提取高精度、可解释的突发事件主题及演化路径,为应急响应争取宝贵时间,全面提升了应急管理的科学性与时效性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122903683A_ABST
    Figure CN122903683A_ABST
Patent Text Reader

Abstract

The application relates to a large language model-based dynamic multi-dimensional public opinion analysis theme generation method, which comprises the following steps: obtaining a text cluster, performing sub-cluster division on the text cluster, and calculating the center and weight of the sub-cluster; the center of the sub-cluster is used for representing the position of the sub-cluster, and the weight of the sub-cluster is used for reflecting the proportion of the sub-cluster scale in the cluster and the semantic influence; the weight of the center of the sub-cluster is used to obtain the weighted distance score of the text to the center of each sub-cluster and the information amount score of the text; based on the weighted distance score and the information amount score, the most representative text is screened out from the text data to obtain a representative text set; the representative text set is input into a Qwen large model to obtain theme text and description text; the Qwen large model is obtained by training a training set; in the model training process, a double alignment loss function is used as a training target to measure the difference between the generated theme and description and the expected result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of natural language processing and big data analysis technology, and in particular to a method for generating topics for dynamic multi-dimensional public opinion analysis based on a large language model. Background Technology

[0002] In emergency management scenarios, public opinion analysis is a core component of disaster response and decision support. Following emergencies (such as natural disasters and public health emergencies), multi-source data rapidly emerges from social media, news platforms, forums, and other sources, containing crucial information such as disaster descriptions, public demands, and rescue progress. Traditional public opinion analysis relies on manual screening or single-platform keyword matching, making it difficult to integrate multilingual and multimodal data (such as short texts from Chinese microblogs, long English news articles, and short video comments) in real time. This leads to delayed disaster assessment, biased resource allocation, and severely impacts emergency response efficiency during the critical rescue period.

[0003] Currently, the field of public opinion analysis mainly employs three approaches: traditional models, pre-trained models, and large-scale models. Traditional public opinion analysis models are primarily based on rules and statistical methods, such as keyword matching and word frequency statistics. While these methods are simple, easy to understand, and computationally inexpensive, they have significant limitations when dealing with complex semantic information and large-scale data, making it difficult to accurately capture the deeper meaning and dynamic changes in public opinion. Pre-trained models, such as Word2Vec and BERT, learn rich linguistic knowledge and semantic representations through pre-training on large-scale unsupervised data, improving the accuracy and efficiency of public opinion analysis to some extent. However, pre-trained models typically require fine-tuning for specific tasks and have limited capabilities for processing public opinion data from multiple platforms and languages. In recent years, the emergence of large-scale language models such as GPT-3 and ChatGPT has brought new opportunities to public opinion analysis. Large-scale language models possess powerful language understanding and generation capabilities, enabling them to handle various complex natural language tasks. However, in practical applications, they also face challenges such as high computational resource consumption and long processing times for large-scale data.

[0004] To address the aforementioned issues, there is an urgent need for a dynamic, multi-dimensional public opinion analysis topic generation method based on a large language model. This method aims to utilize a Qwen-based dynamic, multi-dimensional topic generation approach to abstract and summarize common themes from input text information, generating readable topic tags and content. This method can effectively overcome the limitations of existing technologies and enhance the ability of emergency management departments to respond to emergencies. Summary of the Invention

[0005] To address the problems existing in the prior art, the present invention aims to propose a dynamic multi-dimensional public opinion analysis topic generation method based on a large language model. This method locates multi-center semantic nodes through text cluster structure analysis, selects representative text sets by combining multi-dimensional semantic weight allocation and dynamic sampling, and uses Qwen abstraction to summarize the common themes and descriptions expressed in the text clusters. This enables the generation of themes and theme descriptions, rapidly extracting high-precision, interpretable themes and evolution paths of emergencies from massive heterogeneous data. This provides real-time and accurate semantic support for disaster response, resource allocation, and decision-making, comprehensively improving the scientific rigor and timeliness of emergency management.

[0006] To achieve the above objectives, the present invention provides the following solution:

[0007] A method for generating topics for dynamic multi-dimensional public opinion analysis based on a large language model includes:

[0008] Obtain text clusters, divide the text clusters into subclusters, and calculate the center and weight of the subclusters; the center of the subcluster is used to characterize the position of the subcluster, and the weight of the subcluster is used to reflect the proportion of the subcluster size in its own cluster and its semantic influence;

[0009] Using the weights of the centers of the subclusters, the weighted distance scores from the text to the centers of each subcluster and the information content scores of the text are obtained. Based on the weighted distance scores and the information content scores, the most representative texts are selected from the text data to obtain a representative text set.

[0010] The representative text set is input into the Qwen large model to obtain topic text and descriptive text; the Qwen large model is trained using the training set; during the model training process, the bihomogeneous loss function is used as the training objective to measure the difference between the generated topics and descriptions and the expected results.

[0011] Optionally, sub-clustering the text cluster includes:

[0012] Based on a predefined text cluster T, obtain all texts D = {d1, d2, ..., d...} within the cluster. n The BGE vector V = {v1, v2, ..., v} is given by}. n Cluster the vector set V using the k-means algorithm, dividing it into k sub-clusters.

[0013]

[0014] Where k is the number of sub-clusters. Let T be the number of texts within a cluster, and T be the number of text clusters. This represents the floor function, which takes the largest integer not greater than the given number.

[0015] Optionally, calculating the center and weight of the sub-clusters includes:

[0016] Calculating the center of the sub-cluster includes:

[0017]

[0018] in, As the center of the sub-cluster, For sub-clusters, v j It is a cluster A vector

[0019] Calculating the weights of the subclusters includes:

[0020]

[0021] in, As weight, It is a sub-cluster The number of elements in the cluster, i.e., the size of the cluster, |T i | is text cluster T i The total number of elements in the middle.

[0022] Optionally, obtaining the weighted distance score from the text to the center of each sub-cluster includes:

[0023]

[0024] Among them, w dist (x) represents the weighted distance score from text x to each sub-center, and γ is the distance decay coefficient. Let vec(x) be the squared Euclidean distance between the vector of text x and the center vector of the p-th subcluster, and let vec(x) be the vector representation of text x implemented using BGE. Let p be the center vector of the p-th sub-cluster. The weights of the subclusters.

[0025] Optionally, obtaining the information content score of the text includes:

[0026] w info (x)=α·len(x)+β·Qwen_Score(x)

[0027] Where α and β are both weighting coefficients, and Qwen_Score(x) is the score of the information content of text x using Qwen.

[0028] Optionally, obtaining the representative text set includes:

[0029] The weighted distance score and the information content score are subjected to comprehensive weight normalization, and sampling conditions are set. The sampling conditions are used as the filtering target to filter the text with a preset ranking in the comprehensive weight. The text is then extracted according to the remaining weight probability using a roulette wheel to cover long-tail semantics and obtain the representative text set.

[0030] Optionally, performing comprehensive weight normalization on the weighted distance score and the information content score includes:

[0031]

[0032] Among them, w dist (x) is the weighted distance, w info (x) represents the amount of information, and x' represents traversing the distinct points in the dataset. dist (x′) represents the weighted distance score of data point x′, w info (x′) represents the information content score of data point x′. In dataset D i In the above, the weighted distance score w is calculated for each data point x'. dist (x) and information content score w info The product of (x′).

[0033] Optionally, obtaining the topic text and the description text includes:

[0034] The representative text set is input into the Qwen large model to obtain the topic text and the descriptive text. The first generation path in the Qwen large model is used to perform multi-dimensional topic abstraction and summarization of the representative text, and the second generation path in the Qwen large model is used to extract textual details from the representative text to generate context-appropriate descriptive content.

[0035]

[0036] Where Qwen represents the Qwen model, T theme For the topic text, T desc To describe the text, D selected This is a representative text.

[0037] Optionally, the expression for the double alignment loss function is:

[0038]

[0039] Wherein, -log T theme (y t ) represents the subject loss portion, T theme (y t The topic generation path model predicts and generates topic words y.t The probability, -log T desc (y d T is used to describe the loss component. desc (y d To describe the generated topic sentence y, the model predicts the path in the path. d The probability, β is the alignment strength coefficient, KL(p) t ||p d () represents the distribution alignment item. The beneficial effects of this invention are:

[0040] This invention provides a method for generating topics for dynamic multi-dimensional public opinion analysis based on a large language model. First, through text cluster structure analysis and multi-center determination, it is determined that a text cluster may not be clustered around a single center, but may have multiple sub-centers representing different topic dimensions. By finding multiple representative centers within the cluster, richer semantic information is captured. Then, based on Qwen's multi-dimensional semantic weight allocation and dynamic sampling, combined with multi-center distance and text information content, a representative text set is dynamically selected. Further, based on Qwen's multi-dimensional topic abstraction and generalization, leveraging the powerful understanding and generation capabilities of the Qwen large model, topics and descriptions are generated through two independent paths. Multi-dimensional topic abstraction and generalization are performed on the selected representative texts to generate topics and descriptions respectively. Finally, by combining semantic constraints and dynamic optimization, a dual alignment loss function is defined to constrain the results of the topic generation path and the description generation path, making the generated topics and descriptions more semantically matched and consistent. While ensuring the quality of topic generation, it significantly improves analysis efficiency, enabling the rapid extraction of high-precision and interpretable topics and evolution paths of emergencies from massive amounts of data, thus saving valuable time for emergency response and comprehensively enhancing the scientific nature and timeliness of emergency management. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 This is a flowchart of a method for generating topics for dynamic multi-dimensional public opinion analysis based on a large language model, according to an embodiment of the present invention. Detailed Implementation

[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0044] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0045] like Figure 1 As shown in the figure, this embodiment discloses a method for generating topics for dynamic multi-dimensional public opinion analysis based on a large language model, including: obtaining text clusters, dividing the text clusters into subclusters, and calculating the center and weight of the subclusters; the center of the subcluster is used to characterize the subcluster position, and the weight of the subcluster is used to reflect the proportion of the subcluster size in its respective cluster and its semantic influence; using the weight of the subcluster center, obtaining the weighted distance score from the text to each subcluster center and the information content score of the text; based on the weighted distance score and information content score, selecting the most representative text from the text data to obtain a representative text set; inputting the representative text set into the Qwen large model to obtain topic texts and descriptive texts; the Qwen large model is trained using a training set; during the model training process, a bihomogeneous loss function is used as the training objective to measure the difference between the generated topics and descriptions and the expected results.

[0046] Furthermore, the sub-clustering of text clusters includes: obtaining the BGE vectors of all texts within a text cluster, clustering the BGE vector set, and using an improved K-means algorithm to perform sub-clustering.

[0047]

[0048] Where k is the number of sub-clusters. This represents the number of text elements within the cluster.

[0049] Specifically, step one involves analyzing the intra-cluster structure of text and determining multiple centroids:

[0050] This invention seeks multiple representative center points within text clusters to capture richer semantic information. For each text cluster, an improved K-means algorithm is first used to divide it into subclusters. The number of subclusters is determined by calculating the logarithm of the number of texts within the cluster, and upper and lower bounds are set to avoid over-subdivision. Then, the center and weight of each subcluster are calculated. The subcluster center is used to characterize the subcluster's position, and the weight reflects the subcluster's size as a proportion of its parent cluster and its semantic influence. This enables the analysis of the cluster structure and the discovery of potential subcenters and multidimensional semantic information.

[0051] First, for a given text cluster T, obtain all texts D = {d1, d2, ..., dn} within the cluster. n The BGE vector representation of} is V = {v1, v2, ..., v}. n Then, the vector set V is clustered using the k-means algorithm to divide it into k sub-clusters.

[0052]

[0053] Here, represents the number of sub-clusters divided by k. It is determined by the number of text elements within each cluster. It is obtained by taking the logarithm to the base 2 and rounding down.

[0054] Then for each sub-cluster Perform calculations to obtain the sub-cluster centers. and weight The center is used to represent the core position of the subcluster, and the weight reflects the proportion of the subcluster size in its parent cluster and its semantic influence:

[0055]

[0056] Furthermore, calculating the centers and weights of subclusters includes:

[0057] The center of the computational sub-cluster includes:

[0058]

[0059] in, As the center of the sub-cluster, For sub-clusters;

[0060] Calculating the weights of subclusters includes:

[0061]

[0062] in, As weight.

[0063] Furthermore, obtaining the weighted distance scores from the text to the centers of each sub-cluster includes:

[0064]

[0065] Among them, w dist (x) represents the weighted distance score from text x to each sub-center, and γ is the distance decay coefficient. Let vec(x) be the squared Euclidean distance between the vector of text x and the center vector of the p-th subcluster, and let vec(x) be the vector representation of text x implemented using BGE. Let be the center vector of the p-th sub-cluster.

[0066] Furthermore, the information content score of the extracted text includes:

[0067] w info (x)=α·len(x)+β·Qwen_Score(x)

[0068] Where α and β are both weighting coefficients, and Qwen_Score(x) is the score of the information content of text x using Qwen.

[0069] Furthermore, obtaining a representative text set includes:

[0070] The weighted distance score and information content score are combined and normalized. Sampling conditions are set and used as the filtering target to filter the texts with the preset ranking in the comprehensive weight. The texts are then extracted according to the remaining weight probability using a roulette wheel to cover long-tail semantics and obtain a representative text set.

[0071] Specifically, step two involves topic multidimensional semantic weight allocation and dynamic sampling based on Qwen:

[0072] The core of this step is to dynamically select representative texts by combining multi-center distance and text information content. First, the weighted distance score from the text to each sub-center and the information content score of the text are calculated using specific formulas. Then, these two scores are combined and normalized to obtain the comprehensive weight of the text. Finally, based on a dynamic sampling strategy, a certain number of representative texts are selected according to the calculated weights. The sampling strategy adopts a mixed sampling method, which considers both high-weight texts and long-tail semantic coverage.

[0073] First, for text x, calculate its weighted distance w to each sub-center. dist (x):

[0074]

[0075] Among them, w dist (x) represents the weighted distance score from text x to each sub-center. γ is the distance decay coefficient, with a default value of 0.5, used to control the degree of influence of the distance between the text and the sub-center on the score, i.e., the similarity sensitivity. vec(x) is the vector representation of text x implemented using BGE. It is the center vector of the p-th sub-cluster. It is the square of the Euclidean distance between the vector of text x and the center vector of the p-th subcluster.

[0076] Then, Qwen is used to calculate the information content w from text x to each subcenter. info (x) Score:

[0077] w info(x)=α·len(x)+β·Qwen_Score(x) (4)

[0078] Here, α is a weighting coefficient used to adjust the weight of text length in the information content score. β is a weighting coefficient used to adjust the weight of Qwen's information content score in the overall information content score. Qwen_Score(x) is the information content score of text x using Qwen, with a value ranging from 0 to 1, obtained through Prompt evaluation.

[0079] Then the weighted distance w dist (x) and information content w info (x) The scores are then subjected to comprehensive weighting and normalization:

[0080]

[0081] Among them, w dist (x) is the weighted distance, w info (x) represents the information content, and x' here is used to iterate through the distinct points in the dataset. dist (x′) represents the weighted distance score of data point x′, reflecting the weighted value of x′ in terms of distance metric, w info (x′) represents the information content score of data point x′, which is a quantitative value reflecting the amount or importance of information contained in x′. In dataset D i In the above, the weighted distance score w is calculated for each data point x'. dist (x) and information content score w info The product of (x′) is calculated, and then the maximum value is found among all the product results.

[0082] Finally, a roulette wheel test is performed, employing a dynamic sampling strategy. The number of texts sampled is determined by... Determined, Top-K selection is used to rank the top-weighted groups. The text is extracted using a roulette wheel based on the remaining weighted probability. The text is selected to cover long-tail semantics. In this way, the most representative texts are filtered from a large amount of text data to better reflect the characteristics and semantic information of the data. Based on the selected sampling strategy and quantity, a representative text set D is selected from cluster D. selected .

[0083] Furthermore, the weighted distance score and information content score are subjected to comprehensive weight normalization, including:

[0084]

[0085] Among them, w dist (x) is the weighted distance, winfo (x) represents the amount of information.

[0086] Furthermore, obtaining the topic text and description text includes:

[0087] Inputting a representative text set into the Qwen large model yields topic text and descriptive text. The first generation path in the Qwen large model is used for multi-dimensional topic abstraction and summarization of the representative text, while the second generation path is used to extract textual details from the representative text to generate context-appropriate descriptive content.

[0088]

[0089] Where Qwen represents the Qwen model, T theme For the topic text, T desc To describe the text, D selected This is a representative text.

[0090] Furthermore, the expression for the double alignment loss function is:

[0091]

[0092] Wherein, -log T theme (y t ) represents the subject loss portion, T theme (y t The topic generation path model predicts and generates topic words y. t The probability, -log T desc (y d T is used to describe the loss component. desc (y d To describe the generated topic sentence y, the model predicts the path in the path. d The probability, β is the alignment strength coefficient, KL(p) t ||p d ) represents the distribution alignment item.

[0093] Furthermore, training the Qwen large model using the training set includes:

[0094] (1) Three-stage construction process:

[0095] This embodiment uses 50,000 cross-platform texts (WeChat long articles, Weibo short articles, and Twitter tweets) to construct a topic generation dataset through semantic vector clustering and manual topic annotation. The specific process is as follows:

[0096] (a) Semantic clustering: Text vectors were generated based on the BGE-M3 model, and 3,021 initial text clusters were obtained through clustering.

[0097] (b) Topic generation: Use the Qwen model to generate candidate topic titles (7–15 words) and descriptions (20–50 words) for each cluster.

[0098] (c) Manual proofreading: A team of 5 domain experts and 10 trained graduate students reviewed and revised the generated content in terms of both language fluency and accuracy.

[0099] (2) Data quality control:

[0100] In the initial clustering results, 12.7% of the clusters (384 / 3,021) were identified as noisy clusters due to semantic divergence or lack of core themes. After cleaning and filtering, the final dataset contains 2,637 high-quality topic clusters.

[0101] (3) Cross-platform distribution characteristics and data examples:

[0102] The thematic clusters exhibit significant platform differences: for example, the War Thunder leak accounted for 57% (35 / 63) of the Twitter sample. Typical data examples include multi-platform distribution statistics (Weibo / WeChat / Twitter sample sizes). To illustrate the data characteristics, typical sample examples are shown in Table 1.

[0103] Table 1. Typical Data Examples

[0104]

[0105]

[0106] Step 3: Multi-dimensional topic abstraction and generalization based on Qwen:

[0107] The dual-path generator is designed to deeply explore and fully leverage the powerful understanding and generative capabilities of the Qwen large model. It constructs two independent generation paths, focusing respectively on theme extraction and descriptive creation. This unique architecture enables the system to accurately extract and utilize different types of information features, starting from selected representative text D... selected On the one hand, it performs multi-dimensional thematic abstraction and generalization; on the other hand, it delves into details to generate rich, vivid, and context-appropriate descriptive content. This clearly defined and collaborative mechanism not only improves the accuracy and informational value of the generated content but also allows for flexible adjustments to the generation strategy based on the actual needs of different application scenarios, thereby generating more targeted and practical thematic content. theme With description T desc combination:

[0108]

[0109] Here, Qwen represents the Qwen model, which is used to generate topic text and descriptive text based on representative input text.

[0110] Step 4, Joint semantic constraints and dynamic optimization:

[0111] Joint semantic constraints primarily constrain the results of the topic generation and description generation paths by defining a dual alignment loss function, making the generated topics and descriptions more semantically matched and consistent. Specifically, the loss function consists of three parts: topic loss, description loss, and distribution alignment term. By minimizing this loss function, the model can ensure that the generated topics and descriptions not only have high accuracy (measured by topic loss and description loss) but also that their semantic distributions are aligned (measured by the distribution alignment term). The overall metric used to measure the difference between the generated topics and descriptions and the expected results is the dual alignment loss function. The goal of model training is to minimize this loss value:

[0112]

[0113] Wherein, -log T theme (y t ) represents the subject loss component, T theme (y t ) is the topic word y predicted and generated by the topic generation path model. t The probability of the topic, after taking its negative logarithm, results in a smaller loss as the model's prediction probability for the correct topic word increases, and vice versa. It is used to supervise the accuracy of topic generation. -log T desc (y d T is the part describing the loss. desc (y d ) is a description of the generated topic sentence y, which is predicted by the model in the path generation process. d The probability, also taken as the negative logarithm, is used to measure the accuracy of the generated description; the loss value is inversely proportional to the predicted probability. β is the alignment strength coefficient, with a default value of 0.3. It is used to adjust the weight of the distribution alignment term in the overall loss function, controlling the importance of semantic distribution alignment between topics and descriptions in the model optimization process. The larger the β value, the more the model will focus on matching the semantic distributions of topics and descriptions. KL(p t ||p d ) is the distribution alignment term, using KL divergence to measure the topic semantic distribution p. t and describing semantic distribution p d The smaller the difference between the two distributions, the more similar the two distributions are.

[0114] The dynamic optimizer is primarily responsible for calculating the double alignment loss based on the joint semantic constraints. The model's parameters are dynamically updated to optimize performance. The core principle is to adjust the model parameters θ using LoRA (Local Area Relationship) based on a predefined parameter update rule. This allows the model to produce better results in subsequent topic and description generation tasks, generating topics and descriptions that are more consistent with expectations and semantics. The parameter update rule is as follows:

[0115]

[0116] Where, θ (t+1) This represents the model parameters after the (t+1)th iteration update. It is the target value for updating the model parameters, obtained through the current parameter θ. (t) It is obtained by adjusting based on the gradient information of the loss function. η represents the learning rate. sign is the sign function, used to enhance model training. It is a loss function The gradient with respect to the model parameter θ.

[0117] This algorithm leverages the superior deep semantic understanding capabilities of the Qwen model. Through refined analysis of the text cluster structure of complex text data, it accurately locates multi-center semantic nodes. Building upon this, it employs a multi-dimensional semantic weighting strategy and dynamic sampling techniques to select the most representative text set from massive amounts of text. Subsequently, utilizing the Qwen model's powerful abstraction and summarization capabilities, it extracts the common core themes from the text clusters and generates precise and vivid theme descriptions. This process not only efficiently generates themes and descriptions but also ensures high consistency and informational value in the generated content, providing an innovative and efficient method for semantic parsing and content extraction of complex texts.

[0118] This invention breaks through the traditional assumption of a single centroid by using algorithms to identify and determine multiple sub-centroids within a text cluster, thereby capturing richer semantic information and thematic dimensions. This multi-centroid determination method, and its specific applications in text cluster structure analysis, including centroid selection algorithms and sub-cluster partitioning strategies, form the foundation for this invention's ability to more comprehensively understand public opinion themes.

[0119] This invention combines multicenter distance and textual information content to dynamically assign semantic weights to each text in a text set, and then samples the texts according to these weights to select the most representative subset, thus solving the semantic bias problem caused by traditional random sampling or static rules. This dynamic weight allocation and sampling strategy, and its application in topic generation, including weight calculation methods and sampling algorithm optimization, are key to this invention's ability to improve efficiency while ensuring topic quality.

[0120] This invention leverages the powerful capabilities of the Qwen large model to generate topics and descriptions through two independent paths, enabling multi-dimensional topic abstraction and summarization of representative texts. This dual-path generator architecture, and its application in topic generation, is key to the invention's ability to generate high-quality, interpretable topics.

[0121] This invention constrains the results of both topic generation and description generation paths by defining a dual alignment loss function, making the generated topics and descriptions more semantically matched and consistent. This joint semantic constraint and dynamic optimization mechanism, and its application in topic generation, including the design of the loss function and the selection of optimization algorithms, are key to ensuring topic consistency and avoiding semantic deviation in this invention.

[0122] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A method for generating topics for dynamic multi-dimensional public opinion analysis based on a large language model, characterized in that, include: Obtain text clusters, divide the text clusters into subclusters, and calculate the center and weight of the subclusters; The center of the sub-cluster is used to characterize the position of the sub-cluster, and the weight of the sub-cluster is used to reflect the proportion of the sub-cluster size in its own cluster and its semantic influence; Using the weights of the centers of the subclusters, the weighted distance scores from the text to the centers of each subcluster and the information content scores of the text are obtained. Based on the weighted distance scores and the information content scores, the most representative texts are selected from the text data to obtain a representative text set. The representative text set is input into the Qwen large model to obtain topic text and descriptive text; the Qwen large model is trained using the training set; during the model training process, the bihomogeneous loss function is used as the training objective to measure the difference between the generated topics and descriptions and the expected results.

2. The method for generating topics for dynamic multi-dimensional public opinion analysis based on a large language model according to claim 1, characterized in that, Sub-clustering of the text clusters includes: Based on a predefined text cluster T, obtain all texts D = {d1, d2, ..., d...} within the cluster. n The BGE vector V = {v1, v2, ..., v} is given by}. n Cluster the vector set V using the k-means algorithm, dividing it into k sub-clusters. Where k is the number of sub-clusters. Let T be the number of texts within a cluster, and T be the number of text clusters. This represents the floor function, which takes the largest integer not greater than the given number.

3. The method for generating topics for dynamic multi-dimensional public opinion analysis based on a large language model according to claim 1, characterized in that, Calculating the center and weight of the sub-clusters includes: Calculating the center of the sub-cluster includes: in, As the center of the sub-cluster, For sub-clusters, v j It is a cluster A vector Calculating the weights of the subclusters includes: in, As weight, It is a sub-cluster The number of elements in the cluster, i.e., the size of the cluster, |T i | is text cluster T i The total number of elements in the middle.

4. The method for generating topics for dynamic multi-dimensional public opinion analysis based on a large language model according to claim 1, characterized in that, Obtaining the weighted distance score from the text to the center of each sub-cluster includes: Among them, w dist (x) represents the weighted distance score from text x to each sub-center, and γ is the distance decay coefficient. Let vec(x) be the squared Euclidean distance between the vector of text x and the center vector of the p-th subcluster, and let vec(x) be the vector representation of text x implemented using BGE. Let p be the center vector of the p-th sub-cluster. The weights of the subclusters.

5. The method for generating topics for dynamic multi-dimensional public opinion analysis based on a large language model according to claim 1, characterized in that, The information content score of the text includes: w info (x)=α·len(x)+β·Qwen_Score(x) Where α and β are both weighting coefficients, and Qwen_Score(x) is the score of the information content of text x using Qwen.

6. The method for generating topics for dynamic multi-dimensional public opinion analysis based on a large language model according to claim 1, characterized in that, Obtaining the representative text set includes: The weighted distance score and the information content score are subjected to comprehensive weight normalization, and sampling conditions are set. The sampling conditions are used as the filtering target to filter the text with a preset ranking in the comprehensive weight. The text is then extracted according to the remaining weight probability using a roulette wheel to cover long-tail semantics and obtain the representative text set.

7. The method for generating topics for dynamic multi-dimensional public opinion analysis based on a large language model according to claim 6, characterized in that, The comprehensive weight normalization process for the weighted distance score and the information content score includes: Among them, w dist (x) is the weighted distance, w info (x) represents the amount of information, x' represents traversing the distinct points in the dataset, and w dist (x′) represents the weighted distance score of data point x′, w info (x′) represents the information content score of data point x′. In dataset D i In the above, the weighted distance score w is calculated for each data point x'. dist (x) and information content score w info The product of (x′).

8. The method for generating topics for dynamic multi-dimensional public opinion analysis based on a large language model according to claim 1, characterized in that, Obtaining the topic text and the description text includes: The representative text set is input into the Qwen large model to obtain the topic text and the descriptive text. The first generation path in the Qwen large model is used to perform multi-dimensional topic abstraction and summarization of the representative text, and the second generation path in the Qwen large model is used to extract textual details from the representative text to generate context-appropriate descriptive content. Where Qwen represents the Qwen model, T theme For the topic text, T desc To describe the text, D selected This is a representative text.

9. The method for generating topics for dynamic multi-dimensional public opinion analysis based on a large language model according to claim 1, characterized in that, The expression for the double alignment loss function is: Wherein, -log T theme (y t ) represents the subject loss portion, T theme (y t The topic generation path model predicts and generates topic words y. t The probability, -log T desc (y d T is used to describe the loss component. desc (y d To describe the generated topic sentence y, the model predicts the path in the path. d The probability, β is the alignment strength coefficient, KL(p) t ||p d ) represents the distribution alignment item.