Data mining method, device and computer readable storage medium

By converting comment sentences into sentence vectors and using a machine learning model to identify synonyms, the problem of being unable to identify synonyms in the existing technology is solved, and the accuracy of mining user opinions in comment data is improved.

CN111259159BActive Publication Date: 2024-10-18BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN201811453553.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-11-30
Publication Date
2024-10-18
Estimated Expiration
2038-11-30

AI Technical Summary

Technical Problem

Existing review opinion mining methods cannot identify synonyms, resulting in insufficient accuracy in mining user opinions in review data.

Method used

A pre-trained machine learning model is used to convert comment sentences into sentence vectors, and the contextual relationships of words are used to reflect semantics. The second machine learning model identifies synonyms to accurately mine the opinions in the comments.

Benefits of technology

Improved the recognition rate of synonyms and the accuracy of mining user opinions in review data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111259159B_ABST
    Figure CN111259159B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a data mining method, device and computer-readable storage medium, and relates to the field of computer technology. The method of the present disclosure includes: obtaining a comment sentence to be mined; using a pre-trained first machine learning model, according to the contextual relationship of words in the comment sentence to be mined, converting the comment sentence to be mined into a sentence vector; inputting the sentence vector into a pre-trained second machine learning model, and outputting the attribute words about the comment object in the comment sentence to be mined and the opinion words corresponding to the attribute words. The scheme of the present disclosure can improve the recognition rate of synonyms and improve the accuracy of mining user opinions in comment data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a data mining method, device and computer-readable storage medium. Background Art

[0002] With the rapid development of the Internet, the scale of data is growing exponentially. In the era of big data, a complete set of solutions for data collection, processing, storage and structured data analysis is becoming more mature. Compared with other data, user review data is often text-based and unstructured, which raises the threshold for mining product performance by analyzing user reviews. However, analyzing the advantages and disadvantages of products and the quality of services from user review feedback is of great guiding significance for optimizing products and services.

[0003] Currently, the more common review opinion mining methods include opinion mining methods based on vocabulary. The vocabulary stores the attributes of the review object and the corresponding opinion values ​​of the attributes, such as "taste" and "fragrant". The words in the review sentence are matched according to the vocabulary to determine the attributes of the review object in the review sentence and the corresponding opinion values ​​of the attributes. Summary of the invention

[0004] The inventor found that the existing review opinion mining methods cannot identify synonyms. There are many different terms in online user reviews. For example, mellow, fragrant, pure, etc. are synonyms, but the existing methods cannot recognize all of them. Therefore, the existing methods cannot accurately mine the opinions in the reviews.

[0005] A technical problem to be solved by the present disclosure is to improve the accuracy of mining user opinions in comment data.

[0006] According to some embodiments of the present disclosure, a data mining method is provided, including: obtaining comment sentences to be mined; using a pre-trained first machine learning model to convert the comment sentences to be mined into sentence vectors according to the contextual relationship between words in the comment sentences to be mined; inputting the sentence vectors into a pre-trained second machine learning model, and outputting attribute words about the comment object in the comment sentences to be mined and opinion words corresponding to the attribute words.

[0007] In some embodiments, using a pre-trained first machine learning model, converting the comment sentences to be mined into sentence vectors according to the contextual relationship between words in the comment sentences to be mined includes: segmenting the comment sentences to be mined; inputting the segmented words into the pre-trained first machine learning model so as to output the word vectors of each segmented word according to the contextual relationship between words in the comment sentences to be mined; adding the word vectors of each segmented word in the comment sentences to be mined to obtain the sentence vector of the comment sentences to be mined.

[0008] In some embodiments, the method also includes: obtaining comment sentences for training, the comment sentences for training are annotated with attribute words about the comment object and opinion words corresponding to the attribute words; using a pre-trained first machine learning model to convert the comment sentences for training into sentence vectors based on the contextual relationship between words in the comment sentences for training; and training the second machine learning model using the sentence vectors of the comment sentences for training.

[0009] In some embodiments, the method further includes: marking attribute words about the review object and opinion words corresponding to the attribute words in the review sentence according to the syntactic structure of the review sentence and the part of speech of each participle, as the review sentence for training.

[0010] In some embodiments, based on the syntactic structure of the comment sentence and the part of speech of each participle, marking the attribute words about the comment object and the opinion words corresponding to the attribute words in the comment sentence includes: selecting a comment sentence fragment with a preset syntactic structure, and marking the participles in the comment sentence fragment as the attribute words about the comment object and the opinion words corresponding to the attribute words; or determining nouns and adjectives whose distance is within a preset range from the comment sentence, marking the noun as the attribute word about the comment object, and marking the adjective as the opinion word corresponding to the attribute word.

[0011] In some embodiments, the method also includes: determining candidate attribute words about the comment object and candidate opinion words corresponding to the candidate attribute words as candidate phrases based on the syntactic structure of the comment sentence and the part of speech of each participle; and marking attribute words about the comment object and opinion words corresponding to the attribute words in the comment sentence as comment sentences for training based on at least one of the following information: the importance of the candidate phrases in the comment sentence and the relevance of the candidate attribute words and the candidate opinion words in the candidate phrases.

