A method for in-depth analysis of public opinion based on large language model

Through the dual-model public opinion in-depth analysis method based on large language model, the joint screening of primary sensitive word matching model and deep learning model is solved, and the problem of public opinion analysis system consumes a lot of human resources in the existing technology is improved, and the analysis efficiency and accuracy are improved. , adapts to the needs of large-scale public opinion analysis on the Internet.

CN118885618BActive Publication Date: 2024-12-31GUANGZHOU JOYSLIM NETWORK TECH
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing public opinion analysis system relies on keyword screening, resulting in a large amount of similar content that requires manual analysis and consumes a lot of human resources, and cannot adapt to the needs of large-scale public opinion analysis on the Internet.

Method used

Using a dual-model public opinion in-depth analysis method based on large language models, firstly, quickly screening through the primary sensitive word matching model to determine text security. If it is not safe, in-depth analysis will be performed through a text public opinion analysis model based on deep learning to reduce all Depth detection of text improves processing power and response speed.

Benefits of technology

Through dual-model joint screening analysis, artificial resources are saved, the accuracy and automation of public opinion analysis are improved, time-consuming in-depth detection is avoided, all text is performed, and the system's processing ability and response speed are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885618B_ABST
    Figure CN118885618B_ABST
Patent Text Reader

Abstract

The present invention provides a method for deep analysis of public opinion based on a large language model, comprising: S1 obtaining a text detection request sent by a caller, wherein the text detection request contains text information to be analyzed; S2 inputting the text to be analyzed into a first analysis model, using the first analysis model that has been trained to perform a preliminary analysis on the text to be analyzed, and obtaining a preliminary analysis result of the text to be analyzed; S3 when the preliminary analysis result is safe, returning the preliminary analysis result to the caller; S4 when the preliminary analysis result is unsafe, further inputting the text to be analyzed into a second analysis model, using the second analysis model that has been trained to perform a deep analysis on the text to be analyzed, and obtaining a deep analysis result of the text to be analyzed; S5 returning the deep analysis result to the caller. The present invention helps to improve the efficiency and intelligence level of public opinion analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of public opinion analysis, and in particular to a method for in-depth public opinion analysis based on a large language model. Background Art

[0002] In the context of the rapid development of the Internet, once a hot topic of public opinion appears, it is easy to have a serious impact on related companies and organizations. At present, most of the common public opinion analysis systems on the market are based on the name of the unit, product name, service name and other keywords to conduct full network screening. Although the scope of analysis has been narrowed, there will still be a large amount of similar content, which requires manual qualitative analysis to determine whether it is marked as information that needs special attention or public relations intervention. This process requires a lot of human resources and cannot adapt to the current large-scale Internet public opinion analysis application. Summary of the invention

[0003] In view of the above problems, the present invention aims to provide a method for in-depth analysis of public opinion based on a large language model.

[0004] The purpose of the present invention is achieved by the following technical solutions:

[0005] The present invention provides a method for in-depth analysis of public opinion based on a large language model, which is characterized by comprising:

[0006] S1 obtains a text detection request sent by the caller, where the text detection request contains text information to be analyzed;

[0007] S2: inputting the text to be analyzed into the first analysis model, using the trained first analysis model to perform a preliminary analysis on the text to be analyzed, and obtaining a preliminary analysis result of the text to be analyzed;

[0008] S3 returns the preliminary analysis result to the caller when it is safe.

[0009] S4: when the preliminary analysis result is unsafe, further input the text to be analyzed into the second analysis model, and use the trained second analysis model to perform in-depth analysis on the text to be analyzed to obtain a in-depth analysis result of the text to be analyzed;

[0010] S5 returns the deep analysis result to the caller.

[0011] Preferably, the method further comprises, before step S2:

[0012] Sb21 performs preprocessing according to the acquired text information to be analyzed to obtain the preprocessed text information to be analyzed;

[0013] The preprocessing includes data standardization and data cleaning preprocessing.

[0014] Preferably, step Sb21 includes:

[0015] Performing standardization processing based on the acquired text information to be analyzed, and organizing the text to be analyzed into a text sequence without spaces;

[0016] The acquired text sequence is further cleaned to remove punctuation marks and special characters in the text sequence to obtain a continuous text sequence.

