Public opinion analysis method and device based on large language model, equipment and storage medium

Through a large language model, analyzing public opinion data, generating sentiment classification results and automatically notifying target users, solving the problems of high demand for sample data and low classification efficiency in the existing technology, and achieving efficient sentiment classification and automated monitoring.

CN119128157APending Publication Date: 2024-12-13GUANGDONG ESHORE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411250670.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The existing emotion classification methods rely on a large number of strictly annotated data samples. The classification effect is poor when the samples are insufficient or the quality is poor, and human predefined emotion categories are required, which limits the breadth and efficiency of application.

Method used

Using a public opinion analysis method based on a large language model, the input text is generated by obtaining public opinion data and preset prompt templates, and the emotional classification results are generated by using a large language model, and the target public opinion data and users are determined based on the results, and the target users are automatically notified to reduce the sample. Data requirements to improve classification efficiency and effectiveness.

Benefits of technology

There is no need to manually predefined emotions categories, which greatly reduces sample data demand, improves the efficiency and effect of emotions classification, realizes automated monitoring, adapts to unpredefined emotions categories, and enhances application simplicity and expansion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128157A_ABST
    Figure CN119128157A_ABST
Patent Text Reader

Abstract

The invention provides a big language model-based public opinion analysis method, device and equipment and a storage medium, and the method comprises the steps: obtaining public opinion data of a plurality of platforms, generating a public opinion input text according to the public opinion data and a preset prompt template, providing a standardized public opinion input text, and improving the user experience. Analysis of a large language model is facilitated; the emotion classification result is generated according to the public opinion input text and the large language model, compared with an existing classification model, the large language model does not need to manually pre-define emotion categories, the requirement for sample data can be greatly reduced, and the emotion classification efficiency and effect can be improved; according to the emotion classification result and the public opinion data, determining the target public opinion data, determining the target user issuing the target public opinion data and the target platform, notifying the target user according to the notification rule of the target platform, automatically callback and determining the target user according to the emotion classification result, and performing notification, so that convenience and rapidness are realized, and automatic monitoring is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and in particular to a public opinion analysis method, apparatus, device and storage medium based on a large language model. Background Art

[0002] Sentiment classification is used in many fields. It is a classic text classification problem. Its goal is to distinguish texts of different emotion categories based on the different features and semantics contained in the text information. At present, the sentiment classification method usually adopts NLP text classification. NLP text classification requires training the classification model on a large number of strictly labeled data samples. Therefore, it has high requirements on the quantity and quality of sample data. When there is a lack of sample data or the sample data quality is poor, it will lead to poor classification results. In addition, the emotion categories classified by the model need to be manually predefined in advance. The efficiency and effect of text classification are poor, which limits its application. Summary of the invention

[0003] The embodiment of the present application provides a public opinion analysis method, apparatus, device and storage medium based on a large language model to solve at least one problem existing in the related technology. The technical solution is as follows:

[0004] In a first aspect, an embodiment of the present application provides a method for public opinion analysis based on a large language model, including:

[0005] Obtain public opinion data from several platforms, and generate public opinion input text based on the public opinion data and a preset prompt template;

[0006] Generate sentiment classification results based on the public opinion input text and the large language model;

[0007] Determining target public opinion data according to the emotion classification result and the public opinion data;

[0008] Determine the target user and target platform for publishing the target public opinion data, and notify the target user according to the notification rule of the target platform.

[0009] In one implementation, the large language model is obtained by the following steps:

[0010] Initializing an initial large model, and importing preset model information into the initial large model;

[0011] A number of different public opinion sentiment question-answer pairs are obtained, and the public opinion sentiment question-answer pairs are input into the initial large model for fine-tuning to obtain the large language model.

[0012] In one implementation, generating a sentiment classification result according to the public opinion input text and the large language model includes:

[0013] Inputting the public opinion input text into the large language model, performing prediction processing through the large language model, and obtaining predicted words;

