Method and device for extracting viewpoint feature words of comment information and electronic equipment
By generating a weighted sample lexicon, updating weights, calculating chi-square values and generating a polar dictionary of opinion, the problems of high cost and low accuracy of opinion feature words extraction in the prior art are solved, and more efficient and accurate opinion feature words extraction is achieved.
Patent Information
- Application Number
- CN202411974018.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-04
AI Technical Summary
In the prior art, the extraction of characteristic words with high cost and low accuracy.
By determining the weight of each sample characteristic word, a weighted sample lexicon library is generated; the weight of the sample lexicon library is updated based on the synonyms library of each sample characteristic word; the chi-square value of each word in the updated weighted sample lexicon library is determined, and the perspective polarity dictionary is generated; the polarity of the characteristic words extracted from the target comment information is determined based on the perspective polarity dictionary, thereby determining the perspective characteristic words of the target comment information.
The accuracy of extracting the point-of-view feature word is improved, the difficulty of extraction is reduced, and the problems of high cost and low accuracy in the prior art are solved.
Smart Images

Figure CN119761352A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of big data mining, and in particular to a method, device and electronic equipment for extracting opinion feature words from comment information. Background Art
[0002] With the rapid development and popularization of Internet technology, the Internet has become an indispensable part of people's lives. Consumers no longer rely solely on traditional advertisements or sales recommendations when making purchasing decisions, but are increasingly inclined to refer to the experiences and evaluations of other consumers. Online review platforms have sprung up like mushrooms after a rain. Whether it is user feedback on e-commerce platforms or discussions on social media and professional review websites, they have become important factors influencing consumer behavior. Consumers evaluate the quality, performance, cost-effectiveness and other aspects of products or services by reading these online reviews. Positive reviews can enhance the confidence of potential buyers, while negative feedback may cause vigilance or even directly change purchasing decisions. Therefore, it is crucial for merchants to understand and effectively manage these review information.
[0003] In order to extract valuable information from massive amounts of review data, opinion analysis (also known as sentiment analysis) has emerged. Existing technologies usually use natural language processing technology and machine learning algorithms to automatically identify and classify emotional tendencies in reviews, such as positive, negative, or neutral. Although machine learning-based methods are widely used in areas such as product review opinion analysis, they also have some obvious shortcomings or limitations. The use of natural language processing methods often involves manually enumerating patterns of linguistic features and matching them with characteristic words of review information using custom rules or lexicons, which is very labor-intensive and affects the accuracy of opinion data extraction results. Summary of the invention
[0004] The purpose of the present invention is to provide a method, device and electronic device for extracting opinion feature words from comment information, so as to solve the technical problems of high cost and low accuracy of opinion feature word extraction in the prior art.
[0005] In a first aspect, an embodiment of the present invention provides a method for extracting opinion feature words from comment information, the method comprising: determining the weight of each sample feature word and generating a weighted sample vocabulary; updating the weight of the sample vocabulary based on a synonym vocabulary of each sample feature word; determining the chi-square value of each word in the updated weighted sample vocabulary and generating an opinion polarity dictionary based on the chi-square value; determining the polarity of the feature words extracted from the target comment information based on the opinion polarity dictionary, thereby determining the opinion feature words of the target comment information.
[0006] In some optional implementations, the weight of each sample feature word is determined to generate a weighted sample word library, including: generating a number of sample feature words based on pre-collected comment information; determining the opinion polarity of each sample feature word; the above opinion polarity includes: positive opinion and negative opinion; based on the above opinion polarity, determining the weight of each sample feature word; the weight value of the sample feature word of the positive opinion is positive, and the weight value of the sample feature word of the negative opinion is negative.
[0007] In some optional implementations, based on the synonym thesaurus of the above-mentioned sample feature words, the weight of the above-mentioned sample thesaurus is updated, including: determining the synonym thesaurus of each sample feature word based on the pre-acquired synonym thesaurus; traversing the words in the synonym thesaurus of the above-mentioned sample feature words to determine whether the above-mentioned sample feature words and synonyms exist in the above-mentioned sample thesaurus, and updating the word frequency and document frequency; based on the updated word frequency and the above-mentioned document frequency, determining the weight of the updated sample thesaurus.
[0008] In some optional implementations, traversing and looping the words in the synonym word library of the above-mentioned sample feature words, determining whether the above-mentioned sample feature words and synonyms exist in the above-mentioned sample word library, and updating the word frequency and document frequency, includes: traversing and looping the words in the synonym word library of the above-mentioned sample feature words, determining whether the synonyms of the above-mentioned sample feature words exist in the above-mentioned sample word library; if so, determining the target document of the synonyms of the above-mentioned sample feature words in the above-mentioned sample word library; determining whether the above-mentioned sample feature words exist in the above-mentioned target document.
[0009] In some optional implementations, the words in the synonym dictionary of the above-mentioned sample feature words are traversed and looped to determine whether the above-mentioned sample feature words and synonyms exist in the above-mentioned sample dictionary, and the word frequency and document frequency are updated, which also includes: if the above-mentioned sample feature words exist in the above-mentioned target document, the word frequency is increased by 1; otherwise, the document frequency is increased by 1.
[0010] In some optional implementations, after the step of determining the weight of each sample feature word and generating a weighted sample vocabulary, the method further includes: determining the word weight of each sample feature word in different opinion polarity categories; sorting the word weights in different opinion polarity categories, retaining the words whose absolute values of word weights are greater than a first threshold in order, and generating a sample vocabulary.
[0011] In some optional implementations, the chi-square value of each word in the updated weighted sample vocabulary is determined, and an opinion polarity dictionary is generated based on the chi-square value, including: determining the category weight parameters of each feature word in the updated weighted sample vocabulary; based on the above category weight parameters, calculating the chi-square value of each feature word using the chi-square test formula; determining the target sample feature word according to the above chi-square value of each feature word; generating an opinion polarity dictionary based on the opinion polarity of the target sample feature word; the above opinion polarity dictionary includes a positive opinion dictionary and a negative opinion dictionary.
[0012] In a second aspect, an embodiment of the present invention provides a device for extracting opinion feature words of comment information, the device comprising: a vocabulary generation module, used to determine the weight of each sample feature word, and generate a weighted sample vocabulary; a vocabulary update module, used to update the weight of the above sample vocabulary based on the synonym vocabulary of the above sample feature words; an opinion polarity dictionary generation module, used to determine the chi-square value of each word in the updated sample vocabulary with weights, and generate an opinion polarity dictionary based on the above chi-square value; an opinion feature word extraction module, used to determine the polarity of the feature words extracted from the target comment information based on the above opinion polarity dictionary, thereby determining the opinion feature words of the target comment information.
[0013] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the processor executes the computer program, the steps of any one of the methods described in the first aspect are implemented.
[0014] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores machine-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to execute any method described in the first aspect above.
[0015] The present invention provides a method, device and electronic device for extracting opinion feature words from comment information, the method comprising: determining the weight of each sample feature word and generating a sample word library with weights; updating the weight of the sample word library based on the synonym word library of each sample feature word; determining the chi-square value of each word in the updated sample word library with weights and generating an opinion polarity dictionary; determining the polarity of the feature words extracted from the target comment information based on the opinion polarity dictionary, thereby determining the opinion feature words of the target comment information. The method solves the technical problems of high cost and low accuracy of the existing opinion feature word extraction, and achieves the technical effect of improving accuracy and reducing extraction difficulty. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 A schematic diagram of a flow chart of a method for extracting opinion feature words from comment information provided by an embodiment of the present invention;
[0018] Figure 2 A flowchart of a specific implementation method of constructing a polarity dictionary provided by an embodiment of the present invention;
[0019] Figure 3 A schematic diagram of the structure of a device for extracting opinion feature words from comment information provided by an embodiment of the present invention;
[0020] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0022] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. Some embodiments of the present invention are described in detail below in conjunction with the drawings. The following embodiments and features in the embodiments can be combined with each other without conflict.
[0024] In order to extract valuable information from a vast amount of review data, existing technologies usually utilize natural language processing techniques and machine learning algorithms to automatically identify and classify the sentiment tendencies in reviews, such as positive, negative, or neutral, for the purpose of opinion analysis. Although machine learning-based methods have extensive applications in fields such as product review opinion analysis, they also have some obvious drawbacks or limitations. Utilizing natural language processing means often involves manually listing patterns of linguistic features and matching them with the feature words of review information using custom rules or word libraries, which is extremely labor-intensive and affects the accuracy of opinion data extraction results.
[0025] Based on this, embodiments of the present invention provide a method, apparatus, and electronic device for extracting opinion feature words of review information to solve the technical problems of high cost and low accuracy in extracting opinion feature words in the prior art.
[0026] For ease of understanding of this embodiment, first, a method for extracting opinion feature words of review information disclosed in the embodiments of the present invention will be introduced in detail. Refer to Figure 1 the flowchart of a method for extracting opinion feature words of review information shown in
[0027] S110: Determine the weights of each sample feature word and generate a weighted sample word library;
[0028] Among them, the sample feature words are sample feature words collected in advance from review information, and these sample feature words are generally words with opinion features. Then, classify each sample feature word to determine the opinion polarity of each word, and the opinion polarity can include positive opinions and negative opinions.
[0029] In one embodiment, usually collect review information texts to form documents, and form a training data sample set from multiple documents. Then, segment the collected review information texts, retain the part-of-speech and remove stop words such as 'de' (的), 'shi' (是), 'bushi' (不是), etc. Then, classify the segmented words according to their opinion polarity (such as positive opinions, negative opinions, neutral opinions, etc.) to generate a word library of the training data sample set.
[0030] In this embodiment, it is necessary to calculate the weight of each word in the word library of the training data sample set to generate a weighted sample word library. Usually, the TF*IDF formula is used for calculation, and the specific formula is:
[0031]
[0032] Among them, TF refers to the number of times a word (in the vocabulary of the training data sample set) appears in a certain document (in the training data sample set). DF (Document Frequency) is the document frequency, which refers to the number of documents in which a word (in the vocabulary of the training data sample set) appears in the document training set. IDF stands for Inverse Document Frequency, which is translated into Chinese as inverse document frequency. The calculation formula is: IDF = log (N / DF), where N is the total number of documents in the document set (in the training data sample set).
[0033] In this embodiment, the weight of each sample feature word is determined based on the viewpoint polarity; wherein the weight value of the sample feature word of a positive viewpoint is positive, and the weight of the sample feature word of a negative viewpoint is negative. That is, the weight calculated for each sample feature word is assigned a positive or negative value according to the viewpoint polarity. The assigned weight is the sample word library with weight.
[0034] In one embodiment, after the step of determining the weight of each sample feature word and generating a sample word library with weights in the above S110, the method further includes:
[0035] (1) Determine the word weights of each sample feature word in different opinion polarity categories; polarity categories include positive opinion and negative opinion;
[0036] (2) Sort the word weights in different opinion polarity categories, retain the words whose absolute values of word weights are greater than the first threshold in order, and generate a sample word library.
[0037] Among them, the first threshold is used to screen out words that contribute significantly to the classification. The specific value of the threshold can be determined according to the needs of the actual application. For example: a higher threshold can be set to reduce the number of features and retain only the most relevant words, thereby improving the accuracy of model classification; conversely, if a higher recall rate is pursued, the threshold can be lowered to allow more words to enter the model. It should be noted that this step can be performed separately in the positive opinion sample set and the negative opinion sample set of the feature vocabulary. When sorting the word weights and retaining the weight values in order, the influence of positive and negative values is ignored, and the absolute value of the weight is calculated.
[0038] S120: based on the synonym word library of each sample feature word, updating the weight of the sample word library;
[0039] In one embodiment, in the above S120, the step of updating the weight of the sample word library based on the synonym word library of each sample feature word includes:
[0040] (S21) determining a synonym word library for each sample feature word based on the pre-acquired synonym word library;
[0041] The pre-acquired synonym word library may be a broad synonym word library directly obtained through existing channels (such as books, publications, online resources, websites, etc.), or may be generated based on a training data set and continuously expanded during the application process.
[0042] In this embodiment, the synonym word library of each sample feature word can be a synonym word queue Bai of the word library Ai obtained by traversing the words in the sample word library A and circulating the synonym word library B (where i=1...p, and p is the number of words).
[0043] (S22) traversing the words in the synonym word library of the loop sample feature word, determining whether the sample feature word and the synonym word exist in the sample word library, and updating the word frequency and document frequency;
[0044] In one embodiment, the above step (S22) includes:
[0045] (1) traverse the words in the synonym word library of the sample feature word to determine whether there is a synonym of the sample feature word in the sample word library;
[0046] (2) If it exists, determine the target document of the synonym of the sample feature word in the sample vocabulary;
[0047] (3) Determine whether the sample feature words exist in the target document.
[0048] In one embodiment, the above step (S22) further includes:
[0049] (4) If the sample feature word exists in the target document, the word frequency is increased by 1;
[0050] (5) Otherwise, the document frequency increases by 1.
[0051] That is to say, for the sample vocabulary A and the synonym vocabulary B, the words in vocabulary A traverse the cyclic vocabulary B to obtain the synonym queue Bai of vocabulary Ai, and the words in the cyclic Bai and Ai are compared with the sample library. If Bai exists in m sample documents j and Ai also exists, the word frequency TF is increased by 1 (m is at least 1); if Bai appears in document j and Ai does not appear in the document j, the document frequency DF is increased by 1.
[0052] (S23) Determine the weight of the updated sample vocabulary based on the updated word frequency and document frequency.
[0053] In this embodiment, the word frequency TF and document frequency DF values of each word calculated through the above steps are substituted into the weight calculation formula:
[0054]
[0055] In formula (1): TF refers to the number of times a word appears in a document. DF refers to the number of documents in which the word appears in the document training set. The IDF calculation formula is: IDF = log (N / DF), where N is the total number of documents in the document set. The TF-IDF (term frequency - inverse document frequency) is used to calculate the word weight. The larger the TF-IDF, the greater the probability that the word is the keyword, rather than a keyword with little relevance to the training sample set.
[0056] S130: Determine the chi-square value of each word in the updated weighted sample word library, and generate an opinion polarity dictionary based on the chi-square value;
[0057] In one embodiment, the above S130, the step of determining the chi-square value of each word in the updated weighted sample word library and generating the opinion polarity dictionary based on the chi-square value, includes:
[0058] (S31) determining the category weight parameter of each feature word in the updated weighted sample word library;
[0059] (S32) calculating the chi-square value of each feature word using a chi-square test formula based on the category weight parameter;
[0060] (S33) determining a target sample feature word according to the chi-square value of each feature word;
[0061] (S34) Generate an opinion polarity dictionary based on the opinion polarity of the target sample feature words; the opinion polarity dictionary includes a positive opinion dictionary and a negative opinion dictionary.
[0062] As a specific example, the chi-square test is calculated as follows:
[0063]
[0064] Among them, n1, n2, n3, n4 are the category weight parameters of each feature word; n is the total number of documents;
[0065] n1 represents the weight of the i-th term appearing in the j-th category;
[0066] n2 represents the weight of the i-th term appearing in categories other than the j-th category;
[0067] n3 represents the weight of words other than the i-th term appearing in the j-th category;
[0068] n4 represents the weight of words other than the i-th term appearing in categories other than the j-th category.
[0069] The main idea of the chi-square test (calculating the CHI chi-square value) is that the relationship between terms and categories conforms to the χ2 distribution, and the χ2 statistic of a term represents the contribution of the term to a certain category. The higher the value of the χ2 statistic, the smaller the independence and the stronger the correlation between the term and the category, that is, the greater the contribution of the term to this category.
[0070] That is, according to the CHI value, terms with a greater contribution to a certain category are determined. For example, when constructing a positive opinion dictionary, terms with a CHI value exceeding the second threshold are determined as the target sample feature words of this polarity category, and then the target sample feature words are added to the dictionary representing positive opinions; when constructing a negative opinion dictionary, terms with a CHI value exceeding the third threshold are determined as the target sample feature words of this polarity category, and then the target sample feature words are added to the dictionary representing negative opinions.
[0071] Among them, the second threshold and the third threshold can be the same or different, and are respectively used to screen out words with a stronger correlation with the positive opinion polarity category and the negative opinion polarity category. The specific values of the thresholds can be determined according to the requirements of actual applications.
[0072] S140: Determine the polarity of the feature words extracted from the target comment information based on the opinion polarity dictionary, so as to determine the opinion feature words of the target comment information.
[0073] The embodiment of the present application provides a method for extracting opinion feature words of comment information. The method includes: determining the weights of each sample feature word to generate a weighted sample word library; updating the weights of the sample word library based on the synonym word libraries of each sample feature word; determining the chi-square value of each word in the updated weighted sample word library, and generating an opinion polarity dictionary based on the chi-square value; determining the polarity of the feature words extracted from the target comment information based on the opinion polarity dictionary, so as to determine the opinion feature words of the target comment information. By this method, the technical problems of high cost and low accuracy in the extraction of existing opinion feature words are solved, and the technical effects of improving accuracy and reducing extraction difficulty are achieved. By this method, the technical problems of high cost and low accuracy in the extraction of existing opinion feature words are solved, and the technical effects of improving accuracy and reducing extraction difficulty are achieved.
[0074] As a specific example, in the method for extracting opinion feature words of comment information provided by the embodiment of the present application, the specific implementation manner of constructing the polarity dictionary is combined with Figure 2 as shown, and the method includes the following steps:
[0075] S210: Perform word segmentation to generate a sample set word library.
[0076] First, the training data sample set is manually classified (such as positive opinions, negative opinions), and then word segmentation is performed, the part-of-speech is retained, and stop words such as 'de' (的), 'shi' (是), 'bushi' (不是) are removed to obtain the word library of the sample set;
[0077] S220: Counting the word weight of each word in the sample set vocabulary in the classification, and retaining the words with a weight value greater than N according to the weight sorting;
[0078] (a) Adding word weights to the synonym word library: The word i in S210 is queried in the synonym word library to obtain a set of synonyms of word i, and then the words in this set are used to traverse the word library obtained in S210. If word i and its synonyms appear in the same sample document j, TF is increased by 1; if word i does not appear in document j but a synonym appears, DF is increased by 1;
[0079] (b) Substitute the TF and DF values of each word calculated in (a) into formula (1);
[0080] The specific description of the TF*IDF formula is shown in formula (1):
[0081]
[0082] In formula (1): TF refers to the number of times a word appears in a document. DF refers to the number of documents in which the word appears in the document training set. IDF is the inverse document frequency, and the calculation formula is: IDF = log (N / DF), where N is the total number of documents in the document set. TF-IDF (term frequency - inverse document frequency) is used to calculate the word weight. The larger the TF-IDF, the more likely it is that the word is the keyword, rather than a keyword with little relevance to the training sample set.
[0083] It should be noted that the weight calculated for each word is assigned a positive or negative value according to the opinion polarity thereof, wherein the weight value of a word with a positive opinion is positive, and the weight value of a word with a negative opinion is negative.
[0084] S230: Calculate the CHI value (chi-square value) of each word according to the statistical results;
[0085] The main idea of CHI is that the terms and categories follow the χ2 distribution. The χ2 statistics of a term represent the contribution of the term to a certain category. The higher the value of the χ2 statistic, the smaller the independence and the stronger the correlation between the term and the category, that is, the greater the contribution of the term to this category. The calculation formula is as follows:
[0086]
[0087] in:
[0088] n1 represents the weight of the i-th term appearing in the j-th category;
[0089] n2 represents the weight of the i-th term appearing in categories other than the j-th category;
[0090] n3 represents the weight of words other than the i-th term appearing in the j-th category;
[0091] n4 represents the weight of words other than the i-th term appearing in categories other than the j-th category.
[0092] S240: construct a dictionary according to the CHI value;
[0093] Among all words with positive weight values, if the CHI value of the word is greater than the second threshold, the word is added to the dictionary representing positive opinions; among all words with negative weight values, if the CHI value of the word is greater than the third threshold, the word is added to the dictionary representing negative opinions. The second threshold and the third threshold can be the same or different, and are used to filter out words with strong correlation with the positive opinion polarity category and the negative opinion polarity category, respectively. The specific values of the thresholds can be determined according to the needs of actual applications.
[0094] In the above embodiment, the weight of synonyms is added in the feature word extraction. Considering that opinion words basically have polarity, TF*IDF and CHI of synonym information are added to identify and extract feature words, thereby improving the effect of extracting opinion feature words in comment information.
[0095] In addition, the present application also provides a device for extracting feature words of opinions in comment information, see Figure 3 As shown, the device comprises:
[0096] The word library generation module 310 is used to determine the weight of each sample feature word and generate a sample word library with weights;
[0097] The word library update module 320 is used to update the weight of the sample word library based on the synonym word library of each sample feature word;
[0098] The opinion polarity dictionary generation module 330 is used to determine the chi-square value of each word in the updated weighted sample word library and generate an opinion polarity dictionary based on the chi-square value;
[0099] The opinion feature word extraction module 340 is used to determine the polarity of the feature words extracted from the target comment information based on the opinion polarity dictionary, so as to determine the opinion feature words of the target comment information.
[0100] The device for extracting characteristic words of viewpoints from comment information provided in the embodiment of the present application may be specific hardware on a device or software or firmware installed on the device, etc. The implementation principle and technical effects of the device provided in the embodiment of the present application are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment. Technical personnel in the relevant field can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here. The device for extracting characteristic words of viewpoints from comment information provided in the embodiment of the present application has the same technical features as the method for extracting characteristic words of viewpoints from comment information provided in the aforementioned embodiment, so it can also solve the same technical problems and achieve the same technical effects.
[0101] An embodiment of the present application further provides an electronic device. Specifically, the electronic device includes a processor and a storage device. The storage device stores a computer program, and when the computer program is executed by the processor, it executes the method described in any one of the above-mentioned embodiments.
[0102] Figure 4 A structural schematic diagram of an electronic device provided in an embodiment of the present application, the electronic device 400 includes: a processor 40, a memory 41, a bus 42 and a communication interface 43, wherein the processor 40, the communication interface 43 and the memory 41 are connected via the bus 42; the processor 40 is used to execute an executable module stored in the memory 41, such as a computer program.
[0103] The memory 41 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 43 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0104] The bus 42 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0105] Among them, the memory 41 is used to store programs, and the processor 40 executes the program after receiving the execution instruction. The method executed by the process definition device disclosed in any embodiment of the above-mentioned embodiment of the present invention can be applied to the processor 40 or implemented by the processor 40.
[0106] The processor 40 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 40. The above processor 40 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor to execute, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 41, and the processor 40 reads the information in the memory 41 and completes the steps of the above method in combination with its hardware.
[0107] Corresponding to the above method, an embodiment of the present application also provides a computer-readable storage medium, which stores machine-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the steps of the above method.
[0108] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0109] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0110] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0111] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, electronic device, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0112] It should be noted that similar numbers and letters represent similar items in the accompanying drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for extracting opinion feature words from comment information, characterized in that: include: Determine the weight of each sample feature word and generate a sample word library with weights; Based on the synonym word library of each sample feature word, updating the weight of the sample word library; Determine the chi-square value of each word in the updated weighted sample word library, and generate an opinion polarity dictionary based on the chi-square value; The polarity of the feature words extracted from the target review information is determined based on the opinion polarity dictionary, thereby determining the opinion feature words of the target review information.
2. The method for extracting opinion feature words from comment information according to claim 1, characterized in that: Determine the weight of each sample feature word and generate a weighted sample word library, including: Generate several sample feature words based on the pre-collected review information; Determine the opinion polarity of each sample feature word; the opinion polarity includes: positive opinion and negative opinion; Based on the opinion polarity, the weight of each sample feature word is determined; the weight value of the sample feature word of the positive opinion is positive, and the weight value of the sample feature word of the negative opinion is negative.
3. The method for extracting opinion feature words from comment information according to claim 1, characterized in that: Based on the synonym word library of each sample feature word, updating the weight of the sample word library includes: Determine the synonym word library of each sample feature word based on the pre-acquired synonym word library; Traverse the words in the synonym word library of the sample feature word, determine whether the sample feature word and the synonym word exist in the sample word library, and update the word frequency and document frequency; Based on the updated word frequency and the document frequency, an updated weight of the sample vocabulary is determined.
4. The method for extracting opinion feature words from comment information according to claim 3, characterized in that: Traversing the words in the synonym word library of the sample feature word, determining whether the sample feature word and the synonym word exist in the sample word library, and updating the word frequency and document frequency, including: Traversing the words in the synonym word library of the sample feature word to determine whether there is a synonym of the sample feature word in the sample word library; If so, determining the target document of the synonyms of the sample feature word in the sample word library; Determine whether the sample feature word exists in the target document.
5. The method for extracting opinion feature words from comment information according to claim 4, characterized in that: Traversing the words in the synonym word library of the sample feature word, determining whether the sample feature word and the synonym word exist in the sample word library, and updating the word frequency and document frequency, further comprising: If the sample feature word exists in the target document, the word frequency is increased by 1; Otherwise, the document frequency increases by 1.
6. The method for extracting opinion feature words from comment information according to claim 1, characterized in that: After the step of determining the weight of each sample feature word and generating a sample word library with weights, the method further includes: Determine the word weights of each sample feature word in different opinion polarity categories; The word weights in different opinion polarity classifications are sorted, and the words whose absolute values of word weights are greater than the first threshold are retained in order to generate a sample word library.
7. The method for extracting opinion feature words from comment information according to claim 6, characterized in that: Determining the chi-square value of each word in the updated weighted sample word library, and generating an opinion polarity dictionary based on the chi-square value, including: Determining the updated category weight parameter of each feature word in the weighted sample word library; Based on the category weight parameter, the chi-square value of each feature word is calculated using the chi-square test formula; Determining target sample feature words according to the chi-square value of each feature word; Based on the opinion polarity of the target sample feature words, an opinion polarity dictionary is generated; the opinion polarity dictionary includes a positive opinion dictionary and a negative opinion dictionary.
8. A device for extracting characteristic words of opinions from comment information, characterized in that: include: The word library generation module is used to determine the weight of each sample feature word and generate a sample word library with weights; A word library updating module, used for updating the weight of the sample word library based on the synonym word library of each sample feature word; An opinion polarity dictionary generation module, used to determine the chi-square value of each word in the updated weighted sample word library, and generate an opinion polarity dictionary based on the chi-square value; The opinion feature word extraction module is used to determine the polarity of the feature words extracted from the target comment information based on the opinion polarity dictionary, so as to determine the opinion feature words of the target comment information.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the method according to any one of claims 1 to 7.