[0017] Preferably, the first analysis model is a sensitive word matching model, specifically comprising:

[0018] The first analysis model is used to perform word segmentation on the text to be analyzed based on the acquired text information to be analyzed, and match and analyze the divided characters and words with the sensitive character list and sensitive word list preset in the sensitive character database to detect whether the text to be analyzed contains sensitive characters or sensitive words. When sensitive characters or sensitive words are detected in the text to be analyzed, the preliminary analysis result of the text to be analyzed is unsafe; when it is detected that no sensitive characters or sensitive words appear in the text to be analyzed, the preliminary analysis result of the text to be analyzed is safe.

[0019] Preferably, the first analysis model first performs sensitive word matching analysis on the text to be analyzed. When sensitive words are found, the text information to be analyzed is further analyzed for sensitive words. When sensitive words are found, the preliminary analysis result of the text to be analyzed is that it is unsafe.

[0020] Preferably, the method further comprises: Sb22 building the sensitive word database, specifically comprising:

[0021] According to the set conventional sensitive word, the pinyin corresponding to the conventional sensitive word is obtained as the first feature, and the strokes corresponding to the conventional sensitive word are obtained as the second feature; the conventional sensitive word and the first feature and the second feature corresponding to the conventional sensitive word are added to the sensitive word list;

[0022] When performing sensitive word matching analysis, the first analysis model matches the target word to be analyzed with the regular sensitive words in the sensitive word list. If the target word is a regular sensitive word, the target word is marked as a regular sensitive word; further obtain the pinyin feature corresponding to the target word and match it with the sensitive word list. If the sensitive word list contains a first feature that is the same as the pinyin feature of the target word, the target word is marked as a suspected sensitive word; further obtain the stroke feature corresponding to the target word, when the stroke feature of the target word contains the second feature in the sensitive word list, or the similarity between the stroke feature of the target word and the second feature in the sensitive word list exceeds a set threshold, the target word is marked as a suspected sensitive word; when there is a target word marked as a regular sensitive word or a suspected sensitive word, the text to be analyzed is marked as unsafe; at the same time, when the target word is marked as unsafe, further obtain the sensitive word corresponding to the target word, and associate the obtained sensitive word with the target word;

[0023] According to the set regular sensitive words, the pinyin corresponding to the regular sensitive words is obtained as the third feature, and the first letter combination of the corresponding pinyin is used as the fourth feature; the regular sensitive words, and the third and fourth features corresponding to the regular sensitive words are added to the sensitive word list;

[0024] When performing sensitive word matching analysis, the first analysis model matches the target word to be analyzed with the regular sensitive words in the sensitive word list. If the target word is a regular sensitive word, the target word is marked as a regular sensitive word; the pinyin feature of the target word is further obtained and matched with the sensitive word list. If there is a third feature in the sensitive word list that is the same as the pinyin feature of the target word, the target word is marked as a suspected sensitive word; when there is a target word marked as a regular sensitive word or a suspected sensitive word, the text to be analyzed is marked as unsafe;

[0025] Among them, when the target word contains a target word marked as unsafe, the unsafe target word is further replaced with an associated sensitive word, and the above-mentioned sensitive word matching is repeated based on the sensitive words composed of the replaced sensitive words. When the matching result of the replaced target word is unsafe, the matching result of the original target word is also marked as unsafe.

[0026] Preferably, the similarity between the stroke feature of the target character and the second feature in the sensitive character list is calculated, and the similarity calculation formula used is: ,in Indicates the similarity of stroke features, Indicates the total number of strokes of the target character, The stroke feature representing the target character includes the same number of strokes as the second feature, wherein the number of strokes is the same order of consecutive strokes and the number of consecutive identical strokes is greater than or equal to 2.

[0027] Preferably, for English characters or English character strings, the corresponding pinyin features are the English characters or English character strings themselves.

[0028] For the matching analysis of English strings, the English strings are matched with the sensitive word list and the sensitive word list respectively. If the English string is the same as the first feature in the sensitive word list, or the English string is the same as the third feature or the fourth feature in the sensitive word list, the English string is marked as a suspected sensitive word.