[0012] In some embodiments, the importance of a candidate phrase in a comment sentence is determined based on the frequency of occurrence of the candidate phrase in the comment sentence, the total number of comment sentences in a comment sentence set, and the number of comment sentences in which the candidate phrase appears; or the relevance of the candidate attribute words and the candidate opinion words in the candidate phrase is determined based on the probability that the candidate attribute words and the candidate opinion words appear simultaneously in one comment sentence in the comment sentence set and the probability that the candidate attribute words and the candidate opinion words appear respectively in the comment sentence set.

[0013] In some embodiments, the method further includes: filtering the comment sentences in the comment sentence set according to at least one of a blacklist of words, word repetition and length of the comment sentence, and selecting the filtered comment data as the comment data sentences for training; or selecting the comment sentences with an importance higher than a threshold as the comment sentences for training according to the importance of the comment sentences in the comment sentence set.

[0014] In some embodiments, the importance of a comment statement is determined based on the importance of each participle of the comment statement in a set of comment statements; the importance of a participle in a set of comment statements is determined based on the frequency of occurrence of the participle in each comment statement, the total number of comment statements in the set of comment statements, and the number of comment statements in which the participle appears; or the importance of a participle in a set of comment statements is determined based on the number of times the participle appears together with other participles in a window of a preset length.

[0015] According to other embodiments of the present disclosure, a data mining device is provided, including: a comment acquisition module, used to acquire comment sentences to be mined; a vector conversion module, used to convert the comment sentences to be mined into sentence vectors according to the contextual relationship between words in the comment sentences to be mined, using a pre-trained first machine learning model; and an opinion mining module, used to input the sentence vectors into a pre-trained second machine learning model, and output attribute words about the comment object in the comment sentences to be mined and the opinion words corresponding to the attribute words.

[0016] In some embodiments, the vector conversion module is used to segment the comment sentences to be mined; the segmented words are input into a pre-trained first machine learning model so as to output the word vectors of each segmented word according to the contextual relationship between the segmented words in the comment sentences to be mined; the word vectors of each segmented word in the comment sentences to be mined are added together to obtain the sentence vector of the comment sentences to be mined.

[0017] In some embodiments, the device also includes: a training sentence acquisition module and a training module; a training sample acquisition module is used to acquire comment sentences for training, and the comment sentences for training are annotated with attribute words about the comment object and opinion words corresponding to the attribute words; a vector conversion module is used to use a pre-trained first machine learning model to convert the comment sentences for training into sentence vectors according to the contextual relationship between words in the comment sentences for training; and the training module is used to train the second machine learning model using the sentence vectors of the comment sentences for training.

[0018] In some embodiments, the device also includes: a first training sample generation module, which is used to mark attribute words about the comment object and opinion words corresponding to the attribute words in the comment sentence according to the syntactic structure of the comment sentence and the part of speech of each word, as a comment sentence for training.

[0019] In some embodiments, the first training sample generation module is used to select comment sentence fragments whose syntactic structure is a preset structure, and mark the participles in the comment sentence fragments as attribute words about the comment object and opinion words corresponding to the attribute words; or determine nouns and adjectives whose distance is within a preset range from the comment sentence, mark the noun as an attribute word about the comment object, and mark the adjective as an opinion word corresponding to the attribute word.

[0020] In some embodiments, the device also includes: a second training sample generation module, which is used to determine candidate attribute words about the comment object and candidate opinion words corresponding to the candidate attribute words as candidate phrases based on the syntactic structure of the comment sentence and the part of speech of each participle; and mark the attribute words about the comment object and the opinion words corresponding to the attribute words in the comment sentence as comment sentences for training based on at least one of the importance of the candidate phrases in the comment sentence and the correlation between the candidate attribute words and the candidate opinion words in the candidate phrases.

[0021] In some embodiments, the importance of a candidate phrase in a comment sentence is determined based on the frequency of occurrence of the candidate phrase in the comment sentence, the total number of comment sentences in a comment sentence set, and the number of comment sentences in which the candidate phrase appears; or the relevance of the candidate attribute words and the candidate opinion words in the candidate phrase is determined based on the probability that the candidate attribute words and the candidate opinion words appear simultaneously in one comment sentence in the comment sentence set and the probability that the candidate attribute words and the candidate opinion words appear respectively in the comment sentence set.

[0022] In some embodiments, the device also includes: a comment sentence filtering module, which is used to filter the comment sentences in the comment sentence set according to at least one of a blacklist of words, word repetition and the length of the comment sentence, and select the filtered comment data as the comment data sentences for training; or according to the importance of the comment sentences in the comment sentence set, select the comment sentences with an importance higher than a threshold as the comment sentences for training.

[0023] In some embodiments, the importance of a comment statement is determined based on the importance of each participle of the comment statement in a set of comment statements; the importance of a participle in a set of comment statements is determined based on the frequency of occurrence of the participle in each comment statement, the total number of comment statements in the set of comment statements, and the number of comment statements in which the participle appears; or the importance of a participle in a set of comment statements is determined based on the number of times the participle appears together with other participles in a window of a preset length.

