Intelligent matching method and system for bullet screen response text based on knowledge base

Through adaptive clustering and principal component analysis, danmu clusters with similar meanings are merged and response texts are optimized, which solves the problem of response deviation caused by inaccurate expression of barrage meaning and improves the accuracy and user experience of barrage responses.

CN118296147BActive Publication Date: 2024-09-06JIANGSU WURUN UNITED SHIPPING INTERNET CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410458151.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-17
Publication Date
2024-09-06
Estimated Expiration
2044-04-17

AI Technical Summary

Technical Problem

In the existing technology, inaccurate expression of the meaning of barrages leads to deviations in response answers, affecting user experience and live program effects.

Method used

Adopt an intelligent matching method of barrage response text based on the knowledge base, through adaptive clustering and principal component analysis, merge barrage clusters with similar meanings, calculate the merging effect, and optimize the barrage text within the cluster to respond to improve the accuracy of the response sex.

Benefits of technology

Optimized the error in response results caused by inaccurate expression of barrage meaning, improving response accuracy and user interaction experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118296147B
    Figure CN118296147B
Patent Text Reader

Abstract

The invention belongs to the technical field of data processing, and discloses a method and system for intelligent matching of bullet-screen response texts based on a knowledge base, as follows: clustering a bullet-screen text sample set to obtain a plurality of first result clusters; calculating the degree of clustering of each first result cluster; calculating the degree of merging of two adjacent first result clusters according to the degree of clustering, the amount of data contained in the first result cluster, and the relative positions between different first result clusters; merging two first result clusters whose degrees of merging meet a first preset condition to obtain a plurality of merged clusters; clustering each merged cluster to obtain a second result cluster; calculating the merging effect of the merged cluster according to the amount of data and the position of each merged cluster and the corresponding second result cluster; screening out the merged cluster whose merging effect meets the second preset condition, screening out a preferred cluster from the second result cluster or the merged cluster according to the merging effect, responding to the corresponding bullet-screen text with question meaning through a knowledge base, and obtaining an answer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a knowledge base-based bullet screen response text intelligent matching method and system. Background Art

[0002] The current process of responding to barrages is to extract features from the barrage questions, and then use the knowledge base to obtain answers to respond. However, due to the inaccurate and incomplete language expression of some barrage questions, the corresponding answers are biased, which affects the viewing experience of users and the effect of the live broadcast. Summary of the invention

[0003] In order to overcome the problem in the prior art that inaccurate expression of the meaning of barrages leads to deviations in corresponding answers, the present invention provides a barrage response text intelligent matching method and system based on a knowledge base.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0005] A method for intelligently matching barrage response text based on a knowledge base, the method comprising the following steps:

[0006] Obtain a vectorized sample set of bullet comment texts with questioning meanings;

[0007] Adaptively clustering the bullet comment text sample set to obtain multiple first result clusters;

[0008] The principal component analysis method is used to calculate the degree of aggregation of each first result cluster;

[0009] Calculate the degree to which two adjacent first result clusters can be merged according to the aggregation degree of the first result clusters, the amount of data contained in the first result clusters, and the relative positions between different first result clusters;

[0010] Merge the two first result clusters whose mergeability degree satisfies the first preset condition to obtain a plurality of merged clusters;

[0011] Performing adaptive clustering on each merged cluster to obtain a corresponding second result cluster;

[0012] Calculate the merging effect of the merged clusters according to the data volume and position of each merged cluster and the corresponding second result cluster;

[0013] A merged cluster whose merge effect meets the second preset condition is screened out, a preferred cluster is screened out from the second result cluster or the merged cluster according to the merge effect, and a bullet text with question meaning corresponding to the preferred cluster is responded to through the knowledge base to obtain a corresponding answer.

[0014] Preferably, the combining principal component analysis method to calculate the aggregation degree of each first result cluster includes:

[0015] Using the principal component analysis method to analyze each first result cluster, a plurality of principal component vectors are obtained;

[0016] Selecting some principal component vectors, and calculating differences of the selected principal component vectors according to the modulus lengths of the selected principal component vectors;

[0017] Calculate the average Euclidean distance between any data point in each first result cluster and the cluster center position of the first result cluster;

[0018] Calculate the relative coefficient of difference of each first result cluster according to the mean and standard deviation of the data in the first result cluster;

[0019] Calculate the shortest distance between the edge of each first result cluster and the edge of another adjacent first result cluster, and calculate the average inter-cluster distance between each first result cluster and all the adjacent first result clusters based on the shortest distance;

[0020] The degree of aggregation of each first result cluster is calculated based on the obtained difference of the selected part of the principal component vectors, the average Euclidean distance, the relative difference coefficient, and the average inter-cluster distance.

[0021] Preferably, calculating the degree to which two adjacent first result clusters can be merged according to the aggregation degree of the first result clusters, the amount of data contained in the first result clusters, and the relative positions between different first result clusters includes:

