Public opinion report generation method based on retrieval enhancement generation

Through the method of retrieval enhancement generation, using a large language model to process public opinion data, the problem of poor timeliness of existing public opinion reports is solved, and faster and more accurate public opinion analysis and report generation are achieved.

CN119476219AActive Publication Date: 2025-02-18HARBIN INST OF TECH
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411625388.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-02-18
Estimated Expiration
2044-11-14

AI Technical Summary

Technical Problem

The existing methods for generating public opinion reports are poor in timeliness, and a lot of time is consumed during manual writing, which affects the timeliness of the report.

Method used

A method based on search-enhanced generation is adopted to obtain relevant news and comments through topics entered by users, and a large language model is used to generate news summary and comment positions, and finally a public opinion report is generated.

Benefits of technology

It improves the timeliness of public opinion reports, reduces the time for manual writing, and achieves faster public opinion analysis and response strategy formulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476219A_ABST
    Figure CN119476219A_ABST
Patent Text Reader

Abstract

The invention discloses a public opinion report generation method based on retrieval enhancement generation, relates to the technical field of artificial intelligence, aims at the problem of poor timeliness of public opinion report generation by an existing method, and can be applied to analysis of public opinion conditions of recent hot topics in a social media platform and collection of a large amount of news and comment data through crawlers or APIs provided by websites. And abstracting the collected news by using a large language model and carrying out standing detection on the comments. And generating a public opinion report by using the large language model. The public opinion report generated by the method is high in timeliness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method for generating a public opinion report based on retrieval-enhanced generation. Background Art

[0002] With the rapid development of social media, some major emergencies may be quickly spread and trigger discussions. Public opinion reports are text reports with the theme of sorting out public opinion. By analyzing and judging the public sentiment in the public opinion field, they study the causes of public opinion and give feasible suggestions. With the help of public opinion reports, relevant departments can timely understand the public's views on a topic or event and discover potential crisis events, so as to formulate response strategies more effectively. In the previous public opinion report writing process, a large number of links needed to be completed manually. For example, the writers needed to retrieve media reports related to the event and organize and extract information from them, manually analyze the data and write text descriptions, and manually analyze user comments and summarize opinions. All of the above links will consume a lot of time and affect the timeliness of public opinion reports. Summary of the invention

[0003] The purpose of the present invention is to propose a method for generating public opinion reports based on retrieval enhanced generation in order to solve the problem that the existing methods for generating public opinion reports have poor timeliness.

[0004] The technical solution adopted by the present invention to solve the above technical problems is:

[0005] The method for generating a public opinion report based on retrieval enhancement generation comprises the following steps:

[0006] Step 1: Get relevant news and comments based on the topic words entered by the user;

[0007] Step 2: Get the news summary and perform stance detection on the comments to get the stance of the comments;

[0008] Step 3: Input the summary and comments’ stance into the large language model to generate a public opinion report.

[0009] Furthermore, the specific steps of step one are:

[0010] Step 1: Get the topic words entered by the user, use the topic words entered by the user as search words to search for news, then sort the search results by focus, and finally, use requests to crawl the news sorted by focus;

[0011] Step 1 and 2: Select social media comments as the data source, use the topic words entered by the user as search words to search and crawl the topic words;

[0012] Step 13: crawl the text and links under each topic word one by one according to the topic words obtained in step 12. If the corresponding topic words are not retrieved in step 12, use the topic words entered by the user as the search words to crawl the text and links of the search results;

[0013] Step 14: Crawl the user comments and user locations under each link. During the crawling process, if the number of comments obtained exceeds the set threshold, stop crawling.

[0014] Furthermore, the specific steps of step 2 are:

[0015] Step 21: Based on the news crawled in step 11, use the large language model to generate a summary of each news;

[0016] Step 22: Use regular expressions to remove special symbols in the text and user comments;

[0017] Step 23: Filter the comments based on the similarity between the user comments and the text, and remove the comments that are too low in similarity with the text;

[0018] Step 24: For the comments retained after filtering in step 23, use the large language model to detect the stance of each user comment.

[0019] Furthermore, the specific steps of steps two and three are:

[0020] Step 231: Convert the text and user comments into vector representation V(p i ) and V(c ij ), where p i represents the ith text, c ij represents the jth user comment under the i-th text;

[0021] Step 232: Get the text vector V(p i ) and user comment vector V(c ij )'s cosine similarity CosSim(p i ,c ij ), CosSim(p i ,c ij ) is expressed as:

[0022]