[0029] Preferably, the second analysis model is a text public opinion analysis model based on deep learning, wherein the text public opinion analysis model includes an input layer, a feature extraction layer and an output layer; wherein the input layer is used to obtain the text to be analyzed, and locate the characters contained in the text to be analyzed according to the text to be analyzed, and obtain the text vector to be analyzed as follows: ,in Represents the text vector to be analyzed, which contains N sentences , each sentence contains K words, as independent sentence vectors , Indicates Sentence No. The positional encoding vector, character vector and sentence vector corresponding to the sentence are input into the Roberta language model. The language model performs word embedding representation based on the three input vectors to obtain the embedded word vector. Based on the embedded word vector, the dual Transformer encoder is used to perform feature representation on the embedded word vector to obtain the feature representation of the corresponding sentence. ;

[0030] The feature extraction layer is used to input the text to be analyzed into BiGRU for multi-segment feature extraction, capture the feature information of the entire length of the text to be analyzed, apply the attention mechanism to the main body of the text to be analyzed, capture the important characters in the text, calculate the weights assigned to all characters, and obtain the corresponding sentence representation; then input the sentence representation into BiGRU for feature extraction; and add an attention control to the obtained features to obtain the vector representation of each sentence for the characters and the weighted sum of the corresponding weights to obtain the full length representation of the text to be analyzed;

[0031] The output layer performs classification based on the full text representation through the softmax function to obtain the in-depth analysis results of the text to be analyzed.

[0032] Preferably, in step S1, the text detection request includes image information to be analyzed;

[0033] The method also includes: Sa11 extracts text information from the image to be analyzed based on the acquired image information to be analyzed, so as to obtain text information to be analyzed.

[0034] The beneficial effects of the present invention are as follows: the present invention designs a public opinion in-depth analysis method based on a dual model. For the acquired text information to be analyzed, firstly, a rapid screening is performed based on the primary model, which can screen out a large number of safe texts, and for texts that may have problems, the advanced model is used for in-depth monitoring. Through the secondary joint screening and analysis method, time-consuming in-depth detection of all texts can be avoided, thereby improving the processing capacity and response speed of the system. At the same time, based on the intelligent analysis method, it can save labor and improve accuracy and automation. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The present invention is further described using the accompanying drawings, but the embodiments in the accompanying drawings do not constitute any limitation to the present invention. A person skilled in the art can obtain other drawings based on the following drawings without creative work.

[0036] Figure 1 The present invention is a schematic diagram of the steps of a method for in-depth analysis of public opinion based on a large language model according to an embodiment of the present invention.

[0037] Figure 2 A schematic diagram of a method for in-depth analysis of public opinion based on a large language model according to an embodiment of the present invention. DETAILED DESCRIPTION

[0038] The present invention is further described in conjunction with the following application scenarios.

[0039] See also Figure 1 , Figure 2 , which shows a method for in-depth analysis of public opinion based on a large language model, including:

[0040] S1 obtains a text detection request sent by the caller, where the text detection request contains text information to be analyzed;

[0041] S2: inputting the text to be analyzed into the first analysis model, using the trained first analysis model to perform a preliminary analysis on the text to be analyzed, and obtaining a preliminary analysis result of the text to be analyzed;

[0042] S3 returns the preliminary analysis result to the caller when it is safe.

[0043] S4: when the preliminary analysis result is unsafe, further input the text to be analyzed into the second analysis model, and use the trained second analysis model to perform in-depth analysis on the text to be analyzed to obtain a in-depth analysis result of the text to be analyzed;

[0044] S5 returns the deep analysis result to the caller.

[0045] The above-mentioned implementation mode of the present invention firstly conducts a quick screening based on the primary model (first analysis model) for the acquired text information to be analyzed, and can screen out a large number of safe texts (such as texts that do not contain target keywords), and for texts that may have problems (such as texts that contain target information), the advanced model (second analysis model) conducts in-depth monitoring. Through the secondary joint screening and analysis method, it can avoid time-consuming in-depth detection of all texts, thereby improving the processing capacity and response speed of the system. At the same time, based on the intelligent analysis method, it can save labor and improve accuracy and automation.

[0046] The method of the present invention can be implemented based on a server, an intelligent terminal, SAAS (such as ai-safe-text), etc., wherein the caller includes a specific user terminal or a designated system.

[0047] In one scenario, the caller can be a private user (such as a corporate user, organizational user, etc., to monitor their own public opinion) or a public management organization (monitoring sensitive information in a specific direction in the public opinion environment).

