Text sentiment classification method and device, electronic equipment and storage medium

The aspect-level information of financial texts is obtained through large models and combined with text results in the same field, the problems of high cost and low accuracy of deep learning methods are solved, and low-cost and high-precision text emotion classification is achieved.

CN120353936APending Publication Date: 2025-07-22THE PEOPLES BANK OF CHINA NAT CLEARING CENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510520140.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-24
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The existing aspect-level emotion classification method based on deep learning requires a large amount of labeled data, which is costly and easy to overfit, resulting in poor classification accuracy, especially when it comes to emotional classification of financial-related texts, it is difficult to effectively explore obscure emotional characteristics.

Method used

Use the big model to obtain aspect-level text information of specific aspects, select preliminary emotional classification results from multiple currently optional emotional categories through the big model, and combine the classification results of other texts in the same field to guide the emotional classification of target texts, reduce dependence on the annotated data, and improve classification accuracy.

Benefits of technology

Without labeling data, the cost is reduced and the accuracy of text emotion classification in specific aspects of the target text is significantly improved, especially in the sentiment analysis of financial-related texts, which can more accurately explore obscure emotional characteristics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353936A_ABST
    Figure CN120353936A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a text sentiment classification method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining aspect-level text information corresponding to a specific aspect in a target text through a large model based on aspect-level information description of the specific aspect, and obtaining target aspect-level text information; based on the target aspect level text information, obtaining a target sentiment category in a plurality of current selectable sentiment categories in a specific aspect through a large model, and taking the target sentiment category as a preliminary sentiment classification result of the target text in the specific aspect; and obtaining a final sentiment classification result of the target text in the specific aspect based on the preliminary sentiment classification result of the target text in the specific aspect and sentiment classification results of other texts in the same field in the specific aspect. According to the embodiment of the invention, the accuracy of aspect-level text sentiment classification can be improved, and the required cost is relatively low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular, to a method, device, electronic device and storage medium for text sentiment classification. Background Art

[0002] Aspect-based text sentiment classification is a common task in natural language processing. It is a fine-grained sentiment analysis task aimed at identifying the sentiment polarity of a specific aspect in a text. The existing aspect-based text sentiment classification methods in the prior art include deep learning-based methods. The deep learning-based aspect-level sentiment classification method requires a large amount of labeled data for training, which consumes a high cost; and the deep learning-based aspect-level sentiment classification method has the problem that the classification accuracy of the model is poor due to the high requirements for data quality and easy overfitting. Summary of the Invention

[0003] Embodiments of the present invention provide a method, device, electronic device and storage medium for text sentiment classification, which can improve the accuracy of aspect-level text sentiment classification and require a lower cost.

[0004] In a first aspect, an embodiment of the present invention provides a method for text sentiment classification, including:

[0005] Based on the aspect-level information description of a specific aspect, obtaining, through a large model, the aspect-level text information corresponding to the specific aspect in the target text to obtain target aspect-level text information;

[0006] Based on the target aspect-level text information, obtaining, through a large model, the target sentiment category among multiple current optional sentiment categories of the specific aspect as the preliminary sentiment classification result of the target text in the specific aspect; and

[0007] Based on the preliminary sentiment classification result of the target text in the specific aspect and the sentiment classification results of other texts in the same field in the specific aspect, obtaining the final sentiment classification result of the target text in the specific aspect, where the other texts in the same field are other texts belonging to the same field as the target text.

[0008] In a second aspect, an embodiment of the present invention provides a text sentiment classification device, including:

[0009] An aspect-level text information acquisition module, configured to obtain, through a large model, the aspect-level text information corresponding to a specific aspect in a target text based on the aspect-level information description of the specific aspect to obtain target aspect-level text information;

[0010] A preliminary sentiment classification result acquisition module, configured to obtain, based on the target aspect-level text information, a target sentiment category from multiple current optional sentiment categories of the specific aspect through a large model, as the preliminary sentiment classification result of the target text in the specific aspect; and

[0011] A final sentiment classification result acquisition module, configured to obtain the final sentiment classification result of the target text in the specific aspect based on the preliminary sentiment classification result of the target text in the specific aspect and the sentiment classification results of other texts in the same field in the specific aspect, where the other texts in the same field are other texts belonging to the same field as the target text.

[0012] Thirdly, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the text sentiment classification method described in any one of the embodiments of the present invention is implemented.

[0013] Fourthly, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the text sentiment classification method described in any one of the embodiments of the present invention is implemented.

[0014] In the text sentiment classification method, device, electronic device, and storage medium provided by the embodiments of the present invention, the aspect-level text information of a specific aspect is obtained by using a large model. Then, based on the aspect-level text information of the specific aspect, the large model is used to select the preliminary sentiment classification result of the target text in the specific aspect from multiple current optional sentiment categories of the specific aspect. By using the large model to perform sentiment classification on the target text, it is not necessary to rely on the cost of labeled data, and the accuracy of text sentiment classification of the target text in the specific aspect can be improved. Further, based on the preliminary sentiment classification result of the target text in the specific aspect and the sentiment classification results of other texts in the same field in the specific aspect, the final sentiment classification result of the target text in the specific aspect is obtained. By guiding the sentiment classification of the target text based on the corresponding classification results of other texts in the same field, the accuracy of text sentiment classification of the target text in the specific aspect can be further improved. Description of the Drawings

