A method and device for generating summary of target object

By clustering in the dimensions of the target object and the target area and selecting key sentences in combination with the inverse document frequency, the problems of rigid abstracts and homogeneity in the existing technology are solved, and high-quality and differentiated abstracts are generated, highlighting the targets The characteristics of the object.

CN113377949BActive Publication Date: 2025-02-21BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010161869.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-10
Publication Date
2025-02-21
Estimated Expiration
2040-03-10

AI Technical Summary

Technical Problem

The abstracts generated by the prior art are too rigid, with severe homogeneous sentences, unable to control the length of the sentence, and may extract subjective or specific words.

Method used

The initial clustering is performed in the target object dimension, and then the secondary clustering is performed in the target area dimension. The appropriate key sentences are selected as abstracts based on the inverse document frequency to reduce the appearance of repeated sentences and generate high-quality and differentiated abstracts.

Benefits of technology

The generated abstract is more qualitative and differentiated, can better highlight the characteristics of the target object, reduce subjectivity and homogeneity issues, and can control sentence length.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113377949B_ABST
    Figure CN113377949B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for generating summaries of target objects, relating to the field of computer technology. One specific implementation of the method includes: extracting key sentences from comment data of multiple target objects within a target region; calculating the similarity between key sentences belonging to the same target object to cluster the key sentences and obtain a basic classification under the target object dimension; calculating the similarity between first classification groups contained in the basic classifications belonging to different target objects to cluster the first classification groups and obtain a final classification under the target region dimension; calculating the inverse document frequency of a second classification group contained in the final classification with respect to the overall classification; calculating the score of the second classification group based on the inverse document frequency and a set weight; and selecting key sentences from the final classification as the summary of the target object based on the score. This implementation reduces the occurrence of duplicate sentences, generates high-quality, differentiated summaries, and better highlights the characteristics of the target object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for generating a summary of a target object. Background Art

[0002] In order to allow users to quickly and comprehensively obtain the characteristics and related information of the target object, Internet websites usually add text description information to the target object to show the target object to users. This text description information is called a summary in this application. The method of generating a summary in the prior art generally uses the TextRank algorithm to extract the summary of the target object, or by splitting the user's comment data on the target object, counting the sentences with high frequency, and then assembling the sentences with high frequency to obtain the summary.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] The summaries generated by the above method are too rigid, have serious sentence homogeneity problems, cannot control sentence length, and will extract some very subjective sentences or sentences containing specific words. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a method and device for generating a summary of a target object, which first performs an initial clustering on key sentences under the target object dimension, then performs a secondary clustering on the initial clustering results under the target area dimension, and selects appropriate key sentences as summaries in combination with the inverse document frequency, thereby reducing the occurrence of repeated sentences, generating high-quality and differentiated summaries, and better highlighting the characteristics of the target object.

[0006] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for generating a summary of a target object is provided.

[0007] A method for generating a summary of a target object according to an embodiment of the present invention includes: extracting key sentences from comment data of multiple target objects in a target area, calculating the similarity between key sentences belonging to the same target object to obtain a first similarity, clustering the key sentences according to the first similarity to obtain a basic classification under the target object dimension; calculating the similarity between first classification groups included in basic classifications belonging to different target objects to obtain a second similarity, clustering the first classification groups according to the second similarity to obtain a final classification under the target area dimension; calculating the inverse document frequency of the second classification group included in the final classification for the overall classification, calculating the score of the second classification group according to the inverse document frequency and a set weight, and selecting a key sentence from the final classification as a summary of the target object according to the score.

[0008] Optionally, the inverse document frequency of the second classification group included in the final classification for the overall classification is calculated, including: counting the sum of the numbers of the first classification groups included in the basic classification to obtain the number of all classification groups; counting the sum of the number of occurrences of all key sentences in the second classification group to obtain the number of occurrences of the second classification group; using the number of all classification groups as the numerator and the number of occurrences of the second classification group plus 1 as the denominator to perform a logarithmic operation to obtain the inverse document frequency.

[0009] Optionally, the score of the second classification group is calculated according to the inverse document frequency and set weights, including: according to the set weights, weighted addition of the inverse document frequency and the number of occurrences of the second classification group to obtain the score of the second classification group.

[0010] Optionally, selecting key sentences from the final classification according to the score includes: sorting the second classification groups included in the final classification in reverse order according to the score to select the first K second classification groups; wherein K is a positive integer; sorting the key sentences belonging to the first K second classification groups according to the number of occurrences of the key sentences in the second classification groups, and selecting the key sentences with the largest number of occurrences in the first K second classification groups.

[0011] Optionally, extracting key sentences from comment data of multiple target objects in a target area includes: treating each sentence contained in the comment data as a node, calculating the similarity between the nodes, and constructing a node connection graph based on the similarity; iteratively calculating the weights of the nodes based on the node connection graph and the similarity until the weights converge, and selecting the sentence corresponding to the node with the highest weight at the time of convergence as the key sentence.

[0012] Optionally, before the step of extracting key sentences of the comment data of multiple target objects in the target area, the method also includes: preprocessing the multiple comment data separately; wherein the preprocessing includes filtering processing and merging processing performed according to the set first filtering rule, and the merging processing includes: performing syntactic analysis on the sentences contained in the comment data separately to obtain the syntactic components of the sentences; using the set symbol as a segmentation marker, judging the syntactic structure of the first sentence after the symbol, and merging sentences with non-subject-predicate structure and non-attributive structure upwards; extracting the key sentences of the comment data of multiple target objects in the target area includes: extracting the key sentences of the preprocessed comment data.

[0013] Optionally, before the step of calculating the similarity between the first classification groups included in the basic classifications belonging to different target objects, the method also includes: performing sentiment analysis on the key sentences included in the basic classifications corresponding to the multiple target objects respectively; filtering the key sentences according to the sentiment analysis results and the set second filtering rules to obtain an optimized classification under the target object dimension; wherein the second filtering rule is used to retain the first classification group in which the number of key sentences with positive emotions is greater than the number of key sentences with negative emotions, and the retained key sentences are key sentences with positive emotions; calculating the similarity between the first classification groups included in the basic classifications belonging to different target objects to obtain a second similarity, and clustering the first classification groups according to the second similarity, includes: calculating the similarity between the classification groups included in the optimized classifications belonging to different target objects, and clustering the classification groups included in the optimized classifications according to the obtained similarity.

[0014] Optionally, after the step of selecting key sentences from the final classification as the summary of the target object according to the score, the method also includes: determining whether the summary contains set keywords, or whether the regular expression corresponding to the summary is in a set format; if the summary contains the keywords, or the regular expression corresponding to the summary is in the set format, correcting the summary using the set replacement information.