[0048] Preferably, the method further comprises, before step S2:

[0049] Sb21 performs preprocessing according to the acquired text information to be analyzed to obtain the preprocessed text information to be analyzed;

[0050] The preprocessing includes data standardization and data cleaning preprocessing.

[0051] Preprocessing the acquired text to be analyzed can filter out erroneous information contained in the text, which helps to improve the efficiency and accuracy of subsequent further analysis and processing.

[0052] Preferably, step Sb21 includes:

[0053] Performing standardization processing based on the acquired text information to be analyzed, and organizing the text to be analyzed into a text sequence without spaces;

[0054] The acquired text sequence is further cleaned to remove punctuation marks and special characters in the text sequence to obtain a continuous text sequence.

[0055] By extracting the text characters in the text information to be analyzed and clarifying the interference information in the text (such as punctuation or special characters, etc.), a continuous text sequence can be obtained for further screening, which helps to improve the efficiency and reliability of subsequent public opinion analysis.

[0056] Preferably, the first analysis model is a sensitive word matching model, specifically comprising:

[0057] The first analysis model is used to perform word segmentation on the text to be analyzed based on the acquired text information to be analyzed, and match and analyze the divided characters and words with the sensitive character list and sensitive word list preset in the sensitive character database to detect whether the text to be analyzed contains sensitive characters or sensitive words. When sensitive characters or sensitive words are detected in the text to be analyzed, the preliminary analysis result of the text to be analyzed is unsafe; when it is detected that no sensitive characters or sensitive words appear in the text to be analyzed, the preliminary analysis result of the text to be analyzed is safe.

[0058] Preferably, the first analysis model first performs sensitive word matching analysis on the text to be analyzed. When sensitive words are found, the text information to be analyzed is further analyzed for sensitive words. When sensitive words are found, the preliminary analysis result of the text to be analyzed is that it is unsafe.

[0059] Optionally, if the text to be analyzed does not contain sensitive words, the preliminary analysis result of the text information to be analyzed is safe.

[0060] Among them, the first analysis model (primary model) performs a preliminary analysis on the text information to be analyzed. It can perform a preliminary analysis on the text to be analyzed based on the setting of more common sensitive characters and sensitive word screening conditions, quickly screen out safe text content, and further call the second analysis model for secondary analysis for content that may contain unsafe information. This helps to improve the efficiency of text public opinion analysis.

[0061] Among them, by first performing sensitive word analysis and then further performing sensitive word analysis based on the sensitive word analysis results, the reliability of the preliminary analysis of the text to be analyzed can be further improved, which helps to improve the effect of the preliminary analysis.

[0062] Preferably, the method further comprises: Sb22 building the sensitive word database, specifically comprising:

[0063] According to the set conventional sensitive word, the pinyin corresponding to the conventional sensitive word is obtained as the first feature, and the strokes corresponding to the conventional sensitive word are obtained as the second feature; the conventional sensitive word and the first feature and the second feature corresponding to the conventional sensitive word are added to the sensitive word list;

[0064] When performing sensitive word matching analysis, the first analysis model matches the target word to be analyzed with the regular sensitive words in the sensitive word list. If the target word is a regular sensitive word, the target word is marked as a regular sensitive word; further obtain the pinyin feature corresponding to the target word and match it with the sensitive word list. If the sensitive word list contains a first feature that is the same as the pinyin feature of the target word, the target word is marked as a suspected sensitive word; further obtain the stroke feature corresponding to the target word, when the stroke feature of the target word contains the second feature in the sensitive word list, or the similarity between the stroke feature of the target word and the second feature in the sensitive word list exceeds a set threshold, the target word is marked as a suspected sensitive word; when there is a target word marked as a regular sensitive word or a suspected sensitive word, the text to be analyzed is marked as unsafe; at the same time, when the target word is marked as unsafe, further obtain the sensitive word corresponding to the target word, and associate the obtained sensitive word with the target word;

[0065] According to the set regular sensitive words, the pinyin corresponding to the regular sensitive words is obtained as the third feature, and the first letter combination of the corresponding pinyin is used as the fourth feature; the regular sensitive words, and the third and fourth features corresponding to the regular sensitive words are added to the sensitive word list;