[0015] In order to more clearly illustrate the technical solutions of the present invention, the drawings required for the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0016] Figure 1It is a schematic flowchart of the text sentiment classification method provided by an embodiment of the present invention;

[0017] Figure 2 It is another schematic flowchart of the text sentiment classification method provided by an embodiment of the present invention;

[0018] Figure 3 It is another schematic flowchart of the text sentiment classification method provided by an embodiment of the present invention;

[0019] Figure 4 It is another schematic flowchart of the text sentiment classification method provided by an embodiment of the present invention;

[0020] Figure 5 It is another schematic flowchart of the text sentiment classification method provided by an embodiment of the present invention;

[0021] Figure 6 It is another schematic flowchart of the text sentiment classification method provided by an embodiment of the present invention;

[0022] Figure 7 It is another schematic flowchart of the text sentiment classification method provided by an embodiment of the present invention;

[0023] Figure 8 It is another schematic flowchart of the text sentiment classification method provided by an embodiment of the present invention;

[0024] Figure 9 It is another schematic flowchart of the text sentiment classification method provided by an embodiment of the present invention;

[0025] Figure 10 It is a schematic structural diagram of the text sentiment classification device provided by an embodiment of the present invention;

[0026] Figure 11 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0027] Aspect-based text sentiment classification is a common task in natural language processing. It is a fine-grained sentiment analysis task aiming to identify the sentiment polarity towards specific aspects in the text. Existing sentiment classification methods in the prior art include sentiment dictionary-based methods and deep learning-based methods. Among them, sentiment dictionary-based methods cannot provide aspect-level sentiment classification. Deep learning-based methods require a large amount of labeled data for training, which incurs high costs. Moreover, aspect-level sentiment classification methods based on deep learning have high requirements for data quality, and there are often situations where the data quality for sentiment classification does not meet the requirements. Especially when classifying financial-related texts, since the sentiment expressions of some aspects in financial-related texts are rather implicit, it is not easy to extract the corresponding aspect sentiment features from the original text. Additionally, the models of aspect-level sentiment classification methods based on deep learning are prone to overfitting, thus resulting in poor accuracy of sentiment classification.

[0028] In the embodiments of the present invention, a text sentiment classification method, device, electronic device, and storage medium are provided. The aspect-level text information of a specific aspect is obtained by using a large model. Then, based on the aspect-level text information of the specific aspect, the large model selects the preliminary sentiment classification result of the target text in the specific aspect from multiple current optional sentiment categories of the specific aspect. By using the large model to perform sentiment classification on the target text, it does not rely on labeled data, has a relatively low cost, and can improve the accuracy of text sentiment classification of the target text in the specific aspect. Further, in the embodiments of the present invention, based on the preliminary sentiment classification result of the target text in the specific aspect and the sentiment classification results of other texts in the same field in the specific aspect, the final sentiment classification result of the target text in the specific aspect is obtained. By guiding the sentiment classification of the target text based on the corresponding classification results of other texts, the accuracy of text sentiment classification of the target text in the specific aspect can be further improved.

[0029] In order to enable those skilled in the art of the present technology to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0030] It should be noted that the terms "first", "second", etc. in the description, claims and above-mentioned drawings of the present invention are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention described here can be implemented in an order other than those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0031] Figure 1 FIG. 4 is a schematic flowchart of a text sentiment classification method provided by an embodiment of the present invention. This embodiment is applicable to the scenario of aspect-level text sentiment classification. This method can be executed by a text sentiment classification device provided by an embodiment of the present invention, and the device can be implemented in a software and / or hardware manner. In a specific embodiment, the device can be integrated in an electronic device, such as a computer, a server, etc. The following embodiments will be described by taking the device integrated in the electronic device as an example. Refer to Figure 1 , the method specifically may include the following steps:

[0032] Step 101, based on the aspect-level information description of a specific aspect, obtain the aspect-level text information corresponding to the specific aspect in the target text through a large model, and obtain the target aspect-level text information. This step can accurately obtain the target aspect-level text information at a relatively low cost by using the large model without relying on labeled data, which is beneficial to determining the preliminary sentiment classification result of the target text in a specific aspect based on the target aspect-level text information.

[0033] Specifically, the above-mentioned target text can be the text after data cleaning of the original text data crawled from the network. The above-mentioned original text data can be, for example, news about the central bank's monetary policy tools crawled from the network.

[0034] Specifically, the process of cleaning the original text data includes: removing noise data such as html tags, advertisement information and other irrelevant news titles in the original text data.

[0035] Optionally, the above-mentioned target text includes one text among multiple texts in the same field that need to be sentiment classified.