[0022] Calculating a data quantity feature between the first result cluster and another adjacent first result cluster according to the data quantity contained in the first result cluster and another adjacent first result cluster; the data quantity feature indicates the amount of data contained in the other adjacent first result cluster relative to the first result cluster;

[0023] Calculate the difference in the degree of clustering between a first result cluster and another adjacent first result cluster;

[0024] Calculate the Euclidean distance between a first result cluster and another adjacent first result cluster;

[0025] According to the obtained data volume characteristics, clustering difference, and Euclidean distance, the degree of merging of two adjacent first result clusters is calculated.

[0026] Furthermore, after calculating the merging degree of two adjacent first result clusters, and before merging the two first result clusters whose merging degree satisfies the first preset condition, the method further includes:

[0027] The merging degree is normalized to obtain a normalized merging degree.

[0028] Preferably, the calculating the merging effect of the merged clusters according to the data amount and position of each merged cluster and the corresponding second result cluster includes:

[0029] Calculate the data volume difference between each merged cluster and the corresponding second result cluster according to the intersection of the data in each merged cluster and the corresponding second result cluster, the data volume contained in each merged cluster, and the data volume contained in the second result cluster corresponding to each merged cluster;

[0030] Calculate the Euclidean distance between each merged cluster and the cluster center of the corresponding second result cluster;

[0031] The merging effect of the merging clusters is obtained according to the difference in data volume between each merging cluster and the corresponding second result cluster and the Euclidean distance calculation.

[0032] Preferably, a preferred cluster is selected from the second result cluster or the merged cluster according to the merging effect, and the bullet text with the meaning of the question corresponding to the preferred cluster is responded to through the knowledge base to obtain the corresponding answer, including:

[0033] Determine whether the merging effect of each merging cluster meets the second preset condition;

[0034] If the conditions are met, the merged cluster is taken as the preferred cluster, and the bullet-screen question content corresponding to the bullet-screen text closest to the cluster center in the merged cluster is searched, and the corresponding answer is obtained by responding through the knowledge base;

[0035] If not satisfied, the second result cluster corresponding to the merged cluster is selected as the preferred cluster, and the bullet screen question content corresponding to the bullet screen text closest to the cluster center position in the second result cluster is searched, and the knowledge base is used to respond to obtain the corresponding answer.

[0036] Preferably, the step of obtaining a vectorized sample set of bullet texts with questioning meanings includes:

[0037] Get the vectorized bullet text;

[0038] Use the trained neural network model to classify the vectorized bullet texts and filter out the vectorized bullet texts with question meanings;

[0039] The vectorized bullet-screen text with question meaning is mapped into the sample space, thereby obtaining a vectorized bullet-screen text sample set with question meaning.

[0040] Furthermore, the obtaining of vectorized bullet text includes:

[0041] Real-time collection of barrage text generated during live broadcast;

[0042] The barrage text is vectorized to obtain vectorized barrage text.

[0043] Furthermore, after collecting the barrage text generated during the live broadcast in real time and before vectorizing the barrage text, the method further includes:

[0044] The barrage text is preprocessed, and the preprocessing includes any one or more of cleaning empty data items, removing duplicate items, removing invalid symbols, removing emoticons, removing text symbols, and mechanical weight reduction.

[0045] A barrage response text intelligent matching system based on a knowledge base, applying the barrage response text intelligent matching method based on a knowledge base, the system comprises:

[0046] An acquisition module is used to obtain a vectorized sample set of bullet texts with question meanings;

[0047] A first clustering module, used for adaptively clustering the bullet text sample set to obtain a plurality of first result clusters;

[0048] A clustering degree calculation module, used to calculate the clustering degree of each first result cluster in combination with a principal component analysis method;

[0049] A merging degree calculation module, used to calculate the merging degree of two adjacent first result clusters according to the aggregation degree of the first result clusters, the amount of data contained in the first result clusters, and the relative positions between different first result clusters;

[0050] A first screening module, used to screen out two first result clusters whose mergibility degree meets a first preset condition;

[0051] A merging module, configured to merge two first result clusters whose mergeability degree satisfies a first preset condition, to obtain a plurality of merged clusters;

[0052] A second clustering module performs adaptive clustering on each merged cluster to obtain a corresponding second result cluster;

[0053] A merging effect calculation module, used to calculate the merging effect of the merging clusters according to the data volume and position of each merging cluster and the corresponding second result cluster;

[0054] A second screening module, used to screen out the merged clusters whose merging effect meets the second preset condition;

[0055] The knowledge matching module is used to select a preferred cluster from the second result cluster or the merged cluster according to the merging effect, and respond to the bullet text with the question meaning corresponding to the preferred cluster through the knowledge base to obtain the corresponding answer.

[0056] Compared with the prior art, the present invention has the following beneficial effects:

[0057] The present invention obtains multiple first result clusters by adaptively clustering a sample set of barrage texts, calculates the clustering degree of each first result cluster in combination with a principal component analysis method, merges the multiple first result clusters in combination with their clustering degrees, the amount of data contained in the first result clusters, and their relative positions to obtain a merged cluster, so that some barrages with inaccurate meanings can be in the same result cluster as barrages with the same meanings and accurate expressions; then secondary clustering is performed based on the clustering center of the merged cluster, the merging effect is calculated, and finally, answers are obtained through a knowledge base according to the meanings expressed by the barrages in multiple preferred clusters for response, thereby optimizing the problem of errors in response results caused by inaccurate expression of barrage meanings, thereby improving the accuracy of the response.

[0058] The present invention performs secondary clustering based on the cluster center of the merged cluster, so that the sample points in each cluster that reflect the meaning of the barrage are more accurate, so as to improve the accuracy and efficiency of the response, thereby improving the user interaction experience. Through the secondary clustering method, the barrages with inaccurate meanings are as similar as possible, and the barrages with accurate expressions are classified into the same result cluster, so that accurate responses can be made based on the meaning of the barrages in the cluster with the help of the knowledge base. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 It is a flow chart of the steps of a knowledge base-based intelligent matching method for barrage response texts of the present invention.

[0060] Figure 2 This is a schematic diagram of some barrage data that has not been preprocessed.

[0061] Figure 3 This is a schematic diagram of part of the barrage data after preprocessing.

[0062] Figure 4 It is a principle block diagram of a knowledge base-based barrage response text intelligent matching system of the present invention.

[0063] Figure 5 It is a schematic block diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0064] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. The present invention is described in detail below in combination with the drawings and specific implementation methods.

[0065] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0066] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0067] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations. Embodiment 1:

[0068] like Figure 1 As shown, a method for intelligently matching barrage response text based on a knowledge base comprises the following steps:

[0069] Obtain a vectorized sample set of bullet comment texts with questioning meanings;

[0070] Adaptively clustering the bullet comment text sample set to obtain multiple first result clusters;

[0071] The principal component analysis method is used to calculate the degree of aggregation of each first result cluster;

[0072] Calculate the degree to which two adjacent first result clusters can be merged according to the aggregation degree of the first result clusters, the amount of data contained in the first result clusters, and the relative positions between different first result clusters;

[0073] Merge the two first result clusters whose mergeability degree satisfies the first preset condition to obtain a plurality of merged clusters;

[0074] Performing adaptive clustering on each merged cluster to obtain a corresponding second result cluster;

[0075] Calculate the merging effect of the merged clusters according to the data volume and position of each merged cluster and the corresponding second result cluster;

[0076] A merged cluster whose merge effect meets the second preset condition is screened out, a preferred cluster is screened out from the second result cluster or the merged cluster according to the merge effect, and a bullet text with question meaning corresponding to the preferred cluster is responded to through the knowledge base to obtain a corresponding answer.

[0077] The present invention obtains multiple first result clusters by adaptively clustering a sample set of barrage texts, calculates the clustering degree of each first result cluster in combination with a principal component analysis method, merges the multiple first result clusters in combination with their clustering degrees, the amount of data contained in the first result clusters, and their relative positions to obtain a merged cluster, so that some barrages with inaccurate meanings can be in the same result cluster as barrages with the same meanings and accurate expressions; then secondary clustering is performed based on the clustering center of the merged cluster, the merging effect is calculated, and finally, answers are obtained through a knowledge base according to the meanings expressed by the barrages in multiple preferred clusters for response, thereby optimizing the problem of errors in response results caused by inaccurate expression of barrage meanings, thereby improving the accuracy of the response.

[0078] The present invention performs secondary clustering based on the cluster center of the merged cluster, so that the sample points in each cluster that reflect the meaning of the barrage are more accurate, so as to improve the accuracy and efficiency of the response, thereby improving the user interaction experience. Through the secondary clustering method, the barrages with inaccurate meanings are as similar as possible, and the barrages with accurate expressions are classified into the same result cluster, so that accurate responses can be made based on the meaning of the barrages in the cluster with the help of the knowledge base.

[0079] In a specific embodiment, the step of obtaining a vectorized sample set of bullet texts with questioning meanings includes:

[0080] Get the vectorized bullet text;

[0081] In this embodiment, the step of obtaining vectorized bullet text includes:

[0082] Real-time collection of barrage text generated during live broadcast;

[0083] In this embodiment, by entering the current live page, finding the asynchronous request packet of the web page sending the bullet screen, and analyzing the URL changes of the target web page, the segmented crawling of data can be quickly realized by using the change rules. Secondly, after analyzing the structure of the target web page, the data interface is found. Since the bullet screen data returned by the target web page is in JSON format, json.loads can be used to directly parse the bullet screen data. Finally, the obtained bullet screen data is stored. The obtained bullet screen data includes user ID and bullet screen text. The partial bullet screen data obtained in this step is as follows: Figure 2 shown.

[0084] The URL generally refers to a uniform resource locator (URL).

[0085] The barrage text is vectorized to obtain vectorized barrage text.