[0014] The predicted words are concatenated into the public opinion input text to obtain a new public opinion input text, and according to the new public opinion input text, the step of inputting the public opinion input text into the large language model is returned until a preset end condition is met to obtain a sentiment classification result.

[0015] In one implementation, the predictive processing performed by the large language model to obtain the predicted words includes:

[0016] Processing the public opinion input text through the embedding layer of the large language model to obtain an input embedding;

[0017] According to the multi-head attention module and the input embedding, a hidden layer embedding is obtained;

[0018] According to the MLP layer, the softmax layer and the hidden layer embedding, the probability of each word in the public opinion input text is obtained;

[0019] According to the probability and the argmax function, the predicted word is determined.

[0020] In one embodiment, returning to the step of inputting the public opinion input text into the large language model according to the new public opinion input text until a preset end condition is met to obtain a sentiment classification result includes:

[0021] According to the new public opinion input text, the step of inputting the public opinion input text into the large language model is returned until the number of words in the new public opinion input text reaches a preset number of generated words or the predicted words have an end symbol, thereby obtaining a sentiment classification result.

[0022] In one implementation, determining target public opinion data according to the emotion classification result and the public opinion data includes:

[0023] Filtering out target emotion classification results representing negative emotions from all the emotion classification results;

[0024] The public opinion data corresponding to the target emotion classification result is determined as the target public opinion data.

[0025] In one implementation, notifying the target user according to a notification rule of the target platform includes:

[0026] If the notification rule of the target platform includes a total number threshold, when the number of times the target user corresponding to the target public opinion data sends is greater than the total number threshold, the target user is notified in a preset manner of the notification rule;

[0027] or,

[0028] If the notification rule of the target platform includes a frequency threshold within a specified time interval, when the sending frequency of the target user corresponding to the target public opinion data is greater than the frequency threshold within the specified time interval, the target user is notified in the preset manner of the notification rule.

[0029] In a second aspect, the embodiment of the present application provides a public opinion analysis device based on a large language model, comprising:

[0030] An acquisition module is used to acquire public opinion data from several platforms and generate public opinion input text according to the public opinion data and a preset prompt template;

[0031] A generation module, used to generate sentiment classification results based on the public opinion input text and the large language model;

[0032] A determination module, used to determine target public opinion data according to the emotion classification result and the public opinion data;

[0033] The notification module is used to determine the target user and target platform for publishing the target public opinion data, and to notify the target user according to the notification rules of the target platform.

[0034] In one embodiment, the acquisition module is further used for:

[0035] Initializing an initial large model, and importing preset model information into the initial large model;

[0036] A number of different public opinion sentiment question-answer pairs are obtained, and the public opinion sentiment question-answer pairs are input into the initial large model for fine-tuning to obtain the large language model.

[0037] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement a method in any one of the above-mentioned embodiments.

[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, the method in any one of the above-mentioned embodiments is implemented.

[0039] The beneficial effects of the above technical solution include at least:

[0040] By acquiring public opinion data from several platforms and generating public opinion input text based on the public opinion data and preset prompt templates, standardized public opinion input text is provided to facilitate analysis by the large language model; based on the public opinion input text and the large language model, sentiment classification results are generated. Compared with existing classification models, the large language model does not require manual pre-definition of sentiment categories and can greatly reduce the demand for sample data, which is conducive to improving the efficiency and effectiveness of sentiment classification; based on the sentiment classification results and public opinion data, the target public opinion data is determined, and the target users and target platforms for publishing the target public opinion data are determined. According to the notification rules of the target platform, the target users are notified, and the target users are automatically determined and notified based on the sentiment classification results. This is convenient and fast, and automated monitoring is achieved.

[0041] The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present application will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present application and should not be regarded as limiting the scope of the present application.

[0043] Figure 1 This is a schematic diagram of the steps of a public opinion analysis method based on a large language model according to an embodiment of the present application;

[0044] Figure 2 This is a specific example schematic diagram of language model analysis according to an embodiment of the present application;

[0045] Figure 3 This is a structural block diagram of a public opinion analysis device based on a large language model according to an embodiment of the present application;

[0046] Figure 4 This is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0047] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the spirit or scope of the present application. Therefore, the drawings and descriptions are considered to be exemplary and non-restrictive in nature.