[0066] When performing sensitive word matching analysis, the first analysis model matches the target word to be analyzed with the regular sensitive words in the sensitive word list. If the target word is a regular sensitive word, the target word is marked as a regular sensitive word; the pinyin feature of the target word is further obtained and matched with the sensitive word list. If there is a third feature in the sensitive word list that is the same as the pinyin feature of the target word, the target word is marked as a suspected sensitive word; when there is a target word marked as a regular sensitive word or a suspected sensitive word, the text to be analyzed is marked as unsafe;

[0067] Among them, when the target word contains a target word marked as unsafe, the unsafe target word is further replaced with an associated sensitive word, and the above-mentioned sensitive word matching is repeated based on the sensitive words composed of the replaced sensitive words. When the matching result of the replaced target word is unsafe, the matching result of the original target word is also marked as unsafe.

[0068] Among them, for English characters or English character strings, the corresponding pinyin features are the English characters or English character strings themselves.

[0069] For the matching analysis of English strings, the English strings are matched with the sensitive word list and the sensitive word list respectively. If the English string is the same as the first feature in the sensitive word list, or the English string is the same as the third feature or the fourth feature in the sensitive word list, the English string is marked as a suspected sensitive word.

[0070] Common sensitive words include organization names, personal names, special codes, etc.

[0071] Conventional sensitive words include organization names, enterprise names, brand names, celebrity names, etc.

[0072] Preferably, the similarity between the stroke feature of the target character and the second feature in the sensitive word list is calculated using the following similarity calculation formula: , where represents the stroke feature similarity, represents the total number of strokes of the target character, represents the number of strokes in the stroke feature of the target character that are the same as the second feature, where the number of strokes is consecutive with the same stroke order and the number of consecutive identical strokes is greater than or equal to 2.

[0073] In one scenario, for the sensitive word "Cheng Dong" (for example, for the public opinion analysis of the target enterprise name), "Cheng" and "Dong" are respectively included in the conventional sensitive words. At the same time, the pinyin "cheng" of "Cheng" is used as the first feature, and the strokes of "Cheng" (for example, the stroke order feature "horizontal|vertical|hook|horizontal|left-falling stroke|horizontal hook|slanting hook|left-falling stroke|dot|") are used as the second feature and recorded in the sensitive word list of the sensitive word database; and the sensitive word "Cheng Dong" and the corresponding pinyin "chengdong" are included in the sensitive word list. When performing sensitive word matching analysis, for example, for the target text to be analyzed containing "Cheng Dong", sensitive word analysis is performed on the text characters "Cheng" and "Dong" respectively. When performing sensitive word matching analysis on the character "Cheng", first directly match the target character "Cheng" with the sensitive words in the sensitive word list, but "Cheng" does not exist in the sensitive word list; then further obtain the pinyin "cheng" and the stroke feature "left-falling stroke|horizontal|horizontal|horizontal|vertical hook|horizontal|left-falling stroke|horizontal hook|slanting hook|left-falling stroke|dot|" of the target character "Cheng", and match the pinyin "cheng" of the target character "Cheng" with the sensitive word list. When it is detected that there is a matching pinyin "cheng" in the sensitive word list, mark the target character "Cheng" as a suspected sensitive word, and further match the corresponding second feature in the stroke feature of the target character "Cheng" to obtain the similarity between the two , where represents the stroke feature similarity, represents the total number of strokes of the target character, represents the number of strokes in the stroke feature of the target character that are the same as the second feature, where the number of strokes is consecutive with the same stroke order and the number of consecutive identical strokes is greater than 2; according to the obtained similarity, if the similarity exceeds the set threshold When, for example If so, mark the target character "Cheng" as unsafe, further obtain the sensitive character "Cheng" corresponding to the target character "Cheng", and associate the two. For another target character "Dong", since it can match the regular sensitive character "Dong" existing in the sensitive word list, directly mark the target character "Dong" as a sensitive word.

[0074] Further perform sensitive word matching analysis. Directly match the target word "Chengdong" with the sensitive words in the sensitive word list. When the target word does not exist in the sensitive word list, further perform matching analysis based on the pinyin feature "chengdong" of the target word "Chengdong" with the sensitive word list. When it is detected that the same third feature "chengdong" exists in the sensitive word list, mark the target word "Chengdong" as a sensitive word.