[0086] When the obtained bullet text does not contain empty data items, duplicate items, invalid symbols, emoticons, or text symbols, in order to construct the bullet text sample data space, the Word2Vec method can be directly used to vectorize the obtained bullet text, so different bullet contents will correspond to different feature vectors. Of course, in addition to using the Word2Vec method to vectorize the bullet text, you can also use methods including the Bag of Words Model or the Document-Vector Model (Doc2vec). Or other methods that can vectorize text.

[0087] Use the trained neural network model to classify the vectorized bullet texts and filter out the vectorized bullet texts with question meanings;

[0088] In this embodiment, the neural network model can adopt a TextCNN network model, a TextRNN network model, or a TextRCNN network model. These network models are all existing models and can be used after corresponding training. In order to improve the classification accuracy, this embodiment uses a trained neural network to classify the barrage text, identify the content of the barrage text, and filter out the target barrage text of the "question" type that needs to be responded to.

[0089] The vectorized bullet-screen text with question meaning is mapped into the sample space, thereby obtaining a vectorized bullet-screen text sample set with question meaning.

[0090] In a specific embodiment, after real-time acquisition of the bullet screen text generated during the live broadcast process and before vectorization processing of the bullet screen text, the method further includes:

[0091] The barrage text is preprocessed, and the preprocessing includes any one or more of cleaning empty data items, removing duplicate items, removing invalid symbols, removing emoticons, removing text symbols, and mechanical weight reduction.

[0092] This is because there are often empty data items, duplicate items, invalid symbols, emoticons, or text symbols in the barrage text. In order to reduce the overhead of subsequent vectorization of the barrage text, after real-time collection of the barrage text generated during the live broadcast, before vectorization of the barrage text, the collected barrage text needs to be preprocessed, including cleaning empty data items, removing duplicate items, removing invalid symbols, removing emoticons, removing text symbols, and mechanical weight reduction. Preprocessing can be selectively performed based on the actual defects of the barrage text. You can also select all preprocessing items for preprocessing. This example is for Figure 2 After preprocessing some of the bullet text in Figure 3 shown.

[0093] In this example, the K-means algorithm or the ISODATA algorithm can be used to adaptively cluster the sample set of bullet text to obtain multiple first result clusters. Preferably, the ISODATA algorithm is preferably used to adaptively cluster the sample set of bullet text to obtain multiple first result clusters. Since the K-means algorithm or the ISODATA algorithm are both existing algorithms, they will not be described in detail here.

[0094] In a specific embodiment, since multiple first result clusters can be obtained by using the ISODATA algorithm for adaptive clustering, the meaning of the barrage represented by the data in each first result cluster is very similar. However, there may be some inaccurate expressions of the meaning of the barrage, resulting in the corresponding data not being included in the first result cluster with the same meaning. In order to make the barrage text contained in each first result cluster more complete, the meanings expressed by the data with similar barrage texts are also similar. At the same time, the positions in the sample space are also similar and can form a cluster, while those barrage texts with inaccurate meanings will form multiple small clusters around this cluster. Therefore, for each first result cluster, its aggregation degree is calculated. Specifically, it is necessary to analyze the data distribution characteristics of the first result cluster to calculate the aggregation degree, and then merge the clusters according to the positional relationship based on the differences in the aggregation degrees of multiple first result clusters, so that each cluster can more completely contain the barrage text reflecting this feature.

[0095] From the perspective of data distribution characteristics, since each first result cluster has a cluster center position, the closer the average distance between each data point in the first result cluster and the cluster center position is, the more likely this cluster is a dense cluster. The inter-cluster distance between this cluster and its adjacent clusters can also be combined. If the data in this cluster is more concentrated, the average inter-cluster distance is relatively larger.

[0096] In this example, the principal component analysis method is combined to calculate the aggregation degree of each first result cluster, including:

[0097] Using the principal component analysis method to analyze each first result cluster, a plurality of principal component vectors are obtained;

[0098] Selecting some principal component vectors, and calculating differences of the selected principal component vectors according to the modulus lengths of the selected principal component vectors;

[0099] In this embodiment, the first result cluster is analyzed by using the principal component analysis method PCA to obtain multiple principal component vectors (This embodiment selects the first 30% of the principal component vectors for analysis). Since the more clustered the clusters are, the smaller the differences between the principal component vectors are, the degree of clustering can be measured by comparing the differences in the module lengths of multiple principal component vectors corresponding to each cluster.

[0100] Calculate the average Euclidean distance between any data point in each first result cluster and the cluster center position of the first result cluster;

[0101] Calculate the relative coefficient of difference of each first result cluster according to the mean and standard deviation of the data in the first result cluster;

[0102] Calculate the shortest distance between the edge of each first result cluster and the edge of another adjacent first result cluster, and calculate the average inter-cluster distance between each first result cluster and all the adjacent first result clusters based on the shortest distance;

[0103] The degree of aggregation of each first result cluster is calculated based on the obtained difference of the selected part of the principal component vectors, the average Euclidean distance, the relative difference coefficient, and the average inter-cluster distance.

[0104] In this embodiment, for any first result cluster, the calculation formula of its aggregation degree is as follows:

[0105]

[0106] In the formula, Q is the clustering index corresponding to the first result cluster; The first result cluster The modulus of the value component vector after PCA decomposition, The first result cluster The modulus of the value component vector after PCA decomposition; is the number of principal component vectors of the first 30% selected; c 0 is the cluster center position of the first result cluster, is the number of clusters adjacent to the first result cluster, The edge of the first result cluster and its adjacent first result cluster j The shortest distance to the edge; c j is the first result cluster data points, N is the amount of data contained in the first result cluster; σ is the mean of the data in the first result cluster, μ is the standard deviation of the data in the first result cluster, represents the coefficient of variation of the data within the first result cluster, are the maximum and minimum values ​​of all corresponding coefficients of variation, respectively.

[0107] It represents the difference between multiple principal component vectors of the first result cluster. If the difference is larger, the multiple principal component vectors of the first result cluster after dimensionality reduction still have large differences, which means that the data in the first result cluster is more discrete, so the aggregation is smaller.

[0108] It represents the average inter-cluster distance between each first result cluster and all the first result clusters adjacent to it. If the average inter-cluster distance is larger, it means that the a data of this first result cluster is more concentrated, and the corresponding degree of concentration of this first result cluster is larger.

[0109] represents the average Euclidean distance between any data point in each first result cluster and the cluster center position of the first result cluster; if The smaller the value of , the closer the data in the first result cluster is to the cluster center, and the closer the data in the first result cluster is, the greater the corresponding degree of aggregation is.

[0110] Represents the relative coefficient of variation of the first result cluster, the coefficient of variation It reflects the degree to which the data points deviate from the mean value, and can indirectly express the information of data aggregation. When the coefficient of variation is large, it means that the standard deviation of the data within the cluster is large relative to the mean value, and the distribution of data points around the mean value is more dispersed. This indicates that the data has a high degree of dispersion and a low degree of aggregation.

[0111] According to the above calculation formula, the aggregation degree calculated for all first result clusters can be normalized to the range of [0, 1] for subsequent analysis.

[0112] After obtaining the degree of clustering corresponding to the first result cluster, the clusters with relatively high merging degree are merged. Since some bullet comments expressing the same meaning are sent by multiple users, the bullet comment texts sent by most of these users can accurately reflect their meanings, but there will be a small number of users who fail to express their meanings. Then, when mapped to the sample space, these bullet comment texts that are not accurately expressed may be in different multiple result clusters, resulting in an increase in the time cost of the response or a decrease in the accuracy of the response. Here, we hope to merge similar clusters to group these bullet comment texts with similar meanings into one result cluster as much as possible, thereby reducing the occurrence of the above problems.

[0113] In a specific embodiment, calculating the degree to which two adjacent first result clusters can be merged according to the aggregation degree of the first result clusters, the amount of data contained in the first result clusters, and the relative positions between different first result clusters includes:

[0114] Calculating a data quantity feature between the first result cluster and another adjacent first result cluster according to the data quantity contained in the first result cluster and another adjacent first result cluster; the data quantity feature indicates the amount of data contained in the other adjacent first result cluster relative to the first result cluster;

[0115] Calculate the difference in the degree of clustering between a first result cluster and another adjacent first result cluster;

[0116] Calculate the Euclidean distance between a first result cluster and another adjacent first result cluster;

[0117] According to the obtained data volume characteristics, clustering difference, and Euclidean distance, the degree of merging of two adjacent first result clusters is calculated.

[0118] In this embodiment, for a first result cluster and the first cluster of results adjacent to it The degree of merging that exists is calculated as follows:

[0119]

[0120] In the formula, The first result cluster and a cluster of results adjacent to it the degree of mergeability; and The first result cluster , The amount of data included, and The first result cluster , The corresponding degree of aggregation. Represents the first result cluster , The Euclidean distance of the cluster center. Therefore Represents the first result cluster , The data volume characteristics of the adjacent first result cluster The amount of data contained is relative to the first result cluster Less, that is The larger the value of The more likely it is to belong to those bullet comments whose meaning is not accurately expressed, so it is not related to the first result cluster. The greater the degree of merger. Represents the first result cluster , Differences in clustering, i.e., the first result cluster The first result cluster adjacent to The more similar the clustering degrees are, the greater the possibility of merging. Represents the first result cluster , The closer the two clusters are, the more likely it is that the meanings of the bullet comments corresponding to the two clusters are the same, so the possibility of merging them is greater. Represents the activation function, which is used to normalize the data; L() represents the Euclidean distance acquisition function.

[0121] According to the above formula, we can get the degree of merging of the first result cluster: V ,use The function normalizes the result to the range of [0,1], and then selects two clusters whose merging degree meets the first preset condition for merging.

[0122] In this embodiment, after calculating the merging degree of two adjacent first result clusters, and before merging the two first result clusters whose merging degree meets the first preset condition, the method further includes:

[0123] The merging degree is normalized to obtain a normalized merging degree.