[0015] Optionally, after the step of extracting key sentences of the comment data of multiple target objects in the target area, the method further comprises: filtering the key sentences according to a set third filtering rule; wherein the third filtering rule is used to limit the length of the key sentences.

[0016] To achieve the above objective, according to another aspect of an embodiment of the present invention, a device for generating a summary of a target object is provided.

[0017] A summary generation device for a target object according to an embodiment of the present invention includes: an extraction clustering module, which is used to extract key sentences of comment data of multiple target objects in a target area, calculate the similarity between key sentences belonging to the same target object to obtain a first similarity, cluster the key sentences according to the first similarity to obtain a basic classification under the target object dimension; a secondary clustering module, which is used to calculate the similarity between first classification groups included in basic classifications belonging to different target objects to obtain a second similarity, cluster the first classification groups according to the second similarity to obtain a final classification under the target area dimension; and a summary generation module, which is used to calculate the inverse document frequency of the second classification group included in the final classification for the overall classification, calculate the score of the second classification group according to the inverse document frequency and a set weight, and select a key sentence from the final classification as a summary of the target object according to the score.

[0018] Optionally, the summary generation module is further used to: count the sum of the numbers of first classification groups included in the basic classification to obtain the number of all classification groups; count the sum of the occurrences of all key sentences in the second classification group to obtain the occurrences of the second classification group; use the number of all classification groups as the numerator and the number of occurrences of the second classification group plus 1 as the denominator to perform logarithmic operation to obtain the inverse document frequency.

[0019] Optionally, the summary generation module is further used to: perform weighted addition of the inverse document frequency and the number of occurrences of the second classification group according to a set weight, so as to obtain a score of the second classification group.

[0020] Optionally, the summary generation module is further used to: sort the second classification groups included in the final classification in reverse order according to the scores to select the top K second classification groups; wherein K is a positive integer; sort the key sentences belonging to the top K second classification groups according to the number of occurrences of the key sentences in the second classification groups, and select the key sentences with the largest number of occurrences in the top K second classification groups.

[0021] Optionally, the extraction clustering module is also used to: regard each sentence contained in the comment data as a node, calculate the similarity between the nodes, and construct a node connection graph based on the similarity; iteratively calculate the weight of the node based on the node connection graph and the similarity until the weight converges, and select the sentence corresponding to the node with the highest weight at convergence as the key sentence.

[0022] Optionally, the device also includes: a preprocessing module, used to preprocess the multiple comment data separately; wherein the preprocessing includes filtering processing and merging processing performed according to the set first filtering rule, and the merging processing includes: performing syntactic analysis on the sentences contained in the comment data separately to obtain the syntactic components of the sentences; using the set symbol as a segmentation marker, judging the syntactic structure of the first sentence after the symbol, and merging sentences with non-subject-predicate structure and non-attributive structure upwards; the extraction and clustering module is also used to: extract key sentences of the preprocessed comment data.

[0023] Optionally, the device also includes: an optimization module, which is used to perform sentiment analysis on the key sentences contained in the basic classifications corresponding to the multiple target objects respectively; according to the sentiment analysis results and the set second filtering rules, the key sentences are filtered to obtain the optimized classification under the target object dimension; wherein the second filtering rule is used to retain the first classification group in which the number of key sentences with positive emotions is greater than the number of key sentences with negative emotions, and the retained key sentences are key sentences with positive emotions; the secondary clustering module is also used to: calculate the similarity between the classification groups contained in the optimized classifications belonging to different target objects, and cluster the classification groups contained in the optimized classifications according to the obtained similarity.

[0024] Optionally, the device also includes: a correction module, used to determine whether the summary contains set keywords, or whether the regular expression corresponding to the summary is in a set format; if the summary contains the keywords, or the regular expression corresponding to the summary is in the set format, the summary is corrected using the set replacement information.

[0025] Optionally, the device further comprises: a filtering module, configured to filter the key sentences according to a set third filtering rule after extracting the key sentences of the comment data of the multiple target objects in the target area; wherein the third filtering rule is used to limit the length of the key sentences.

[0026] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.

[0027] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement a method for generating a summary of a target object according to an embodiment of the present invention.

[0028] To achieve the above objective, according to another aspect of the embodiments of the present invention, a computer readable medium is provided.

[0029] A computer-readable medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, a method for generating a summary of a target object according to an embodiment of the present invention is implemented.

[0030] One embodiment of the above invention has the following advantages or beneficial effects:

[0031] 1. First, the key sentences are clustered in the target object dimension, and then the primary clustering results are clustered again in the target area dimension. The appropriate key sentences are selected as summaries based on the inverse document frequency, which reduces the occurrence of repeated sentences, generates high-quality and differentiated summaries, and better highlights the characteristics of the target object.

[0032] 2. Calculate the inverse document frequency based on the number of occurrences of the second classification group, and then calculate the score of the second classification group in combination with the weight to reduce the score of the key sentence with a high number of occurrences. Performing a weighted summation operation on the inverse document frequency and the number of occurrences of the second classification group can reduce the score of the key sentence with a high number of occurrences and increase the score of the key sentence with a low number of occurrences, so that the key sentence finally selected is the data with a medium number of occurrences, further ensuring the quality and diversity of the generated summary.

[0033] 3. Based on the score and the number of occurrences of key sentences in the second classification group, key sentences are selected as the summary, further highlighting the characteristics of the target object. A node connection graph is constructed through the similarity between nodes, and then the node weight is calculated. Key sentences are selected from the comment data based on the weight, realizing the automatic extraction of key sentences and ensuring that the extracted key sentences can reflect the core meaning of the comment data. By pre-processing the comment data by filtering and merging, it is ensured that the data to be processed subsequently meets the data format requirements for generating summaries.

[0034] 4. Perform sentiment analysis on the key sentences contained in the basic classification, and filter the key sentences according to the sentiment analysis results, so that the generated summary reflects positive emotions and is easy to attract users. Use the set replacement information to correct the sentences in the summary that are not expressed in a written form, ensuring that the generated summary is more written and formal. The length of the key sentences is limited by the third filtering rule to prevent the generated summary from being too long or too short, which is flexible.

[0035] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0037] Figure 1 is a schematic diagram of the main steps of the method for generating a summary of a target object according to the first embodiment of the present invention;

[0038] Figure 2 is a schematic diagram of the main flow of a method for generating a summary of a target object according to Embodiment 2 of the present invention;

[0039] Figure 3 This is a schematic diagram of the classification of the top, middle and bottom parts of the comment data under the target object dimension according to the second embodiment of the present invention;

[0040] Figure 4 This is a schematic diagram of the main process of extracting key sentences according to the second embodiment of the present invention;