[0075] In another way, according to the sensitive character analysis result, since the unsafe target character "Cheng" exists in the target word "Chengdong", further replace the unsafe target character "Cheng" with the associated sensitive character "Cheng", and perform matching analysis with the sensitive word list using the replaced phrase "Chengdong". If the result of the target word "Chengdong" is found to be unsafe, then the target word matching result of the corresponding target word "Chengdong" is also unsafe.

[0076] Among them, when there is an unsafe target word in the text information to be analyzed, mark the text sequence to be analyzed as unsafe, and further perform advanced analysis on the unsafe text sequence based on the second analysis model.

[0077] The above embodiments of the present invention propose a fast matching analysis method for target words / target words in the text information to be analyzed. Different from the traditional sensitive word recognition method, it can further screen for similar sensitive words based on the pinyin feature and stroke feature of the target character, effectively avoiding loopholes in the traditional sensitive word matching method where形近字 (similar in form) and other methods are used to avoid sensitive information screening, helping to improve the accuracy of sensitive character recognition. At the same time, for the obtained sensitive characters, it can further handle problems such as "homophones" and "similar in form" characters that appear in the sensitive word recognition process, helping to improve the intelligent level of sensitive character / sensitive word recognition in the public opinion analysis process, and improving the accuracy and effect of sensitive character / word recognition analysis.

[0078] When sensitive characters / sensitive words (or set to only appear sensitive words) are identified in the text to be analyzed, further mark the extracted text sequence to be analyzed as unsafe, and further perform public opinion analysis on the text to be analyzed through the second analysis model in the follow-up.

[0079] Preferably, the second analysis model is a text public opinion analysis model based on deep learning, wherein the text public opinion analysis model includes an input layer, a feature extraction layer and an output layer; wherein the input layer is used to obtain the text to be analyzed, and locate the characters contained in the text to be analyzed according to the text to be analyzed, and obtain the text vector to be analyzed as follows: ,in Represents the text vector to be analyzed, which contains N sentences , each sentence contains K words, as independent sentence vectors , Indicates Sentence No. The positional encoding vector, character vector and sentence vector corresponding to the sentence are input into the Roberta language model. The language model performs word embedding representation based on the three input vectors to obtain the embedded word vector. Based on the embedded word vector, the dual Transformer encoder is used to perform feature representation on the embedded word vector to obtain the feature representation of the corresponding sentence. ;

[0080] The feature extraction layer is used to input the text to be analyzed into BiGRU for multi-segment feature extraction, capture the feature information of the entire length of the text to be analyzed, apply the attention mechanism to the main body of the article, capture the important characters in the text, calculate the weights assigned to all characters, and obtain the corresponding sentence representation; then input the sentence representation into BiGRU for feature extraction; and add an attention control to the obtained features to obtain the vector representation of each sentence for the characters and the weighted sum of the corresponding weights to obtain the full length representation of the text to be analyzed;

[0081] The output layer performs classification based on the full text representation through the softmax function to obtain the in-depth analysis results of the text to be analyzed.

[0082] The in-depth analysis results include safe and unsafe.

[0083] In one scenario, the unsafe results include sentiment analysis results of specific public opinions.

[0084] By conducting secondary public opinion analysis on the text to be analyzed based on the text public opinion analysis model trained based on deep learning, it is possible to accurately extract text features based on the contextual characteristics of the text, and conduct public opinion analysis based on the text features. It is also possible to accurately and intelligently classify the public opinion nature of the text based on deep learning, which helps to improve the intelligence level of text public opinion analysis.

[0085] At the same time, in another scenario, the second analysis model can also be implemented by using a deep learning model that has been trained in the prior art for public opinion sentiment analysis of text sequences, such as a text sentiment analysis model based on the BERT model, a public opinion sentiment analysis model based on LSTM, etc., which will not be repeated here in the present invention.

[0086] Preferably, the method further comprises:

[0087] Sb12 trains the second analysis model.

[0088] When training the second analysis model, the target model is trained using the constructed training set. After the model training is completed, the model is tested using the test set. When the test result exceeds a preset standard, the training of the second analysis model is completed.

[0089] Preferably, in step S1, the text detection request includes image information to be analyzed;

[0090] The method also includes: Sa11 extracts text information from the image to be analyzed based on the acquired image information to be analyzed, so as to obtain text information to be analyzed.