[0124] In this embodiment, use The function will be about the degree of merging of the first result cluster V Normalized to the range of [0,1]. In one embodiment of the present invention, the first preset condition is: the degree of merging V When it is greater than 0.88, the first preset condition is met, that is, all V The two first result clusters corresponding to ≥0.88 were merged.

[0125] It should be noted that the degree of merging obtained by the above-mentioned feature calculation in this embodiment may not be normalized, and the calculated result may be directly compared with the preset threshold value to select two first result clusters that meet the preset threshold value for merging. This embodiment normalizes the calculated result to the range of [0, 1] for subsequent analysis.

[0126] In a specific embodiment, the K-means algorithm or ISODATA algorithm is used to adaptively cluster each merged cluster to obtain the corresponding second result cluster; this embodiment preferably uses the K-means algorithm to adaptively cluster each merged cluster to obtain the corresponding second result cluster.

[0127] This embodiment uses the K-means algorithm to select the average position of the cluster center of each merged cluster as its cluster center, thereby obtaining multiple second result clusters, and each merged cluster corresponds to a second result cluster. Therefore, the merging effect can be determined by comparing the data similarity between the two.

[0128] In a specific embodiment, the step of calculating the merging effect of the merged clusters according to the data amount and position of each merged cluster and the corresponding second result cluster includes:

[0129] Calculate the data volume difference between each merged cluster and the corresponding second result cluster according to the intersection of the data in each merged cluster and the corresponding second result cluster, the data volume contained in each merged cluster, and the data volume contained in the second result cluster corresponding to each merged cluster;

[0130] Calculate the Euclidean distance between each merged cluster and the cluster center of the corresponding second result cluster;

[0131] The merging effect of the merging clusters is obtained according to the difference in data volume between each merging cluster and the corresponding second result cluster and the Euclidean distance calculation.

[0132] In this embodiment, it is assumed that if the sequence of data points contained in the merged cluster is A :{ A 1, A 2… A n}, and its cluster center position is recorded as , then the sequence of data points contained in the second result cluster formed after secondary clustering with this cluster center is B :{ B 1, B 2… B m}, and its cluster center position is recorded as . Then the merging effect corresponding to the merged cluster is calculated as follows:

[0133]

[0134] In the formula, M is the merging effect of merging clusters; A ∩ B For sequence A with sequence B The intersection of the inner data; count ( A ∩ B ) represents the amount of data contained in this intersection; m For sequence A , that is, the amount of data contained in the merged cluster; n For sequence B , that is, the amount of data contained in the second result cluster formed after secondary clustering. L ( c A , c B ) represents the Euclidean distance between the cluster centers of the merged cluster and the second result cluster; norm [ ] is the normalization function; count () is the data volume extraction function. The difference in data volume between the merged cluster and the second result cluster is shown in Figure 2. If the data change in the second result cluster formed after the merged cluster is clustered twice is relatively small, The larger the value, the better the cluster merging effect. The Euclidean distance between the cluster centers of the merged cluster and the second result cluster L ( c A , c B ), the smaller the offset is, and the better the merging effect is. Finally, all merged clusters are clustered again and the corresponding merging effect is calculated.

[0135] In a specific embodiment, a preferred cluster is selected from the second result cluster or the merged cluster according to the merging effect, and a bullet text with a question meaning corresponding to the preferred cluster is responded to through a knowledge base to obtain a corresponding answer, including:

[0136] Determine whether the merging effect of each merging cluster meets the second preset condition;

[0137] If the conditions are met, the merged cluster is taken as the preferred cluster, and the bullet-screen question content corresponding to the bullet-screen text closest to the cluster center in the merged cluster is searched, and the corresponding answer is obtained by responding through the knowledge base;

[0138] If not satisfied, the second result cluster corresponding to the merged cluster is selected as the preferred cluster, and the bullet screen question content corresponding to the bullet screen text closest to the cluster center position in the second result cluster is searched, and the knowledge base is used to respond to obtain the corresponding answer.

[0139] In one embodiment of the present invention, the second preset condition is: the second preset condition is satisfied when the combined effect is greater than 0.85. M The merged clusters corresponding to >0.85 are clusters with good merging effects, and the others are considered to have unsatisfactory merging effects.

[0140] This embodiment obtains corresponding answers to respond to all data in this preferred cluster.

[0141] This embodiment has merged all bullet-screen texts with similar meanings into the same result cluster as much as possible, but it cannot guarantee that each bullet-screen text in the result cluster can reflect the same meaning. Therefore, the clustering starting position of all the data in the merged cluster after the merger is re-determined for secondary clustering, and then the second result cluster formed after the secondary clustering is compared with the merged cluster to measure the merging effect. If the merging effect of a merged cluster is relatively good, a subsequent response is made to the merged cluster formed by the merger. If the merging effect of a merged cluster is poor, the response is based on the second result cluster formed by the secondary clustering. Responding by the above method improves the response accuracy and efficiency of the bullet screen and improves the user interaction experience.