[0024] According to some further embodiments of the present disclosure, a data mining device is provided, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute the data mining method of any of the aforementioned embodiments based on instructions stored in the memory.

[0025] According to some further embodiments of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the program is executed by a processor, the data mining method of any of the aforementioned embodiments is implemented.

[0026] In the present disclosure, the comment sentences to be mined are converted into sentence vectors according to the contextual relationship of the words in the comment sentences to be mined through a pre-trained first machine learning model. Furthermore, the sentence vectors are input into a pre-trained second machine learning model, and the attribute words about the comment object in the comment sentences to be mined and the opinion words corresponding to the attribute words can be obtained. Since the contextual relationship of words can reflect the semantics of the words, the conversion of comment sentences into sentence vectors can reflect the semantics of the words in the comment sentences, and words with similar semantics can generate similar vectors. Further, similar vectors can be identified by the second machine learning model. Therefore, the scheme of the present disclosure can improve the recognition rate of synonyms and improve the accuracy of mining user opinions in comment data.

[0027] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0029] Figure 1 A flowchart diagram showing a data mining method according to some embodiments of the present disclosure is provided.

[0030] Figure 2 A schematic flowchart of a data mining method according to some other embodiments of the present disclosure is shown.

[0031] Figure 3 A schematic diagram showing the structure of a data mining device according to some embodiments of the present disclosure.

[0032] Figure 4 A schematic diagram showing the structure of a data mining device according to some other embodiments of the present disclosure.

[0033] Figure 5A schematic diagram showing the structure of a data mining device according to some other embodiments of the present disclosure.

[0034] Figure 6 A schematic diagram showing the structure of a data mining device according to some further embodiments of the present disclosure. DETAILED DESCRIPTION

[0035] The technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present disclosure and its application or use. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0036] The present disclosure provides a data mining method that can improve the accuracy of mining user opinions in comment data. Figure 1 Some embodiments of the data mining method of the present disclosure are described.

[0037] Figure 1 Flowcharts of some embodiments of the data mining method disclosed in the present invention. Figure 1 As shown, the method of this embodiment includes: steps S102 to S106.

[0038] In step S102, the comment sentences to be mined are obtained.

[0039] For example, the user's comment statements on the product (ie, the comment object) are obtained from the product comment area, etc., and then opinion mining is performed to determine the user's opinion on the product.

[0040] In step S104, the pre-trained first machine learning model is used to convert the comment sentences to be mined into sentence vectors according to the contextual relationship between words in the comment sentences to be mined.

[0041] The first machine learning model is, for example, a word2vec model or a doc2vec model. Due to the semantic relevance between words, these models can generate a word vector for a word based on the context of the word, reflecting the semantics of the word. Therefore, synonyms can be represented by similar word vectors. For example, the word vectors of "sweet and sour" and "sour and sweet" are similar.

[0042] The sentence vector can be directly obtained by using the first machine learning model, such as the doc2vec model, or the word vector can be obtained by using the first machine learning model, and then the sentence vector is obtained based on the word vector. In some embodiments, the comment sentence to be mined is segmented; the segmented words are input into the pre-trained first machine learning model so that the word vectors of each segmented word are output according to the before-after association relationship of the segmented words in the comment sentence to be mined; the word vectors of each segmented word in the comment sentence to be mined are added together to obtain the sentence vector of the comment sentence to be mined.

[0043] In step S106, the sentence vector is input into the pre-trained second machine learning model, and the attribute words about the comment object in the comment sentence to be mined and the opinion words corresponding to the attribute words are output.

[0044] The attribute words about the review object and the opinion words corresponding to the attribute words in the review sentence to be mined are used to express the user's evaluation of the review object. For example, the attribute word is "quality" and the opinion word is "good".

[0045] The second machine learning model is, for example, a seq2seq (sequence to sequence) model. The input sequence and output sequence of the seq2seq model may not be of equal length, and the number of words contained in the output sequence may be set, that is, the beam size may be set. The seq2seq model includes two parts, an encoder and a decoder, and both the encoder and the decoder are composed of RNN (Recurrent Neural Network). The encoder is used to input the sentence vector of the comment sentence to be mined, and the decoder is used to output the attribute words about the comment object and the opinion words corresponding to the attribute words. The decoder outputs the attribute words and opinion words one by one, and can obtain the probability of outputting each word each time.

[0046] The following describes the process of each word in the decoder output sequence with beam size = 2. (1) When the decoder outputs the first word, the two words with the highest probability are selected as the current sequence. (2) When generating the next word, the current sequence is combined with all the words in the vocabulary to obtain a new sequence, which is then input into the decoder to obtain the probability of each word output by the decoder, and the two words with the highest probability are selected as the current sequence. (3) Repeat step (2) until the end symbol is encountered. Finally, the two sequences with the highest probability are output. The vocabulary stores the attribute words obtained based on the training samples and the opinion words corresponding to the attribute words. The subsequent embodiments will describe the generation process of the vocabulary.