[0023] Step 233: According to the cosine similarity obtained in step 232, the user comments are sorted in descending order, and comments with too low similarity to the text are filtered out according to the set threshold.

[0024] Furthermore, the specific steps of step 24 are:

[0025] Step 241: Use the stance detection results to label the user comments, and then build an example pool S based on the user comments, text and labels. The example pool S is expressed as:

[0026] S={s 1 ,s 2 ,...,s N}

[0027] s i =(t i ,c i ,l i )

[0028] Where i = 1, 2...N, t i represents the comment text of the i-th comment, c i Indicates the main text of the microblog. i Indicates the label, s i represents a triple consisting of a microblog comment, a microblog text, and a tag, and N represents the total number of annotated comments;

[0029] Step 242: randomly extract examples from the example pool S, and use the extracted examples to construct a model prompt containing context and a few-sample example, wherein the context means providing the body content of the comment in the prompt of the large language model, and the few-sample example means randomly extracting a number of triplets from the example pool S;

[0030] Step 243: Based on the large language model and using the model prompts built in step 242, perform stance detection on each comment.

[0031] Furthermore, the specific steps of step three are:

[0032] Step 31: Input the news summary into the large language model to generate an event summary;

[0033] Step 32: Use the stance detection results of all user comments and the user locations corresponding to the user comments, and generate a text description of the user's provincial distribution through a large language model;

[0034] Step 33: Based on the news summary, use the large language model to obtain the main opinions of the media and the news supporting the opinions, that is, the media discussion topics in the public opinion;

[0035] Step 3 and 4: Based on the user comments and their position detection results, extract positive and negative opinions as user comment opinions in public opinion;

[0036] Step 35: Input the event overview, the text description of the user's province distribution, the user's province distribution map, and public opinion into the big language model to obtain the public opinion report output by the big language model;

[0037] Step 36: Based on the text description of the user's provincial distribution, use pyecharts to generate a user's provincial distribution map, and then display the user's provincial distribution map in the public opinion report to obtain the final public opinion report.

[0038] Furthermore, the specific steps of step three are:

[0039] Step 3: Number the abstracts of each news item to obtain the abstract set R, which is expressed as:

[0040] R = {r 1 ,r 2 ,...,r M}

[0041] Where M represents the total number of news summaries, r i Represents the summary of the i-th news, i = 1, 2...M;

[0042] Step 312: Based on the summary set R, use the large language model to generate an event summary with citations, where the cited content is the news corresponding to the news summary.

[0043] Furthermore, the specific steps of step three are:

[0044] Step 331: Based on the summary set R obtained in step 311, use the embedding model to convert each news summary in the summary set R into an embedded representation;

[0045] Step 332: Based on the embedded representation obtained in step 331, use the K-Means algorithm and combine it with the silhouette coefficient to determine the optimal number of clusters k within a given range. optimal , and finally cluster the news summaries into k optimal news summary clusters;

[0046] Step 333: Based on the news summary clusters obtained in step 332, prompt the large language model to extract the viewpoint of the news summary in each cluster;

[0047] Step 334: Convert the opinions extracted in step 331 into vector representations, then calculate the cosine similarity between the news summaries within the cluster and the opinion vector representations, and finally use the news summaries with cosine similarity higher than the threshold as the basis for supporting the opinion.

[0048] Furthermore, the specific steps of steps three and four are:

[0049] Step 341: Divide user comments into three groups: support, opposition, and neutral according to the results of stance detection;

[0050] Step 342: Use the embedding model to convert the comments in the support and opposition sets into vector representations. Then, use the HDBSCAN clustering algorithm to cluster the comments in these two comment sets to obtain several comment clusters.

[0051] Step 343: Based on the comment clusters obtained by clustering in step 342, the large language model is prompted to extract the opinions of the user comments in each cluster. If the comment cluster belongs to the support comment set, the extracted opinions are positive opinions. If the comment cluster belongs to the opposition comment set, the extracted opinions are negative opinions.

[0052] Step 343: Use the embedding model to convert the opinions extracted by the large language model into vector representations, calculate the cosine similarity between the user comments and the opinions within the cluster, and use the comments with similarity higher than the threshold as the basis for supporting the opinion.

[0053] Furthermore, the embedding model is text-embedding-3-small or bge-large-zh.

[0054] The beneficial effects of the present invention are:

[0055] This application can be used to analyze the public opinion of recent hot topics on social media platforms. It collects a large amount of news and comment data through crawlers or APIs provided by various websites, and uses a large language model to summarize the collected news and perform stance detection on the comments. Then, a public opinion report is generated using the large language model. The public opinion report generated by this application is highly timely. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 This is a diagram of a public opinion report with citations;