[0041] Figure 52 is a schematic diagram of the main flow of a method for generating a summary of a target object according to Embodiment 3 of the present invention;

[0042] Figure 6 is a schematic diagram of syntactic analysis results according to Embodiment 3 of the present invention;

[0043] Figure 7 is a schematic diagram of main modules of a device for generating a summary of a target object according to an embodiment of the present invention;

[0044] Figure 8 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0045] Fig. 9 It is a schematic diagram of the structure of a computer device suitable for implementing the electronic device of the embodiment of the present invention. DETAILED DESCRIPTION

[0046] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0047] At present, some companies own hundreds of thousands of hotels. The hotel descriptions displayed in the client's hotel list are generally not rich enough. In order to enrich the list content and highlight the hotel's characteristics so that users can obtain the hotel's characteristics more quickly and comprehensively, it is necessary to extract the hotel's description information and display it to users. Due to the large number of hotels, the manual handwriting method has a large workload. We need a method that can batch generate hotel summaries to highlight the hotel's selling points.

[0048] The existing methods mentioned in the background technology extract too rigid summaries and have serious sentence homogeneity problems. Homogeneity refers to high repetition, such as "the hotel is clean and hygienic", "convenient transportation" and similar sentences with high frequency. In addition, some sentences based on user subjectivity or containing specific words will be extracted, such as "the Forbidden City is very close to me" and "the bed is very comfortable, I like it very much". In addition, the length of the sentences contained in the summary in the prior art cannot be determined, and there is a problem of sentences being too long or too short, which is not attractive to users.

[0049] In order to solve the above problems, the present invention provides a method for generating a summary of a target object. While extracting hotel feature information, the method greatly reduces the number of sentences with high frequency, reduces the homogeneity problem, and can control the number of words in the sentence to prevent the sentence from being too long or too short.

[0050] In addition, when extracting key sentences from user review data, there may be typos. Although typos appear in the review data of a certain hotel, the number of occurrences in the target area (such as the whole province or the whole city) will be greatly reduced. When generating the summary, a threshold of the number of occurrences in the target area is set to avoid typos in the summary. The following is a detailed description in conjunction with the embodiments.

[0051] Figure 1 FIG. 1 is a schematic diagram of the main steps of the method for generating a summary of a target object according to the first embodiment of the present invention. Figure 1 As shown, the target object summary generation method of the first embodiment of the present invention mainly includes the following steps:

[0052] Step S101: extract key sentences from review data of multiple target objects in a target area, calculate the similarity between key sentences belonging to the same target object to obtain a first similarity, cluster the key sentences according to the first similarity, and obtain a basic classification under the target object dimension.

[0053] Obtain multiple comment data of multiple target objects in the target area, extract key sentences in each comment data in the same way, and then use the text similarity algorithm to calculate the similarity between any two key sentences belonging to the same target object, and cluster the key sentences with similarity greater than the first threshold into one category, so as to obtain the basic classification under the target object dimension. Among them, the basic classification of each target object contains at least one first classification group.

[0054] The following is an explanation of how to extract the key sentence of one of the comment data: each sentence contained in the comment data is regarded as a node, and the similarity between nodes is calculated to construct a node connection graph. Then, based on the node connection graph and the similarity between nodes, the weight of the node is iteratively calculated until the weight converges. The sentence corresponding to the node with the highest weight at convergence is selected as the key sentence of the comment data.

[0055] Step S102: Calculate the similarity between the first classification groups included in the basic classifications belonging to different target objects to obtain a second similarity, cluster the first classification groups according to the second similarity, and obtain a final classification under the target area dimension.

[0056] Use the text similarity algorithm to calculate the similarity between the first classification groups contained in the basic classification of any two target objects in the target area, cluster the first classification groups with similarity greater than the second threshold into one category, and obtain the final classification under the target area dimension. It should be noted that when calculating the similarity, the similarity between each first classification group of each target object in the target area and each first classification group of other target objects is calculated.

[0057] Step S103: Calculate the inverse document frequency of the second classification group included in the final classification for the overall classification, calculate the score of the second classification group according to the inverse document frequency and the set weight, and select a key sentence from the final classification as the summary of the target object according to the score.

[0058] The final classification contains at least one second classification group. The inverse document frequency of each second classification group relative to the overall classification is calculated, and then the inverse document frequency is weighted and added to the number of occurrences of the second classification group according to the set weight to obtain the score of each second classification group. The second classification groups included in the final classification are sorted in reverse order according to the score size, and the first K second classification groups are selected. The key sentences with the most occurrences are selected from the first K second classification groups as the summary of the target object, which can better highlight the characteristics of the target object.

[0059] Since the summary of the target object is derived based on the user's comment data, directly processing the comment data in Example 1 may cause the generated summary to have quality problems due to failure to meet the data format requirements for generating the summary. In order to solve this problem, the comment data needs to be preprocessed, which is described in detail below in conjunction with Example 2.

[0060] Figure 2 FIG. 1 is a schematic diagram of the main flow of the method for generating a summary of a target object according to the second embodiment of the present invention. Figure 2 As shown, the target object summary generation method of the second embodiment of the present invention mainly includes the following steps:

[0061] Step S201: Obtain comment data of multiple target objects in the target area and pre-process the multiple comment data. Pre-process the comment data of all target objects in the target area so that they meet the data format requirements set for generating summaries. In this embodiment, the target object can be any object with comment data, such as a hotel, an item, a service, etc.

[0062] In the embodiment, the preprocessing includes filtering and merging of the comment data. The filtering is implemented based on the setting of the first filtering rule, including pre-filtering before the merging and secondary filtering after the merging. The pre-filtering is used to filter out the comment data that does not meet the requirements. The secondary filtering is to filter the merged result of each comment data again.

[0063] After pre-filtering the comment data, each comment data obtained needs to be merged. When merging, a syntactic analysis tool can be used to perform syntactic analysis on each sentence in the comment data to obtain the syntactic components of each sentence (i.e., subject, predicate, object, attributive, adverbial, complement, etc.); then, a set symbol (such as punctuation mark) is used as a segmentation mark to determine the syntactic structure of the first sentence after the set symbol, so as to merge the sentences of the "non-subject-predicate / attributive-media" structure upwards.

[0064] Step S202: Extract the key sentences of each preprocessed comment data. The principle of extracting key sentences is: formulate a weighted scoring standard, score each sentence, and then use the sentences with the highest scores as key sentences. In the embodiment, it can be implemented based on the TextRank algorithm. For the specific implementation of this step, please refer to Figure 4 Description.