[0047] The seq2seq model belongs to the existing model, and the specific process inside the model will not be repeated. The existing seq2seq model generally inputs the one-hot vector of the sentence and cannot recognize synonyms. The present disclosure combines the first machine learning model (such as word2vec or doc2vec, etc.) with a deep neural network model such as the seq2seq model and applies it to the comment opinion mining scenario. Based on the training of a large amount of data, it can recognize synonyms and improve the accuracy of comment opinion mining.

[0048] In the method of the above embodiment, the comment sentence to be mined is converted into a sentence vector according to the contextual relationship of the words in the comment sentence to be mined through a pre-trained first machine learning model. Further, the sentence vector is input into a pre-trained second machine learning model, and the attribute words about the comment object in the comment sentence to be mined and the opinion words corresponding to the attribute words can be obtained. Since the contextual relationship of words can reflect the semantics of words, the conversion of comment sentences into sentence vectors can reflect the semantics of words in the comment sentences, and words with similar semantics can generate similar vectors. Further, similar vectors can be identified by the second machine learning model. Therefore, the scheme of the above embodiment can improve the recognition rate of synonyms and improve the accuracy of mining user opinions in comment data.

[0049] The above embodiment uses a first machine learning model and a second machine learning model. Both models need to be trained in advance. Usually, training samples need to be manually labeled. The present disclosure also proposes a method for automatically generating training samples. Figure 2 Give a description.

[0050] Figure 2 Flowcharts of other embodiments of the data mining method disclosed in the present invention. Figure 2 As shown, the method of this embodiment includes: steps S202 to S214.

[0051] In step S202, a set of comment statements is obtained.

[0052] The review statement set may include user review statements for popular products on the e-commerce platform. For example, review statements for products with high search volume rankings. These products have more valid review statements.

[0053] In step S204, the comment statements in the comment statement set are filtered according to a preset filtering rule.

[0054] In some embodiments, invalid comment statements in a comment statement set are filtered according to at least one of a blacklist, word repetition, and the length of a comment statement. For example, the blacklist contains sensitive words, illegal words, etc., and the comment statements containing these words are filtered out according to the blacklist. For another example, the number of times a word is repeated in a comment statement can be used as the word repetition, and the comment statements whose word repetition times are higher than a threshold are filtered out. The word repetition in these comment statements is too high, and the amount of information is small, which is not conducive to the training of subsequent models. For example, a comment statement is "good, good, good!", and such a statement can be filtered out. For another example, comment statements whose length is less than a length threshold are filtered out. Other filtering rules can also be set according to actual needs to filter invalid comment statements in a comment statement set, not limited to the examples cited.

[0055] The method of the above embodiment can filter out comment sentences that contain little information and are not suitable for use as training samples, thereby improving the effect of model training and further improving the accuracy of subsequent use of the model to mine opinions in comments.

[0056] In step S206, based on the importance of the comment sentences in the comment sentence set, comment sentences with importance higher than a threshold are selected.

[0057] In some embodiments, the importance of a comment statement is determined based on the importance of each participle of the comment statement in a set of comment statements, and the importance of a participle in the set of comment statements is determined based on the frequency of occurrence of the participle in each comment statement, the total number of comment statements in the set of comment statements, and the number of comment statements in which the participle appears.

[0058] For example, LTP (Language Technology Platform) can be used to segment the comment sentences. The importance of a segmentation in a comment sentence can be determined based on the frequency of the segmentation in the comment sentence and the frequency of the segmentation in the comment sentence set. The frequency of the segmentation in the comment sentence is, for example, the ratio of the number of times the segmentation appears in the comment sentence to the total number of segmentations in the comment sentence.

[0059] For example, the TF-IDF (Term Frequency–Inverse Document Frequency) algorithm can be used to calculate the importance of a segmentation in a comment sentence, that is, the importance of a segmentation in a comment sentence is the TF-IDF value of the segmentation in the comment sentence. The TF-IDF value of a segmentation in a comment sentence is the product of the frequency (TF) of the segmentation in the comment sentence and the inverse document frequency (IDF). Inverse document frequency (IDF) = log [total number of comment sentences / (number of comment sentences in which the segmentation appears + 1)]. The importance of a segmentation in a set of comment sentences can be the sum of the importance of the segmentation in each comment sentence.

[0060] Furthermore, the importance of a comment sentence in the comment sentence set is, for example, the sum of the importance of each word in the comment sentence in the comment sentence set.

[0061] In some embodiments, the importance of a comment statement is determined based on the importance of each participle of the comment statement in the comment statement set. The importance of a participle in the comment statement set is determined based on the number of times the participle appears together with other participles in a window of a preset length. For example, the importance of a comment statement is the sum of the importance of each participle of the comment statement in the comment statement set.

[0062] For example, the TextRank algorithm can be used to calculate the importance of a segmentation in a set of comment sentences. The main steps of the TextRank algorithm are as follows. (1) The comment sentences are segmented and tagged, and stop words are filtered out, retaining only words with specified parts of speech, such as nouns, verbs, and adjectives. (2) Construct a segmentation graph G = (V, E), where V is a node set consisting of the segmentations generated by (1), and then use the co-occurrence relationship to construct an edge between any two points. An edge exists between two nodes only if their corresponding segmentations co-occur in a window of length K, where K represents the window size, that is, at most K segmentations co-occur. (3) According to the following formula, iteratively propagate the weight of each node until convergence. The weight of each node is the importance of the segmentation of each node.