[0091] Among them, in one scenario, the text extraction based on pictures can be implemented by using an image processing model based on Baidu AI, or other image processing models for text extraction based on pictures, and the present invention does not make specific limitations here.

[0092] The adaptability of public opinion analysis can be improved by extracting text from images and further performing public opinion analysis on the extracted text.

[0093] S6: when the deep analysis result is unsafe, marking the unsafe content in the unsafe text information;

[0094] The marked text information is transmitted to the first analysis model to update the first analysis model.

[0095] Based on the obtained unsafe text information, unsafe phrases or words contained therein are marked to update the sensitive word database used in the first analysis model, which helps to further improve the analysis efficiency and adaptability of the subsequent first analysis model.

[0096] It should be noted that each functional unit / module in each embodiment of the present invention may be integrated into one processing unit / module, or each unit / module may exist physically separately, or two or more units / modules may be integrated into one unit / module. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of software functional unit / module.

[0097] Through the description of the above implementation modes, it can be clearly understood by those skilled in the art that the embodiments described herein can be implemented in hardware, software, firmware, middleware, code or any appropriate combination thereof. For hardware implementation, the processor can be implemented in one or more of the following units: an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a processor, a controller, a microcontroller, a microprocessor, other electronic units designed to implement the functions described herein or a combination thereof. For software implementation, part or all of the processes of the embodiment can be completed by instructing the relevant hardware through a computer program. When implemented, the above program can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any medium that facilitates the transmission of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a computer. Computer-readable media can include, but are not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer.

[0098] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention, rather than to limit the scope of protection of the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should analyze that the technical solution of the present invention can be modified or replaced by equivalents without departing from the essence and scope of the technical solution of the present invention.

Claims

