Method and device for determining sentiment information in comment information
By segmenting and annotating comment information with a sentiment dictionary, and combining word vector frequency and topic distribution, the problem of low accuracy of sentiment information in existing technologies is solved, and multi-dimensional sentiment information acquisition and monitoring are achieved.
Patent Information
- Application Number
- CN202211606643.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-12
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2042-12-12
AI Technical Summary
Existing public opinion analysis technologies have low accuracy when obtaining sentiment information through a single keyword matching method, and the data statistics have a single dimension, resulting in insufficient in-depth monitoring of public opinion information.
By acquiring comment information, word vectors are obtained through word segmentation. A pre-built sentiment dictionary is used to label the part-of-speech sentiment values. Sentiment information is determined based on the frequency of word vectors and the distribution of sentiment themes. By combining the context and part-of-speech sentiment values, multi-dimensional sentiment information acquisition is achieved.
It improves the accuracy of obtaining emotional information, realizes multi-dimensional emotional information monitoring, and solves the problem of low accuracy of emotional information caused by single keyword matching.
Smart Images

Figure CN115935979B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data analysis, and more specifically, to a method and apparatus for determining sentiment information in comment information. Background Technology
[0002] In the mobile internet era, users often express their opinions on operators' services through online platforms, forming public opinion information about service evaluations. Existing public opinion analysis technologies simply match user-preset keywords in a database to obtain corresponding public opinion information. This matching method is too limited, leading to incomplete detection of public opinion information and the possibility of missed monitoring. Furthermore, relying solely on keywords for public opinion monitoring results in a single data statistical dimension, insufficient for monitoring in-depth public opinion information.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This application provides an embodiment of emotional information in comment information and an apparatus to at least solve the technical problem that the accuracy of the obtained emotional information is low due to the reliance on keywords to determine the emotional information in the comment information.
[0005] According to one aspect of the embodiments of this application, a method for determining sentiment information in comment information is provided, comprising: acquiring comment information of a target business, and performing word segmentation on the evaluation text in the comment information to obtain multiple word vectors; determining the weights of multiple word vectors based on the frequency of occurrence of the segmented words corresponding to the multiple word vectors in the evaluation text, and determining a topic distribution matrix of multiple word vectors based on the weights of the multiple word vectors and the probability of occurrence of the segmented words corresponding to the multiple word vectors under each sentiment theme in the evaluation text, wherein the topic distribution matrix is used to represent the relationship between the multiple word vectors and the sentiment theme; labeling the part-of-speech sentiment values corresponding to the sentiment words in the topic distribution matrix using a pre-constructed sentiment dictionary, and determining the target sentiment value of the sentiment words based on the context and part-of-speech sentiment values, wherein the part-of-speech sentiment values are used to represent the sentiment tendency of the words corresponding to the word vectors, and the target sentiment value is used to represent the sentiment intensity of the sentiment words; classifying the target sentiment values of the sentiment words in the multiple word vectors according to the comment time and theme to obtain the sentiment information in the comment information.
[0006] Optionally, the weights of multiple word vectors are determined based on the frequency of occurrence of the segments corresponding to multiple word vectors in the evaluation text, including: determining the frequency of occurrence of the segments corresponding to each word vector in the evaluation text; determining the average frequency of occurrence of all words in the word set corresponding to the evaluation text; determining the representation value of each word vector based on the frequency of occurrence of the segments corresponding to each word vector in the evaluation text and the average frequency of occurrence; and determining the weights of the multiple word vectors based on the representation value of each word vector and the frequency of occurrence of the segments corresponding to each word vector in the evaluation text.
[0007] Optionally, a topic distribution matrix for multiple word vectors is determined based on the weights of multiple word vectors and the probability of the segmented words corresponding to the multiple word vectors appearing in each sentiment theme in the comment information. This includes: determining the first occurrence probability of the segmented words corresponding to each word vector in the evaluation text based on the frequency of occurrence of the segmented words corresponding to each word vector in the evaluation text and the total number of multiple word vectors; determining the second occurrence probability of each word vector under each theme; and determining the elements in the topic distribution matrix based on the first occurrence probability, the second occurrence probability, and the weight of each word vector. The elements in the topic distribution matrix represent the sentiment themes to which the multiple word vectors belong.
[0008] Optionally, the part-of-speech sentiment values corresponding to sentiment words in the topic distribution matrix are labeled using a pre-built sentiment dictionary, including: matching all sentiment words in the topic distribution matrix with the sentiment dictionary; labeling the part-of-speech sentiment values of sentiment words that match positive sentiment words as the first value, the part-of-speech sentiment values of sentiment words that match negative sentiment words as the second value, and the part-of-speech sentiment values of sentiment words that match neutral sentiment words as the third value.
[0009] Optionally, the target sentiment value of the sentiment word is determined based on the context and part-of-speech sentiment value, including: determining the first sentiment value corresponding to the punctuation mark after the sentiment word in the target sentence from the sentiment dictionary; determining the second sentiment value corresponding to the degree adverb before the sentiment word in the target sentence from the sentiment dictionary; determining the number of negative words before the sentiment word in the target sentence, and determining the third sentiment value based on the number of negative words, wherein the target sentence refers to the sentence in which the sentiment word is located; and determining the target sentiment value based on the part-of-speech sentiment value, the first sentiment value, the second sentiment value, and the third sentiment value.
[0010] Optionally, the third sentiment value is determined based on the number of negative words, including: when the number of negative words is odd, the third sentiment value is determined to be negative; when the number of negative words is even, the third sentiment value is determined to be positive.
[0011] Optionally, the target sentiment values of sentiment words in multiple word vectors are classified according to the comment time and topic to obtain the sentiment information in the comment information, including: classifying the target sentiment values of sentiment words in multiple word vectors into target sentiment values of multiple time periods according to the time when the corresponding word segment is issued; classifying the target sentiment values of multiple time periods into target sentiment values of different sentiment themes within multiple time periods according to the sentiment theme to which the corresponding word segment belongs; and visually displaying the classified target sentiment values.
[0012] According to another aspect of the embodiments of this application, a device for determining sentiment information in comment information is also provided, comprising: an acquisition module, configured to acquire comment information of a target business and perform word segmentation processing on the evaluation text in the comment information to obtain multiple word vectors; a matrix module, configured to determine the weights of multiple word vectors based on the frequency of occurrence of the segmented words corresponding to the multiple word vectors in the evaluation text, and determine a topic distribution matrix of multiple word vectors based on the weights of the multiple word vectors and the probability of occurrence of the segmented words corresponding to the multiple word vectors under each sentiment theme in the evaluation text, the topic distribution matrix being used to represent the relationship between the multiple word vectors and the sentiment theme; an annotation module, configured to annotate the part-of-speech sentiment values corresponding to the sentiment words in the topic distribution matrix using a pre-constructed sentiment dictionary, and determine the target sentiment value of the sentiment words based on the context and part-of-speech sentiment values of the sentiment words, the part-of-speech sentiment values being used to represent the sentiment tendency of the words corresponding to the word vectors, and the target sentiment value being used to represent the sentiment intensity of the sentiment words; and a classification module, configured to classify the target sentiment values of the sentiment words in the multiple word vectors according to the comment time and theme to obtain the sentiment information in the comment information.
[0013] According to another aspect of the embodiments of this application, a non-volatile storage medium is also provided, wherein a program is stored in the non-volatile storage medium, and the program controls the device where the non-volatile storage medium is located to execute the emotional information determination method in the above-mentioned comment information when it runs.
[0014] According to another aspect of the embodiments of this application, a computer device is also provided, including: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the program executes the sentiment information determination method in the above-mentioned comment information during runtime.
[0015] In this embodiment, the following steps are taken: Review information of the target business is obtained, and the evaluation text in the review information is segmented to obtain multiple word vectors. The weights of the multiple word vectors are determined based on the frequency of occurrence of the corresponding word segments in the evaluation text. A topic distribution matrix of the multiple word vectors is determined based on the weights of the multiple word vectors and the probability of occurrence of the corresponding word segments under each sentiment theme in the evaluation text. The topic distribution matrix represents the relationship between the multiple word vectors and the sentiment theme. A pre-constructed sentiment dictionary is used to annotate the part-of-speech sentiment values corresponding to the sentiment words in the topic distribution matrix. Based on the context and part-of-speech sentiment values of the sentiment words, the target sentiment value of the sentiment words is determined. The part-of-speech sentiment value represents the sentiment tendency of the words corresponding to the word vectors. The target sentiment value is used to... This method represents the emotional intensity of sentiment words. It categorizes the target sentiment values of sentiment words from multiple word vectors according to comment time and theme, thus obtaining the sentiment information in the comment information. The weights of multiple word vectors are determined based on the frequency of occurrence of their corresponding word segments in the evaluation text. Furthermore, a theme distribution matrix of multiple word vectors is determined based on their weights and the probability of occurrence of their corresponding word segments under each sentiment theme in the evaluation text. This yields the sentiment values of different sentiment themes at different times in the comment information, achieving the goal of obtaining multi-dimensional sentiment information and improving the accuracy of sentiment information acquisition. This solves the technical problem of low accuracy in obtaining sentiment information due to relying solely on keywords to determine the sentiment information in the evaluation information. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0017] Figure 1 This is a hardware structure block diagram of a computer terminal (or mobile device) for a method of determining sentiment information in comment information according to an embodiment of this application;
[0018] Figure 2 This is a flowchart illustrating a method for determining sentiment information in comment information according to this application;
[0019] Figure 3 This is a schematic diagram of an optional device for determining emotional information in comment information according to an embodiment of this application. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0021] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0022] In related technologies, the corresponding public opinion information is obtained by simply matching and searching in a database using user-preset keyword information. This matching and searching method is too limited, and therefore suffers from low accuracy in obtaining sentiment information. To solve this problem, this application provides a method embodiment for obtaining sentiment information from comment information. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0023] The methods and embodiments provided in this application can be executed on mobile terminals, computer terminals, or similar computing devices. Figure 1 A hardware block diagram of a computer terminal (or mobile device) for implementing emotional information in comment information is shown. Figure 1As shown, the computer terminal 10 (or mobile device 10) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0024] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0025] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the sentiment information method in the comment information in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the aforementioned sentiment information method in the comment information. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0026] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0027] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0028] Under the aforementioned operating environment, this application embodiment provides a method for extracting sentiment information from comment information, such as... Figure 2 As shown, the method includes the following steps:
[0029] Step S202: Obtain the comment information of the target business, and perform word segmentation on the evaluation text in the comment information to obtain multiple word vectors;
[0030] Step S204: Determine the weights of multiple word vectors based on the frequency of occurrence of the word segments corresponding to multiple word vectors in the evaluation text, and determine the topic distribution matrix of multiple word vectors based on the weights of multiple word vectors and the probability of occurrence of the word segments corresponding to multiple word vectors under each sentiment theme in the evaluation text. The topic distribution matrix is used to represent the relationship between multiple word vectors and sentiment themes.
[0031] Step S206: Use a pre-built sentiment dictionary to annotate the part-of-speech sentiment values corresponding to sentiment words in the topic distribution matrix, and determine the target sentiment value of the sentiment word based on the context and part-of-speech sentiment value. The part-of-speech sentiment value is used to represent the sentiment tendency of the word corresponding to the word vector, and the target sentiment value is used to represent the sentiment intensity of the sentiment word.
[0032] Step S208: Classify the target sentiment values of sentiment words in multiple word vectors according to comment time and topic to obtain the sentiment information in the comment information.
[0033] Through the above steps, the weights of multiple word vectors can be determined based on the frequency of occurrence of the corresponding word segments in the evaluation text. Furthermore, based on the weights of the multiple word vectors and the probability of occurrence of the corresponding word segments under each sentiment theme in the evaluation text, a theme distribution matrix of the multiple word vectors can be determined. This yields the sentiment values of different sentiment themes at different times in the comment information, achieving the goal of obtaining multi-dimensional sentiment information. This improves the accuracy of sentiment information acquisition and solves the technical problem of low accuracy in obtaining sentiment information due to relying solely on keywords to determine sentiment information in evaluations.
[0034] It should be noted that the comment information includes the review text, the reviewer's location, and the review time. In practical applications, web scraping technology can be used to obtain review text, reviewer's location, and review time information relevant to the target business from internet platforms (video playback platforms, music platforms, shopping platforms, reading platforms, etc.).
[0035] In step S202, the evaluation text in the comment information is segmented into words. After obtaining the evaluation text, it can be preprocessed. The preprocessing includes word segmentation and noise reduction. Noise reduction includes removing stop words and punctuation marks to improve the accuracy of subsequent data processing results.
[0036] In one alternative approach, word segmentation can be implemented using byte-pair encoding techniques.
[0037] Specifically, the information in the service review event dataset, such as the evaluation text, the evaluator's location, and the evaluation time, can be segmented first using byte-pair encoding technology. Then, word vectors can be generated using a preset target model. Based on the word vector results, word segments that do not meet the preset conditions can be filtered out to obtain multiple word vectors.
[0038] It should be noted that the objective function of the preset target model is shown in the following equation:
[0039]
[0040] In the formula, W is the word vector matrix, X ij Indicator W j In the word W i The number of times it appears in the context of f(X) ij ) indicates a preset weight item.
[0041] in,
[0042] In the formula, X max X represents i The maximum value in, X i Indicates the word in word Wi The number of times X appears in the context of the word. i =∑ j X ij .
[0043] For the original analysis results Y = W1, W2...Wn, compare the cosine of the angle between the word vector of the current word Wi and the vector of Wi+1 from the initial position. The cosine of the angle is calculated using the formula for the cosine of the angle.
[0044] After calculating the cosine of the included angle, the included angle is obtained. If this included angle is greater than a threshold... Then, combine Wi and Wi+1 to form a new word, and normalize the combined word vector using existing normalization methods.
[0045] Then, using this new word, a greedy matching process is performed until all text has been traversed. Finally, the word segmentation results are the word vectors.
[0046] Steps S202 to S208 are described below through specific embodiments.
[0047] In step S204, the weights of multiple word vectors are determined based on the frequency of occurrence of the segmented words corresponding to multiple word vectors in the comment information. Specifically, the frequency of occurrence of the segmented words corresponding to each word vector in the evaluation text is determined; the average frequency of occurrence of all words in the word set corresponding to the evaluation text is determined; the representation value of each word vector is determined based on the frequency of occurrence of the segmented words corresponding to each word vector in the evaluation text and the average frequency of occurrence; and the weights of the multiple word vectors are determined based on the representation value of each word vector and the frequency of occurrence of the segmented words corresponding to each word vector in the evaluation text.
[0048] Because related technologies do not perform adequate word vector differentiation representation on the segmented data, resulting in uneven distribution of topics corresponding to words, the accuracy of subsequent sentiment analysis is reduced. Considering this factor, this application determines word vectors in the following way: Based on the frequency of each word in the evaluation text and the average word frequency of all words in the word set corresponding to the evaluation text, the words are differentiated and represented using the following calculation method to obtain the representation value F(wi) of each word vector, as shown in the following formula:
[0049]
[0050] In the formula, Frwi represents the frequency of each word in the evaluation text, and Mnwi represents the average frequency τ of all words in the word set wi corresponding to the evaluation text. 2 variance.
[0051] The word vector weights WE are calculated using the following formula:
[0052]
[0053] In the formula, Ni represents the number of word vectors.
[0054] In one alternative approach, the topic distribution matrix can be determined by: determining the first occurrence probability of each word vector in the evaluation text based on the frequency of occurrence of the word corresponding to each word vector in the evaluation text and the total number of word vectors; determining the second occurrence probability of each word vector under each topic; and determining the elements in the topic distribution matrix based on the first occurrence probability, the second occurrence probability, and the weight of each word vector, wherein the elements in the topic distribution matrix represent the sentiment topics to which multiple word vectors belong.
[0055] Specifically, the topic distribution matrix can be determined by the following formula:
[0056]
[0057] In the formula, P(w) i ,z i ) represents topic z i word w i The distribution matrix, P(w) i ) indicates the word w i In evaluating the probability of occurrence in the text, P(w) i |Z i ) indicates that in topic z i Next word w i The probability of its occurrence.
[0058] After determining the topic matrix, the part-of-speech sentiment values corresponding to the sentiment words in the topic distribution matrix are labeled using a pre-built sentiment dictionary. This includes: matching all sentiment words in the topic distribution matrix with the sentiment dictionary; labeling sentiment words that match positive sentiment words with a first value, sentiment words that match negative sentiment words with a second value, and sentiment words that match neutral sentiment words with a third value.
[0059] In practical applications, words in the topic distribution matrix can be matched with a pre-built sentiment dictionary. Words that can be automatically matched are automatically labeled with sentiment attributes, with positive sentiment words labeled as 1, negative sentiment words labeled as -1, and neutral sentiment words labeled as 0.
[0060] After determining the part-of-speech sentiment values of all sentiment words, the first sentiment value corresponding to the punctuation marks after the sentiment words in the target sentence is determined from the sentiment dictionary; the second sentiment value corresponding to the degree adverbs before the sentiment words in the target sentence is determined from the sentiment dictionary; the number of negative words before the sentiment words in the target sentence is determined, and the third sentiment value is determined based on the number of negative words, where the target sentence refers to the sentence containing the sentiment words; the target sentiment value is determined based on the part-of-speech sentiment value, the first sentiment value, the second sentiment value, and the third sentiment value.
[0061] Specifically, when the number of negative words is odd, the third sentiment value is determined to be negative; when the number of negative words is even, the third sentiment value is determined to be positive.
[0062] The target sentiment value of the topic distribution matrix can be determined by the following formula:
[0063]
[0064] In the formula, E represents the target sentiment value of the topic distribution matrix, E(W i ) represents the part-of-speech sentiment value of the sentiment word, λ1 represents the first sentiment value, λ2 represents the second sentiment value, λ3 represents the third sentiment value, E1 represents the sentiment value of the target sentence in which the sentiment word is located, and E2 represents the sentiment correction factor based on the evaluator's position.
[0065] It should be noted that if the sentence containing the sentiment word is the first sentence of the evaluation text, then E1 is 1; if the sentence containing the sentiment word is the last sentence of the evaluation text, then E1 is 0.5; if the sentence containing the sentiment word is neither the first nor the last sentence of the evaluation text, then E1 is 0.
[0066] When determining the sentiment correction factor, the sentiment correction factor that matches the evaluator's location can be determined based on the evaluator's location and a preset location-sentiment database. The preset location-sentiment database stores the mapping relationship between location and sentiment correction factor.
[0067] Optionally, the target sentiment values of sentiment words in multiple word vectors are classified according to the comment time and topic to obtain the sentiment information in the comment information, including: classifying the target sentiment values of sentiment words in multiple word vectors into target sentiment values of multiple time periods according to the time when the corresponding word segment is issued; classifying the target sentiment values of multiple time periods into target sentiment values of different sentiment themes within multiple time periods according to the sentiment theme to which the corresponding word segment belongs; and visually displaying the classified target sentiment values.
[0068] Specifically, firstly, the calculated text sentiment analysis results are integrated into a time-series text set according to time slices, yielding sentiment analysis results in the "text-time" dimension. Then, the sentiment analysis results in the "text-time" dimension are further divided into K different sentiment themes, resulting in sentiment statistics in the three dimensions of time, text, and theme. For datasets matched to suitable visualization methods, visualization encoding technologies such as echarts are used, and the data transmission interface pushes the data to the front end for visualization chart display.
[0069] This application provides a device for determining sentiment information in comment information, such as... Figure 3 As shown, the system includes: an acquisition module 30, used to acquire comment information of the target business and perform word segmentation on the evaluation text in the comment information to obtain multiple word vectors; a matrix module 32, used to determine the weights of multiple word vectors based on the frequency of occurrence of the corresponding word segments in the evaluation text, and to determine the topic distribution matrix of multiple word vectors based on the weights of multiple word vectors and the probability of occurrence of the corresponding word segments in each sentiment theme in the evaluation text, the topic distribution matrix being used to represent the relationship between multiple word vectors and sentiment themes; an annotation module 34, used to annotate the part-of-speech sentiment values corresponding to sentiment words in the topic distribution matrix using a pre-built sentiment dictionary, and to determine the target sentiment value of sentiment words based on the context and part-of-speech sentiment values, the part-of-speech sentiment values being used to represent the sentiment tendency of the words corresponding to the word vectors, and the target sentiment value being used to represent the sentiment intensity of the sentiment words; and a classification module 36, used to classify the target sentiment values of sentiment words in multiple word vectors according to comment time and theme to obtain sentiment information in the comment information.
[0070] According to another aspect of the embodiments of this application, a non-volatile storage medium is also provided, wherein a program is stored in the non-volatile storage medium, and the program controls the device where the non-volatile storage medium is located to execute the emotional information determination method in the above-mentioned comment information when it runs.
[0071] According to another aspect of the embodiments of this application, a computer device is also provided, including: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the program executes the above-described method for determining sentiment information in comment information during runtime.
[0072] It should be noted that the modules in the sentiment information determination device mentioned above can be program modules (e.g., a set of program instructions to implement a specific function) or hardware modules. For the latter, they can be in the following forms, but are not limited to these: each of the above modules is represented by a processor, or the functions of each of the above modules are implemented by a processor.
[0073] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0074] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0075] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.
[0076] The units described as separate components may or may not be physically separate. Similarly, the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0077] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0078] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0079] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for determining sentiment information in comment information, characterized in that, include: Obtain comment information for the target business, and perform word segmentation on the evaluation text in the comment information to obtain multiple word vectors; The weights of the multiple word vectors are determined based on the frequency of occurrence of the word segments corresponding to the multiple word vectors in the evaluation text. The topic distribution matrix of the multiple word vectors is determined based on the weights of the multiple word vectors and the probability of occurrence of the word segments corresponding to the multiple word vectors under each sentiment theme in the evaluation text. The topic distribution matrix is used to represent the relationship between the multiple word vectors and the sentiment theme. The part-of-speech sentiment values corresponding to the sentiment words in the topic distribution matrix are labeled using a pre-constructed sentiment dictionary. Based on the context of the sentiment words and the part-of-speech sentiment values, the target sentiment value of the sentiment words is determined. The part-of-speech sentiment values are used to represent the sentiment tendency of the words corresponding to the word vectors, and the target sentiment value is used to represent the sentiment intensity of the sentiment words. The target sentiment values of sentiment words in the multiple word vectors are classified according to comment time and topic to obtain the sentiment information in the comment information; The target sentiment values of sentiment words in the multiple word vectors are classified according to comment time and topic to obtain the sentiment information in the comment information, including: The target sentiment values of the sentiment words in the multiple word vectors are divided into target sentiment values for multiple time periods according to the time when the word segment corresponding to the word vector is issued. The target sentiment values for the multiple time periods are categorized into different sentiment themes within the time periods according to the sentiment theme of the word segmentation corresponding to the word vector, and the categorized target sentiment values are then visualized.
2. The method according to claim 1, characterized in that, The weights of the multiple word vectors are determined based on the frequency of their corresponding word segments in the comment information, including: Determine the frequency of occurrence of the word segment corresponding to each word vector in the evaluation text; Determine the average frequency of all words in the word set corresponding to the evaluation text; The representation value of each word vector is determined based on the frequency of occurrence of the word segment corresponding to each word vector in the evaluation text and the average frequency of occurrence. The weights of the multiple word vectors are determined based on the representation value of each word vector and the frequency of occurrence of the corresponding word segment in the evaluation text.
3. The method according to claim 2, characterized in that, The topic distribution matrix of the multiple word vectors is determined based on their weights and the probabilities of their corresponding word segments appearing under each sentiment topic in the comment information, including: The first occurrence probability of each word segment corresponding to each word vector in the evaluation text is determined based on the frequency of occurrence of the segment corresponding to each word vector in the evaluation text and the total number of the multiple word vectors; Determine the second occurrence probability of each word vector under each topic; The elements in the topic distribution matrix are determined based on the first occurrence probability, the second occurrence probability, and the weight of each word vector. The elements in the topic distribution matrix represent the sentiment topics to which the multiple word vectors belong.
4. The method according to claim 1, characterized in that, The part-of-speech sentiment values corresponding to sentiment words in the topic distribution matrix are labeled using a pre-constructed sentiment dictionary, including: Match all sentiment words in the topic distribution matrix with the sentiment dictionary; The sentiment words that match positive sentiment words are labeled with the first value, the sentiment words that match negative sentiment words are labeled with the second value, and the sentiment words that match neutral sentiment words are labeled with the third value.
5. The method according to claim 4, characterized in that, Based on the context of the sentiment word and its part-of-speech sentiment value, the target sentiment value of the sentiment word is determined, including: Determine the first sentiment value corresponding to the punctuation mark after the sentiment word in the target sentence from the sentiment dictionary; Determine the second sentiment value corresponding to the degree adverb before the sentiment word in the target sentence from the sentiment dictionary; The number of negative words preceding the sentiment word in the target sentence is determined, and a third sentiment value is determined based on the number of negative words, wherein the target sentence refers to the sentence in which the sentiment word is located; The target sentiment value is determined based on the part-of-speech sentiment value, the first sentiment value, the second sentiment value, and the third sentiment value.
6. The method according to claim 5, characterized in that, The third sentiment value is determined based on the number of negative words, including: When the number of negative words is odd, the third sentiment value is determined to be negative. If the number of negative words is even, the third sentiment value is determined to be positive.
7. A device for determining sentiment information in comment information, characterized in that, include: The acquisition module is used to acquire comment information of the target business and perform word segmentation on the evaluation text in the comment information to obtain multiple word vectors; The matrix module is used to determine the weights of the multiple word vectors based on the frequency of occurrence of the segmented words corresponding to the multiple word vectors in the evaluation text, and to determine the topic distribution matrix of the multiple word vectors based on the weights of the multiple word vectors and the probability of occurrence of the segmented words corresponding to the multiple word vectors under each sentiment theme in the evaluation text. The topic distribution matrix is used to represent the relationship between the multiple word vectors and the sentiment theme. The annotation module is used to annotate the part-of-speech sentiment values corresponding to the sentiment words in the topic distribution matrix using a pre-built sentiment dictionary, and to determine the target sentiment value of the sentiment word based on the context of the sentiment word and the part-of-speech sentiment value. The part-of-speech sentiment value is used to represent the sentiment tendency of the word corresponding to the word vector, and the target sentiment value is used to represent the sentiment intensity of the sentiment word. The classification module is used to classify the target sentiment values of sentiment words in the multiple word vectors according to the comment time and topic, so as to obtain the sentiment information in the comment information; The target sentiment values of sentiment words in the multiple word vectors are classified according to comment time and topic to obtain the sentiment information in the comment information, including: The target sentiment values of the sentiment words in the multiple word vectors are divided into target sentiment values for multiple time periods according to the time when the word segment corresponding to the word vector is issued. The target sentiment values for the multiple time periods are categorized into different sentiment themes within the time periods according to the sentiment theme of the word segmentation corresponding to the word vector, and the categorized target sentiment values are then visualized.
8. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores a program, wherein when the program is executed, it controls the device where the non-volatile storage medium is located to execute the emotional information determination method in the comment information as described in any one of claims 1 to 6.
9. A computer device, characterized in that, include: A memory and a processor, the processor being configured to run a program stored in the memory, wherein the program, when running, executes the method for determining sentiment information in comment information as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Sentiment value based web text sentiment analysis method
CN104008091A
Hotspot classification method of public opinion based on deep learning
CN107239529A