[0063]

[0064] In formula (2), WS(V i ) represents node V i The weight of WS(V j ) represents node V j The weight of, i, j, k are positive integers, d is the damping coefficient, ranging from 0 to 1, representing the probability of moving from a specific node value to any other node in the graph. In(V i ) indicates pointing to node Vi The collection of nodes, Out(V j ) indicates that the node V j The set of nodes pointed to, w ji Represents node V j To V i The weight of the edge between jk Represents node V j To V k For example, the weight of the edge between word A of one node and word B of another node represents the ratio of the number of times word A and B appear together in a window of a preset length (e.g., K) to the number of times word A and words other than A appear together in a window of a preset length.

[0065] In some embodiments, the TF-IDF value and TextRank value of each comment statement in the comment statement set are calculated, and comment statements whose TF-IDF value and TextRank value are respectively higher than corresponding thresholds are selected, or comment statements whose sum of TF-IDF value and TextRank value is higher than the corresponding threshold are selected.

[0066] The method of the above embodiment can select relatively important comment sentences as training samples and filter out low-quality comment sentences. For example, system-provided comments such as "satisfactory service, fast delivery, good quality, practical, five-star praise" can be filtered out.

[0067] In step S208, based on the syntactic structure of the comment sentence and the part of speech of each participle, attribute words about the comment object and viewpoint words corresponding to the attribute words are marked in the selected comment sentence as the comment sentence for training. The comment sentence for training is the training sample.

[0068] The syntactic structure of the comment sentence and the part of speech of each word are determined, for example, using the LTP platform. The LTP platform can segment each comment text and mark the part of speech of each word (such as noun, verb, adjective, etc.), and can also identify the syntactic structures such as "subject, predicate, object", "attributive, adverbial, complement" of different segments of the comment sentence.

[0069] In some embodiments, a comment sentence segment with a preset syntactic structure is selected, and the segmented words in the comment sentence segment are marked as attribute words about the comment object and the viewpoint words corresponding to the attribute words. And / or, nouns and adjectives whose distance is within a preset range are determined from the comment sentence, and the nouns are marked as attribute words about the comment object, and the adjectives are marked as the viewpoint words corresponding to the attribute words.

[0070] The preset structure is, for example, a syntactic structure of a subject-predicate relationship. A comment sentence fragment of a subject-predicate relationship contains a noun and an adjective group that can be used as an attribute word and an opinion word corresponding to the attribute word. Since attribute words are generally nouns, opinion words are generally adjectives, and opinion words are used to modify attribute words, they are highly correlated and close in the text. Therefore, the comments can be segmented according to punctuation marks to generate comment fragments, a window can be set corresponding to a preset range, and for each comment fragment, the nouns and adjectives within the window range are paired as attribute words and corresponding opinion words.

[0071] The attribute words and opinion words obtained according to the syntactic structure and the attribute words and opinion words determined by the distance can be merged to increase the recall rate of the attribute words and opinion words. Further, the obtained attribute words and opinion words can be stored in a dictionary. The dictionary is the dictionary used for seq2seq in step S106.

[0072] Through the method of the above embodiment, the attribute words and opinion words of the comment sentence can be automatically annotated, thereby improving the generation efficiency of training samples.

[0073] In some embodiments, step S208 can be replaced by: determining candidate attribute words about the comment object and candidate opinion words corresponding to the candidate attribute words as candidate phrases based on the syntactic structure of the comment sentence and the part of speech of each participle; marking attribute words about the comment object and opinion words corresponding to the attribute words in the comment sentence as a comment sentence for training (not shown in the figure) based on at least one of the importance of the candidate phrase in the comment sentence and the correlation between the candidate attribute words and the candidate opinion words in the candidate phrase.

[0074] In some embodiments, the importance of the candidate phrase in the comment sentence is determined based on the frequency of the candidate phrase in the comment sentence, the total number of comment sentences in the comment sentence set, and the number of comment sentences in which the candidate phrase appears. For example, the TF-IDF algorithm is used to calculate the TF-IDF value of the candidate phrase in the comment sentence as the importance of the candidate phrase in the comment sentence.

[0075] In some embodiments, the correlation between the candidate attribute words and the candidate opinion words in the candidate phrase is determined based on the probability that the candidate attribute words and the candidate opinion words appear in one comment sentence in the comment sentence set at the same time, and the probability that the candidate attribute words and the candidate opinion words appear in the comment sentence set respectively. For example, the PMI (Pointwise Mutual Information) algorithm can be used to calculate the correlation between the candidate attribute words and the candidate opinion words in the candidate phrase. The PMI algorithm formula is as follows.

[0076]

[0077] In formula (1), a and b represent the candidate attribute words and candidate opinion words in the candidate phrase, respectively. P(a, b) represents the probability that the candidate attribute words and candidate opinion words appear in the same comment sentence in the comment sentence set. P(a) and P(b) represent the probability that the candidate attribute words and candidate opinion words appear in the comment sentence set, respectively.