[0048] In the embodiment of the present application, a large language model (LLM) is applied. The large language model does not have much demand for strictly labeled data. At the same time, the large language model does not require predefined text categories, supports recognition without predefined emotion categories, and has strong generalization ability.

[0049] It should be noted that the large language model can learn the grammar, semantics and contextual information of the language by training massive text data, so as to model natural language text. During the training process, the model will continuously optimize its parameters to improve its modeling ability for text data. Technically, the large language model complies with the task objectives of the language model, aiming to generate according to the probability of the next token, thereby modeling the generation probability of the entire word sequence. Its training method is based on the pre-training-fine-tuning paradigm, and adds RLHF (Reinforcement Learning from Human Feedback). Pre-training tasks include language modeling, masked language modeling, next sentence prediction, etc.; fine-tuning tasks can be text classification, machine translation, sentiment analysis, etc. During the fine-tuning process, the model is trained on a dataset for a specific task and its parameters are adjusted to meet the task requirements. Through RLHF, the text generated by the large language model can be closer to human thinking and language patterns.

[0050] Reference Figure 1 , a flowchart of a public opinion analysis method based on a large language model according to an embodiment of the present application is shown. The public opinion analysis method based on a large language model may at least include steps S100-S400:

[0051] S100, obtaining public opinion data from several platforms, and generating public opinion input text according to the public opinion data and a preset prompt template.

[0052] S200: Generate sentiment classification results based on public opinion input text and a large language model.

[0053] S300: Determine target public opinion data according to the emotion classification result and the public opinion data.

[0054] S400: Determine the target user and target platform for publishing the target public opinion data, and notify the target user according to the notification rules of the target platform.

[0055] The public opinion analysis method based on a large language model in the embodiment of the present application can be executed by an electronic control unit, a controller, a processor, etc. of a terminal such as a computer, a mobile phone, a tablet, a vehicle-mounted terminal, etc., or it can be executed by a cloud server.

[0056] The technical solution of the embodiment of the present application obtains public opinion data from several platforms, generates public opinion input text based on the public opinion data and a preset prompt template, and provides standardized public opinion input text to facilitate analysis by a large language model; generates emotion classification results based on the public opinion input text and the large language model, and utilizes the large language model. Compared with the existing classification model, it does not require manual pre-definition of emotion categories and can greatly reduce the demand for sample data, which is conducive to improving the efficiency and effect of emotion classification; determines the target public opinion data based on the emotion classification results and the public opinion data, determines the target user and the target platform for publishing the target public opinion data, and notifies the target user based on the notification rules of the target platform, and automatically determines the target user and notifies the target user based on the emotion classification result, which is convenient and fast, and realizes automatic monitoring.

[0057] In one embodiment, public opinion data of several platforms are obtained. The platforms may be various existing social platforms, including social platforms, news media, professional forums, etc. The public opinion data includes but is not limited to comments, barrages, etc., without specific limitation. In the embodiment of the present application, comments are taken as an example, for example, comments posted by several users may be included, including the user's ID, the text content of the comments, and the comment time, etc. It should be noted that a preset prompt template is configured in advance, and the public opinion data such as the included comments are filled into the preset prompt template prompt respectively, so as to obtain the public opinion input text, provide the large language model with standardized public opinion input text, and facilitate the large language model to perform sentiment analysis. It should be noted that after obtaining the public opinion data, data cleaning operations may also be performed, including but not limited to data quality filtering, privacy data masking, deduplication, etc., to obtain purified public opinion data, which is then input into the preset prompt template prompt.