[0065] Step S203: Calculate the similarity between key sentences belonging to the same target object, and obtain the first similarity between key sentences contained in each target object. In the process of natural language processing, it is often involved in how to measure the similarity between two texts, use the similarity between texts to perform deduplication preprocessing on large-scale corpora, or find related names of a certain entity name.

[0066] The similarity between two key sentences is calculated as follows: the two key sentences are segmented, and then the word frequency-inverse document frequency of each word is calculated. Finally, the angle between the two key sentences is calculated based on the word frequency-inverse document frequency and the cosine similarity algorithm. The smaller the angle value, the higher the similarity between the two key sentences. The following example illustrates this.

[0067] Suppose the key sentences under a target object are: Sentence 1: "The service is very enthusiastic" and Sentence 2: "The service is particularly enthusiastic". First, perform word segmentation on Sentence 1 and Sentence 2 respectively. The word segmentation result of Sentence 1 is: {service, very, enthusiastic}, and the word segmentation result of Sentence 2 is: {service, especially, enthusiastic}. Therefore, we can know that the word set obtained by word segmentation is: {service, very, enthusiastic, especially}.

[0068] Then, the term frequency-inverse document frequency (TF-IDF) of each word is calculated. Specifically, the term frequency of each word in the word set in sentence A and sentence B is calculated respectively. The term frequency of sentence A is: service 1, very 1, enthusiasm 1, special 0, and the term frequency of sentence B is: service 1, very 0, enthusiasm 1, special 1; then the term frequency is vectorized, and the term frequency vector of sentence A is (1, 1, 1, 0), and the term frequency vector of sentence B is (1, 0, 1, 1).

[0069] Finally, based on the word frequency vectorization results, the cosine value between the angles of the two word frequency vectors is calculated. The larger the cosine value, the higher the similarity. The calculation formula for the cosine value between the angles of the two vectors is as follows:

[0070]

[0071] In this formula, cosθ is the cosine of the angle between vector a and vector b.

[0072] From the above formula, the cosine value of the angle between the two word frequency vectors can be calculated as:

[0073]

[0074] Step S204: Cluster the key sentences belonging to the same target object according to the first similarity to obtain the basic classification under the target object dimension. When clustering, a similarity threshold can be set in advance, which is referred to as the first threshold in this article. In the embodiment, the first threshold can be set to 0.6, 0.7, 0.8, etc. Taking the first threshold of 0.6 as an example, the key sentences with a first similarity greater than 0.6 are clustered into one category, and the key sentences with the most occurrences in each category are used as the group name of this classification group, and the basic classification under the target object dimension can be obtained.

[0075] Step S205: Calculate the similarity between the first classification groups in the basic classification belonging to different target objects to obtain a second similarity. The second similarity is the similarity between each first classification group of each target object in the target area and each first classification group of other target objects. The similarity calculation method of this step is the same as that of step S203, which will not be repeated here.

[0076] Step S206: Cluster the first classification groups belonging to different target objects according to the second similarity to obtain the final classification under the target area dimension. After calculating the second similarity, according to a preset similarity threshold (hereinafter referred to as the second threshold), such as 0.5, the classification groups with the second similarity greater than the second threshold are aggregated into one category to obtain the final classification under the target area dimension. The final classification includes at least one second classification group.

[0077] Step S207: Calculate the inverse document frequency of each second classification group of the final classification for the overall classification, so as to calculate the score of each second classification group of the final classification according to the inverse document frequency and the set weight. In order to calculate the inverse document frequency, it is necessary to first count the number of all classification groups and the number of occurrences of each second classification group, and then the inverse document frequency of each second classification group for the overall classification can be calculated according to Formula 2.

[0078] The inverse document frequency of a second classification group for the overall classification is calculated as follows:

[0079]

[0080] In this formula, the number of all classification groups is the sum of the number of first classification groups included in the basic classification, and the number of occurrences of the second classification group is the sum of the number of occurrences of all key sentences in the second classification group of the final classification.

[0081] The score calculation formula for a second classification group is as follows:

[0082] The score of the second classification group =

[0083] The number of occurrences of the second classification group * weight 1 + the IDF of the second classification group * weight 2

[0084] Formula 3

[0085] In this formula, weight 1 + weight 2 = 1, weight 1 > weight 2, and the specific values ​​can be set as weight 1 is 0.7 and weight 2 is 0.3 (this value is obtained by experiment).

[0086] Step S208: Determine the summary of the target object according to the score of each second classification group of the final classification and the number of occurrences of each key sentence in the second classification group. Sort the scores of each second classification group of the final classification in descending order, and select the first K second classification groups. Then, sort the key sentences belonging to the K second classification groups according to the number of occurrences, and select the key sentence with the largest number of occurrences in each second classification group as the summary of the target object. The value of K can be set by user.

[0087] See also Figure 3 , the classification of comment data under the target object dimension can be divided into three parts: head, middle and bottom. The head, middle and bottom are determined based on the proportion of the number of occurrences of a sentence. Figure 3 As shown, "clean and hygienic" has the highest proportion, and at the bottom is the characteristic style of the target object.

[0088] For a target object, "problematic comments" will theoretically appear at the bottom or in the middle, but if these comments are magnified to the target area, they will be very low and can only appear in the bottom classification. The head classification is solved by the inverse document frequency method. The high number of occurrences is in the head, and the high inverse document frequency is in the tail. Therefore, according to Formula 3, the middle part of the data can be obtained, so that the final summary information is obtained from the middle classification, ensuring the high quality and diversity of the obtained summary information.

[0089] Here, "problematic comments" refer to sentences with typos or sentences containing words specific to the target audience. For example, "This hotel is next to Tiananmen Square." Figure 3The sentence "The Forbidden City is indeed very close" may appear very frequently in the review data of this hotel, but if this sentence is viewed from a provincial perspective, the number of occurrences will be lower.

[0090] Figure 4 FIG. 1 is a schematic diagram of the main process of extracting key sentences according to the second embodiment of the present invention. Figure 4 As shown, the implementation method of key sentence extraction of the second embodiment of the present invention (i.e., step S202), taking the extraction of key sentences of a pre-processed comment data (hereinafter referred to as a given text) as an example, mainly includes the following steps:

[0091] Step S401: each sentence contained in the given text is regarded as a node, and the similarity between nodes is calculated. The formula for measuring the similarity between nodes is as follows:

[0092]

[0093] In the formula, S i , S j Respectively represent the i-th and j-th sentences of a given text, ω k Represents the words in the sentence, log(|S i |)、log(|S j |) represents the logarithm of the number of words in the i-th and j-th sentences respectively, and the numerator represents the number of the same word that appears in both the i-th and j-th sentences.