[0036] In an optional example, the above-mentioned target text is the text corresponding to the news about the central bank's monetary policy tools in a specific month.

[0037] Optionally, the above-mentioned target text may include multiple sub-texts. For example, the multiple sub-texts may be the texts corresponding to each news in multiple news related to the central bank's monetary policy tools within the corresponding month.

[0038] Specifically, the above-mentioned specific aspect can be understood as a dimension for sentiment classification of the target text. For example, it can be sentiment classification of the target text from the perspective of the expectations of enterprises or the market for the central bank's monetary policy, so as to analyze whether the expectations reflected in the text are optimistic or pessimistic.

[0039] Specifically, the above-mentioned aspect-level description can be defined based on experience. For example, it can be the expectations of enterprises or the market for the central bank's monetary policy tools, the intensity of the government's support for the financial industry, or the expectations of the public for the economic trend.

[0040] Optionally, the process of obtaining the aspect-level text information corresponding to a specific aspect in the target text through a large model for the above-mentioned aspect-level information description based on a specific aspect to obtain the target aspect-level text information includes: constructing a prompt for generating the target aspect-level text information according to the aspect-level information description and the target text, and calling the large model based on the corresponding prompt to generate the above-mentioned target aspect-level text information.

[0041] Specifically, the content of the above-mentioned prompt may include: role, role skills, role profile, rules to be followed by the role, work process, and / or output format, etc.

[0042] Step 102, based on the target aspect-level text information, obtain the target sentiment category among multiple currently available sentiment categories for a specific aspect through a large model as the preliminary sentiment classification result of the target text in the specific aspect. This step can, without relying on labeled data, use the large model to accurately obtain the preliminary sentiment classification result of the target text in the specific aspect at a relatively low cost, which is conducive to determining the corresponding final sentiment classification result based on this.

[0043] Specifically, the multiple currently available sentiment categories for the above-mentioned specific aspect can be determined based on experience or knowledge in the corresponding field, or can be iteratively updated during the subsequent process of text sentiment root classification.

[0044] Optionally, as Figure 2 shown, the process of obtaining the target sentiment category among multiple currently available sentiment categories for a specific aspect through a large model based on the target aspect-level text information as the preliminary sentiment classification result of the target text in the specific aspect includes: constructing a prompt for sentiment classification of the target aspect-level text information according to the above-mentioned target aspect-level text information and the above-mentioned multiple currently available sentiment categories, and calling the large model based on the corresponding prompt to output the preliminary sentiment classification result of the target aspect-level text information, that is, the preliminary sentiment classification result of the target text in the specific aspect.

[0045] Step 103: Based on the preliminary sentiment classification result of the target text in a specific aspect and the sentiment classification results of other texts in the same field in the specific aspect, obtain the final sentiment classification result of the target text in the specific aspect. The other texts in the same field are other texts belonging to the same field as the target text. Based on the corresponding classification results of other texts to guide the sentiment classification of the target text on the basis of Steps 101 and 102, this step can further improve the accuracy of text sentiment classification of the target text in the specific aspect.

[0046] Optionally, the above-mentioned other texts in the same field include each of the other texts except the target text among the multiple texts in the same field that need to be sentiment classified.

[0047] In an optional specific example, each of the above-mentioned other texts in the same field can be, for example, the text corresponding to the news about the central bank's monetary policy tools in each month except the month corresponding to the target text.

[0048] Optionally, each of the above-mentioned other texts in the same field includes multiple sub-texts. Each of the multiple sub-texts in the same field can be, for example, the text corresponding to each news among the multiple news about the central bank's monetary policy tools in the corresponding month.

[0049] Optionally, the sentiment classification result of the above-mentioned other texts in the same field includes the preliminary sentiment classification result of the other texts in the same field.

[0050] Optionally, the sentiment classification result of the above-mentioned other texts in the same field includes the final sentiment classification result of the other texts in the same field.

[0051] Optionally, the process of obtaining the final sentiment classification result of the target text in the specific aspect based on the preliminary sentiment classification result of the target text in the specific aspect and the sentiment classification results of other texts in the same field in the specific aspect includes: obtaining the final sentiment classification result of the target text in the specific aspect based on the preliminary sentiment classification result of the target text in the specific aspect and the preliminary sentiment classification results of other texts in the same field in the specific aspect; or, obtaining the final sentiment classification result of the target text in the specific aspect based on the preliminary sentiment classification result of the target text in the specific aspect and the final sentiment classification results of other texts in the same field in the specific aspect.

[0052] Optionally, the process of obtaining the final sentiment classification result of the target text in the specific aspect based on the preliminary sentiment classification result of the target text in the specific aspect and the sentiment classification results of other texts in the same field in the specific aspect includes: determining the final sentiment classification result of the target text in the specific aspect based on whether the preliminary sentiment classification result of the target text in the specific aspect is one of the sentiment classification results of other texts in the same field in the specific aspect.

[0053] The text sentiment classification method provided by the embodiments of the present invention will be further introduced below. As Figure 3 shown, step 101 in Figure 1 may include the following steps:

[0054] Step 1011: Based on the knowledge graph metadata of a specific aspect, obtain the text information knowledge graph corresponding to the target aspect-level text information through a large model.

[0055] Specifically, the above knowledge graph metadata may be pre-determined.

[0056] Optionally, before step 1011, based on the aspect-level information description and sample texts, obtain the knowledge graph metadata of a specific aspect through a large model.

[0057] Specifically, other methods in the prior art may also be used based on the aspect-level information description and sample texts to obtain the above knowledge graph metadata.

[0058] Specifically, the above sample texts may include partial sub-texts of the above target text, and may also include partial sub-texts of the foregoing other texts in the same field.

[0059] Optionally, as Figure 4 shown, the process of obtaining the knowledge graph metadata of a specific aspect through a large model based on the aspect-level information description and sample texts includes: constructing a prompt for generating the knowledge graph metadata of a specific aspect according to the aspect-level information description and sample texts, and calling the large model based on the corresponding prompt to generate the knowledge graph metadata of a specific aspect.

[0060] Optionally, as Figure 5 shown, the process of obtaining the text information knowledge graph corresponding to the target aspect-level text information through a large model based on the knowledge graph metadata of a specific aspect includes: constructing a prompt for generating the text information knowledge graph corresponding to the target aspect-level text information according to the knowledge graph metadata of a specific aspect and the target text, and calling the large model based on the corresponding prompt to generate the text information knowledge graph corresponding to the target aspect-level text information.

[0061] Step 1012: Use the community detection algorithm to divide the text information knowledge graph into multiple communities, and obtain the community reports of each community.

[0062] It can be understood that since the nodes in the community have a stronger correlation degree compared with the nodes outside the community, through community division, sentiment analysis can be carried out from more dimensions. Therefore, it is beneficial to extract more implicit sentiment expressions in the target text, mine the corresponding sentiment features, and thus improve the accuracy of sentiment classification of the target text.

[0063] Step 1013, based on the aspect-level information description and the community reports of each community, the target aspect-level text information is obtained through the large model.

[0064] Optional, such as Figure 6 As shown, the process of obtaining the target aspect-level text information through the big model based on the aspect-level information description and the community reports of each community includes: constructing prompt words for obtaining the target aspect-level text information according to the above-mentioned aspect-level information description and the community reports of each community, and calling the big model based on the corresponding prompt words to output the above-mentioned target aspect-level text information.

[0065] The embodiment of the present invention constructs a text information knowledge graph of the target text in specific aspects, and further divides the community to mine the implicit emotional information that may exist in the target text in specific aspects, which can help improve the accuracy of classifying the emotions of the target text in specific aspects.

[0066] The text sentiment classification method provided by the embodiment of the present invention is further described below. Figure 7 As shown, Figure 1 Step 103 in the method may include the following steps:

[0067] Step 1031 , determining a provisional sentiment category distribution based on the preliminary sentiment classification result of the target text and the sentiment classification results of other texts in the same field.

[0068] Specifically, the provisional sentiment category distribution may include the following information: sentiment categories corresponding to the preliminary sentiment classification results of the target text and sentiment classification results of other texts in the same field, and the number of classification results corresponding to the same sentiment category.

[0069] Optionally, the process of determining the provisional sentiment category distribution based on the preliminary sentiment classification results of the target text and the sentiment classification results of other texts in the same field includes: determining the provisional sentiment category distribution based on the preliminary sentiment classification results of the target text and other texts in the same field.

[0070] Optionally, the process of determining the provisional sentiment category distribution based on the preliminary sentiment classification results of the target text and the sentiment classification results of other texts in the same field includes: determining the provisional sentiment category distribution based on the preliminary sentiment classification results of the target text and the final sentiment classification results of other texts in the same field.

[0071] Step 1032 , determining a final sentiment classification result of the target text in a specific aspect based on whether the tentative sentiment category distribution conforms to the expected sentiment category distribution.

[0072] Optionally, the above-mentioned expected emotional category distribution includes: the total number of emotional categories corresponding to the preliminary emotional classification results of the target text and the emotional classification results of other texts in the same field, accounting for the number of multiple currently optional emotional categories, not less than the first preset ratio.

[0073] Specifically, the above-mentioned first preset ratio can be set according to empirical data. For example, it can be set to 80%.

[0074] Optionally, the above-mentioned expected emotional category distribution includes: the number of classification results corresponding to each optional emotional category, accounting for the total number of the preliminary emotional classification results of the target text and the emotional classification results of other texts in the same field, not greater than the second preset ratio and not less than the third preset ratio.

[0075] Specifically, the above-mentioned second preset ratio and the third ratio can be set based on empirical data. For example, they can be set to 40% and 10% respectively.