[0058] For example, the preset prompt template prompt includes description content, emotional text and emotional classification results. The description content can be: "You are an AI engineer who is good at public opinion analysis and emotional text classification expert, and you are good at identifying the emotions contained in a text. Please output the emotions of the following emotional text. You are required to output only positive, neutral and negative. The result only needs 2 words. Please refer to the example I gave: <Example>", the public opinion data is filled in the position of the emotional text, and the emotional classification result recognized by the large language model will appear in the position of the recognition result.

[0059] In one implementation, the large language model is obtained by following the steps S101-S102:

[0060] S101, initializing an initial large model, and importing preset model information into the initial large model.

[0061] Optionally, a block consisting of an attention layer (including a multi-head attention module), a residual network (including an embedding layer, softmax), and an MLP (including an MLP layer), an initial large model of llama-7 consisting of 12 layers of blocks, the initial large model is initialized, and the preset model information is imported into the initial large model; the preset model information includes but is not limited to model parameters, status, tokenizer, etc.

[0062] S102: Obtain a number of different public opinion sentiment question-answer pairs, input the public opinion sentiment question-answer pairs into the initial large model for fine-tuning, and obtain a large language model.

[0063] Optionally, several different public opinion sentiment question and answer pairs can be obtained from the Internet to form public opinion sentiment question and answer pairs QA in JSON format, and then all public opinion sentiment question and answer pairs QA are input into the prompt, corresponding to the position of the sentiment text, and then the prompt containing the public opinion sentiment question and answer pairs is input as a whole into the above-mentioned initial large model, and fine-tuned using the Lora method to obtain the LLM of the fine-tuned field, that is, the large language model; therefore, the large language model can output the sentiment classification of the text, such as whether it is positive or negative.

[0064] In one implementation, step S200 includes steps S210-S220:

[0065] S210: input the public opinion input text into the large language model, perform prediction processing through the large language model, and obtain predicted words.

[0066] Optionally, S210 includes the following steps S2101-S2104:

[0067] S2101. Process the public opinion input text through the embedding layer of the large language model to obtain input embedding.

[0068] Optionally, the public opinion input text is input into the embedding layer nn.Embedding of the large language model. The embedding layer of the large language model processes the public opinion input text and initializes a vocabulary to convert the text into input embedding.

[0069] S2102. Obtain hidden layer embedding according to the multi-head attention module and input embedding.

[0070] Optionally, the input embedding is input into the multi-head attention module RMSNorm, and the attention mechanism of the multi-head attention module RMSNorm is used, such as Figure 2As shown, including the processing of each hidden layer representation, Q_mapper, K_mapper, V_mapper, softmax, etc., determining the attention output, combining the output mapper, residual Add (connection), etc., the first residual Add determines the hidden layer output hidden layer embedding.

[0071] S2103. According to the MLP layer, softmax layer and hidden layer embedding, the probability of each word in the public opinion input text is obtained.

[0072] Optionally, the hidden layer embedding is again passed through the multi-head attention module RMSNorm, MLP layer + softmax layer, and the softmax layer outputs the probability of each word in the vocabulary, specifically the probability of positive, neutral, negative (t1) and face, cube, square (t2).

[0073] S2104: Determine the predicted word based on the probability and the argmax function.

[0074] Then, according to the argmax function and probability, the next word predicted by the large language model is output, that is, the predicted word, specifically the word with the highest probability calculated based on the argmax function and probability.

[0075] S220, concatenating the predicted words into the public opinion input text to obtain a new public opinion input text, and returning to the step of inputting the public opinion input text into the large language model according to the new public opinion input text, until the preset end condition is met to obtain the emotion classification result.