[0078] Through the method of the above embodiment, more important and more accurate attribute words and opinion words corresponding to the attribute words can be further screened out, thereby improving the accuracy of training samples and further improving the effect of model training.

[0079] In step S210, a review sentence for training is obtained. The review sentence for training is annotated with attribute words about the review object and opinion words corresponding to the attribute words according to the method in the above steps.

[0080] In step S212, the pre-trained first machine learning model is used to convert the training comment sentence into a sentence vector according to the contextual relationship of the words in the training comment sentence.

[0081] The first machine learning model, such as a word2vec model, also needs to be pre-trained, and the training process will not be described here.

[0082] In step S214, the second machine learning model is trained using the sentence vectors of the review sentences used for training.

[0083] For example, the comment sentence is "The appearance is very beautiful", and the sentence vector generated by the pre-trained first machine learning model is "0.14, 0.11, 0.4...", and the attribute words and the corresponding opinion words are marked as "beautiful appearance". Such a comment sentence can be used as a training sample to train the second machine learning model.

[0084] Through the method of the above embodiment, the effect of model training can be improved, the accuracy of the model can be improved, and further, the accuracy of mining comment opinions can be improved.

[0085] The present disclosure also provides a data mining device, Figure 3 Give a description.

[0086] Figure 3 Figure 1 is a structural diagram of some embodiments of the data mining device disclosed in the present invention. Figure 3 As shown, the device 30 of this embodiment includes: a comment acquisition module 302 , a vector conversion module 304 , and an opinion mining module 306 .

[0087] The comment acquisition module 302 is used to acquire the comment sentences to be mined.

[0088] The vector conversion module 304 is used to convert the comment sentence to be mined into a sentence vector according to the contextual relationship of words in the comment sentence to be mined, using the pre-trained first machine learning model.

[0089] In some embodiments, the vector conversion module 304 is used to segment the comment sentences to be mined; the segmented words are input into a pre-trained first machine learning model so as to output the word vectors of each segmented word according to the contextual relationship between the segmented words in the comment sentences to be mined; the word vectors of each segmented word in the comment sentences to be mined are added together to obtain the sentence vector of the comment sentences to be mined.

[0090] The opinion mining module 306 is used to input the sentence vector into a pre-trained second machine learning model, and output the attribute words about the comment object in the comment sentence to be mined and the opinion words corresponding to the attribute words.

[0091] Combine the following Figure 4 Other embodiments of the data mining apparatus disclosed herein are described.

[0092] Figure 4 FIG. 1 is a structural diagram of some other embodiments of the data mining device disclosed in the present invention. Figure 4 As shown, the device 40 of this embodiment includes: a comment acquisition module 402, a vector conversion module 404, and an opinion mining module 406, which have the same or similar functions as the comment acquisition module 302, the vector conversion module 304, and the opinion mining module 306 respectively; and a training sentence acquisition module 408 and a training module 410.

[0093] In some embodiments, the training sample acquisition module 408 is used to acquire the review sentences for training, and the review sentences for training are annotated with the attribute words about the review object and the opinion words corresponding to the attribute words. The vector conversion module 404 is also used to use the pre-trained first machine learning model to convert the review sentences for training into sentence vectors according to the contextual relationship between the words in the review sentences for training. The training module 410 is used to train the second machine learning model using the sentence vectors of the review sentences for training.

[0094] In some embodiments, the device 40 also includes: a first training sample generating module 412, which is used to mark attribute words about the comment object and opinion words corresponding to the attribute words in the comment sentence according to the syntactic structure of the comment sentence and the part of speech of each word segment, as a comment sentence for training.

[0095] Furthermore, the first training sample generation module 412 is used to select comment sentence fragments whose syntactic structure is a preset structure, and mark the participles in the comment sentence fragments as attribute words about the comment object and opinion words corresponding to the attribute words; or determine nouns and adjectives whose distances are within a preset range from the comment sentence, mark the nouns as attribute words about the comment object, and mark the adjectives as opinion words corresponding to the attribute words.

[0096] In some embodiments, the device 40 also includes: a second training sample generating module 414, which is used to determine candidate attribute words about the comment object and candidate opinion words corresponding to the candidate attribute words as candidate phrases based on the syntactic structure of the comment sentence and the part of speech of each participle; and to mark the attribute words about the comment object and the opinion words corresponding to the attribute words in the comment sentence as comment sentences for training based on at least one of the importance of the candidate phrases in the comment sentence and the correlation between the candidate attribute words and the candidate opinion words in the candidate phrases.

[0097] Furthermore, the importance of a candidate phrase in a comment sentence is determined based on the frequency of occurrence of the candidate phrase in the comment sentence, the total number of comment sentences in a comment sentence set, and the number of comment sentences in which the candidate phrase appears; or the relevance of a candidate attribute word and a candidate opinion word in a candidate phrase is determined based on the probability that the candidate attribute word and the candidate opinion word appear simultaneously in one comment sentence in a comment sentence set and the probability that the candidate attribute word and the candidate opinion word appear respectively in the comment sentence set.