[0057] Figure 2 This is the overall framework diagram of this application. DETAILED DESCRIPTION

[0058] It should be particularly noted that, in the absence of conflict, the various embodiments disclosed in this application can be combined with each other.

[0059] Specific implementation method 1: The method for generating a public opinion report based on retrieval enhancement generation described in this implementation method includes the following steps:

[0060] Step 1: Get relevant news and comments based on the topic words entered by the user;

[0061] Step 2: Get the news summary and perform stance detection on the comments to get the stance of the comments;

[0062] Step 3: Input the summary and comments’ stance into the large language model to generate a public opinion report.

[0063] The overall structure of this application is as follows Figure 2 shown.

[0064] The specific steps of step one are:

[0065] Step 1: Use the topic words entered by the user as search words to search for news in Baidu News. Sort the search results by focus. Use requests to crawl the first five pages of news. When implementing, they can be stored in a list.

[0066] Step 1 and 2: Select Sina Weibo as the data source for social media comments, use the topic words entered by the user as search words to search and crawl the topic words on the first page of Weibo topic search pages;

[0067] Step 13: crawl the text and links of the first two pages of microblogs under each topic word one by one according to the topic words obtained in step 12. If the corresponding topic words are not retrieved in step 12, use the topic words entered by the user as the search words to directly crawl the text and links of the first two pages of microblogs under the search results;

[0068] Step 14: crawl the Weibo user comments and user location under each Weibo link in the results of step 13. During the crawling process, if the number of comments obtained exceeds the set threshold, stop obtaining.

[0069] The specific steps of step 2 are:

[0070] Step 21: Use the large language model to generate a summary of each news item in the list;

[0071] Step 22: Use regular expressions to remove special symbols from Weibo text and Weibo user comments;

[0072] Step 23: Filter the comments based on the similarity between the Weibo user comments and the Weibo text;

[0073] Step 24: For the comments retained after filtering in step 23, use the large language model to detect the stance of each Weibo user comment, and divide the comments into three categories: support, opposition, and neutral. The target of stance detection is the topic word entered by the user.

[0074] The specific steps of steps two and three are:

[0075] Step 231: Define the body of the crawled i-th microblog as p i , the jth comment under this microblog is c ij , use a small embedding model (such as text-embedding-3-small) to convert the microblog text and microblog comments into vector representation V(p i and V(c ij );

[0076] Step 232: Get the microblog text vector V(p i ) and Weibo user comment vector V(c ij )'s cosine similarity CosSim ( p i ,c ij ), CosSim ( p i ,c ij ) is expressed as:

[0077]

[0078] Step 233: Arrange all comments in descending order according to the cosine similarity between the comments and the main text of the Weibo to which they belong, save them as a list, truncate the list according to the set threshold, and filter out comments with too low semantic similarity to the main text of the Weibo.

[0079] The specific steps of step 24 are:

[0080] Step 241: Use the stance detection results to label the Weibo user comments, and then build an example pool S based on the Weibo user comments, Weibo text and tags. The example pool S is expressed as:

[0081] S= { s 1 ,s 2 ,...,s N }

[0082] s i =(t i ,c i ,l i )

[0083] Where i = 1, 2...N, t i represents the comment text of the i-th comment, c i Indicates the main text of the microblog. i Indicates the label, s i represents a triple consisting of a microblog comment, a microblog text, and a tag, and N represents the total number of annotated comments;

[0084] Step 242: randomly extracting examples from the example pool S, and using the extracted examples to construct a model prompt containing context and a few-sample example, wherein the context means providing the microblog body content to which the microblog comment belongs in the prompt of the large language model, and the few-sample example means randomly extracting a number of triplets from the example pool S to provide examples for stance detection for the large language model;

[0085] Step 243: Based on the large language model and using the model prompts built in step 242, perform stance detection on each comment.

[0086] The specific steps of step three are:

[0087] Step 31: Input the news summary into the large language model to generate an event summary;

[0088] Step 32: Use the stance detection results of all Weibo user comments and the location of the user corresponding to the Weibo user comments, and generate a text description of the user's provincial distribution through a large language model;

[0089] Step 33: Based on the news summary, use the large language model to obtain the main opinions of the media and the news supporting the opinions, that is, the media discussion topics in the public opinion;

[0090] Step 3 and 4: Based on the Weibo user comments and their position detection results, extract positive and negative opinions as user comment opinions in public opinion;

[0091] Step 35: Use the first three parts of the report as input, namely the event overview, data analysis, and public opinion, to prompt LLM to generate the event summary and suggestions part of the report. At this point, a public opinion report consisting of four parts: event overview, data analysis, public opinion, and event summary and suggestions is formed.

[0092] The specific steps of step 31 are:

[0093] Step 3: Number the summary of each news item. The summary of the i-th news item is denoted as r. i , use these summaries to build a summary set R;

[0094] R = {r 1 ,r 2 ,...,r M}

[0095] Where M represents the total number of news summaries, r i Represents the summary of the i-th news, i = 1, 2...M;

[0096] Step 312: Based on the summary set, use LLM to generate an event summary with citations, where the citations are the news corresponding to the summary;

[0097] That is, for the paragraph S generated by LLM, 1 ,s 2 ,...,s N}, where s i Represents a sentence, requiring LLM to be after the sentence for each s i Provide a reference set C i ={c i1 ,c i2 ,...,ciK},c ij represents the jth citation of the i-th sentence. ij ∈R and C i Can be an empty set;