[0076] Optionally, after determining the predicted word, the predicted word is spliced ​​into the public opinion input text. For example, the predicted word B is obtained from the public opinion input text of comment A. At this time, the predicted word B is spliced ​​into the public opinion input text of comment A to obtain a new public opinion input text. Then, according to the new public opinion input text, the step of inputting the public opinion input text into the large language model is returned, that is, returning to step S210 until the preset end condition is met to obtain the sentiment classification result. It should be noted that the preset end condition can be that the number of words in the new public opinion input text reaches the preset number of generated words or the predicted word has an end symbol. <eos>(ie, the end symbol is output), the preset number of generated words length can be based on actual settings, for example, length=50.

[0077] like Figure 2 As shown, assuming that the public opinion input text is: "On March 12, 2024, the long-distance running team of a certain district in a certain city had a dinner. I am so happy. Thank you very much for the hospitality of Captain Liu and Mr. Chen of the certain cup." First, the large language model performs a round of reasoning to obtain the predicted word (the word with the highest probability) "positive", and splices the word "positive" into the public opinion input text to obtain a new public opinion input text: "On March 12, 2024, the long-distance running team of a certain district in a certain city had a dinner. I am so happy. Thank you very much for the hospitality of Captain Liu and Mr. Chen of the certain cup. Positive", then return to the step of inputting the public opinion input text into the large language model according to the new public opinion input text, and then reason again to obtain the predicted word (the word with the highest probability): "face", and output the new public opinion input text again: "On March 12, 2024, the long-distance running team of a certain district in a certain city had a dinner. I am so happy. Thank you very much for the hospitality of Captain Liu and Mr. Chen of the certain cup. Positive". Until the preset end condition is reached, the sentiment classification result, that is, the last two words "positive", is obtained.

[0078] In one implementation, step S300 includes steps S310-S320:

[0079] S310 , screening out target emotion classification results representing negative emotions from all emotion classification results.

[0080] S320: Determine the public opinion data corresponding to the target emotion classification result as the target public opinion data.

[0081] Optionally, target emotion classification results representing negative emotions are screened out from all emotion classification results, because negative emotions may be offensive remarks such as malicious comments. Then, the public opinion data corresponding to the target emotion classification results are determined as the target public opinion data, thereby determining all target comments with negative emotions.

[0082] In one implementation, in step S400, notifying the target user according to the notification rule of the target platform includes step S410 or S420:

[0083] S410. If the notification rule of the target platform includes a total number threshold, when the target user's sending times corresponding to the target public opinion data is greater than the total number threshold, the target user is notified in a preset manner according to the notification rule.

[0084] In the embodiment of the present application, after the target public opinion data is determined, for example, the target public opinion data includes several target comments, the user and platform where each target comment is posted are determined as the target user and target platform. Since the notification rules of each platform may be different and their tolerance for the target public opinion data is different, it is necessary to notify the target user according to the notification rules of the corresponding target platform.

[0085] Optionally, if the notification rule of the target platform includes a total number threshold, when the number of times the target user corresponding to the target public opinion data sends is greater than the total number threshold, for example, in platform P, the number of times the target user C sends the target comment evaluated as the target public opinion data is greater than the total number threshold, then the target user is notified according to the preset method of the notification rule of platform P. It should be noted that the preset method includes but is not limited to SMS, email and other methods, which can also be pre-selected and defined by the user; the notification rule can also include a message template, and the corresponding target public opinion data can be filled into the message template, and the filled-in message template is used as the notification content to notify the target user according to the target user's ID.

[0086] S420. If the notification rule of the target platform includes a frequency threshold within a specified time interval, when the sending frequency of the target user corresponding to the target public opinion data within the specified time interval is greater than the frequency threshold, the target user is notified in a preset manner according to the notification rule.

[0087] Optionally, if the notification rule of the target platform includes a frequency threshold within a specified time interval, the specified time interval and the frequency threshold can be based on actual settings, for example, the specified time interval is set to 6 hours and the frequency threshold is set to 2. Assuming that the target user D is within the specified time interval, the sending frequency of the target user corresponding to the target public opinion data is greater than the frequency threshold, that is, the sending frequency of the target comments evaluated as the target public opinion data is greater than the frequency threshold, and the target user is notified by the preset method of the notification rule. It should be noted that the specific notification method and content are similar to step S410 and will not be repeated here.