[0142] The specific scenario targeted by the present invention is: in the scenario of responding to bullet-screen text based on the knowledge base, the response content may be biased due to the inaccurate meaning expressed by some bullet-screens. The present invention optimizes this problem.

[0143] Embodiment 2:

[0144] This embodiment also provides a knowledge base-based bullet screen response text intelligent matching system. Figure 4 As shown, the knowledge base-based intelligent matching method for barrage response texts as described in Example 1 is applied, and the system includes:

[0145] An acquisition module is used to obtain a vectorized sample set of bullet texts with question meanings;

[0146] A first clustering module, used for adaptively clustering the bullet text sample set to obtain a plurality of first result clusters;

[0147] A clustering degree calculation module, used to calculate the clustering degree of each first result cluster in combination with a principal component analysis method;

[0148] A merging degree calculation module, used to calculate the merging degree of two adjacent first result clusters according to the aggregation degree of the first result clusters, the amount of data contained in the first result clusters, and the relative positions between different first result clusters;

[0149] A first screening module, used to screen out two first result clusters whose mergibility degree meets a first preset condition;

[0150] A merging module, configured to merge two first result clusters whose mergeability degree satisfies a first preset condition, to obtain a plurality of merged clusters;

[0151] A second clustering module performs adaptive clustering on each merged cluster to obtain a corresponding second result cluster;

[0152] A merging effect calculation module, used to calculate the merging effect of the merging clusters according to the data volume and position of each merging cluster and the corresponding second result cluster;

[0153] A second screening module, used to screen out the merged clusters whose merging effect meets the second preset condition;

[0154] The knowledge matching module is used to select a preferred cluster from the second result cluster or the merged cluster according to the merging effect, and respond to the bullet text with the question meaning corresponding to the preferred cluster through the knowledge base to obtain the corresponding answer.

[0155] See also Figure 5 , Figure 55 is a schematic block diagram of a computer device provided by an embodiment of the present invention. The computer device 500 is a server, which can be an independent server or a server cluster composed of multiple servers.

[0156] See also Figure 5 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .

[0157] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 can execute a knowledge-based intelligent matching method for barrage response texts.

[0158] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

[0159] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a knowledge-based intelligent matching method for barrage response texts.

[0160] The network interface 505 is used for network communication, such as providing data information transmission, etc. Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device 500 to which the solution of the present invention is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0161] The processor 502 is used to run a computer program 5032 stored in the memory to implement the knowledge base-based intelligent matching method for barrage response texts disclosed in an embodiment of the present invention.

[0162] Those skilled in the art will understand that Figure 5 The embodiments of the computer device shown in the figure do not constitute a limitation on the specific composition of the computer device. In other embodiments, the computer device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, in some embodiments, the computer device may only include a memory and a processor. In such embodiments, the structure and function of the memory and the processor are the same as those of the embodiment of the present invention. Figure 5 The embodiments shown are consistent and will not be described again here.

[0163] It should be understood that in the embodiment of the present invention, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0164] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium may be a non-volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the method for intelligently matching barrage response text based on a knowledge base disclosed in an embodiment of the present invention is implemented.

[0165] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the above-described equipment, devices and units can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. Those of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0166] In the several embodiments provided by the present invention, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. Units with the same function may also be combined into one unit. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices or units, or may be an electrical, mechanical or other form of connection.

[0167] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.

[0168] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0169] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), disk or optical disk and other media that can store program codes.

[0170] Obviously, the above embodiments of the present invention are only examples for clearly explaining the present invention, and are not intended to limit the implementation methods of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention shall be included in the protection scope of the claims of the present invention.

Claims