[0094] Step S402: Construct a node connection graph based on the similarity between nodes. A connection threshold is set in advance. If the similarity between nodes is greater than or equal to the connection threshold, the corresponding two sentences are considered similar, and there is an undirected weighted edge between the nodes; if the similarity between nodes is less than the connection threshold, there is no connection edge between the nodes. The node connection graph can be represented by G = (V, E, W), where V is a node set, E is a set of edges between nodes, and W is a set of weights on each edge.

[0095] Step S403: Iteratively calculate the weight of each node until convergence. The calculation formula of the node weight is as follows:

[0096]

[0097] Where V i 、V j Respectively represent the i-th and j-th nodes in the node set V; WS(V i ) indicates the node V after the last iteration i The weight of; d is the damping coefficient, which is generally set to 0.85; In(V i ) indicates pointing to V iThe node set of Out(V j ) indicates V j The set of other nodes pointed to; ω ij Represents node V i and node V j The similarities between.

[0098] When calculating the weight of a node for the first iteration, you need to customize the initial weight of the node. After multiple iterations, the weight of each node tends to be stable, and it is considered converged at this time.

[0099] Step S404: Sort the weights of the nodes, and use the sentences corresponding to the nodes with the highest weights as the key sentences. Assuming that the given text includes the two sentences "This hotel has great service" and "This is rare", "This hotel has great service" is representative and has a high degree of importance, so it will have a higher weight, while "This is rare" has no meaning and has a low degree of importance, so it has a low weight. The key sentence finally extracted is "This hotel has great service".

[0100] The second embodiment restricts the format of the comment data, but some of the comment data are negative comments. If the summary is generated based on the negative comments, it will not be able to attract users. In order to solve this problem, the third embodiment performs sentiment analysis on the extracted key sentences to filter out sentences with negative sentiment. The following is a detailed description.

[0101] Figure 5 FIG. 1 is a schematic diagram of the main flow of the method for generating a summary of a target object according to the third embodiment of the present invention. Figure 5 As shown, the target object summary generation method of the third embodiment of the present invention mainly includes the following steps:

[0102] Step S501: Obtain comment data of multiple target objects in the target area, and pre-process the multiple comment data. In this embodiment, the target object is a hotel. The pre-processing includes pre-filtering, merging, secondary filtering, etc. of the comment data of the hotel.

[0103] Pre-filtering is used to filter out comment data that does not meet the requirements, such as short sentences, repeated sentences, and sentences containing specified characters. The short sentences here can be sentences with a total number of words less than a specified value, and sentences with a number of words after a specified character less than a specified value. The specified characters can be defined by yourself, such as words, punctuation marks, mathematical symbols, special symbols, etc. that belong to the filter library. The filter library stores the words that need to be filtered out.

[0104] The repeated sentences here can be sentences with repeated characters or words greater than a specified value. For example, "Good good good hotel is very good", "This hotel, this hotel, this hotel is average". Sentences containing specified characters can be sentences containing filtered words, or sentences with the number of consecutive occurrences of punctuation marks, mathematical symbols, and special symbols greater than a specified number. For example, "The environment is very good,,,,", "It's okay ~~~~~~".

[0105] Merge each piece of comment data obtained after pre-filtering. In actual applications, due to the error in the recognition of punctuation marks by the syntactic analysis tool itself, the embodiments of the present invention provide a preferred merging method. That is, before syntactic analysis, first replace all punctuation marks in each sentence of the comment data with spaces, perform syntactic analysis on the replaced sentences to obtain the syntactic components of each sentence (i.e., subject, predicate, object, attributive, adverbial, complement, etc.); then, using spaces as the segmentation identifier, judge the syntactic structure of the first sentence after the space to merge the sentences with the "non-predicate / attributive-center" structure upward. The following is an example for illustration.

[0106] Suppose a piece of comment data obtained after pre-filtering is: "The staff's service is very good. Even non-guests coming to the lobby to borrow the toilet will be warmly guided. It can be seen that their service is quite in place. There will always be window screens first, for ventilation, which is very rare.", after replacing all punctuation marks in this text with spaces and performing syntactic analysis, the results are as Figure 6 shown.

[0107] After that, using spaces as the segmentation identifier, for Figure 6 each obtained sentence, perform upward merging. Taking the Figure 6 first 6 lines of sentences as an example, the first 5 lines of sentences are: [The staff], [Service], [Very], [Good], [ ], since the 5th line is a space, but the [Even] in the 6th line is marked as an adverbial-center structure, not a non-predicate / attributive-center structure, so it needs to be merged upward. Therefore, the merged sentence is: "The staff's service is very good. Even non-guests coming to the lobby to borrow the toilet will be warmly guided."

[0108] Secondary filtering is to filter the merging results of each piece of comment data again. For example, filter the repeated characters / words in the merged multiple sentences, filter sentences with a word count less than or equal to 2, etc. Still taking the above example, the results of secondary filtering are as follows:

[0109] The staff's service is very good. Even non-guests coming to the lobby to borrow the toilet will be warmly guided. It can be seen that their service is quite in place

[0110] There will always be window screens first

[0111] This is very rare

[0112] Step S502: Extract the key sentences of each pre-processed comment data. For the specific implementation of this step, please refer to Figure 4 Description.

[0113] Step S503: Calculate the similarity between key sentences belonging to the same target object to obtain the first similarity between key sentences contained in each target object. The implementation of this step is the same as step S203, and will not be repeated here.

[0114] Step S504: Cluster the key sentences belonging to the same target object according to the first similarity to obtain the basic classification under the target object dimension. Cluster the key sentences whose first similarity is greater than the first threshold into one category, and use the key sentence with the most occurrences in each category as the group name of this classification group, so as to obtain the basic classification under the target object dimension. The following is an example.

[0115] Assume that the key sentences for a hotel include: few taxis, high cost performance, high cost performance, good cost performance, good service, and convenient stores nearby. After the above clustering process, the basic classification corresponding to the hotel can be obtained. The specific results are shown in Table 1. As can be seen from Table 1, the basic classification includes 4 first classification groups.

[0116] Table 1 shows the basic classification results of hotels

[0117]

[0118] Step S505: sentiment analysis is performed on the key sentences in the basic classification corresponding to the multiple target objects respectively, and filtering is performed according to the set second filtering rule to obtain the optimized classification under the target object dimension. Sentiment analysis is performed on each key sentence in the basic classification of each target object respectively to determine the sentiment tendency of each key sentence, and then the key sentences are filtered according to the set second filtering rule to obtain the optimized classification corresponding to the multiple target objects, and the number of occurrences of each first classification group is counted.