[0088] In an embodiment of the present application, after the target public opinion data is determined, callback processing can be performed to trace the corresponding target user and target platform, and a structure file including the target public opinion data, emotion classification results, target platform and target user ID can be constructed. The structure file can be combined with a message template to notify the user.

[0089] It should be noted that in traditional public opinion analysis solutions, the core emotion classification task relies on a large number of accurately labeled sample training, and it is impossible to identify emotion categories that have not been seen in the training samples, which limits their application. The embodiment of the present application uses a large language model to perform public opinion emotion classification. It only needs to design a suitable prompt and define a small amount of json to fine-tune the large language model to ensure that the output format meets the requirements, so that accurate public opinion emotion classification can be achieved. The public opinion analysis solution using a large language model is easy to apply and has good scalability.

[0090] The method of the embodiment of the present application uses a large language model to generate seq2seq tokens. Given the powerful semantic understanding and reasoning capabilities of the large language model, sentiment classification can be achieved without sentiment classification task training, and the demand for accurate training data is relatively small. At the same time, the traditional NLP text classification model requires predefined classification categories and cannot handle categories that have not appeared in the training data, while the large language model can better adapt to the emotion categories that have not appeared, which brings great scalability to our public opinion analysis method.

[0091] Reference Figure 3 , shows a structural block diagram of a public opinion analysis device based on a large language model according to an embodiment of the present application, and the device may include:

[0092] The acquisition module is used to obtain public opinion data from several platforms and generate public opinion input text based on the public opinion data and the preset prompt template;

[0093] The generation module is used to generate sentiment classification results based on public opinion input text and large language models;

[0094] A determination module is used to determine target public opinion data based on the emotion classification results and public opinion data;

[0095] The notification module is used to determine the target users and target platforms for publishing the target public opinion data, and to notify the target users according to the notification rules of the target platform.

[0096] In one embodiment, the acquisition module is further used to:

[0097] Initialize the initial large model and import the preset model information into the initial large model;

[0098] Obtain several different public opinion sentiment question-answer pairs, input the public opinion sentiment question-answer pairs into the initial large model for fine-tuning, and obtain a large language model.

[0099] The functions of each module in each device in the embodiments of the present application can be found in the corresponding description in the above method, and will not be repeated here.

[0100] Reference Figure 4 , shows a structural block diagram of an electronic device according to an embodiment of the present application, the electronic device includes: a memory 310 and a processor 320, the memory 310 stores instructions that can be run on the processor 320, and the processor 320 loads and executes the instructions to implement the public opinion analysis method based on a large language model in the above embodiment. The number of the memory 310 and the processor 320 can be one or more.

[0101] In one embodiment, the electronic device also includes a communication interface 330 for communicating with external devices and performing data exchange transmission. If the memory 310, the processor 320 and the communication interface 330 are implemented independently, the memory 310, the processor 320 and the communication interface 330 can be interconnected through a bus and complete mutual communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0102] Optionally, in a specific implementation, if the memory 310, the processor 320 and the communication interface 330 are integrated on a chip, the memory 310, the processor 320 and the communication interface 330 can communicate with each other through an internal interface.

[0103] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the public opinion analysis method based on a large language model provided in the above embodiment.

[0104] An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method provided by the embodiment of the present application.

[0105] An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the application.

[0106] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the advanced RISC machines (ARM) architecture.

[0107] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory, and may also include a non-volatile random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus RAM (DR RAM).

[0108] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.

[0109] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the described specific features, structures, materials or characteristics may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.

[0110] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of this application, "multiple" means two or more, unless otherwise clearly and specifically defined.

[0111] Any process or method description in the flow chart or otherwise described herein can be understood to represent a module, fragment or portion of a code including one or more executable instructions for implementing the steps of a specific logical function or process. And the scope of the preferred embodiment of the present application includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved.