1. A method for intelligently matching barrage response text based on a knowledge base, characterized in that: The method comprises the following steps: Get the vectorized bullet text; Use the trained neural network model to classify the vectorized bullet texts and filter out the vectorized bullet texts with question meanings; Mapping the vectorized bullet-screen text with questioning meaning into the sample space, thereby obtaining a vectorized bullet-screen text sample set with questioning meaning; The ISODATA algorithm is used to perform the first adaptive clustering on the sample set of bullet text to obtain multiple first result clusters; The principal component analysis method is used to calculate the degree of aggregation of each first result cluster; Calculate the degree to which two adjacent first result clusters can be merged according to the aggregation degree of the first result clusters, the amount of data contained in the first result clusters, and the relative positions between different first result clusters; Merge the two first result clusters whose mergeability degree satisfies the first preset condition to obtain a plurality of merged clusters; Perform a second adaptive clustering using the K-means algorithm on each merged cluster to obtain the corresponding second result cluster; Calculate the merging effect of the merged clusters according to the data volume and position of each merged cluster and the corresponding second result cluster; According to the merging effect, a preferred cluster is selected from the second result cluster or the merged cluster, and the bullet text with the meaning of the question corresponding to the preferred cluster is responded to through the knowledge base to obtain the corresponding answer, which specifically includes: Determine whether the merging effect of each merging cluster meets the second preset condition; If the conditions are met, the merged cluster is taken as the preferred cluster, and the bullet-screen question content corresponding to the bullet-screen text closest to the cluster center in the merged cluster is searched, and the corresponding answer is obtained by responding through the knowledge base; If not, the second result cluster corresponding to the merged cluster is selected as the preferred cluster, and the bullet-screen question content corresponding to the bullet-screen text closest to the cluster center in the second result cluster is searched, and the knowledge base is used to respond to obtain the corresponding answer; The method of calculating the aggregation degree of each first result cluster by combining the principal component analysis method includes: Using the principal component analysis method to analyze each first result cluster, a plurality of principal component vectors are obtained; Selecting some principal component vectors, and calculating differences of the selected principal component vectors according to the modulus lengths of the selected principal component vectors; Calculate the average Euclidean distance between any data point in each first result cluster and the cluster center position of the first result cluster; Calculate the relative coefficient of difference of each first result cluster according to the mean and standard deviation of the data in the first result cluster; Calculate the shortest distance between the edge of each first result cluster and the edge of another adjacent first result cluster, and calculate the average inter-cluster distance between each first result cluster and all the adjacent first result clusters based on the shortest distance; Calculate the degree of aggregation of each first result cluster according to the obtained difference of the principal component vectors of the selected part, the average Euclidean distance, the relative difference coefficient, and the average inter-cluster distance; The degree to which two adjacent first result clusters can be merged is calculated according to the aggregation degree of the first result clusters, the amount of data contained in the first result clusters, and the relative positions between different first result clusters, including: Calculating a data quantity feature between the first result cluster and another adjacent first result cluster according to the data quantity contained in the first result cluster and another adjacent first result cluster; the data quantity feature indicates the amount of data contained in the other adjacent first result cluster relative to the first result cluster; Calculate the difference in the degree of clustering between a first result cluster and another adjacent first result cluster; Calculate the Euclidean distance between a first result cluster and another adjacent first result cluster; According to the obtained data volume characteristics, clustering difference, and Euclidean distance, the degree of merging of two adjacent first result clusters is calculated.

2. The method for intelligently matching barrage response texts based on a knowledge base according to claim 1, characterized in that: After calculating the merging degree of two adjacent first result clusters, and before merging the two first result clusters whose merging degree meets the first preset condition, the method further includes: The merging degree is normalized to obtain a normalized merging degree.

3. The method for intelligently matching barrage response texts based on a knowledge base according to claim 1, characterized in that: According to the data amount and position of each merged cluster and the corresponding second result cluster, the merge effect of the merged cluster is calculated, including: Calculate the data volume difference between each merged cluster and the corresponding second result cluster according to the intersection of the data in each merged cluster and the corresponding second result cluster, the data volume contained in each merged cluster, and the data volume contained in the second result cluster corresponding to each merged cluster; Calculate the Euclidean distance between each merged cluster and the cluster center of the corresponding second result cluster; The merging effect of the merging clusters is obtained according to the difference in data volume between each merging cluster and the corresponding second result cluster and the Euclidean distance calculation.

4. The method for intelligently matching barrage response texts based on a knowledge base according to claim 1, characterized in that: The step of obtaining the vectorized bullet text includes: Real-time collection of barrage text generated during live broadcast; The barrage text is vectorized to obtain vectorized barrage text.

5. The method for intelligently matching barrage response texts based on a knowledge base according to claim 4 is characterized in that: After real-time acquisition of the barrage text generated during the live broadcast process and before vectorization processing of the barrage text, the method further includes: The barrage text is preprocessed, and the preprocessing includes any one or more of cleaning empty data items, removing duplicate items, removing invalid symbols, removing emoticons, removing text symbols, and mechanical weight reduction.

6. A barrage response text intelligent matching system based on a knowledge base, applying the barrage response text intelligent matching method based on a knowledge base as described in any one of claims 1 to 5, characterized in that: The system comprises: An acquisition module is used to obtain a vectorized sample set of bullet texts with question meanings; A first clustering module, used for adaptively clustering the bullet text sample set to obtain a plurality of first result clusters; A clustering degree calculation module, used to calculate the clustering degree of each first result cluster in combination with a principal component analysis method; A merging degree calculation module, used to calculate the merging degree of two adjacent first result clusters according to the aggregation degree of the first result clusters, the amount of data contained in the first result clusters, and the relative positions between different first result clusters; A first screening module, used to screen out two first result clusters whose mergibility degree meets a first preset condition; A merging module, configured to merge two first result clusters whose mergeability degree satisfies a first preset condition, to obtain a plurality of merged clusters; A second clustering module performs adaptive clustering on each merged cluster to obtain a corresponding second result cluster; A merging effect calculation module, used to calculate the merging effect of the merging clusters according to the data volume and position of each merging cluster and the corresponding second result cluster; A second screening module, used to screen out the merged clusters whose merging effect meets the second preset condition; The knowledge matching module is used to select a preferred cluster from the second result cluster or the merged cluster according to the merging effect, and respond to the bullet text with the question meaning corresponding to the preferred cluster through the knowledge base to obtain the corresponding answer.