[0098] In some embodiments, the device 40 also includes: a comment sentence filtering module 416, which is used to filter the comment sentences in the comment sentence set according to at least one of a blacklist of words, word repetition and the length of the comment sentence, and select the filtered comment data as the comment data sentence for training; or according to the importance of the comment sentences in the comment sentence set, select the comment sentences with an importance higher than a threshold as the comment sentences for training.

[0099] Furthermore, the importance of a comment statement is determined based on the importance of each participle of the comment statement in the comment statement set; the importance of a participle in the comment statement set is determined based on the frequency of occurrence of the participle in each comment statement, the total number of comment statements in the comment statement set, and the number of comment statements in which the participle appears; or the importance of a participle in the comment statement set is determined based on the number of times the participle appears together with other participles in a window of a preset length.

[0100] The data mining apparatus in the embodiments of the present disclosure can be implemented by various computing devices or computer systems. Figure 5 as well as Figure 6 Give a description.

[0101] Figure 5 Figure 1 is a structural diagram of some embodiments of the data mining device disclosed in the present invention. Figure 5 As shown, the device 50 of this embodiment includes: a memory 510 and a processor 520 coupled to the memory 510, and the processor 520 is configured to execute the data mining method in any of some embodiments of the present disclosure based on the instructions stored in the memory 510.

[0102] The memory 510 may include, for example, a system memory, a fixed non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, a database, and other programs.

[0103] Figure 6 FIG. 1 is a structural diagram of some other embodiments of the data mining device disclosed in the present invention. Figure 6 As shown, the device 60 of this embodiment includes: a memory 610 and a processor 620, which are similar to the memory 510 and the processor 520 respectively. It can also include an input and output interface 630, a network interface 640, a storage interface 650, etc. These interfaces 630, 640, 650 and the memory 610 and the processor 620 can be connected, for example, through a bus 660. Among them, the input and output interface 630 provides a connection interface for input and output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 640 provides a connection interface for various networked devices, for example, it can be connected to a database server or a cloud storage server. The storage interface 650 provides a connection interface for external storage devices such as SD cards and USB flash drives.

[0104] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable non-transient storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0105] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0106] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0107] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0108] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.

Claims

1. A data mining method, comprising: According to the importance of the comment sentences in the comment sentence set, the comment sentences with importance higher than a threshold are selected as the comment sentences for training, wherein the comment sentences for training are annotated with attribute words about the comment object and opinion words corresponding to the attribute words, the importance of the comment sentence is determined according to the importance of each participle of the comment sentence in the comment sentence set, the importance of the participle in the comment sentence set is determined according to the frequency of occurrence of the participle in each comment sentence, the total number of comment sentences in the comment sentence set, the number of comment sentences in which the participle appears, or the importance of the participle in the comment sentence set is determined according to the number of times the participle appears together with other participles in a window of a preset length; Using a pre-trained first machine learning model, converting the training review sentence into a sentence vector according to the contextual relationship of words in the training review sentence; Training a second machine learning model using the sentence vector of the review sentence used for training, wherein the second machine learning model is a deep neural network model; Get the comment sentences to be mined; Using a pre-trained first machine learning model, the comment sentence to be mined is converted into a sentence vector according to the contextual relationship of words in the comment sentence to be mined; The sentence vector is input into a pre-trained second machine learning model, and the attribute words about the comment object in the comment sentence to be mined and the opinion words corresponding to the attribute words are output.

2. The data mining method according to claim 1, wherein: The using of the pre-trained first machine learning model to convert the comment sentence to be mined into a sentence vector according to the contextual relationship of words in the comment sentence to be mined comprises: Segmenting the comment sentences to be mined; Input the segmented words into a pre-trained first machine learning model, so as to output the word vector of each segmented word according to the contextual relationship of the segmented words in the comment sentence to be mined; The word vectors of each word in the comment sentence to be mined are added together to obtain the sentence vector of the comment sentence to be mined.

3. The data mining method according to claim 1, further comprising: According to the syntactic structure of the comment sentence and the part of speech of each participle, attribute words about the comment object and opinion words corresponding to the attribute words are marked in the comment sentence as the comment sentence for training.

4. The data mining method according to claim 3, wherein: The method of marking attribute words about the review object and the viewpoint words corresponding to the attribute words in the review sentence according to the syntactic structure of the review sentence and the part of speech of each participle includes: Selecting a comment sentence fragment whose syntactic structure is a preset structure, marking the participles in the comment sentence fragment as attribute words about the comment object and opinion words corresponding to the attribute words; or Nouns and adjectives whose distances are within a preset range are determined from the comment sentences, the nouns are marked as attribute words about the comment object, and the adjectives are marked as opinion words corresponding to the attribute words.

5. The data mining method according to claim 1, further comprising: According to the syntactic structure of the comment sentence and the part of speech of each participle, candidate attribute words about the comment object and candidate opinion words corresponding to the candidate attribute words are determined as candidate phrases; According to at least one of the information of the importance of the candidate phrase in the comment sentence and the relevance of the candidate attribute words and the candidate opinion words in the candidate phrase, the attribute words about the comment object and the opinion words corresponding to the attribute words are marked in the comment sentence as the comment sentence for training.