[0098] The specific steps of step 32 are:

[0099] Step 321: Fill the distribution of stance detection results, regional distribution of comments and other values ​​into the pre-written data description template;

[0100] Step 322: Inject the results obtained in the previous step into the LLM prompt, prompting LLM to generate the data analysis part of the public opinion report and analyze the existing data.

[0101] Furthermore, the specific steps of step three are:

[0102] Step 331: Based on the summary set R obtained in step 311, use the embedding model to convert each news summary in the summary set R into an embedded representation;

[0103] Step 332: Based on the embedded representation obtained in step 331, use the K-Means algorithm and combine it with the silhouette coefficient to determine the optimal number of clusters k within a given range (e.g., an integer between 2 and 10). optimal , and finally cluster the news summaries into k optimal news summary clusters;

[0104] Step 333: Based on the news summary clusters obtained in step 332, prompt the large language model to extract the viewpoint of the news summary in each cluster;

[0105] Step 334: Convert the opinions extracted in step 331 into vector representations, then calculate the cosine similarity between the news summaries within the cluster and the opinion vector representations, and finally use the news summaries with cosine similarity higher than the threshold as the basis for the opinions.

[0106] You can also use relevance to score on a 5-point scale, which requires the large language model to output an integer between 1 and 5;

[0107] Among them, 1 means very irrelevant, that is, the news summary has almost no relevance to the viewpoint, or the content of the summary completely deviates from the theme of the viewpoint and cannot provide any basis for supporting or opposing the viewpoint. 2 means not very relevant, that is, the summary has some relevance to the viewpoint, but the relevance is low. The summary may touch on some aspects of the viewpoint, but cannot effectively support or oppose the viewpoint. 3 means moderate relevance, that is, the summary has a certain degree of relevance to the viewpoint, the content of the summary can partially support or oppose the viewpoint, but the overall relevance is relatively general. 4 means high relevance, that is, the summary is highly relevant to the viewpoint, the content of the summary can well support or oppose the viewpoint, and provides relatively detailed and specific reasons or evidence. 5 means very relevant, that is, the content of the summary is completely relevant to the viewpoint, the content of the summary supports or opposes the viewpoint very clearly and in detail, and provides sufficient reasons and evidence.

[0108] The specific steps of steps three and four are:

[0109] Step 341: Divide the obtained comments into three groups: support, opposition, and neutral according to the results of stance detection;

[0110] Step 342: The set with a neutral stance detection result is not used to extract opinions. An embedding model (such as text-embedding-3-small, bge-large-zh) is used to convert the comments in the support and opposition comment sets into vector representations. Then, the HDBSCAN clustering algorithm is used to cluster the comments in these two comment sets to obtain several comment clusters.

[0111] Step 342: Based on the comment clusters obtained by clustering in step 342, LLM is prompted in each cluster to extract the opinions of social media users on the input topic. If the comment cluster belongs to the support comment set, the extracted opinions are positive; if the comment cluster belongs to the opposition comment set, the extracted opinions are negative;

[0112] Step 343: Use the embedding model to convert the opinions extracted by LLM into vector representations, calculate the cosine similarity between the comments and opinions within the cluster, and use the comments with similarity higher than the threshold as the basis of the opinion.