[0076] It can be understood that when initially performing emotional classification on multiple texts in the same field that need to be emotionally classified, including the target text and other texts in the same field, the initial optional emotional categories for specific aspects can be determined according to experience or knowledge in the corresponding field. However, due to insufficient experience or corresponding knowledge, it may not be possible to well determine the emotional categories of the above-mentioned multiple texts in the same field in specific aspects based on the initial optional emotional categories. Therefore, according to whether the tentative emotional category distribution corresponding to the preliminary emotional classification results of the target text and other texts in the same field conforms to the expected emotional category distribution, it is beneficial to timely update the currently optional emotional categories in specific aspects, and then better determine the emotional classification of multiple texts in the same field including the target text in specific aspects.

[0077] In addition, when performing emotional classification on a newly added target text, based on whether the tentative emotional category distribution corresponding to the final emotional classification results of other texts in the same field that have been classified and the preliminary emotional classification results of the target text conforms to the expected emotional category distribution, it is beneficial to further iteratively update the currently optional emotional categories in specific aspects to further improve the accuracy of emotional classification of the target text in specific aspects.

[0078] In an optional specific embodiment of the present invention, as Figure 8 shown, that is Figure 7 step 1032 in

[0079] Step 1032A, when the tentative emotional category distribution does not conform to the expected emotional category distribution, update the multiple currently optional emotional categories in specific aspects through a large model.

[0080] Optionally, when the tentative emotion category distribution does not conform to the expected emotion category distribution, the preliminary emotion classification result of the foregoing target text is directly determined as the corresponding final emotion classification result.

[0081] Optionally, the process of updating multiple current optional emotion categories for a specific aspect by the large model includes: determining an emotion category modification strategy through the large model based on the multiple current optional emotion categories and the guiding principles of the category modification strategy; and modifying and updating the multiple current optional emotion categories for the specific aspect based on the emotion category modification strategy.

[0082] Optionally, the process of determining an emotion category modification strategy through the large model based on the multiple current optional emotion categories and the guiding principles of the category modification strategy includes:

[0083] Determining an emotion category modification strategy through the large model based on the multiple current optional emotion categories, the guiding principles of the category modification strategy, and the historical update records of the multiple current optional emotion categories.

[0084] Optionally, the foregoing historical update records include: the content of each modification and the modification strategy.

[0085] Optionally, the text emotion classification method provided by the embodiments of the present invention further includes: storing the corresponding modification content and modification strategy after updating the multiple current optional emotion categories for a specific aspect through the large model.

[0086] Specifically, calling the large model to generate an emotion category modification strategy based on the historical update records can make the generated modification strategy more accurate.

[0087] Optionally, as Figure 9 shown, the process of determining an emotion category modification strategy through the large model based on the multiple current optional emotion categories, the guiding principles of the category modification strategy, and the historical update records of the multiple current optional emotion categories includes: constructing a prompt for generating an emotion category modification strategy according to the multiple current optional emotion categories, the guiding principles of the category modification strategy, and the historical update records of the multiple current optional emotion categories, and calling the large model to generate an emotion category modification strategy based on the corresponding prompt.

[0088] Optionally, the foregoing guiding principles of the category modification strategy include the first guiding principle: deleting the optional emotion categories that are not included in the emotion categories corresponding to the preliminary emotion classification result of the target text and the emotion classification results of other texts in the same field.

[0089] Optionally, the above-mentioned category modification strategy guiding principles include the second guiding principle: for the proportion of the number of corresponding classification results in the total number of the preliminary sentiment classification results of the target text and the sentiment classification results of other texts in the same field greater than the second preset ratio, and for the first optional sentiment category and the second optional sentiment category with adjacent corresponding classification scores, an optional sentiment category is added between the first optional sentiment category and the second optional sentiment category.

[0090] Specifically, in the classification task, samples are usually scored according to certain criteria and rules, and corresponding score values are assigned to each category. The above-mentioned scoring scores can be understood as the score values assigned to each optional sentiment category.

[0091] Specifically, the optional sentiment category added between the first optional sentiment category and the second optional sentiment category can be understood as the sentiment category whose corresponding classification score is between the classification score of the first optional sentiment category and the classification score of the second optional sentiment category.

[0092] Optionally, for those in the order of increasing corresponding scores, including a, b, c, d, e, and f, when the corresponding classification results do not include f, based on multiple current optional sentiment categories and the first guiding principle, the sentiment category modification strategy of "deleting category f from multiple current optional sentiment categories a, b, c, d, e, and f" is determined through the large model.

[0093] Optionally, for those in the order of increasing corresponding scores, including a, b, c, d, e, and f, when the corresponding classification results are concentrated in a and b, based on multiple current optional sentiment categories and the second guiding principle, the large model determines that "an optional sentiment category a' is added between category a and b to obtain the updated current optional sentiment categories a, a', b, c, d, e, and f".

[0094] Specifically, by adding more refined optional sentiment categories when updating multiple current optional sentiment categories, it can make the optional sentiment categories better reflect the emotional differences between texts, and make the classification results of aspect-level sentiment classification more distinguishable and more reasonably distributed.