[0119] The second filtering rule is: if the number of key sentences with negative emotions in a first classification group is greater than or equal to the number of key sentences with positive emotions, then the first classification group is discarded; if the number of key sentences with negative emotions in a first classification group is less than the number of key sentences with positive emotions, then the key sentences with positive emotions in the first classification group are retained. The second filtering rule is used to retain the key sentences with positive emotions in the first classification group where the number of key sentences with positive emotions is greater than the number of key sentences with negative emotions.

[0120] There are two ways to perform sentiment analysis on key sentences. One is based on a vocabulary, and the other is based on a machine learning algorithm. Machine learning requires the preparation of training sets and test sets, and then uses a classification algorithm to train the classification model. After the model is trained, sentiment analysis can be performed. The following uses the vocabulary as an example to illustrate.

[0121] The word library is constructed in advance based on the actual scenario of hotel review data. The word library includes the following dictionaries: stop word dictionary, positive evaluation word dictionary, negative evaluation word dictionary, degree word dictionary and negative word dictionary. Among them, stop words such as "of", "and", "between", etc., positive evaluation words such as "cheap", "clean", "beautiful", "good quality and low price", etc., negative evaluation words such as "dirty", "bad", "bad", etc., degree words such as "very good", "special", "ok", "ok", "general", etc., negative words such as "no", "maybe", "not", etc.

[0122] Each positive evaluation word, negative evaluation word and degree word has a score. The score of a positive evaluation word is 1, the score of a negative evaluation word is -1, and the scores of degree words are, for example, 3.0, 2.0, 0.8, 0.5, and 0.5 (corresponding to the above 5 degree words respectively).

[0123] Based on the above word library, the sentiment tendency of the keyword is calculated in the following way: the key sentence is segmented, and then the sentiment score of the key sentence is calculated according to each word obtained by the segmentation, and the sentiment tendency can be obtained from the sentiment score. The calculation formula of the sentiment score can be as follows:

[0124] Sentiment score = (-1) 否定词的个数 *The score of the degree word*The score of the evaluation word Formula 6 Taking "very high cost performance" as an example, the number of negative words is 0, the score of the degree word "very high" is 1, and the score of the evaluation word "high" is 1, then the sentiment score is 1*1*1=1, which is a key sentence with positive sentiment.

[0125] Step S506: Calculate the similarity between the classification groups in the optimized classifications belonging to different target objects, cluster the classification groups of the optimized classifications according to the similarity, and obtain the final classification under the target area dimension. The similarity calculation method of this step is the same as that of step S203, which will not be repeated here. The following example is used to illustrate.

[0126] Assume that the target area is a province, the target object is a hotel, there are N hotels in the province, each hotel has M review data, and there are N*M review data in total. According to steps S501-S505, these N*M review data are preprocessed, key sentence extracted, clustered, sentiment analyzed and filtered to obtain X classification groups. The similarity of the group names of these X classification groups is calculated. If the similarity of two group names is greater than 0.5, they are clustered into one category.

[0127] For the sake of convenience, it is assumed that there are two hotels in the province. After the review data of hotels 1 and 2 are processed respectively according to steps S501 to S505, the obtained optimization classification results are shown in Tables 2 and 3.

[0128] Table 2 shows the optimized classification results of the review data of Hotel 1

[0129]

[0130] Table 3 shows the optimized classification results of the review data of Hotel 2

[0131]

[0132]

[0133] After calculation, the similarity between "high cost performance" and "very good cost performance" is greater than 0.5, so these two classification groups can be classified into one category; the similarity between "very good service" and "very good service" is greater than 0.5, so these two classification groups can be classified into one category. Therefore, the final classification results under the provincial dimension are shown in Table 4.

[0134] Table 4 shows the final classification results of the comment data under the provincial dimension

[0135]

[0136] Step S507: Calculate the inverse document frequency of each second classification group of the final classification for the overall classification, so as to calculate the score of each second classification group of the final classification according to the inverse document frequency and the set weight. The implementation process of this step is the same as that of step S207, and will not be repeated here. However, since the optimized classification is obtained through the sentiment analysis of step S505 in this embodiment, the number of all classification groups in formula 2 is modified to the sum of the number of classification groups included in the optimized classification.

[0137] Step S508: Determine the summary of the target object according to the score of each second classification group of the final classification and the number of occurrences of each key sentence in the second classification group. The implementation process of this step is the same as step S208, which will not be repeated here. This embodiment can generate hotel summaries in batches, greatly reduce the workload of operators, and improve the efficiency of summary generation.

[0138] In a preferred embodiment, if the key sentence with the most occurrences does not meet the set condition, which is generally the word length, the key sentence with the second highest occurrences is selected in order, and so on, to obtain the summary information of the target object.

[0139] In another preferred embodiment, the target object is a hotel of the same grade, such as XX hotel chain and XX express hotel of the same star rating under a certain company. When users comment on the above hotels in different locations in the same province or city, due to differences in location, service, price, etc. of different hotels, users may have different experiences and eventually generate different comment data. Through the processing of steps S501 to S508, high-quality and differentiated summaries can be generated for the above hotels based on the above comment data.

[0140] In actual business scenarios, when calculating the similarity of key sentences in step S203 and step S503, it is preferred to use sentences that meet the business rules and delete additional words. Therefore, in a preferred embodiment, it is necessary to use a pre-set third filtering rule to filter the key sentences extracted in step S202 and step S502, and then calculate the similarity of the filtered key sentences.

[0141] The third filtering rule is set by the user, and can be: filtering sentences that only contain subject-predicate / attributive-predicate relationships, and sentences that do not start with subject-predicate / attributive-predicate relationships, filtering right-attached words in sentences, filtering sentences with a length greater than 8 or less than 4, filtering sentences containing sensitive words, etc. It should be noted that limiting sentence length and filtering sensitive words are business rules, and the length of retained sentences is defined by the user.

[0142] The sensitive words in this embodiment are manually maintained by the user in the database. The preprocessing of step S201 and step S501 only performs coarse-grained filtering on the comment data, and the sensitive words here are used for finer-grained filtering. For the hotel application scenario, the sensitive words here include bad, noisy, messy, mosquito, under renovation, construction, and make do.

[0143] For example, the key sentences extracted in step S202 are: there are few taxis, the price / performance ratio is very high, the price / performance ratio is very high, the price / performance ratio is good, generally speaking, it is good, the service is also in place, and there are convenience stores around; after filtering according to the above rules, the key sentences obtained are: there are few taxis (deleted the right additional words at the end of the sentence), the price / performance ratio is very high (deleted the right additional words at the end of the sentence), the price / performance ratio is very high, the price / performance ratio is good, the service is also in place (deleted the right additional words at the end of the sentence), and there are convenience stores around. In the key sentence "generally speaking, it is good", because "generally" is a sensitive word, the key sentence is abandoned.

