Method and device for determining hotspot problem
By calculating the similarity between the pending statements and the class clusters in real time and using text representation models, we determine the hot issues in the conversation platform system, solve the problem of inefficiency in the existing technology, and achieve timely and accurate identification of hot issues and efficiency improvement.
Patent Information
- Application Number
- CN202310786567.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2024-12-31
AI Technical Summary
In the prior art, it is inefficient to determine hot issues manually, and it is impossible to identify hot issues in the conversation platform system in a timely and accurate manner, especially when the number of customers visits is large, resulting in large workload and long time.
By obtaining the pending statement in real time, calculating its similarity to the benchmark statement in the determined class cluster, using the text representation model to obtain the representation vector, determining the class cluster to which the statement belongs, and determining the hot issues based on the number of statements in the class cluster, using negative samples and positive samples, Sample pairs train the model for improved accuracy.
It realizes timely and accurate identification of hot issues, improves efficiency, reduces the need for manual analysis, and saves human resources.
Smart Images

Figure CN119226506A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of natural language processing, and in particular to a method and device for determining hot issues. Background Art
[0002] In order to improve the automation and intelligence capabilities of the conversation platform system, it is necessary to display hot issues to customers to improve the service efficiency of the conversation platform system.
[0003] At present, hot issues are usually determined manually. Specifically, first, some conversations are randomly selected from the conversations of each work order obtained by the conversation platform system to obtain multiple groups of conversations. Then, the selected multiple groups of conversations are manually analyzed to determine the hot issues.
[0004] When the number of customer visits to the conversation platform system is large, the manual method of determining hot issues will cause a large workload, resulting in low efficiency and long time spent in determining hot issues, thus failing to determine hot issues in a timely and accurate manner. Summary of the invention
[0005] The present application provides a method and device for determining hot issues, which can determine hot issues in a timely and accurate manner and improve the efficiency of determining hot issues.
[0006] In a first aspect, a method for determining a hot issue is provided, comprising:
[0007] Determine the pending statements obtained by the conversation platform system in real time;
[0008] If the statement to be processed is the first statement input into the conversation platform system, determine the first cluster according to the statement to be processed;
[0009] Otherwise, the similarity between the statement to be processed and the benchmark statement in the determined cluster is calculated, and the cluster to which the statement to be processed belongs is determined according to the similarity, where the benchmark statement is a statement in the cluster that meets the first preset condition;
[0010] Determine hot issues based on the number of statements included in each of the identified clusters.
[0011] In a feasible design, the similarity between the sentence to be processed and the benchmark sentence in the determined cluster is calculated, and the cluster to which the sentence to be processed belongs is determined according to the similarity, including:
[0012] Get the similarity threshold;
[0013] Traverse the determined clusters in the preset order. In the process of traversing each determined cluster:
[0014] Calculate the similarity between the sentence to be processed and the benchmark sentence in the current cluster;
[0015] If the similarity is greater than or equal to the similarity threshold, the cluster to which the statement to be processed belongs is determined to be the current cluster, and the traversal process ends;
[0016] Otherwise, traverse the next cluster until all determined clusters are traversed in the preset order.
[0017] In a feasible design, the similarity between the sentence to be processed and the benchmark sentence in the current cluster is calculated, including:
[0018] Based on the text representation model, obtaining a first representation vector of the sentence to be processed;
[0019] Based on the text representation model, obtain a second representation vector of the benchmark sentence in the current cluster;
[0020] The cosine value of the first representation vector and the second representation vector in the direction of the vector space is calculated, and the cosine value is used as the similarity between the sentence to be processed and the benchmark sentence in the current cluster.
[0021] In a feasible design, before obtaining the first representation vector of the sentence to be processed based on the text representation model, the method further includes:
[0022] Obtaining a preprocessed training sample, where the training sample includes at least two sentences;
[0023] Determine at least one negative sample pair according to each sentence;
[0024] Based on the structure of each sentence, the length of each sentence is changed while keeping the semantic variation of each sentence within a predetermined range, so as to obtain at least one positive sample pair;
[0025] Using at least one negative sample pair and at least one positive sample pair, a text representation model is trained.
[0026] In a feasible design, based on the structure of each sentence, the length of each sentence is changed under the premise of keeping the semantic change degree of each sentence within a predetermined range to obtain at least one positive sample pair, including:
[0027] Based on the structure of each sentence, obtaining a first target component in each sentence whose semantic influence degree meets a second preset condition;
[0028] Repeat the first target component in each sentence to obtain each supplemented sentence;
[0029] According to each supplemented sentence and each original sentence, at least one positive sample pair is determined.
[0030] In a feasible design, before obtaining the first target component in each sentence whose semantic influence degree meets the second preset condition based on the structure of each sentence, the method further includes:
[0031] Get multiple test statements;
[0032] Determine each component of each test sentence, wherein each component includes the first target component;
[0033] Traverse multiple test statements. In the process of traversing each test statement:
[0034] Change the semantics of each component of the current test statement in turn, and keep other components unchanged, to obtain n change statements, where n is the number of components of the current test statement;
[0035] Calculate the similarity between the n changed sentences and the current test sentence, and obtain n similarity values corresponding to each component of the current test sentence;
[0036] After traversing the plurality of test sentences, according to the similarity values corresponding to the components of each test sentence, an average value of the similarity values corresponding to the components is determined;
[0037] The average value of the similarity values corresponding to each component determines the semantic influence degree corresponding to each component.
[0038] In a feasible design, at least one positive sample pair is determined based on each supplemented sentence and each original sentence, including:
[0039] Deleting the participles whose semantic influence on the part of speech does not meet the second preset condition in each supplemented sentence, and obtaining each deleted sentence;
[0040] At least one positive sample pair is determined according to each deleted sentence and each original sentence.
[0041] In a feasible design, at least one negative sample pair is determined according to each sentence, including:
[0042] In the process of determining the negative sample pairs corresponding to each sentence:
[0043] Get at least two statements other than the current statement;
[0044] Select a sentence from sentences other than the current sentence as a negative sample of the current sentence;
[0045] Use the negative sample of the current sentence and the current sentence to form a negative sample pair.
[0046] In a feasible design, after traversing the determined clusters in a preset order, the method further includes:
[0047] If the statement to be processed does not belong to any of the determined clusters, a new cluster is determined based on the statement to be processed.
[0048] In a second aspect, a device for determining a hotspot problem is provided, comprising:
[0049] A module for obtaining sentences to be processed, used to determine the sentences to be processed obtained by the conversation platform system;
[0050] A classification module, for determining a first cluster according to the sentence to be processed if the sentence to be processed is the first sentence input into the conversation platform system;
[0051] Otherwise, the classification module is further used to calculate the similarity between the sentence to be processed and the benchmark sentence in the determined cluster, and determine the cluster to which the sentence to be processed belongs according to the similarity, wherein the benchmark sentence is a sentence in the cluster to which it belongs that satisfies the first preset condition;
[0052] The hot issue determination module is used to determine the hot issue according to the number of statements included in each of the determined clusters.
[0053] In the above embodiment of the present application, negative sample pairs and positive sample pairs are obtained respectively according to at least two sentences in the preprocessed training samples. In the process of obtaining the positive sample corresponding to each sentence, based on the structure of the sentence, the length of the sentence is changed under the premise of keeping the semantic change degree of each sentence within a predetermined range to obtain the positive sample of the sentence. At this time, the semantic change degree of the positive sample compared with the sentence is within the predetermined range, so it can meet the semantic requirements of the positive sample. And because the length of the positive sample is different from that of the sentence, the text representation model can avoid the interference of the factor of "same length" when learning the features of the positive sample pair, thereby improving the accuracy of the text representation model when processing conversation sentences of different lengths, thereby improving the accuracy of the text features extracted by the text representation model to ensure the accuracy of the conversation clustering results obtained subsequently. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0055] Figure 1 It is a flowchart of a method for determining a hot issue provided by an exemplary embodiment of the present application;
[0056] Figure 2 is a flowchart of a method for determining a negative sample pair provided by an exemplary embodiment of the present application;
[0057] Figure 3 It is a schematic diagram of the structure of a device for determining a hot issue provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0058] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0059] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0060] In order to improve the timeliness and accuracy of identifying hot issues, such as Figure 1 As shown, the present application provides a method for determining hot spot problems, which is applied to a processor, and the method includes:
[0061] S110, determining the statements to be processed acquired in real time by the conversation platform system.
[0062] Specifically, after the customer inputs a question to the conversation platform system, the conversation platform system transmits the question as a statement to be processed to the processor in real time, so that the processor can determine the statement to be processed and perform subsequent processing.
[0063] It should be understood that the processor may also be a processor inside the conversation platform system, and the module of the conversation platform system that obtains input questions transmits the newly input questions to the processor.
[0064] S120: If the statement to be processed is the first statement input into the conversation platform system, determine a first cluster according to the statement to be processed.
[0065] If the statement to be processed is the first statement input to the conversation platform system, then after the conversation platform system sends the statement to be processed to the processor in real time, since there is no cluster in the processor at this time, it is necessary to determine the first cluster based on the statement to be processed. In other words, the first statement included in the first cluster is the statement to be processed.
[0066] like Figure 1 As shown, the name of this first cluster is "Category 1".
[0067] S130, otherwise, calculate the similarity between the statement to be processed and the benchmark statement in the determined cluster, and determine the cluster to which the statement to be processed belongs according to the similarity, wherein the benchmark statement is a statement in the cluster that satisfies the first preset condition.
[0068] If the statement to be processed is not the first statement input into the conversation platform system, then there is at least one cluster in the processor. Therefore, it is necessary to calculate the similarity between the statement to be processed and the benchmark statements in the determined clusters to determine the cluster to which the statement to be processed belongs.
[0069] Exemplarily, the first preset condition is that the benchmark sentence is the first sentence included in the cluster, that is, the benchmark sentence is the sentence first input to the conversation platform system in the cluster, and is also the sentence first transmitted to the processor by the conversation platform system in the cluster.
[0070] For example, the benchmark sentence of the first cluster is the first sentence to be processed that is input into the conversation platform system.
[0071] In a feasible design, the similarity between the sentence to be processed and the benchmark sentence in the determined cluster is calculated, and the cluster to which the sentence to be processed belongs is determined according to the similarity, including:
[0072] Get the similarity threshold;
[0073] Traverse the determined clusters in the preset order. In the process of traversing each determined cluster:
[0074] Calculate the similarity between the sentence to be processed and the benchmark sentence in the current cluster;
[0075] If the similarity is greater than or equal to the similarity threshold, the cluster to which the statement to be processed belongs is determined to be the current cluster, and the traversal process ends;
[0076] Otherwise, traverse the next cluster until all determined clusters are traversed in the preset order.
[0077] The similarity threshold can be set as needed, and this application does not limit it.
[0078] Exemplarily, the preset order is the order of time for determining the clusters.
[0079] In the above example, the determined clusters are traversed in a preset order. In the process of traversing each determined cluster, the similarity between the statement to be processed and the benchmark statement in the current cluster is calculated to determine whether the statement to be processed belongs to the current cluster. If it does, the traversal process ends. If it does not, the next cluster is traversed to continue to determine whether it belongs to the next cluster until the determined clusters are traversed in the preset order. In this way, it is possible to accurately determine whether the statement to be processed belongs to the determined cluster.
[0080] The present application also considers that after traversing the determined clusters in a preset order, the statement to be processed may belong to the last cluster in the traversal process, or may not belong to any of the determined clusters. If the statement to be processed does not belong to any of the determined clusters, a new cluster is determined based on the statement to be processed. Furthermore, the statement to be processed is used as the benchmark statement of the new cluster.
[0081] In the above example, if the statement to be processed does not belong to any of the determined clusters, determining a new cluster based on the statement to be processed can improve the accuracy of cluster determination.
[0082] In a feasible design, the similarity between the sentence to be processed and the benchmark sentence in the current cluster is calculated, including:
[0083] Based on the text representation model, obtaining a first representation vector of the sentence to be processed;
[0084] Based on the text representation model, obtain a second representation vector of the benchmark sentence in the current cluster;
[0085] The cosine value of the first representation vector and the second representation vector in the direction of the vector space is calculated, and the cosine value is used as the similarity between the sentence to be processed and the benchmark sentence in the current cluster.
[0086] When the representation vectors of the texts of two conversations belong to the same direction, the closer the cosine value is to 1, the more similar the two representation vectors are, indicating that the two conversations are more likely to belong to the same cluster. In the above example, by calculating the cosine value of the first representation vector and the second representation vector in the direction of the vector space, the cosine value is used as the similarity between the sentence to be processed and the benchmark sentence in the current cluster, so as to accurately determine whether the sentence to be processed belongs to the current cluster.
[0087] In a feasible design, before obtaining the first representation vector of the sentence to be processed based on the text representation model, the method further includes:
[0088] The sentences to be processed are preprocessed, including text denoising, text segmentation and stop word removal.
[0089] It should be understood that the expression form of the sentence in this application is text, so the sentence to be processed can be referred to as the text of the sentence to be processed, and the reference sentence can be referred to as the text of the reference sentence. At the same time, the sentence to be processed can also be understood as the text of the sentence to be processed, and the reference sentence can also be understood as the text of the reference sentence.
[0090] It should be understood that each benchmark statement has been processed as a statement to be processed. Therefore, in this example, each benchmark statement is a pre-processed statement.
[0091] Since conversational sentences have diverse expressions, complex semantic structures, and contain a large amount of redundant and invalid information, it is necessary to preprocess the text of the sentences to be processed in order to improve data quality and provide basic data support for subsequent work.
[0092] Exemplarily, text denoising processing includes operations such as removing facial expressions, removing punctuation marks, removing invalid characters, etc., which can improve the quality of the sentence to be processed.
[0093] Exemplarily, the text segmentation process includes:
[0094] Divide the text into multiple tokens based on its part of speech.
[0095] Specifically, the conversation text is divided into separate, meaningful words according to pre-set rules, for example, the Jieba word segmentation tool can be used.
[0096] Exemplarily, the stop word removal process includes: removing useless and redundant information, such as "ah", "oh", "uh" and other modal particles that have no practical meaning; "$", "¥", "%" and other symbols that also have no practical meaning, in addition to some specific names, place names, dates, numbers, etc., which can reduce interference when extracting text features.
[0097] In the above example, the text representation model is used to encode the sentence to be processed and the benchmark sentence, and the representation vectors of the two texts are obtained to extract the semantic features of the two texts. Therefore, the similarity between the two texts calculated based on the representation vectors of the two texts can determine whether the semantics of the two texts are similar, rather than just determining whether the two texts are similar from the text. Therefore, the above example can improve the accuracy of the similarity, thereby improving the accuracy of determining the cluster to which the text to be processed belongs, and ultimately improving the accuracy of the hot issues determined according to each cluster.
[0098] Current text representation models usually obtain positive samples of sentences by randomly replacing word segments in sentences. Since the length of the word segment used for replacement is the same as the length of the replaced word segment, the sample constructed in this way has the same length as the original sample, so that the positive sample pair contains information of the same length, which will cause the model to tend to believe that sentences of the same length have the same semantic information, which is inconsistent with the actual situation and will reduce the accuracy of the text representation model when processing conversation sentences of different lengths.
[0099] In order to solve the above problem, in a feasible design, before obtaining the first representation vector of the sentence to be processed based on the text representation model, the method further includes:
[0100] S131, obtaining a preprocessed training sample, where the training sample includes at least two sentences.
[0101] S132, determining at least one negative sample pair according to each sentence.
[0102] The goal of training a text representation model involves contrastive learning, i.e., making semantically similar texts closer (by learning features of positive pairs) and semantically dissimilar texts farther apart (by learning features of negative pairs).
[0103] The present application provides the following method for obtaining negative sample pairs, and determines at least one negative sample pair according to each sentence, including:
[0104] In the process of determining the negative sample pairs corresponding to each sentence:
[0105] Get at least two statements other than the current statement;
[0106] Select a sentence from sentences other than the current sentence as a negative sample of the current sentence;
[0107] Use the negative sample of the current sentence and the current sentence to form a negative sample pair.
[0108] like Figure 2 As shown, the training samples include sentences S1, S2, ..., Sn. For sentence S1, a sentence is selected from S1 to Sn as a negative sample of sentence S1, and a negative sample pair is generated as (S1, Si)i is not equal to 1, for example (S1, S2).
[0109] In the above example, by selecting a sentence from sentences other than the current sentence as the negative sample of the current sentence, the text distance between the two sentences in the negative sample pair can be made far, which is combined with the positive sample pair with a close text distance, which is beneficial to the comparative learning of the text representation model during the training process.
[0110] Exemplarily, the text representation model is a neural network model based on a Bidirectional Encoder Representation from Transformers (BERT) model.
[0111] S133, based on the structure of each sentence, changing the length of each sentence while keeping the semantic variation degree of each sentence within a predetermined range, so as to obtain at least one positive sample pair.
[0112] There are usually eight components of a sentence in modern Chinese, namely subject, predicate, object, verb, attributive, adverbial, complement and central word.
[0113] Exemplarily, the basic structure of a Chinese sentence includes: subject+predicate, or subject+predicate+object, and the structure of a sentence is usually further added with other sentence components to form the structure of the sentence based on the basic structure.
[0114] It can be seen that as long as the components constituting the basic structure of the sentence remain unchanged, changing the length of the sentence can keep the semantic change of the sentence within a predetermined range. The predetermined range is determined according to actual needs and is not limited in this application.
[0115] For example, take the predetermined range of 0 to 10%. For a sentence whose basic structure includes subject + predicate + object, if the subject, predicate, and object are retained, and the semantic change degree of the sentence after changing other sentence components is 0, then after changing the length of the sentence, the semantic change degree of the sentence is within the predetermined range. If the object is deleted or changed, and the subject, predicate, and other components are retained, then the semantic change degree of the changed sentence is 33% (that is, the number of changed components divided by the total number of components of the basic structure, that is, 1 divided by 3 is the result of the semantic change degree).
[0116] Therefore, based on the structure of the sentence, the application changes the length of the sentence while keeping the degree of change of the sentence within a predetermined range to obtain a positive sample of the sentence. At this time, the semantic change of the positive sample compared to the sentence is within the predetermined range, so it can meet the requirements of the positive sample. And because the length of the positive sample is different from that of the sentence, the text representation model can avoid the interference of the "same length" factor when learning the features of the positive sample pair.
[0117] In a feasible design, based on the structure of each sentence, the length of each sentence is changed while keeping the semantic variation of each sentence within a predetermined range to obtain at least one positive sample pair, including:
[0118] Based on the structure of each sentence, obtaining a first target component in each sentence whose semantic influence degree meets a second preset condition;
[0119] Repeat the first target component in each sentence to obtain each supplemented sentence;
[0120] According to each supplemented sentence and each original sentence, at least one positive sample pair is determined.
[0121] It should be noted that the degree of influence of the components in a sentence on the semantics can be determined based on actual experience, or based on statistics.
[0122] Exemplarily, firstly, a plurality of test statements are obtained, and each component of each test statement is determined, wherein each component includes the first target component. The plurality of test statements are traversed, and in the process of traversing each test statement:
[0123] Change the semantics of each component of the current test statement in turn, and keep other components unchanged, to obtain n change statements, where n is the number of components of the current test statement;
[0124] The similarities between the n changed sentences and the current test sentence are calculated to obtain n similarity values corresponding to each component of the current test sentence.
[0125] The method of calculating the similarity between the n change statements and the current statement is described in the above embodiment, and will not be repeated in this application.
[0126] After traversing multiple test statements, you can get the following table, taking m statements as an example:
[0127] Table 1
[0128]
[0129] As shown in Table 1, after changing the subject, predicate, and object, the semantics of the sentence changed significantly, and the similarity with the original sentence was small. The semantics of the sentence with other components changed did not change significantly, and the similarity with the original sentence was large.
[0130] Finally, according to the similarity values corresponding to each component of each test sentence in Table 1, the average value of the similarity values corresponding to each component is determined. Determine the semantic influence level of the average value of the similarity values corresponding to each component. Among them, the similarity average value is between 0-0.399, and the semantic influence level is level 1; the similarity average value is between 0.400-0.699, and the semantic influence level is level 2; the similarity average value is between 0.700-1, and the semantic influence level is level 3.
[0131] Based on the above embodiment, the second preset condition includes that the semantic influence level is level 2 or level 3. That is, the components with semantic influence level 2 or level 3 in each sentence are obtained as the first target components.
[0132] Exemplarily, based on the statistical results, it is determined that the first target component includes one or more of a subject, a predicate, and an object.
[0133] Since the first target component in the sentence that meets the second preset condition for the degree of influence on semantics constitutes the main semantics of the sentence. In the above example, by repeating the first target component, that is, repeating the component that constitutes the main semantics of the sentence, the length of the generated positive sample can be different from the length of the original sentence under the premise that the semantics of the original sentence remains unchanged. And because the first target component that constitutes the main semantics in the sentence is repeated, the proportion of the main semantics in the sentence is increased, which enables the text representation model to focus on extracting semantic features based on the main semantics in the sentence, thereby improving the accuracy of the text representation model in extracting semantic features. Compared to randomly deleting the components of the original sentence or randomly adding words to the original sentence to change the degree of the sentence, the above embodiment of the present application can avoid the positive sample having additional noise compared to the original sentence, or even misinterpreting the semantics of the sentence itself, thereby causing the text representation model to learn the characteristics of the positive sample pair to be disturbed.
[0134] In a feasible design, at least one positive sample pair is determined based on each supplemented sentence and each original sentence, including:
[0135] Deleting the participles whose semantic influence on the part of speech does not meet the second preset condition in each supplemented sentence, and obtaining each deleted sentence;
[0136] At least one positive sample pair is determined according to each deleted sentence and each original sentence.
[0137] The parts of speech of a text can be divided into nouns, verbs, adjectives, numerals, quantifiers, pronouns, adverbs, prepositions, conjunctions, auxiliary words, onomatopoeia and interjections, etc.
[0138] The method for determining the degree of influence of parts of speech on semantics refers to the method for determining the degree of influence of sentence components on semantics in the above example, which will not be repeated here.
[0139] Exemplarily, deleting the participles whose part of speech influence on semantics does not meet the second preset condition in each supplemented sentence includes:
[0140] Delete participles in the sentence that are adjectives or adverbs.
[0141] According to prior knowledge or statistical results, it is known that the degree of influence of adjectives or adverbs on semantics does not meet the second preset condition. Therefore, the length of the sentence can be changed by deleting participles with adjective or adverb parts of speech, further increasing the proportion of participles that constitute the main semantics (such as verbs, nouns, etc.) in the sentence, so that the text representation model can focus on extracting semantic features based on the main semantics in the sentence. It is also possible to improve the efficiency of semantic feature learning for positive sample pairs by deleting participles that have little influence on the semantics of the sentence.
[0142] Based on the above example, this application provides an example of a process for constructing a positive sample pair, including the following steps:
[0143] Step a: Based on the structure of sentence S1, perform syntactic analysis to obtain sentence components such as the subject, predicate, and object of sentence S1;
[0144] Step b: Repeat one or more components of the subject and predicate (or subject, predicate and object) of sentence S1 to generate a supplemented sentence;
[0145] Step c: Perform part-of-speech analysis on the supplemented sentence, delete adjectives and / or adverbs, and obtain multiple target participles that are retained;
[0146] Step d: Reconstruct the sentence based on the positions of multiple target word segments, and use the reconstructed sentence as the positive sample S of the original sentence + 1.
[0147] S134, training a text representation model using at least one negative sample pair and at least one positive sample pair.
[0148] In the above embodiment of the present application, negative sample pairs and positive sample pairs are obtained respectively according to at least two sentences in the preprocessed training samples. In the process of obtaining the positive sample corresponding to each sentence, based on the structure of the sentence, the length of the sentence is changed under the premise of keeping the semantic change degree of each sentence within a predetermined range to obtain the positive sample of the sentence. At this time, the semantic change degree of the positive sample compared with the sentence is within the predetermined range, so it can meet the semantic requirements of the positive sample. And because the length of the positive sample is different from that of the sentence, the text representation model can avoid the interference of the factor of "same length" when learning the features of the positive sample pair, thereby improving the accuracy of the text representation model when processing conversation sentences of different lengths, thereby improving the accuracy of the text features extracted by the text representation model to ensure the accuracy of the conversation clustering results obtained subsequently.
[0149] S140, determining hot issues according to the number of statements included in each of the determined clusters.
[0150] In a feasible design, hot issues are determined based on the number of statements included in each of the identified clusters, including:
[0151] Get the statement quantity threshold;
[0152] The cluster whose number of sentences included in the determined cluster is greater than or equal to the sentence number threshold is used as the target cluster;
[0153] Determine hot issues based on the statements included in the target cluster.
[0154] The statement quantity threshold can be set according to actual needs and is not limited in this application.
[0155] In the above example, by taking the clusters whose number of sentences included in the determined clusters is greater than or equal to the sentence number threshold as the target cluster, the cluster to which the hot issue belongs can be accurately determined.
[0156] In a feasible design, hot issues are determined based on the statements included in the target cluster, including:
[0157] The benchmark statements of each cluster in the target cluster are identified as hot issues.
[0158] In the above example, by determining the benchmark statements of each cluster in the target cluster as hot issues, the hot issues of each cluster can be efficiently determined.
[0159] In a feasible design, hot issues are determined based on the statements included in the target cluster, including:
[0160] Traverse each cluster in the target cluster. In the process of traversing each cluster:
[0161] Determine at least one keyword corresponding to the current cluster;
[0162] Count the frequency of each keyword appearing in the sentences included in the current cluster;
[0163] Determine the hot issues corresponding to the current cluster based on the frequency of each keyword.
[0164] Exemplarily, determining the hot issues corresponding to the current cluster according to the frequency of each keyword includes:
[0165] Determine frequency threshold;
[0166] Traverse at least one keyword corresponding to the current cluster. In the process of traversing each keyword:
[0167] If the frequency of the current keyword is greater than or equal to the frequency threshold, it is determined that the current keyword belongs to a hot issue;
[0168] Otherwise, it is determined that the current keyword does not belong to a hot topic.
[0169] In the above example, the frequency of occurrence of keywords in each cluster can accurately determine whether the keywords belong to hot issues. For example, if the keywords with a frequency greater than or equal to the frequency threshold in a certain cluster are 123, abc, yur, then the hot issues are 123, abc, yur. That is, these keywords constitute the hot issues, and there is no need to care about the order of the keywords.
[0170] In the above embodiment of the present application, the statement to be processed acquired in real time by the conversation platform system is first determined. If the statement to be processed is the first statement input into the conversation platform system, it means that there is no cluster at this time, so the first cluster is determined directly according to the statement to be processed. Otherwise, the similarity between the statement to be processed and the benchmark statement in the determined cluster is calculated, and the cluster to which the statement to be processed belongs is determined according to the similarity. The cluster to which the statement to be processed belongs is determined by comparing the similarity of the newly input statement to be processed with the benchmark statement of the existing cluster in turn according to the order in which the statements are input into the conversation platform system. Compared with classifying all the statements after acquiring the new statement to be processed, the above method can efficiently and real-time determine the category to which the newly input statement to be processed belongs by streaming the statement to be processed, and then can timely and accurately determine the hot issues from the determined cluster. And there is no need to manually analyze and extract hot issues from a large number of conversations acquired by the conversation platform system on a regular basis, which saves a lot of manpower and improves the efficiency of determining hot issues.
[0171] Based on the above-mentioned method for determining hot issues, the present application also provides a device for determining hot issues, such as Figure 3 As shown, including:
[0172] A module for obtaining sentences to be processed, used to determine the sentences to be processed obtained by the conversation platform system;
[0173] A classification module, for determining a first cluster according to the sentence to be processed if the sentence to be processed is the first sentence input into the conversation platform system;
[0174] Otherwise, the classification module is further used to calculate the similarity between the sentence to be processed and the benchmark sentence in the determined cluster, and determine the cluster to which the sentence to be processed belongs according to the similarity, wherein the benchmark sentence is a sentence in the cluster to which it belongs that satisfies the first preset condition;
[0175] The hot issue determination module is used to determine the hot issue according to the number of statements included in each of the determined clusters.
[0176] In a feasible design, the classification module calculates the similarity between the sentence to be processed and the benchmark sentence in the determined cluster in the following manner, and determines the cluster to which the sentence to be processed belongs according to the similarity, including:
[0177] Get the similarity threshold;
[0178] Traverse the determined clusters in the preset order. In the process of traversing each determined cluster:
[0179] Calculate the similarity between the sentence to be processed and the benchmark sentence in the current cluster;
[0180] If the similarity is greater than or equal to the similarity threshold, the cluster to which the statement to be processed belongs is determined to be the current cluster, and the traversal process ends;
[0181] Otherwise, traverse the next cluster until all determined clusters are traversed in the preset order.
[0182] In a feasible design, the classification module calculates the similarity between the sentence to be processed and the benchmark sentence in the current cluster in the following manner, including:
[0183] Based on the text representation model, obtaining a first representation vector of the sentence to be processed;
[0184] Based on the text representation model, obtain a second representation vector of the benchmark sentence in the current cluster;
[0185] The cosine value of the first representation vector and the second representation vector in the direction of the vector space is calculated, and the cosine value is used as the similarity between the sentence to be processed and the benchmark sentence in the current cluster.
[0186] In a feasible design, the device also includes a text representation model training module:
[0187] The text representation model training module is used to obtain preprocessed training samples, where the training samples include at least two sentences;
[0188] The text representation model training module is also used to determine at least one negative sample pair according to each sentence;
[0189] The text representation model training module is further used to change the length of each sentence based on the structure of each sentence while keeping the semantic change degree of each sentence within a predetermined range, so as to obtain at least one positive sample pair;
[0190] The text representation model training module is also used to train the text representation model using at least one negative sample pair and at least one positive sample pair.
[0191] In a feasible design, the text representation model training module changes the length of each sentence based on the structure of each sentence while keeping the semantic variation of each sentence within a predetermined range to obtain at least one positive sample pair, including:
[0192] Based on the structure of each sentence, obtaining a first target component in each sentence whose semantic influence degree meets a second preset condition;
[0193] Repeat the first target component in each sentence to obtain each supplemented sentence;
[0194] According to each supplemented sentence and each original sentence, at least one positive sample pair is determined.
[0195] In a feasible design, the device further includes a semantic influence degree determination module, which determines the semantic influence degree corresponding to each component in the sentence in the following manner:
[0196] Get multiple test statements;
[0197] Determine each component of each test sentence, each component including the first target component;
[0198] Traverse multiple test statements. In the process of traversing each test statement:
[0199] Change the semantics of each component of the current test statement in turn, and keep other components unchanged, to obtain n change statements, where n is the number of components of the current test statement;
[0200] Calculate the similarity between the n changed sentences and the current test sentence, and obtain n similarity values corresponding to each component of the current test sentence;
[0201] After traversing the plurality of test sentences, according to the similarity values corresponding to the components of each test sentence, an average value of the similarity values corresponding to the components is determined;
[0202] The average value of the similarity values corresponding to each component determines the semantic influence degree corresponding to each component.
[0203] In a feasible design, the text representation model training module determines at least one positive sample pair according to each supplemented sentence and each original sentence in the following manner:
[0204] Deleting the participles whose semantic influence on the part of speech does not meet the second preset condition in each supplemented sentence, and obtaining each deleted sentence;
[0205] At least one positive sample pair is determined according to each deleted sentence and each original sentence.
[0206] In a feasible design, the text representation model training module determines at least one negative sample pair according to each sentence in the following manner, including:
[0207] In the process of determining the negative sample pairs corresponding to each sentence:
[0208] Get at least two statements other than the current statement;
[0209] Select a sentence from sentences other than the current sentence as a negative sample of the current sentence;
[0210] Use the negative sample of the current sentence and the current sentence to form a negative sample pair.
[0211] In a feasible design, after traversing the determined clusters in a preset order, the classification module is further used to determine a new cluster based on the statement to be processed if the statement to be processed does not belong to any of the determined clusters.
[0212] For other implementation methods and effects of the device, please refer to the description in the hot spot problem determination method embodiment, which will not be repeated here.
[0213] The basic principles of the present application are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present application are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present application. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, not for limitation, and the above details do not limit the present application to being implemented by adopting the above specific details.
[0214] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0215] The block diagrams of the devices, apparatuses, equipment, and systems involved in this application are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The words "such as" used here refer to the phrase "such as but not limited to", and can be used interchangeably with them.
[0216] It should also be noted that in the apparatus, device and method of the present application, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present application.
[0217] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present application. Therefore, the present application is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0218] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present application to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A method for determining hot issues, characterized in that: include: Determine the pending statements obtained by the conversation platform system in real time; If the statement to be processed is the first statement input into the conversation platform system, determining a first cluster according to the statement to be processed; Otherwise, calculating the similarity between the statement to be processed and a benchmark statement in the determined cluster, and determining the cluster to which the statement to be processed belongs according to the similarity, wherein the benchmark statement is a statement in the cluster that satisfies a first preset condition; Hot issues are determined based on the number of statements included in each of the determined clusters.
2. The method according to claim 1, characterized in that The calculating the similarity between the statement to be processed and the benchmark statement in the determined cluster, and determining the cluster to which the statement to be processed belongs according to the similarity, comprises: Get the similarity threshold; Traverse the determined clusters in the preset order. In the process of traversing each determined cluster: Calculating the similarity between the sentence to be processed and the benchmark sentence in the current cluster; If the similarity is greater than or equal to the similarity threshold, determine that the cluster to which the statement to be processed belongs is the current cluster, and end the traversal process; Otherwise, traverse the next cluster until all determined clusters are traversed in the preset order.
3. The method according to claim 2, characterized in that The calculating the similarity between the sentence to be processed and the benchmark sentence in the current cluster includes: Based on the text representation model, obtaining a first representation vector of the sentence to be processed; Based on the text representation model, obtaining a second representation vector of a benchmark sentence in the current cluster; The cosine values of the first representation vector and the second representation vector in the direction of the vector space are calculated, and the cosine values are used as the similarity between the sentence to be processed and the benchmark sentence in the current cluster.
4. The method according to claim 3, characterized in that Before obtaining the first representation vector of the sentence to be processed based on the text representation model, the method further includes: Obtaining a preprocessed training sample, wherein the training sample includes at least two sentences; Determine at least one negative sample pair according to each of the sentences; Based on the structure of each of the sentences, changing the length of each of the sentences while keeping the semantic variation of each of the sentences within a predetermined range, so as to obtain at least one positive sample pair; The text representation model is trained using the at least one negative sample pair and the at least one positive sample pair.
5. The method according to claim 4, characterized in that The step of changing the length of each sentence based on the structure of each sentence while keeping the semantic variation of each sentence within a predetermined range to obtain at least one positive sample pair includes: Based on the structure of each of the sentences, obtaining a first target component in each of the sentences whose semantic influence degree meets a second preset condition; Repeating the first target component in each of the sentences to obtain each supplemented sentence; At least one positive sample pair is determined according to each of the supplemented sentences and each of the original sentences.
6. The method according to claim 5, characterized in that Before obtaining the first target component in each of the sentences whose semantic influence degree meets the second preset condition based on the structure of each of the sentences, the method further includes: Get multiple test statements; Determine each component of each of the test sentences, wherein each component includes the first target component; Traverse the plurality of test statements, and in the process of traversing each of the test statements: Sequentially change the semantics of each component of the current test statement, and keep other components unchanged, to obtain n change statements, where n is the number of components of the current test statement; Calculating the similarities between the n changed sentences and the current test sentence, and obtaining n similarity values corresponding to each component of the current test sentence; After traversing the plurality of test sentences, according to the similarity values respectively corresponding to the components of each of the test sentences, an average value of the similarity values respectively corresponding to the components is determined; The average value of the similarity values corresponding to each component determines the semantic influence degree corresponding to each component.
7. The method according to claim 5, characterized in that Determining at least one positive sample pair according to each of the supplemented sentences and each of the original sentences includes: Deleting the participles whose semantic influence on the part of speech does not meet the second preset condition in each supplemented sentence, and obtaining each deleted sentence; At least one positive sample pair is determined according to each deleted sentence and each original sentence.
8. The method according to claim 4, characterized in that The determining at least one negative sample pair according to each of the sentences comprises: In the process of determining the negative sample pairs corresponding to each of the sentences: Obtaining statements other than the current statement from the at least two statements; Selecting a sentence from sentences other than the current sentence as a negative sample of the current sentence; A negative sample of the current sentence is used together with the current sentence to form a negative sample pair.
9. The method according to claim 2, characterized in that: After traversing the determined clusters in a preset order, the method further includes: If the statement to be processed does not belong to any of the determined clusters, a new cluster is determined according to the statement to be processed.
10. A device for determining hot issues, characterized in that: include: A module for obtaining sentences to be processed, used to determine the sentences to be processed obtained by the conversation platform system; A classification module, configured to determine a first cluster according to the statement to be processed if the statement to be processed is the first statement input into the conversation platform system; Otherwise, the classification module is further used to calculate the similarity between the statement to be processed and a benchmark statement in the determined cluster, and determine the cluster to which the statement to be processed belongs according to the similarity, wherein the benchmark statement is a statement in the cluster to which it belongs that satisfies the first preset condition; The hot issue determination module is used to determine the hot issue according to the number of statements included in each of the determined clusters.