[0095] Step 1032B, start executing again to obtain the target sentiment category in multiple current optional sentiment categories for a specific aspect based on the target aspect-level text information through the large model, as the preliminary classification result of the sentiment category corresponding to the target text in the specific aspect, until the tentative sentiment category distribution conforms to the expected sentiment category distribution, or the number of times of updating multiple current optional sentiment categories for the specific aspect reaches not less than the update times threshold.

[0096] Specifically, the above-mentioned update times threshold can be obtained based on multiple test results or set according to empirical data.

[0097] Step 1032C, taking the preliminary sentiment classification result of the target text in a specific aspect obtained last time as the final sentiment classification result of the target text in the specific aspect.

[0098] Based on whether the tentative sentiment category distribution conforms to the expected sentiment category distribution, the embodiments of the present invention determine the final sentiment classification result of the target text in a specific aspect, and can determine abnormal classification results through the expected sentiment category distribution, improving the accuracy of the sentiment classification result of the target text in a specific aspect.

[0099] Figure 10 It is a structural diagram of a text sentiment classification device provided by the embodiments of the present invention, and this device is applicable to execute the text sentiment classification method provided by the embodiments of the present invention. As Figure 10 shown, this device may specifically include:

[0100] The aspect-level text information acquisition module 1001 is used to obtain the aspect-level text information corresponding to a specific aspect in the target text through a large model based on the aspect-level information description of the specific aspect, so as to obtain the target aspect-level text information. This module can accurately obtain the target aspect-level text information at a relatively low cost by using a large model without relying on labeled data, which is conducive to determining the preliminary sentiment classification result of the target text in a specific aspect based on the target aspect-level text information.

[0101] Optionally, the above-mentioned aspect-level text information acquisition module 1001 can specifically be used to obtain the text information knowledge graph corresponding to the target aspect-level text information through a large model based on the knowledge graph metadata of the specific aspect; use the community detection algorithm to divide the text information knowledge graph into multiple communities, and obtain the community reports of each community; and obtain the target aspect-level text information through a large model based on the aspect-level information description and the community reports of each community.

[0102] Optionally, the above-mentioned aspect-level text information acquisition module 1001 can specifically be used to obtain the knowledge graph metadata of the specific aspect through a large model based on the aspect-level information description and sample texts before obtaining the text information knowledge graph corresponding to the target aspect-level text information through a large model based on the knowledge graph metadata of the specific aspect.

[0103] The preliminary sentiment classification result acquisition module 1002 is used to obtain the target sentiment category among multiple current optional sentiment categories in a specific aspect through a large model based on the target aspect-level text information, as the preliminary sentiment classification result of the target text in the specific aspect. This module can accurately obtain the preliminary sentiment classification result of the target text in a specific aspect at a relatively low cost by using a large model without relying on labeled data, which is conducive to determining the corresponding final sentiment classification result based on this.

[0104] The final sentiment classification result acquisition module 1003 is used to obtain the final sentiment classification result of the target text in a specific aspect based on the preliminary sentiment classification result of the target text in the specific aspect and the sentiment classification results of other texts in the same field in the specific aspect. The other texts in the same field are other texts belonging to the same field as the target text. This module combines modules 1001 and 1002. By using a large model to obtain the aspect-level text information in a specific aspect, and then using the large model to select the preliminary sentiment classification result of the target text in the specific aspect from multiple current optional sentiment categories in the specific aspect, it can use the large model to perform sentiment classification on the target text, without relying on the cost of labeled data, and can improve the accuracy of text sentiment classification of the target text in a specific aspect; further, in the embodiment of the present invention, by obtaining the final sentiment classification result of the target text in the specific aspect based on the preliminary sentiment classification result of the target text in the specific aspect and the sentiment classification results of other texts in the same field in the specific aspect, it can guide the sentiment classification of the target text based on the corresponding classification results of other texts in the same field, thereby further improving the accuracy of text sentiment classification of the target text in a specific aspect.

[0105] Optionally, the above-mentioned final sentiment classification result acquisition module 1003 can specifically be used to determine a tentative sentiment category distribution based on the preliminary sentiment classification result of the target text and the sentiment classification results of other texts in the same field; and determine the final sentiment classification result of the target text in the specific aspect based on whether the tentative sentiment category distribution conforms to the expected sentiment category distribution.

[0106] Optionally, the above-mentioned expected sentiment category distribution includes: the proportion of the total number of sentiment categories corresponding to the preliminary sentiment classification result of the target text and the sentiment classification results of other texts in the same field in the number of multiple current optional sentiment categories is not less than a first preset ratio; and / or the proportion of the number of classification results corresponding to each optional sentiment category in the total number of the preliminary sentiment classification result of the target text and the sentiment classification results of other texts in the same field is not greater than a second preset ratio and not less than a third preset ratio.