[0144] Since the summary is extracted from the user's comment data, some expressions may not be written in a formal way. Therefore, in another preferred embodiment, after the summary is obtained in step S208 and step S508, the summary can be polished. Polishing mainly uses specified words to replace the keywords contained in the summary information to make the obtained summary information more written. Among them, the keywords are maintained internally by the system.

[0145] Specifically, it is determined whether the abstract contains set keywords or whether the regular expression corresponding to the abstract is in a set format; if the abstract contains keywords or the regular expression corresponding to the abstract is in a set format, the set replacement information is used to correct the abstract.

[0146] For example, if the summary information contains keywords such as "quite, sincerely, indeed", it can be replaced with "very"; if the summary information contains keywords such as "next to, just outside the door", it can be replaced with "nearby"; if the summary information contains keywords such as "child, son, daughter, baby, darling", the summary information can be directly replaced with "The parent-child service is very good"; if the regular expression corresponding to the summary information is ".*(train|high-speed train).*(near|not.*far),.*(outside the door|next to|around).*(train|high-speed train)", etc., the summary information can be directly replaced with "near the train station".

[0147] It can be seen from the target object summary generation method of the embodiment of the present invention that the key sentences are first clustered under the target object dimension, and then the initial clustering results are clustered again under the target area dimension, and the appropriate key sentences are selected as the summary in combination with the inverse document frequency, which reduces the occurrence of repeated sentences, generates high-quality and differentiated summaries, and better highlights the characteristics of the target object.

[0148] Figure 7 FIG. 1 is a schematic diagram of the main modules of the device for generating a summary of a target object according to an embodiment of the present invention. Figure 7 As shown, the target object summary generation device 700 of the embodiment of the present invention mainly includes:

[0149] The extraction clustering module 701 is used to extract key sentences of the comment data of multiple target objects in the target area, calculate the similarity between the key sentences belonging to the same target object, obtain a first similarity, cluster the key sentences according to the first similarity, and obtain a basic classification under the target object dimension.

[0150] Obtain multiple comment data of multiple target objects in the target area, extract key sentences in each comment data in the same way, and then use the text similarity algorithm to calculate the similarity between any two key sentences belonging to the same target object, and cluster the key sentences with similarity greater than the first threshold into one category, so as to obtain the basic classification under the target object dimension. Among them, the basic classification of each target object contains at least one first classification group.

[0151] The following is an explanation of how to extract the key sentence of one of the comment data: each sentence contained in the comment data is regarded as a node, and the similarity between nodes is calculated to construct a node connection graph. Then, based on the node connection graph and the similarity between nodes, the weight of the node is iteratively calculated until the weight converges. The sentence corresponding to the node with the highest weight at convergence is selected as the key sentence of the comment data.

[0152] The secondary clustering module 702 is used to calculate the similarity between the first classification groups included in the basic classification belonging to different target objects to obtain the second similarity, cluster the first classification groups according to the second similarity, and obtain the final classification under the target area dimension.

[0153] Use the text similarity algorithm to calculate the similarity between the first classification groups contained in the basic classification of any two target objects in the target area, and cluster the first classification groups with similarity greater than the second threshold into one category to obtain the final classification under the target area dimension. It should be noted that when calculating the similarity, the similarity between each first classification group of each target object in the target area and each first classification group of other target objects is calculated.

[0154] The summary generation module 703 is used to calculate the inverse document frequency of the second classification group included in the final classification for the overall classification, calculate the score of the second classification group according to the inverse document frequency and the set weight, and select a key sentence from the final classification as the summary of the target object according to the score.

[0155] The final classification contains at least one second classification group. The inverse document frequency of each second classification group relative to the overall classification is calculated, and then the inverse document frequency is weighted and added to the number of occurrences of the second classification group according to the set weight to obtain the score of each second classification group. The second classification groups included in the final classification are sorted in reverse order according to the score size, and the first K second classification groups are selected. The key sentences with the most occurrences are selected from the first K second classification groups as the summary of the target object, which can better highlight the characteristics of the target object.

[0156] In addition, the target object summary generation device 700 of the embodiment of the present invention may also include: a preprocessing module, an optimization module, a correction module and a filtering module ( Figure 7 The functions of the above modules are as described above.

[0157] From the above description, it can be seen that the key sentences are first clustered under the target object dimension, and then the initial clustering results are clustered again under the target area dimension. In addition, the appropriate key sentences are selected as summaries based on the inverse document frequency, which reduces the occurrence of repeated sentences, generates high-quality and differentiated summaries, and better highlights the characteristics of the target object.

[0158] Figure 8 An exemplary system architecture 800 is shown to which the target object summary generation method or target object summary generation device according to the embodiments of the present invention can be applied.

[0159] like Figure 8 As shown, system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. Network 804 is used to provide a medium for communication links between terminal devices 801, 802, 803 and server 805. Network 804 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0160] Users can use terminal devices 801, 802, and 803 to interact with server 805 through network 804 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 801, 802, and 803, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0161] The terminal devices 801 , 802 , and 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0162] Server 805 may be a server that provides various services, such as a background management server that an administrator uses to process comment data. The background management server may extract key sentences from comment data, perform clustering, calculate inverse document frequency, score, and feed back the processing results (such as the generated summary) to the terminal device.

[0163] It should be noted that the target object summary generation method provided in the embodiment of the present application is generally executed by the server 805 , and accordingly, the target object summary generation device is generally arranged in the server 805 .

[0164] It should be understood that Figure 8 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0165] According to an embodiment of the present invention, the present invention also provides an electronic device and a computer-readable medium.

[0166] The electronic device of the present invention comprises: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement a method for generating a summary of a target object according to an embodiment of the present invention.

[0167] The computer-readable medium of the present invention stores a computer program, and when the program is executed by a processor, a method for generating a summary of a target object according to an embodiment of the present invention is implemented.

[0168] Reference below Fig. 9 , which shows a schematic diagram of the structure of a computer system 900 suitable for implementing an electronic device of an embodiment of the present invention. Fig. 9 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0169] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the computer system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0170] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.

[0171] In particular, according to the embodiments disclosed in the present invention, the process described in the main step diagram above can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the main step diagram. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above-mentioned functions defined in the system of the present invention are executed.

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

[0173] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0174] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor. For example, they may be described as: a processor including an extraction clustering module, a secondary clustering module, and a summary generation module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the extraction clustering module may also be described as "a module that extracts key sentences from comment data of multiple target objects in a target area, calculates the similarity between key sentences belonging to the same target object, obtains a first similarity, clusters the key sentences according to the first similarity, and obtains a basic classification module under the target object dimension."