1. A method for in-depth analysis of public opinion based on a large language model, characterized in that: include: Sb22 builds a sensitive word database, including: According to the set conventional sensitive word, the pinyin corresponding to the conventional sensitive word is obtained as the first feature, and the strokes corresponding to the conventional sensitive word are obtained as the second feature; the conventional sensitive word and the first feature and the second feature corresponding to the conventional sensitive word are added to the sensitive word list; S1 obtains a text detection request sent by the caller, where the text detection request contains text information to be analyzed; S2: inputting the text to be analyzed into the first analysis model, using the trained first analysis model to perform a preliminary analysis on the text to be analyzed, and obtaining a preliminary analysis result of the text to be analyzed; The first analysis model is a sensitive word matching model, which specifically includes: The first analysis model is used to perform word segmentation on the text to be analyzed based on the acquired text information to be analyzed, and to match and analyze the characters and words obtained by the segmentation with the sensitive character list and sensitive word list preset in the sensitive character database to detect whether the text to be analyzed contains sensitive characters or sensitive words; Among them, the first analysis model first performs sensitive word matching analysis on the text to be analyzed. When the analysis finds the existence of sensitive words, the text information to be analyzed is further subjected to sensitive word analysis. When the analysis finds the existence of sensitive words, the preliminary analysis result of the text to be analyzed is obtained as unsafe; specifically including: When performing sensitive word matching analysis, the first analysis model matches the target word to be analyzed with the regular sensitive words in the sensitive word list. If the target word is a regular sensitive word, the target word is marked as a regular sensitive word; further obtain the pinyin feature corresponding to the target word and match it with the sensitive word list. If the sensitive word list contains a first feature that is the same as the pinyin feature of the target word, the target word is marked as a suspected sensitive word; further obtain the stroke feature corresponding to the target word, when the stroke feature of the target word contains the second feature in the sensitive word list, or the similarity between the stroke feature of the target word and the second feature in the sensitive word list exceeds a set threshold, the target word is marked as a suspected sensitive word; when there is a target word marked as a regular sensitive word or a suspected sensitive word, the text to be analyzed is marked as unsafe; at the same time, when the target word is marked as unsafe, further obtain the sensitive word corresponding to the target word, and associate the obtained sensitive word with the target word; The stroke feature includes the stroke order. The similarity between the stroke feature of the target character and the second feature in the sensitive character list is calculated. The similarity calculation formula used is: ,in Indicates the similarity of stroke features, Indicates the total number of strokes of the target character, The stroke feature of the target character includes the same number of strokes as the second feature, wherein the number of strokes is the same order of consecutive strokes and the number of consecutive identical strokes is greater than or equal to 2; According to the set regular sensitive words, the pinyin corresponding to the regular sensitive words is obtained as the third feature, and the first letter combination of the corresponding pinyin is used as the fourth feature; the regular sensitive words, and the third and fourth features corresponding to the regular sensitive words are added to the sensitive word list; When performing sensitive word matching analysis, the first analysis model matches the target word to be analyzed with the regular sensitive words in the sensitive word list. If the target word is a regular sensitive word, the target word is marked as a regular sensitive word; the pinyin feature of the target word is further obtained and matched with the sensitive word list. If there is a third feature in the sensitive word list that is the same as the pinyin feature of the target word, the target word is marked as a suspected sensitive word; when there is a target word marked as a regular sensitive word or a suspected sensitive word, the text to be analyzed is marked as unsafe; When a target word marked as unsafe appears in the target word, the first analysis model further replaces the unsafe target word with an associated sensitive word, and repeats the above sensitive word matching based on the sensitive words composed of the replaced sensitive words. When the matching result of the replaced target word is unsafe, the matching result of the original target word is also marked as unsafe. S3 returns the preliminary analysis result to the caller when it is safe. S4: when the preliminary analysis result is unsafe, further input the text to be analyzed into the second analysis model, and use the trained second analysis model to perform in-depth analysis on the text to be analyzed to obtain a in-depth analysis result of the text to be analyzed; The second analysis model is a text public opinion analysis model based on deep learning, wherein the text public opinion analysis model includes an input layer, a feature extraction layer and an output layer; wherein the input layer is used to obtain the text to be analyzed, and locate the characters contained in the text to be analyzed according to the text to be analyzed, and obtain the text vector to be analyzed as follows: ,in Represents the text vector to be analyzed, which contains N sentences , each sentence contains K words, as independent sentence vectors , Indicates Sentence No. The positional encoding vector, character vector and sentence vector corresponding to the sentence are input into the Roberta language model. The language model performs word embedding representation based on the three input vectors to obtain the embedded word vector. Based on the embedded word vector, the dual Transformer encoder is used to perform feature representation on the embedded word vector to obtain the feature representation of the corresponding sentence. ; The feature extraction layer is used to input the text to be analyzed into BiGRU for multi-segment feature extraction, capture the feature information of the entire length of the text to be analyzed, apply the attention mechanism to the main body of the text to be analyzed, capture the important characters in the text, calculate the weights assigned to all characters, and obtain the corresponding sentence representation; then input the sentence representation into BiGRU for feature extraction; and add an attention control to the obtained features to obtain the vector representation of each sentence for the characters and the weighted sum of the corresponding weights to obtain the full length representation of the text to be analyzed; The output layer uses the softmax function to perform sentiment classification based on the obtained full-text representation to obtain the in-depth analysis results of the text to be analyzed; S5 returns the deep analysis result to the caller.

2. According to claim 1, a method for in-depth analysis of public opinion based on a large language model is characterized in that: Before step S2, the method further includes: Sb21 performs preprocessing according to the acquired text information to be analyzed to obtain the preprocessed text information to be analyzed; The preprocessing includes data standardization and data cleaning preprocessing.

3. According to claim 2, a method for in-depth analysis of public opinion based on a large language model is characterized in that: Step Sb21 includes: Performing standardization processing based on the acquired text information to be analyzed, and organizing the text to be analyzed into a text sequence without spaces; The acquired text sequence is further cleaned to remove punctuation marks and special characters in the text sequence to obtain a continuous text sequence.

4. According to claim 1, a method for in-depth analysis of public opinion based on a large language model is characterized in that: For English characters or English strings, the corresponding pinyin features are the English characters or English strings themselves; For the matching analysis of English strings, the English strings are matched with the sensitive character list and the sensitive word list respectively. If the English string is the same as the first feature in the sensitive character list, or the English string is the same as the third feature or the fourth feature in the sensitive word list, the English string is marked as a suspected sensitive word.

5. According to claim 1, a method for in-depth analysis of public opinion based on a large language model is characterized in that: In step S1, the text detection request includes image information to be analyzed; The method also includes: Sa11 extracts text information from the image to be analyzed based on the acquired image information to be analyzed, so as to obtain text information to be analyzed.