[0107] Optionally, the above-mentioned final sentiment classification result acquisition module 1003 can specifically be used to update multiple current optional sentiment categories for a specific aspect through a large model when the tentative sentiment category distribution does not conform to the expected sentiment category distribution; and based on the updated multiple current optional sentiment categories for the specific aspect, restart the execution of obtaining the target sentiment category from the multiple current optional sentiment categories for the specific aspect through the large model based on the target aspect-level text information as the preliminary classification result of the sentiment category corresponding to the target text in the specific aspect until the tentative sentiment category distribution conforms to the expected sentiment category distribution, or the number of times of updating the multiple current optional sentiment categories for the specific aspect reaches not less than the update times threshold; and use the preliminary sentiment classification result of the target text in the specific aspect obtained last time as the final sentiment classification result of the target text in the specific aspect.

[0108] Optionally, the above-mentioned final sentiment classification result acquisition module 1003 can specifically be used to determine a sentiment category modification strategy through a large model based on multiple current optional sentiment categories and the guiding principles of the category modification strategy; and modify and update the multiple current optional sentiment categories for the specific aspect based on the sentiment category modification strategy.

[0109] Optionally, the above-mentioned final sentiment classification result acquisition module 1003 can specifically be used to determine a sentiment category modification strategy through a large model based on multiple current optional sentiment categories, the guiding principles of the category modification strategy, and the historical update records of the multiple current optional sentiment categories.

[0110] Optionally, the guiding principles of the category modification strategy include: deleting the optional sentiment categories that are not included in the sentiment categories corresponding to the preliminary sentiment classification result of the target text and the sentiment classification results of other texts in the same field; and / or adding an optional sentiment category between the first optional sentiment category and the second optional sentiment category whose proportion of the total number of the preliminary sentiment classification result of the target text and the sentiment classification results of other texts in the same field is greater than the second preset proportion and whose corresponding classification scores are adjacent in size.

[0111] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the above-described functional modules can refer to the corresponding process in the foregoing method embodiments and will not be elaborated here.

[0112] An embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the text sentiment classification method provided in any one of the above embodiments is implemented.

[0113] An embodiment of the present invention also provides a computer-readable medium, on which a computer program is stored. When the program is executed by a processor, the text sentiment classification method provided in any one of the above embodiments is implemented.

[0114] An embodiment of the present invention also provides a computer program product, including a computer program, which implements the text sentiment classification method as described in any one of the embodiments of the present invention when executed by a processor

[0115] Next, refer to Figure 11 , which shows a schematic structural diagram of a computer system 1100 of an electronic device suitable for implementing the embodiments of the present invention. Figure 11 The shown electronic device is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present invention.

[0116] As Figure 11 shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1102 or the program loaded from the storage section 1108 into the random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the system 1100 are also stored. The CPU 1101, ROM 1102, and RAM 1103 are connected to each other via a bus 1104. The input / output (I / O) interface 1105 is also connected to the bus 1104.

[0117] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as required. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as required, so that the computer program read from it can be installed into the storage section 1108 as required.

[0118] In particular, according to the embodiments disclosed by the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed by the present invention include a computer program product, which includes a computer program carried on a computer-readable medium. The computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication section 1109, and / or installed from the removable medium 1111. When the computer program is executed by the central processing unit (CPU) 1101, the above functions defined in the system of the present invention are executed.

[0119] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or combined with an instruction execution system, apparatus, or device. In the present invention, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable medium can send, propagate, or transmit a program for use by or combined with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0120] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, as well as combinations of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0121] The modules and / or units involved in the embodiments of the present invention can be implemented in software or in hardware. The described modules and / or units can also be provided in a processor. For example, it can be described as: a processor includes an aspect-level text information acquisition module, a preliminary sentiment classification result acquisition module, and a final sentiment classification result acquisition module. Among them, the names of these modules do not constitute a limitation to the module itself in some cases.

[0122] As another aspect, the present invention also provides a computer-readable medium, which can be included in the device described in the above embodiments; or can exist separately without being assembled into the device. The above computer-readable medium carries one or more programs. When the one or more programs are executed by the device, the device is enabled to: obtain aspect-level text information corresponding to a specific aspect in a target text through a large model based on an aspect-level information description of a specific aspect, to obtain target aspect-level text information; obtain a target sentiment category from multiple current optional sentiment categories of the specific aspect through the large model based on the target aspect-level text information, as a preliminary sentiment classification result of the target text in the specific aspect; and obtain a final sentiment classification result of the target text in the specific aspect based on the preliminary sentiment classification result of the target text in the specific aspect and the sentiment classification results of other texts in the same field in the specific aspect, where the other texts in the same field are other texts belonging to the same field as the target text.

[0123] The above specific embodiments do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A text sentiment classification method, characterized in that, Including: Aspect-level information description based on specific aspects, obtaining aspect-level text information corresponding to the specific aspects in the target text through a large model to obtain target aspect-level text information; Based on the target aspect-level text information, obtaining a target sentiment category among multiple current optional sentiment categories of the specific aspect through a large model as a preliminary sentiment classification result of the target text in the specific aspect; And Based on the preliminary sentiment classification result of the target text in the specific aspect and the sentiment classification results of other texts in the same field in the specific aspect, obtaining a final sentiment classification result of the target text in the specific aspect, where the other texts in the same field are other texts belonging to the same field as the target text.