[0113] This application can be used to analyze the public opinion of recent hot topics on social media platforms (such as Sina Weibo, Zhihu), collect a large amount of news and comment data through crawlers or APIs provided by various websites, and use a large language model to summarize the collected news and perform stance detection (support, opposition, neutrality) on the comments. Then, the instruction understanding and generation capabilities of the large language model are used to generate a readable public opinion report part by part, and a basis is provided for the content of each part of the report generated. The framework proposed by this method can be deployed without GPU resources by calling the large language model API, avoiding the huge computing power and data overhead brought by model training.

[0114] This application first uses requests to crawl the data of news platforms and social media platforms based on the input topic words, and obtains news related to the topic, comments from social media users, and related information of users. Then, the obtained data is analyzed through the large language model, a summary of the relevant news is obtained, and the comments on the topic are divided into three categories: support, opposition, and neutral. Based on the data analysis, the large language model uses the obtained news and comment data to generate the complete public opinion report content through prompt engineering, and provides a basis for each part of the generated content.

[0115] Most of the existing systems that automatically generate public opinion reports through LLM combine retrieval enhancement generation technology to improve the accuracy of the generated public opinion report content, but do not provide references to the report content generated by LLM, making it difficult for users to trust and verify the report content generated by LLM without any supporting evidence. In this application, this application gradually generates the contents of each part of the public opinion report, rather than using the retrieved information to generate a complete public opinion report at one time. This method enables the content related to the specific part of the report to be injected into its context in a targeted manner during the process of prompting LLM to generate a public opinion report, thereby reducing the impact of irrelevant information on the model-generated content. In addition, in the process of generating each part of the content, we guide LLM to provide references for the content it generates through prompt engineering. In the part of extracting opinions, the model is also required to provide the basis for the opinions. This improves the quality of automatically generated public opinion reports in two aspects: (1) Under such a prompt strategy, it helps LLM generate text that faithfully follows the information provided; (2) The content generated by LLM and its basis can be explicitly displayed in the generated report content, allowing users to quickly verify the accuracy of the report content. Figure 1 As shown, users can click on the hyperlink to view the original news and verify the accuracy of the generated report content.

[0116] It should be noted that the specific implementation is only an explanation and description of the technical solution of the present invention, and cannot be used to limit the scope of protection of the rights. Any partial changes made according to the claims and description of the present invention should still fall within the scope of protection of the present invention.

Claims

1. A method for generating a public opinion report based on retrieval enhancement generation, characterized in that The method comprises the following steps: Step 1: Get relevant news and comments based on the topic words entered by the user; Step 2: Get the news summary and perform stance detection on the comments to get the stance of the comments; Step 3: Input the summary and comments’ stance into the large language model to generate a public opinion report.

2. The method for generating a public opinion report based on retrieval enhancement generation according to claim 1 is characterized in that The specific steps of step one are: Step 1: Get the topic words entered by the user, use the topic words entered by the user as search words to search for news, then sort the search results by focus, and finally, use requests to crawl the news sorted by focus; Step 1 and 2: Select social media comments as the data source, use the topic words entered by the user as search words to search and crawl the topic words; Step 13: crawl the text and links under each topic word one by one according to the topic words obtained in step 12. If the corresponding topic words are not retrieved in step 12, use the topic words entered by the user as the search words to crawl the text and links of the search results; Step 14: Crawl the user comments and user locations under each link. During the crawling process, if the number of comments obtained exceeds the set threshold, stop crawling.

3. The method for generating a public opinion report based on retrieval enhancement generation according to claim 2 is characterized in that The specific steps of step 2 are: Step 21: Based on the news crawled in step 11, use the large language model to generate a summary of each news; Step 22: Use regular expressions to remove special symbols in the text and user comments; Step 23: Filter the comments based on the similarity between the user comments and the text, and remove the comments that are too low in similarity with the text; Step 24: For the comments retained after filtering in step 23, use the large language model to detect the stance of each user comment.

4. The method for generating a public opinion report based on retrieval enhancement generation according to claim 3 is characterized in that The specific steps of step two and three are: Step 231: Convert the text and user comments into vector representation V(p i ) and V(c ij ), where p i represents the ith text, c ij represents the jth user comment under the i-th text; Step 232: Get the text vector V(p i ) and user comment vector V(c ij )'s cosine similarity CosSim(p i ,c ij ), CosSim(p i ,c ij ) is expressed as: Step 233: According to the cosine similarity obtained in step 232, the user comments are sorted in descending order, and comments with too low similarity to the text are filtered out according to the set threshold.