[0112] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.

[0113] It should be understood that the various parts of the present application can be implemented with hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium, and when the program is executed, it includes one of the steps of the method embodiment or a combination thereof.

[0114] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The storage medium may be a read-only memory, a disk or an optical disk, etc.

[0115] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.< / eos>

Claims

1. A public opinion analysis method based on a large language model, characterized in that: include: Obtain public opinion data from several platforms, and generate public opinion input text based on the public opinion data and a preset prompt template; Generate sentiment classification results based on the public opinion input text and the large language model; Determining target public opinion data according to the emotion classification result and the public opinion data; Determine the target user and target platform for publishing the target public opinion data, and notify the target user according to the notification rule of the target platform.

2. The public opinion analysis method based on a large language model according to claim 1 is characterized by: The large language model is obtained by the following steps: Initializing an initial large model, and importing preset model information into the initial large model; A number of different public opinion sentiment question-answer pairs are obtained, and the public opinion sentiment question-answer pairs are input into the initial large model for fine-tuning to obtain the large language model.

3. The public opinion analysis method based on a large language model according to claim 1 or 2, characterized in that: Generating a sentiment classification result according to the public opinion input text and the large language model includes: Inputting the public opinion input text into the large language model, performing prediction processing through the large language model, and obtaining predicted words; The predicted words are concatenated into the public opinion input text to obtain a new public opinion input text, and according to the new public opinion input text, the step of inputting the public opinion input text into the large language model is returned until a preset end condition is met to obtain a sentiment classification result.

4. The public opinion analysis method based on a large language model according to claim 3 is characterized by: The prediction processing performed by the large language model to obtain the predicted words includes: Processing the public opinion input text through the embedding layer of the large language model to obtain an input embedding; According to the multi-head attention module and the input embedding, a hidden layer embedding is obtained; According to the MLP layer, the softmax layer and the hidden layer embedding, the probability of each word in the public opinion input text is obtained; According to the probability and the argmax function, the predicted word is determined.

5. The public opinion analysis method based on a large language model according to claim 3 is characterized by: The step of returning to the step of inputting the public opinion input text into the large language model according to the new public opinion input text until a preset end condition is met, and obtaining the emotion classification result includes: According to the new public opinion input text, the step of inputting the public opinion input text into the large language model is returned until the number of words in the new public opinion input text reaches a preset number of generated words or the predicted words have an end symbol, thereby obtaining a sentiment classification result.

6. The public opinion analysis method based on a large language model according to claim 1 is characterized by: Determining target public opinion data according to the emotion classification result and the public opinion data includes: Filtering out target emotion classification results representing negative emotions from all the emotion classification results; The public opinion data corresponding to the target emotion classification result is determined as the target public opinion data.

7. The public opinion analysis method based on a large language model according to claim 1, 2 or 6, characterized in that: The notifying the target user according to the notification rule of the target platform includes: If the notification rule of the target platform includes a total number threshold, when the number of times the target user corresponding to the target public opinion data sends is greater than the total number threshold, the target user is notified in a preset manner of the notification rule; or, If the notification rule of the target platform includes a frequency threshold within a specified time interval, when the sending frequency of the target user corresponding to the target public opinion data is greater than the frequency threshold within the specified time interval, the target user is notified in the preset manner of the notification rule.

8. A public opinion analysis device based on a large language model, characterized in that: include: An acquisition module is used to acquire public opinion data from several platforms and generate public opinion input text according to the public opinion data and a preset prompt template; A generation module, used to generate sentiment classification results based on the public opinion input text and the large language model; A determination module, used to determine target public opinion data according to the emotion classification result and the public opinion data; The notification module is used to determine the target user and target platform for publishing the target public opinion data, and to notify the target user according to the notification rules of the target platform.

9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed, the method according to any one of claims 1 to 7 is implemented.