6. The data mining method according to claim 5, wherein: The importance of the candidate phrase in the comment sentence is determined according to the frequency of occurrence of the candidate phrase in the comment sentence, the total number of comment sentences in the comment sentence set, and the number of comment sentences in which the candidate phrase appears; or The correlation between the candidate attribute words and the candidate opinion words in the candidate phrase is determined based on the probability that the candidate attribute words and the candidate opinion words appear simultaneously in one comment sentence in the comment sentence set and the probability that the candidate attribute words and the candidate opinion words appear respectively in the comment sentence set.

7. The data mining method according to claim 1, further comprising: The comment sentences in the comment sentence set are filtered according to at least one of a blacklist, a word repetition degree and a length of the comment sentence, and the filtered comment data are selected as the comment data sentences for training.

8. A data mining device, comprising: A comment sentence filtering module, used for selecting comment sentences with importance higher than a threshold as comment sentences for training according to the importance of comment sentences in a comment sentence set, wherein the comment sentences for training are annotated with attribute words about the comment object and opinion words corresponding to the attribute words, the importance of the comment sentence is determined according to the importance of each participle of the comment sentence in the comment sentence set, the importance of the participle in the comment sentence set is determined according to the frequency of occurrence of the participle in each comment sentence, the total number of comment sentences in the comment sentence set, the number of comment sentences in which the participle appears, or the importance of the participle in the comment sentence set is determined according to the number of times the participle appears together with other participles in a window of a preset length; A vector conversion module, used to convert the training comment sentence into a sentence vector according to the contextual relationship of words in the training comment sentence by using a pre-trained first machine learning model; A training module, used to train a second machine learning model using the sentence vectors of the review sentences used for training, wherein the second machine learning model is a deep neural network model; A comment acquisition module, used for acquiring comment sentences to be mined, wherein the vector conversion module is further used for converting the comment sentences to be mined into sentence vectors according to the contextual relationship of words in the comment sentences to be mined, using a pre-trained first machine learning model; The opinion mining module is used to input the sentence vector into a pre-trained second machine learning model, and output the attribute words about the comment object in the comment sentence to be mined and the opinion words corresponding to the attribute words.

9. The data mining device according to claim 8, wherein: The vector conversion module is used to segment the comment sentences to be mined; the segmented words are input into a pre-trained first machine learning model, so as to output the word vectors of each segmented word according to the before-and-after association relationship of the segmented words in the comment sentences to be mined; The word vectors of each word in the comment sentence to be mined are added together to obtain the sentence vector of the comment sentence to be mined.

10. The data mining device according to claim 8, further comprising: The first training sample generation module is used to mark attribute words about the review object and opinion words corresponding to the attribute words in the review sentence according to the syntactic structure of the review sentence and the part of speech of each participle, as the review sentence for training.

11. The data mining device according to claim 10, wherein: The first training sample generation module is used to select comment sentence fragments with a preset syntactic structure, and mark the participles in the comment sentence fragments as attribute words about the comment object and opinion words corresponding to the attribute words; or determine nouns and adjectives whose distances are within a preset range from the comment sentence, mark the noun as an attribute word about the comment object, and mark the adjective as an opinion word corresponding to the attribute word.

12. The data mining device according to claim 8, further comprising: The second training sample generation module is used to determine candidate attribute words about the review object and candidate opinion words corresponding to the candidate attribute words as candidate phrases according to the syntactic structure of the review sentence and the part of speech of each participle; According to at least one of the information of the importance of the candidate phrase in the comment sentence and the relevance of the candidate attribute words and the candidate opinion words in the candidate phrase, the attribute words about the comment object and the opinion words corresponding to the attribute words are marked in the comment sentence as the comment sentence for training.

13. The data mining device according to claim 12, wherein: The importance of the candidate phrase in the comment sentence is determined according to the frequency of occurrence of the candidate phrase in the comment sentence, the total number of comment sentences in the comment sentence set, and the number of comment sentences in which the candidate phrase appears; or The correlation between the candidate attribute words and the candidate opinion words in the candidate phrase is determined based on the probability that the candidate attribute words and the candidate opinion words appear simultaneously in one comment sentence in the comment sentence set and the probability that the candidate attribute words and the candidate opinion words appear respectively in the comment sentence set.

14. The data mining device according to claim 8, further comprising: The comment sentence filtering module is used to filter the comment sentences in the comment sentence set according to at least one of a blacklist, word repetition and comment sentence length, and select the filtered comment data as the comment data sentence for training.

15. A data mining device, comprising: Memory; as well as A processor coupled to the memory, wherein the processor is configured to execute the data mining method according to any one of claims 1 to 7 based on instructions stored in the memory.

16. A computer-readable storage medium having a computer program stored thereon, wherein: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Internet comment and opinion mining method and system on basis of product features

    CN103399916A

  • Public praise analysis method and apparatus for product review data

    CN106021433A

  • Emotion analysis method based on context word vectors and depth learning

    CN108427670A