[0175] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: extracting key sentences of comment data of multiple target objects in a target area, calculating the similarity between key sentences belonging to the same target object, obtaining a first similarity, clustering the key sentences according to the first similarity, and obtaining a basic classification under the target object dimension; calculating the similarity between the first classification groups included in the basic classification belonging to different target objects, obtaining a second similarity, clustering the first classification groups according to the second similarity, and obtaining a final classification under the target area dimension; calculating the inverse document frequency of the second classification group included in the final classification for the overall classification, calculating the score of the second classification group according to the inverse document frequency and the set weight, and selecting a key sentence from the final classification as the summary of the target object according to the score.

[0176] According to the technical solution of the embodiment of the present invention, the key sentences are first clustered in the target object dimension, and then the primary clustering results are clustered again in the target area dimension, and the appropriate key sentences are selected as the summary in combination with the inverse document frequency, thereby reducing the occurrence of repeated sentences, generating high-quality and differentiated summaries, and better highlighting the characteristics of the target object.

[0177] The above product can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the method provided by the embodiment of the present invention.

[0178] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for generating a summary of a target object, characterized in that: include: Extract key sentences from review data of multiple target objects in a target area, calculate similarities between key sentences belonging to the same target object to obtain a first similarity, cluster the key sentences according to the first similarity to obtain a basic classification under the target object dimension; Calculating the similarity between the first classification groups included in the basic classifications belonging to different target objects to obtain a second similarity, clustering the first classification groups according to the second similarity to obtain a final classification under the target area dimension; Calculating the inverse document frequency of the second classification group included in the final classification for the overall classification, calculating the score of the second classification group according to the inverse document frequency and the set weight, and selecting a key sentence from the final classification as the summary of the target object according to the score; Before the step of calculating the similarity between the first classification groups included in the basic classifications belonging to different target objects, the method further includes: Performing sentiment analysis on key sentences contained in the basic categories corresponding to the multiple target objects respectively; According to the sentiment analysis result and the set second filtering rule, the key sentences are filtered to obtain an optimized classification under the target object dimension; Among them, the second filtering rule is used to retain the first classification group in which the number of key sentences with positive emotions is greater than the number of key sentences with negative emotions, and the retained key sentences are key sentences with positive emotions.

2. The method according to claim 1, characterized in that Calculating the inverse document frequency of the second classification group included in the final classification for the overall classification includes: Counting the sum of the numbers of the first classification groups included in the basic classification to obtain the number of all classification groups; Counting the sum of the occurrence times of all key sentences in the second classification group to obtain the occurrence time of the second classification group; The number of all classification groups is used as the numerator and the number of occurrences of the second classification group plus 1 is used as the denominator to perform a logarithmic operation to obtain the inverse document frequency.

3. The method according to claim 2, characterized in that Calculating the score of the second classification group according to the inverse document frequency and the set weight includes: According to the set weight, the inverse document frequency and the number of occurrences of the second classification group are weightedly added to obtain the score of the second classification group.

4. The method according to claim 1, characterized in that: Selecting key sentences from the final classification according to the scores includes: According to the scores, the second classification groups included in the final classification are sorted in reverse order to select the first K second classification groups; wherein K is a positive integer; According to the number of occurrences of the key sentences in the second classification group, the key sentences belonging to the first K second classification groups are sorted respectively, and the key sentences with the largest number of occurrences in the first K second classification groups are selected respectively.

5. The method according to claim 1, characterized in that: Extract key sentences from the review data of multiple target objects in the target area, including: Treat each sentence contained in the comment data as a node, calculate the similarity between the nodes, and construct a node connection graph based on the similarity; The weights of the nodes are iteratively calculated according to the node connection graph and the similarity until the weights converge, and the sentences corresponding to the nodes with the highest weights at the time of convergence are selected as the key sentences.

6. The method according to claim 1, characterized in that Before the step of extracting key sentences of the comment data of the plurality of target objects in the target area, the method further comprises: Preprocessing the plurality of comment data respectively; wherein the preprocessing includes filtering processing and merging processing performed according to the set first filtering rule, and the merging processing includes: Performing syntactic analysis on the sentences contained in the comment data to obtain syntactic components of the sentences; Using the set symbol as a segmentation mark, determining the syntactic structure of the first sentence after the symbol, and merging sentences with non-subject-predicate structure and non-attributive structure upwards; The extracting key sentences of the review data of the plurality of target objects in the target area includes: extracting the key sentences of the preprocessed review data.

7. The method according to any one of claims 1 to 6, characterized in that: The calculating the similarity between the first classification groups included in the basic classifications belonging to different target objects to obtain the second similarity, and clustering the first classification groups according to the second similarity includes: The similarities between the classification groups included in the optimized classifications belonging to different target objects are calculated, and the classification groups included in the optimized classifications are clustered according to the obtained similarities.

8. The method according to any one of claims 1 to 6, characterized in that: After the step of selecting a key sentence from the final classification as a summary of the target object according to the score, the method further comprises: Determine whether the summary contains set keywords, or whether the regular expression corresponding to the summary is in a set format; If the abstract contains the keyword, or the regular expression corresponding to the abstract is in the set format, the set replacement information is used to modify the abstract.

9. The method according to any one of claims 1 to 6, characterized in that: After the step of extracting key sentences of the comment data of the plurality of target objects in the target area, the method further comprises: The key sentence is filtered according to a set third filtering rule; wherein the third filtering rule is used to limit the length of the key sentence.

10. A device for generating a summary of a target object, characterized in that: include: An extraction clustering module is used to extract key sentences of comment data of multiple target objects in a target area, calculate the similarity between key sentences belonging to the same target object to obtain a first similarity, cluster the key sentences according to the first similarity, and obtain a basic classification under the target object dimension; A secondary clustering module, used for calculating the similarity between the first classification groups included in the basic classifications belonging to different target objects to obtain a second similarity, clustering the first classification groups according to the second similarity to obtain a final classification under the target area dimension; A summary generation module, used to calculate the inverse document frequency of the second classification group included in the final classification for the overall classification, calculate the score of the second classification group according to the inverse document frequency and a set weight, and select a key sentence from the final classification as the summary of the target object according to the score; The secondary clustering module is also used for: Performing sentiment analysis on key sentences contained in the basic categories corresponding to the multiple target objects respectively; According to the sentiment analysis result and the set second filtering rule, the key sentences are filtered to obtain an optimized classification under the target object dimension; Among them, the second filtering rule is used to retain the first classification group in which the number of key sentences with positive emotions is greater than the number of key sentences with negative emotions, and the retained key sentences are key sentences with positive emotions.

11. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 9.

12. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Structured abstract generating method

    CN102622411A

  • Event generation method based on text information and related device

    CN110209808A