5. The method for generating a public opinion report based on retrieval enhancement generation according to claim 4 is characterized in that The specific steps of step 24 are: Step 241: Use the stance detection results to label the user comments, and then build an example pool S based on the user comments, text and labels. The example pool S is expressed as: S={s1,s2,...,s N } s i =(t i ,c i ,l i ) Where i = 1, 2...N, t i represents the comment text of the i-th comment, c i Indicates the main text of the microblog. i Indicates the label, s i represents a triple consisting of a microblog comment, a microblog text, and a tag, and N represents the total number of annotated comments; Step 242: randomly extract examples from the example pool S, and use the extracted examples to construct a model prompt containing context and a few-sample example, wherein the context means providing the body content of the comment in the prompt of the large language model, and the few-sample example means randomly extracting a number of triplets from the example pool S; Step 243: Based on the large language model and using the model prompts built in step 242, perform stance detection on each comment.

6. The method for generating a public opinion report based on retrieval enhancement generation according to claim 5 is characterized in that The specific steps of step three are: Step 31: Input the news summary into the large language model to generate an event summary; Step 32: Use the stance detection results of all user comments and the user locations corresponding to the user comments, and generate a text description of the user's provincial distribution through a large language model; Step 33: Based on the news summary, use the large language model to obtain the main opinions of the media and the news supporting the opinions, that is, the media discussion topics in the public opinion; Step 3 and 4: Based on the user comments and their position detection results, extract positive and negative opinions as user comment opinions in public opinion; Step 35: Input the event overview, the text description of the user's province distribution, the user's province distribution map, and public opinion into the big language model to obtain the public opinion report output by the big language model; Step 36: Based on the text description of the user's provincial distribution, use pyecharts to generate a user's provincial distribution map, and then display the user's provincial distribution map in the public opinion report to obtain the final public opinion report.

7. The method for generating a public opinion report based on retrieval enhancement generation according to claim 6 is characterized in that The specific steps of step three are: Step 3: Number the abstracts of each news item to obtain the abstract set R, which is expressed as: R={r1,r2,...,r M} Where M represents the total number of news summaries, r i Represents the summary of the i-th news, i = 1, 2...M; Step 312: Based on the summary set R, use the large language model to generate an event summary with citations, where the cited content is the news corresponding to the news summary.

8. The method for generating a public opinion report based on retrieval enhancement generation according to claim 7 is characterized in that The specific steps of step three are: Step 331: Based on the summary set R obtained in step 311, use the embedding model to convert each news summary in the summary set R into an embedded representation; Step 332: Based on the embedded representation obtained in step 331, use the K-Means algorithm and combine it with the silhouette coefficient to determine the optimal number of clusters k within a given range. optimal , and finally cluster the news summaries into k optimal news summary clusters; Step 333: Based on the news summary clusters obtained in step 332, prompt the large language model to extract the opinions of the news summary in each cluster; Step 334: Convert the opinions extracted in step 331 into vector representations, then calculate the cosine similarity between the news summaries within the cluster and the opinion vector representations, and finally use the news summaries with cosine similarity higher than the threshold as the basis for supporting the opinion.

9. The method for generating a public opinion report based on retrieval enhancement generation according to claim 8 is characterized in that The specific steps of step three and step four are: Step 341: Divide user comments into three groups: support, opposition, and neutral according to the results of stance detection; Step 342: Use the embedding model to convert the comments in the support and opposition sets into vector representations. Then, use the HDBSCAN clustering algorithm to cluster the comments in these two comment sets to obtain several comment clusters. Step 343: Based on the comment clusters obtained by clustering in step 342, the large language model is prompted to extract the opinions of the user comments in each cluster. If the comment cluster belongs to the support comment set, the extracted opinions are positive opinions. If the comment cluster belongs to the opposition comment set, the extracted opinions are negative opinions. Step 343: Use the embedding model to convert the opinions extracted by the large language model into vector representations, calculate the cosine similarity between the user comments and the opinions within the cluster, and use the comments with similarity higher than the threshold as the basis for supporting the opinion.

10. The method for generating a public opinion report based on retrieval enhancement generation according to claim 9 is characterized in that The embedding model is text-embedding-3-small or bge-large-zh.

Citation Information

Patent Citations

  • Whole-network patriotic public opinion event identifying and popularity tracking method

    CN111191096A

  • Public opinion detection method, device and equipment for news event, and storage medium

    CN113282754A

  • Convergent media public opinion analysis method based on information dissemination

    CN113704636A

  • News comment viewpoint sentence identification method

    CN113722482A

  • Method and system for generating public opinion report of hot topic

    CN117556130A