2. The text sentiment classification method according to claim 1, wherein The aspect-level information description based on specific aspects, obtaining aspect-level text information corresponding to the specific aspects in the target text through a large model, includes: Based on the knowledge graph metadata of the specific aspect, obtaining a text information knowledge graph corresponding to the target aspect-level text information through a large model; Using a community detection algorithm to divide the text information knowledge graph into multiple communities and obtaining community reports for each community; and Based on the aspect-level information description and the community reports of each community, obtaining the target aspect-level text information through a large model.

3. The text sentiment classification method according to claim 2, wherein Before obtaining the text information knowledge graph corresponding to the target aspect-level text information through a large model based on the knowledge graph metadata of the specific aspect, the text sentiment classification method further includes: Based on the aspect-level information description and sample texts, obtaining the knowledge graph metadata of the specific aspect through a large model.

4. The text sentiment classification method according to claim 1, characterized in that The obtaining the final sentiment classification result of the target text in the specific aspect based on the preliminary sentiment classification result of the target text in the specific aspect and the sentiment classification results of other texts in the same field in the specific aspect includes: Determining a tentative sentiment category distribution based on the preliminary sentiment classification result of the target text and the sentiment classification results of other texts in the same field; and Based on whether the tentative sentiment category distribution conforms to the expected sentiment category distribution, determining the final sentiment classification result of the target text in the specific aspect.

5. The text sentiment classification method according to claim 4, wherein The expected sentiment category distribution includes: The proportion of the total number of sentiment categories corresponding to the preliminary sentiment classification result of the target text and the sentiment classification results of other texts in the same field in the number of the multiple current optional sentiment categories is not less than a first preset proportion; and / or The proportion of the number of classification results corresponding to each optional sentiment category in the total number of the preliminary sentiment classification result of the target text and the sentiment classification results of other texts in the same field is not greater than a second preset proportion and not less than a third preset proportion.

6. The text sentiment classification method according to claim 4, wherein The determining the final sentiment classification result of the target text in the specific aspect based on whether the tentative sentiment category distribution conforms to the expected sentiment category distribution includes: When the tentative sentiment category distribution does not conform to the expected sentiment category distribution, updating the multiple current optional sentiment categories of the specific aspect through a large model; and Restart the execution of obtaining, based on the target aspect-level text information, the target sentiment category from multiple current optional sentiment categories of the specific aspect through a large model as the preliminary classification result of the sentiment category corresponding to the target text in the specific aspect until the tentative sentiment category distribution conforms to the expected sentiment category distribution, or the number of times of updating the multiple current optional sentiment categories of the specific aspect reaches not less than the update times threshold; and Use the preliminary sentiment classification result of the target text in the specific aspect obtained last time as the final sentiment classification result of the target text in the specific aspect.

7. The text sentiment classification method according to claim 6, characterized in that The updating of the multiple current optional sentiment categories of the specific aspect by the large model includes: Determining a sentiment category modification strategy through a large model based on the multiple current optional sentiment categories and the category modification strategy guiding principles; and Modifying and updating the multiple current optional sentiment categories of the specific aspect based on the sentiment category modification strategy.

8. The text sentiment classification method according to claim 7, wherein The determining of the sentiment category modification strategy through a large model based on the multiple current optional sentiment categories and the category modification strategy guiding principles includes: Determining a sentiment category modification strategy through a large model based on the multiple current optional sentiment categories, the category modification strategy guiding principles, and the historical update records of the multiple current optional sentiment categories.

9. The text sentiment classification method according to claim 7, characterized in that The category modification strategy guiding principles include: Deleting the optional sentiment categories not included in the sentiment categories corresponding to the preliminary sentiment classification result of the target text and the sentiment classification results of other texts in the same field; and / or Adding an optional sentiment category between a first optional sentiment category and a second optional sentiment category where the proportion of the quantity of the corresponding classification result in the total quantity of the preliminary sentiment classification result of the target text and the sentiment classification results of other texts in the same field is greater than a second preset proportion, and the corresponding classification scoring scores are adjacent to each other.

10. A text sentiment classification device, characterized in that, including: An aspect-level text information acquisition module, configured to obtain, based on the aspect-level information description of a specific aspect, the aspect-level text information corresponding to the specific aspect in the target text through a large model to obtain the target aspect-level text information; A preliminary sentiment classification result acquisition module, configured to obtain, based on the target aspect-level text information, the target sentiment category from multiple current optional sentiment categories of the specific aspect as the preliminary sentiment classification result of the target text in the specific aspect; and A final sentiment classification result acquisition module, configured to obtain the final sentiment classification result of the target text in the specific aspect based on the preliminary sentiment classification result of the target text in the specific aspect and the sentiment classification results of other texts in the same field in the specific aspect, where the other texts in the same field are other texts belonging to the same field as the target text.

11. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the text sentiment classification method according to any one of claims 1 to 9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the text sentiment classification method according to any one of claims 1 to 9.