Text processing method and apparatus, and electronic device

By using keywords from the target scene to weight the text during text processing, the problem of low text similarity caused by speech recognition errors is solved, and more accurate text similarity calculation is achieved.

CN116127331BActive Publication Date: 2026-05-01MASHANG CONSUMER FINANCE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MASHANG CONSUMER FINANCE CO LTD
Filing Date
2022-10-28
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Traditional text similarity calculation methods have low accuracy in speech recognition scenarios due to semantic recognition errors, making it impossible to accurately determine the similarity between texts.

Method used

By acquiring keywords corresponding to the target scene, weighting is performed on each word in the first and second texts to obtain weighted features, and similarity is calculated based on these features.

Benefits of technology

It improves the accuracy of determining text similarity, weakens the impact of semantic recognition errors, and enhances the precision of text similarity calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116127331B_ABST
    Figure CN116127331B_ABST
Patent Text Reader

Abstract

The present disclosure discloses a text processing method, device and electronic equipment, and relates to the technical field of text processing. The text processing method comprises: in response to a trigger event of calculating the similarity of texts in a target scene, obtaining keyword words corresponding to the target scene; based on the situation of the keyword words contained in the first text, performing weighting processing on each word in the first text to obtain the weighted features of the first text; determining the weighted features of the second text, wherein the weighted features of the second text are obtained by performing weighting processing on each word in the second text based on the situation of the keyword words contained in the second text; and calculating the similarity according to the weighted features of the first text and the weighted features of the second text to determine the similarity between the first text and the second text. The present disclosure determines the similarity between two texts through the weighted features of the two texts, which can reduce the influence of long text sentences and incorrect semantics on the similarity, and improve the accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of text processing technology, specifically to a text processing method, apparatus, and electronic device. Background Technology

[0002] In recent years, with the rapid development of intelligent technology, text similarity calculation tasks have been increasingly widely used in daily life. Text similarity is used to measure the similarity between two texts. Text similarity calculation tasks have wide applications in search engines, recommendation systems, intelligent question answering, machine translation, automatic response, named entity recognition, and pinyin correction.

[0003] However, traditional text similarity calculations mostly rely on word-by-word similarity. In speech recognition scenarios, semantic errors in the text can lead to low accuracy in text similarity calculations. In summary, current text similarity calculation methods in text processing are relatively simple, have limited application scenarios, and suffer from low accuracy in many situations, thus failing to accurately determine the similarity between texts. Therefore, how to more accurately determine the similarity between texts has become one of the urgent problems to be solved in the field of text processing. Summary of the Invention

[0004] In view of this, the present disclosure provides a text processing method, apparatus and electronic device to solve the problem that traditional methods are difficult to accurately determine the similarity between texts.

[0005] In a first aspect, one embodiment of this disclosure provides a text processing method, comprising: in response to a triggering event for calculating text similarity in a target scene, acquiring keywords corresponding to the target scene; weighting each word in the first text based on the keywords contained in the first text to obtain weighted features of the first text; determining weighted features of a second text, wherein the weighted features of the second text are obtained by weighting each word in the second text based on the keywords contained in the second text; and calculating similarity based on the weighted features of the first text and the weighted features of the second text to determine the similarity between the first text and the second text.

[0006] Secondly, one embodiment of this disclosure provides a text processing apparatus, including: an acquisition module, configured to acquire keywords corresponding to the target scene in response to a trigger event for calculating text similarity in a target scene; a processing module, configured to perform weighted processing on each word in the first text based on the keywords contained therein, to obtain weighted features of the first text; and a determination module, configured to determine weighted features of a second text, wherein the weighted features of the second text are obtained by performing weighted processing on each word in the second text based on the keywords contained therein. Furthermore, the determination module is also configured to perform similarity calculation based on the weighted features of the first text and the weighted features of the second text, to determine the similarity between the first text and the second text.

[0007] Thirdly, one embodiment of this disclosure provides an electronic device including: a processor and a memory for storing processor-executable instructions, wherein the processor is used to perform the method mentioned in the first aspect above.

[0008] Fourthly, one embodiment of this disclosure provides a computer storage medium storing a computer program, which, when loaded by a processor, is used to perform the method mentioned in the first aspect.

[0009] The text processing method disclosed herein performs weighted processing on the words in the two texts to be evaluated based on the keywords corresponding to the target scene and the presence of these keywords, obtaining weighted features for each text. Based on these weighted features, the similarity between the two texts is determined. In other words, this disclosure highlights the relationship between the two texts and the keywords corresponding to the target scene, thereby emphasizing the semantic information of the text. Therefore, this disclosure utilizes keywords corresponding to the target scene and weighted operations to highlight the importance of keywords in the text. Since the importance of keywords in the text helps in understanding the semantic information, determining text similarity based on this understood semantic information can reduce the impact of semantic errors and improve the accuracy of text similarity determination. Attached Figure Description

[0010] The above and other objects, features, and advantages of this disclosure will become more apparent from the more detailed description of the embodiments thereof in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the embodiments of this disclosure to explain the disclosure and do not constitute a limitation thereof.

[0011] Figures 1a to 1c The diagram shown is an application scenario illustration provided by an embodiment of this disclosure.

[0012] Figure 2The diagram shown is a flowchart of a text processing method provided in an embodiment of this disclosure.

[0013] Figure 3 The diagram shown is a flowchart illustrating an embodiment of this disclosure, in which similarity is calculated based on the weighted features of a first text and the weighted features of a second text to determine the similarity between the first text and the second text.

[0014] Figure 4 The diagram shown is a flowchart illustrating a method for determining first similarity information based on the vector inner product, the vector length of the weighted vector of the first text, and the vector length of the weighted vector of the second text, according to an embodiment of this disclosure.

[0015] Figure 5 The diagram shown is a structural schematic of a text processing model provided in an embodiment of this disclosure.

[0016] Figure 6 The diagram shown is a flowchart illustrating another text processing method provided in an embodiment of this disclosure.

[0017] Figure 7 The diagram shown is a structural schematic of a text processing apparatus provided in an embodiment of this disclosure.

[0018] Figure 8 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0019] The technical solutions of the present disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present disclosure, and not all embodiments.

[0020] In recent years, with the rapid development of intelligent technology, text similarity calculation tasks have been increasingly widely used in daily life. In the field of text processing, text similarity is a crucial indicator for judging text similarity, and its importance is self-evident. For example, in the field of intelligent question answering, the speech of a human answering a question is processed through speech recognition to obtain speech recognition text, and the similarity between the speech recognition text and the answer text can serve as a factor in determining the accuracy of the human answer; similarly, in the field of machine translation, the similarity (or degree of similarity) between the machine-translated text and the standard human translation can serve as a factor in determining the accuracy of the machine translation.

[0021] Research on text similarity calculation has revealed that traditional methods primarily rely on word vector calculation, character-based calculation, probabilistic statistical calculation, and word embedding model-based calculation. However, the development of text similarity calculation in intelligent question-answering systems is limited. Specifically, the high error rate in recognizing human-generated speech text reduces the accuracy of text similarity calculation and increases its difficulty. A common method for obtaining speech recognition text is based on Automatic Speech Recognition (ASR) technology. This involves using a computer to recognize the speech signals generated by human speech to obtain speech recognition text. Since ASR technology generally only considers the Word Error Rate (WER) and not the semantics of the text, it often generates low-quality, illogical sentences. However, in intelligent question-answering systems, the inherent randomness of dialogue, the presence of numerous specialized terms, and the high error rate of speech recognition text mean that traditional text processing methods cannot effectively address the errors in speech recognition text, leading to errors in subsequent determination of text similarity.

[0022] Based on the current state of text similarity calculation, this disclosure proposes a text processing method, apparatus, and electronic device. Utilizing keywords corresponding to the target scene, weighted processing is applied to each word in a first text and a second text to obtain weighted features for each text. Based on these weighted features, the similarity between the first text and the second text is determined. This disclosure emphasizes the importance of keywords in text and can solve the problem of errors in speech recognition leading to incorrect similarity determinations.

[0023] The text processing method proposed in this disclosure can be executed by an electronic device, which can be a terminal or a server. The terminal can refer to computer terminals such as desktop computers and laptops, as well as mobile terminals such as tablet computers and mobile phones. The server can refer to an independent physical server, a server cluster composed of multiple servers, or a cloud server capable of cloud computing.

[0024] The following is combined Figure 1a A brief introduction to the application scenarios of the embodiments of this disclosure is provided.

[0025] Figure 1a The diagram illustrates an application scenario of one embodiment of this disclosure. Figure 1a As shown, this scenario involves evaluating the similarity between text A and text B. Specifically, this scenario includes a server 110 and a user terminal 120 communicatively connected to the server 110, wherein the server 110 is used to execute the text processing method mentioned in the embodiments of this disclosure.

[0026] For example, server 110 and user terminal 120 can jointly form a text processing system for executing the text processing methods mentioned in the embodiments of this disclosure.

[0027] For example, a user sends an instruction to the server 110 via user terminal 120 to evaluate the similarity between text A and text B. Upon receiving the instruction, the server 110 obtains keywords, performs weighted processing on each word in text A based on the presence of keywords in text A, and obtains the weighted features of text A; it also determines the weighted features of text B, and then determines the similarity between text A and text B based on their respective weighted features. Finally, it outputs the similarity evaluation results of text A and text B to user terminal 120 so that user terminal 120 can present the similarity evaluation results of text A and text B to the user.

[0028] For example, the user terminal 120 mentioned above includes, but is not limited to, computer terminals such as desktop computers and laptops, and mobile terminals such as tablet computers and mobile phones.

[0029] Figure 1b The diagram shown illustrates another application scenario provided by an embodiment of this disclosure. Figure 1b As shown, this application scenario involves evaluating the similarity between speech-recognized text and prescribed scripted text. Specifically, this scenario includes a server 111 and a terminal 121 communicatively connected to the server 111, wherein the server 111 is used to execute the text processing method mentioned in the embodiments of this disclosure.

[0030] For example, in response to the evaluation request from the terminal 121, the server 111 first obtains speech recognition text (i.e., the first text) based on the content of the human-generated speech call using ASR technology. It then processes the speech recognition text and the spoken text (i.e., the second text) to obtain weighted features corresponding to each text. Next, the server 111 acquires keywords and performs similarity calculations based on the obtained weighted features of the speech recognition text and the spoken text to determine the similarity between them.

[0031] Figure 1c The diagram shown is another application scenario provided by an embodiment of this disclosure. Figure 1c Take the application of text processing methods in an intelligent question-and-answer system as an example. An intelligent question-and-answer system refers to a system that provides standard question-and-answer results to human agents based on the content of user questions and answers in a question-and-answer format. For example, when an agent is conversing with a customer, the intelligent question-and-answer system can provide a scripted text for the agent's reference based on the conversation content; or, according to the agent's business needs, the intelligent question-and-answer system can push preset scripted texts.

[0032] This intelligent question-and-answer system is used to determine whether the voice expression of human agents is standard and to measure whether agents are using the company's prescribed scripts, thereby helping companies to better regulate and manage their agents. The script texts and preset keywords mentioned above can be set according to actual needs, and this embodiment does not impose specific limitations on them. Furthermore, exemplarily, the voice recognition text can be obtained in real time based on the voice content of the call, or it can be obtained based on the historical voice records of the call.

[0033] like Figure 1c The illustration shows a scenario in which an enterprise evaluates whether its agents use prescribed scripts. This scenario may include a server 112 and a terminal 122 that is communicatively connected to the server 112. The server 112 is used to execute the text processing method mentioned in the embodiments of this disclosure.

[0034] For example, according to the needs, the enterprise issues an instruction through terminal 122 to assess whether the agent is using the prescribed script. In response to the instruction of terminal 122, server 112 first retrieves the dialogue interface 100 between the agent and the customer. The content in the dialogue interface 100 is obtained by recognizing the voice data of the agent and the customer using ASR recognition technology.

[0035] In the dialogue interface 100, a dialogue text from an agent is obtained (this dialogue text can be any one of multiple dialogue texts generated by the agent in the dialogue interface; here, only one dialogue text is used as an example, and the same processing method is used when evaluating each dialogue text, which will not be elaborated here). Server 112 obtains keywords corresponding to this scenario; furthermore, server 112 determines the dialogue intent based on the context of the dialogue text in the dialogue interface 100, and selects a standard script text that matches the dialogue intent. For example, if the dialogue intent is identified as wanting to inquire about the functions of product XX, then a script text related to the functions of product XX is selected as the standard script text.

[0036] Furthermore, based on the keywords contained in the dialogue text, each word in the dialogue text is weighted to obtain the weighted features of the dialogue text. Similarly, based on the keywords contained in the standard script text, each word in the standard script text is weighted to obtain the weighted features of the standard script text. Finally, based on the weighted features of the dialogue text and the standard script text, the similarity between the dialogue text and the standard script text is determined, and then the similarity results between the dialogue text and the standard script text are output to terminal 122. Finally, terminal 122 scores the agent based on the obtained similarity results.

[0037] Based on the application scenarios of the aforementioned text processing methods, the following will combine... Figures 2 to 6 A brief introduction to the text processing method disclosed herein.

[0038] See Figure 2 This is a schematic flowchart illustrating a text processing method provided in an embodiment of this disclosure. Exemplarily, the text processing method provided in this embodiment is executed by an electronic device. Figure 2 As shown, the text processing method provided in this embodiment includes the following steps:

[0039] Step S210: In response to the triggering event of calculating text similarity in the target scene, obtain the keywords corresponding to the target scene.

[0040] For example, the target scenario can be any business scenario that requires calculating text similarity, such as a debt collection scenario, a product consultation scenario, etc., and this disclosure does not impose specific limitations. For example, the keywords corresponding to the target scenario can be keywords preset according to requirements, or keywords extracted from standard script text according to the target scenario.

[0041] The trigger event for calculating text similarity in the target scenario can be: receiving an instruction to perform text similarity calculation; or acquiring the speech-recognized text of the target object in the target scenario. Here, the target object can refer to any object interacting in the target scenario. For example, in a scenario where the target scenario is a customer service representative's debt collection, the interacting objects are a customer service representative and the user, and the target object could refer to the customer service representative. Alternatively, a similarity calculation period can be pre-set; if the current time reaches the period's detection time node, it can be considered that a trigger event has occurred.

[0042] Step S220: Based on the keywords contained in the first text, weighted processing is performed on each word in the first text to obtain the weighted features of the first text.

[0043] For example, the first text is the text for which text similarity assessment needs to be performed. The method of obtaining the first text differs depending on the scenario. For instance, in an interactive scenario, the first text could be the text a service provider replies to a customer.

[0044] In some embodiments, step S220 may include: determining a feature vector a of the first text, and performing a weighted operation on the feature vector a of the first text based on keywords to obtain the weighted features of the first text. Specifically, the weighted features of the first text may be represented as a weighted vector a.

[0045] Step S230: Determine the weighted features of the second text. The weighted features of the second text are obtained by weighting each word in the second text based on the keywords it contains.

[0046] For example, the second text can be a reference text, such as a script text; or, in a translation practice scenario, the first text can be the translation text to be verified, and the second text can be a standard translation text.

[0047] In some embodiments, determining the weighted features of the second text includes: obtaining the weighted features of the second text from a storage module. That is, the storage module stores the predetermined weighted features of the second text; the storage module can be a separate storage module or storage device, or a module with storage function that is installed in an electronic device as needed.

[0048] In another embodiment, determining the weighted features of the second text includes: determining a feature vector b of the second text; and performing a weighted operation on the feature vector b of the second text based on preset keyword data to obtain the weighted features of the second text. Specifically, the weighted features of the second text can be represented as a weighted vector.

[0049] Step S240: Calculate the similarity between the first text and the second text based on the weighted features of the first text and the weighted features of the second text to determine the similarity between the first text and the second text.

[0050] For example, similarity calculation based on the weighted features of the first text and the weighted features of the second text can be performed by calculating the similarity between the first text and the second text based on the weighted vectors of the first text and the second text. In specific implementations, how to calculate the similarity between the first text and the second text based on the weighted vectors of the first text and the second text will be discussed later. Figure 3 The embodiments are described in detail and will not be repeated here.

[0051] Similarity between the first text and the second text can include either the first text being similar to the second text, or the first text being dissimilar to the second text.

[0052] In one embodiment, calculating the similarity between the first text and the second text based on the weighted features of the first text and the weighted features of the second text can be understood as follows: after calculating the similarity based on the weighted features of the first text and the weighted features of the second text, the calculation result is obtained. The calculation result can directly include the results of similarity or dissimilarity. At this time, the similarity between the first text and the second text can be directly determined through the calculation result.

[0053] In other embodiments, similarity is calculated based on the weighted features of the first text and the weighted features of the second text. The calculated result may include a similarity value, but not a result indicating similarity or dissimilarity. In this case, the electronic device can preset a threshold, and determine the similarity between the first text and the second text based on the relationship between the preset threshold and the similarity value in the calculated result. Specifically, it can be defined that if the similarity value is greater than or equal to the preset threshold, the first text and the second text are considered similar; conversely, if the similarity value is less than the preset threshold, the first text and the second text are considered dissimilar. It should be understood that the preset threshold is set according to actual needs, and this disclosure does not specifically limit the range of the preset threshold.

[0054] The text processing method disclosed herein utilizes keywords corresponding to the target scene to perform a weighted operation on the words contained in each of the two texts to be evaluated, obtaining the weighted features of each of the two texts. Based on these weighted features, the similarity between the two texts is determined. Therefore, this disclosure, by utilizing keywords corresponding to the target scene and weighting operations, highlights the importance of keywords, thereby mitigating the impact of sentence length and semantic errors in the text, resulting in a more accurate assessment of the similarity between the two texts.

[0055] Figure 3 The diagram illustrates a process for determining the similarity between a first text and a second text based on weighted features of a first text and weighted features of a second text, according to an embodiment of this disclosure. Figure 3 As shown, the similarity calculation based on the weighted features of the first text and the weighted features of the second text, to determine the similarity between the first text and the second text, includes the following steps:

[0056] Step S310: Based on the weighted features of the first text and the weighted features of the second text, determine the first similarity information of the first text and the second text.

[0057] As mentioned above, the weighted features of the first text can be represented by a weighted vector of the first text, and the weighted features of the second text can be represented by a weighted vector of the second text. In one embodiment, the weighted vectors of the first and second texts are obtained by weighting the feature vectors of the first and second texts, respectively. For example, the feature vector 'a' of the first text is represented as: a = [0,0,1,0,0,1,0], where each element in feature vector 'a' indicates the presence or absence of a keyword (e.g., 0 indicates presence, 1 indicates absence). After feature weighting, the weighted vector of the first text is obtained. Weighted vector of the second text

[0058] Based on this, the implementation of step S310 may include: determining the dot product of the weighted vector of the first text and the weighted vector of the second text; determining the vector length of the weighted vector of the first text and the vector length of the weighted vector of the second text; and determining the first similarity information based on the dot product, the vector length of the weighted vector of the first text, and the vector length of the weighted vector of the second text.

[0059] Suppose the weighted vector of the first text is represented as The weighted vector of the second text is represented as follows: The formula for calculating the dot product of the weighted vectors of the first text and the weighted vectors of the second text can be: It should be understood that the calculation of the dot product between two vectors is well known to those skilled in the art, and will not be described in detail in this embodiment. Weighted vector The vector length is expressed as and weighted vector The vector length is expressed as

[0060] Optionally, determining the first similarity information based on the vector dot product, the vector length of the weighted vector of the first text, and the vector length of the weighted vector of the second text may specifically include: through the vector dot product, the weighted vector of the first text... vector length The weighted vector of the second text vector length Determine the first similarity parameter between the first and second texts; set a preset threshold T. θ Based on the relationship between a first similarity parameter θ of the first text and the second text and a preset threshold, first similarity information is determined. Specifically, when the first similarity parameter is greater than or equal to the preset threshold, the first text and the second text are determined to be similar, that is, the first similarity information is that the first text and the second text are similar. When the first similarity parameter is less than the preset threshold, the first text and the second text are determined to be dissimilar, that is, the first similarity information is that the first text and the second text are dissimilar.

[0061] For example, the weighted vector of the first text is obtained through the vector inner product. vector length The weighted vector of the second text vector length Determining the first similarity parameter between the first text and the second text specifically involves multiplying the length of the weighted vector of the first text by the length of the weighted vector of the second text, then dividing the vector content by the result of the multiplication. The result of this division is used as the first similarity parameter. Specifically, the calculation process of the first similarity parameter can be represented by the following formula:

[0062]

[0063] Where θ represents the first similarity parameter, and the preset threshold T θ Based on actual application requirements, this embodiment of the disclosure does not preset a threshold T. θ Make specific limitations.

[0064] In one embodiment, the step of determining the first similarity information based on the vector inner product, the vector length of the weighted vector of the first text, and the vector length of the weighted vector of the second text may further include the following steps:

[0065] A first similarity parameter is determined based on the vector dot product, the vector length of the weighted vector of the first text, and the vector length of the weighted vector of the second text; a second similarity parameter is determined based on the vector dot product and the vector length of the weighted vector of the second text; and first similarity information is determined based on the relationship between the first similarity parameter and the preset threshold corresponding to the first similarity parameter (i.e., the first preset threshold), and the relationship between the second similarity parameter and the preset threshold corresponding to the second similarity parameter (i.e., the second preset threshold).

[0066] For example, based on vector inner product The length of the weighted vector of the first text The vector length of the weighted vector of the second text The specific calculation method for the first similarity parameter θ of the first text and the second text is as described in formula 1-1 in step S310 above. This embodiment will not elaborate on the method of obtaining the first similarity parameter θ.

[0067] For example, based on vector inner product The vector length of the weighted vector of the second text Determine the second similarity parameter between the first and second texts. Specifically, the second similarity parameter of the first text and the second text It is obtained through the following formula 1-3.

[0068]

[0069] Specifically, based on the first similarity parameter θ of the first text and the second text and the preset threshold T θ And the second similarity parameter of the first and second texts. and preset threshold Determining the first similarity information includes: the first similarity parameter θ between the first text and the second text is greater than or equal to a preset threshold T. θ Furthermore, the second similarity parameter of the first text and the second text Greater than or equal to the preset threshold If the first similarity parameter θ is less than the preset threshold T, then the first similarity information is determined to be that the first text and the second text are similar; otherwise, the first similarity parameter θ of the first text and the second text is less than the preset threshold T. θ And / or the second similarity parameter of the first and second texts Less than the preset threshold If the first similarity information is obtained, then the first text and the second text are determined to be dissimilar.

[0070] The text processing method mentioned in this disclosure determines first similarity information based on a first similarity parameter and a second similarity parameter. Because the first and second similarity parameters interact, the obtained similarity results are more accurate.

[0071] Step S320: Based on the word order information of the first text and the second text, determine the second similarity information of the first text and the second text.

[0072] For example, step S320 can be implemented as follows: based on the word order information of the first text and the second text, determine the longest common subsequence (LCS) of the first text and the second text; vectorize the LCS of the first text and the second text; weight the word data in the LCS; and sum the elements in the weighted feature vector to obtain the second similarity information of the first text and the second text. The text processing method provided in this embodiment determines the second similarity information through the weighted vector of the longest common subsequence, thereby highlighting the word order. In this way, the determined second similarity information can be made more accurate.

[0073] For example, the words in the first text form a set of subsequences of the first text, and the words in the second text form a set of subsequences of the second text. For instance, the content of the first text is "You can pay off part of the debt first," where "you," "can," "pay off," "debt," "first," "pay back," "one," and "part" can form a set of subsequences of the first text; the content of the second text is "Your debt can be partially repaid," where "you," "of," "debt," "can," "perform," "part," and "repayment" can form a set of subsequences of the second text. The longest common subsequence is the longest set of subsequences formed by all identical subsequences in the set of subsequences of the first text and the set of subsequences of the second text. For example, "You owe money and repay part" formed by "you," "debt," "repayment," and "part" is the longest common subsequence of the first text and the second text.

[0074] In the specific implementation, assuming that the longest common subsequence of the first text and the second text is "you", "owe money", "do not pay", the longest common subsequence vector c obtained after vectorization is represented as: c = [1,0,1,0,0,1,0]. The elements in vector c indicate whether there are preset keywords. When an element in the vector is 1, it means that the word corresponding to the element is a keyword. When an element is 0, it means that the word corresponding to the element is not a keyword.

[0075] Based on preset keywords, a weighted operation is performed on the feature vector of the longest common subsequence. After weighting, the weighted feature of the longest common subsequence is obtained. Specifically, the weighted feature of the longest common subsequence is represented by the weighted vector of the longest common subsequence. For example, the weighted vector of the longest common subsequence is represented as follows: (Where β0, β2, and β5 represent the weights of elements in vector c, and the specific values ​​of the weights are set according to actual needs.) In other words, the weighted feature of the longest common subsequence is represented as: In practical applications, the second similarity information is determined by adding the elements of the weighted features of the longest common subsequence, and the sum of these elements is the similarity value. Specifically, using the longest common subsequence of the first and second texts, the elements of the weighted features of the longest common subsequence are added together. Based on the sum, a similarity parameter is determined, and the second similarity information is determined based on the relationship between the similarity parameter and a preset threshold.

[0076] Specifically, the similarity parameter ε corresponding to the longest common subsequence of the first and second texts can be determined by the following equation 1-2:

[0077] ε=|β0|+|β2|+|β5| (Formula 1-2)

[0078] Furthermore, based on the similarity parameter ε corresponding to the longest common subsequence and the preset threshold T... ε The size relationship between the first and second texts is used to determine the second similarity information. Specifically, if the similarity parameter ε corresponding to the longest common subsequence is greater than or equal to a preset threshold T... ε If the first text is similar to the second text, then the second similarity information indicates that the first text and the second text are similar; if the similarity parameter ε corresponding to the longest common subsequence is less than the preset threshold T... ε If the first text and the second text are not similar, then the second similarity information indicates that the first text and the second text are not similar.

[0079] Step S330: Based on the first similarity information and the second similarity information, determine the similarity between the first text and the second text.

[0080] Exemplarily, if the first similarity information indicates that the first text is similar to the second text, and the second similarity information also indicates that the first text is similar to the second text, then it is considered that the first text and the second text are similar; when either the first similarity information or the second similarity information indicates that the first text is not similar to the second text, it is determined that the first text and the second text are not similar.

[0081] The text processing method provided by the embodiments of the present disclosure determines the first similarity information between the first text and the second text based on the weighted features of the first text and the weighted features of the second text, then determines the second similarity information between the first text and the second text based on the word order information, and further determines the similarity between the first text and the second text according to the first similarity information and the second similarity information. It can be seen that the embodiments of the present disclosure fully consider the order of words in the text and pay attention to the logical relationship of the text, making the text similarity calculation method have good noise resistance and orderliness. In addition, the embodiments of the present disclosure can be applied to long texts in practical applications, and can also make the accuracy of the similarity evaluation results of two long texts high. Moreover, by using the first similarity information and the second similarity information to determine the similarity between the first text and the second text, the similarity result can be accurate, and thus the accuracy of the similarity result obtained by the text processing method can be improved. In addition, the text processing method of the embodiments of the present disclosure determines the first text similarity information through the length of the weighted vector and the vector inner product. Assuming that the first text and the second text are equally important, the embodiments of the present disclosure can meet the text content in different scenarios without requiring one of the first text and the second text to be important standard content (for example, standard text, answer text), thereby expanding the application scope of the text processing method mentioned in the embodiments of the present disclosure.

[0082] Figure 4 Shown is a flowchart of a process for weighting each word in the first text based on the keywords included in the first text to obtain the weighted features of the first text according to an embodiment of the present disclosure. As Figure 4 shown, weighting each word in the first text based on the keywords included in the first text to obtain the weighted features of the first text includes the following steps.

[0083] Step S410, perform a word segmentation operation on the first text to obtain each word included in the first text.

[0084] Exemplarily, use a word segmentation tool to perform a word segmentation operation on the first text to obtain each word included in the first text. For example, if the input is X = "It is recommended that you first handle the current arrears", after word segmentation, it becomes X = "It is recommended / you / first / handle / the current / arrears". Exemplarily, the word segmentation tool can be the jieba tool or other common word segmentation tools.

[0085] In other embodiments, a word segmentation model can be pre-trained and used to segment the first text to obtain the individual words contained in the first text.

[0086] In one embodiment, the words and phrases included in the first text may refer to the word segmentation results of the first text; alternatively, to save time and improve the accuracy of similarity calculation, the word segmentation results of the first text can be filtered. For example, stop words or other meaningless words can be filtered and deleted, and the filtered word segmentation results can be used as the words and phrases included in the first text, thus shortening the text sentences. For example, stop words can be selected from adverbs, conjunctions, interjections, numerals, and special symbols, while nouns, pronouns, verbs, prepositions, and adjectives can be retained. Simultaneously, based on specific application requirements, distinctive business terms or professional terms can be retained.

[0087] Step S420: Based on the association between each word and keyword in the first text, generate the feature vector of the first text. The feature vector of the first text is a one-hot vector.

[0088] For example, step S420 can be implemented as follows: based on the association between each word and keyword in the first text, determine the sentences in the first text that contain the keyword; based on the sentences in the first text that contain the keyword, determine the positional relationship of the keyword in the first text. Based on the positional relationship of the keyword in the first text, generate a feature vector of the first text.

[0089] For example, the feature vector of the first text consists of character vectors and word vectors from sentences containing keywords in the first text. The feature vector of the first text is a one-hot vector. A one-hot vector represents a feature vector of a single attribute, meaning that there is only one activation point (not 0) at any given time. This vector has only one non-zero feature, while the others are all zero, making it particularly sparse. Specifically, for the first text, the value at the position corresponding to the preset keyword is 1, and the values ​​at other positions are all 0. For example, the aforementioned feature vector a = [0,0,1,0,0,1,0].

[0090] Step S430: Based on the positional relationship between each word and keyword in the first text, determine the regression coefficient information of each keyword contained in the first text.

[0091] For example, regression coefficient information reflects the degree of change in the dependent variable y caused by a change of one unit x (x∈X) in the corresponding independent variable. It can be understood that regression coefficient information refers to the regression coefficient information of the regression equation. The regression equation can be expressed as y=βX+ξ, and its slope β is called the regression coefficient (i.e., regression coefficient information). The larger the regression coefficient, the greater the influence of X on y; a positive regression coefficient indicates that y increases as X increases, and a negative regression coefficient indicates that y decreases as X increases. The aforementioned multiple regression equation is solved using logistic regression. For example, a trained logistic regression model can be used to determine the regression coefficient information.

[0092] For example, using the sample data corresponding to the second text, an initial logistic regression model is trained with intent as the label category to obtain a trained logistic regression model. Specifically, in the process of evaluating the spoken text and the voice recognition text of the human agent, the sample data of the spoken text can be used to train the logistic regression model, and one or more spoken texts expressing the same intent can be grouped into one category, with intent as the category label.

[0093] Step S440: Based on the regression coefficient information of the keywords contained in the first text, the feature vector of the first text is weighted to obtain the weighted features of the first text.

[0094] For example, based on the regression coefficient information of the keywords contained in the first text, the absolute value of the regression coefficient of the first text is determined; the absolute value of the regression coefficient is used as the weight of the feature vector of the first text, and then the feature vector of the first text is weighted to obtain the weighted feature of the first text.

[0095] The weights in this embodiment are calculated by calculating the regression coefficients of text characters or words. This method requires no complex calculations to obtain the weights, and even with long text data, the weights can be quickly obtained and weighted, improving the speed of text processing. Furthermore, this embodiment utilizes one-hot vectors, which allows for a more reasonable calculation of Euclidean distance when dealing with discrete features, resulting in more accurate processing results.

[0096] The text processing methods in the above embodiments can be implemented by an electronic device calling a text processing model. (See reference...) Figure 5 , Figure 5 This is a schematic diagram of the structure of a text processing model provided in an embodiment of this disclosure. For example... Figure 5As shown, the text processing model provided in this embodiment includes a rule recognition module 510, a TW-CS module 520, a W-CS module 530, and a W-LCS module 540. The TW-CS module 520 is a talk-trick-based weighted cosine similarity (TW-CS) module, used to determine if the first text contains keywords based on the length of the weighted vector of the second text (i.e., the weighted feature of the second text), and to calculate the similarity between the first and second texts. The W-CS module 530 is a weighted cosine similarity (W-CS) calculation module, used to directly calculate the similarity between the texts based on the weighted features of the first and second texts. The W-LCS module 540 is a weighted longest common subsequence (W-LCS) module, used to calculate the longest common subsequence of the first and second texts, and to return the text similarity results in a weighted manner.

[0097] For example, the input Automatic Speech Recognition (ASR) text (i.e., the first text) enters the rule recognition module 510. The rule recognition module 510 judges the ASR text to determine whether it contains preset keywords. If the ASR text contains preset keywords, the rule recognition module 510 performs word segmentation on the ASR text, removes stop words, constructs a dictionary from the obtained words and characters, realizes One-Hot conversion, and vectorizes the input ASR text. Then, the speech text is called or input, and the feature vector of the speech text is determined based on the preset keywords. The TW-CS module 520 calculates the weighted cosine similarity of the ASR text and the spoken text respectively. Based on the length of the weighted vector of the spoken text (i.e., the weighted feature of the second text), it determines the presence of keywords in the ASR text and obtains the first similarity parameter. The W-CS module 530 calculates the weighted cosine similarity of the ASR text and the spoken text respectively. Based on the weighted features of the ASR text and the spoken text, it obtains the second similarity parameter. Based on the first and second similarity parameters, and considering the relationship between the first and second similarity parameters and their corresponding preset thresholds, it determines the first similarity information. The W-LCS module 540 calculates the longest common sub-sequence that co-occurs between the ASR text and the spoken text, and returns the text similarity score with weights. Based on the text similarity score, it determines the second similarity information. Finally, based on the first and second similarity information, it determines the evaluation result.

[0098] In one embodiment of this disclosure, the first text includes dialogue text between an agent and a user in a target scenario; the second text includes scripted text matching the user's dialogue intent in the target scenario. The dialogue intent is obtained by performing intent recognition on the dialogue text; wherein, after calculating similarity based on the weighted features of the first text and the weighted features of the second text to determine the similarity between the first and second texts, the method provided in this embodiment further includes: performing service management for the agent based on the similarity between the first and second texts. Scenarios for performing service management for the agent include scenarios where the agent is using scripted text. Combined with... Figure 6 In the context of using call center staff's scripts, the text processing method provided in this disclosure embodiment will be briefly introduced. For example... Figure 6 As shown, an embodiment of the text processing method provided by this disclosure includes the following steps.

[0099] Step S610: Obtain audio data of the conversation between the agent and the user.

[0100] For example, the audio data of the call between the agent and the user can be real-time voice data of the call between the agent and the user, or it can be historical voice data of the call between the agent and the user that has been saved in advance.

[0101] Step S620: Perform text recognition on the audio data to determine the user's call intent and the agent's dialogue text.

[0102] For example, ASR technology is used to perform text recognition on audio data to obtain automatic speech recognition data; based on the automatic speech recognition data, the user's call intent and the agent's communication text are determined. Furthermore, a trained intent recognition model is used to determine the user's call intent.

[0103] Step S630: Based on the call intent, determine the script text that matches the user.

[0104] For example, based on the user's call intent, the script text matching the user's intent is determined; based on the intent tags of the script text, the user's intent is matched to determine the script text matching the user. For example, regression coefficients of the script text can be calculated first. Each intent corresponds to multiple scripts. Scripts with similar intents are grouped into one category, and the intent category is used as a tag. After processing such as word segmentation and stop word removal, training samples and a dictionary are constructed. The regression coefficient for each word or character in the dictionary is calculated using a logistic regression algorithm and saved for text similarity calculation.

[0105] Step S640: Based on the aforementioned text processing method, determine the similarity between the dialogue text and the script text.

[0106] Step S650: Based on the similarity between the dialogue text and the script text, perform service management for the agents.

[0107] For example, if the dialogue text and the prepared script are dissimilar, the agents will be retrained to further standardize their service and achieve service management. Alternatively, when the dialogue text and the prepared script are dissimilar, a prompt can be set to remind agents to pay attention to their wording. If the dialogue text and the prepared script are similar, a reward system can be set to encourage agents.

[0108] Script application evaluation is an important component of standardized management of agents in intelligent question-and-answer systems. The text processing method provided in this disclosure can determine the script text matching the user based on the call intent, and then evaluate the agent's communication text using text processing methods. This yields a similarity score between the agent's communication text and its corresponding script text, resulting in a more accurate similarity score. This reduces the impact of automatic speech recognition technology on similarity evaluation and more accurately assesses the agent's script application, thus facilitating standardized management of agents.

[0109] The above text, in conjunction with Figures 1 to 12, shows... Figure 6 The present disclosure describes in detail the method embodiments, which are then combined with the following. Figure 7 and Figure 8 The present disclosure provides a detailed description of the apparatus embodiments. It should be understood that the descriptions of the method embodiments correspond to the descriptions of the apparatus embodiments; therefore, any parts not described in detail can be found in the foregoing method embodiments.

[0110] Figure 7 The diagram shown is a structural schematic of a text processing apparatus provided in an embodiment of this disclosure. Figure 7 As shown, the text processing apparatus 700 provided in this embodiment includes an acquisition module 701, a processing module 702, and a determination module 703.

[0111] Specifically, the acquisition module 701 is used to acquire keywords corresponding to the target scene in response to a trigger event that calculates text similarity in the target scene.

[0112] The processing module 702 is used to perform weighted processing on each word in the first text based on the keywords contained in the first text, to obtain the weighted features of the first text. The determining module 703 is used to determine the weighted features of the second text, wherein the weighted features of the second text are obtained by performing weighted processing on each word in the second text based on the keywords contained in the second text.

[0113] The determination module 703 is used to calculate the similarity between the first text and the second text based on the weighted features of the first text and the weighted features of the second text.

[0114] In some embodiments, the determining module 703 is further configured to: determine first similarity information of the first text and the second text based on the weighted features of the first text and the weighted features of the second text; determine second similarity information of the first text and the second text based on the word order information of the first text and the second text respectively; and determine the similarity between the first text and the second text based on the first similarity information and the second similarity information.

[0115] In some embodiments, the determining module 703 is further configured to: determine the longest common subsequence between the first text and the second text based on the word order information of the first text and the second text respectively; perform a weighted operation on the words in the longest common subsequence based on keywords to obtain the weighted features of the longest common subsequence; and add the elements in the weighted features of the longest common subsequence to obtain the second similarity information.

[0116] In some embodiments, the determining module 703 is further configured to: if both the first similarity information and the second similarity information indicate that the first text and the second text are similar, then determine that the similarity between the first text and the second text is similar; if at least one of the first similarity information and the second similarity information indicates that the first text and the second text are not similar, then determine that the similarity between the first text and the second text is not similar.

[0117] In some embodiments, the determining module 703 is further configured to: determine the vector dot product of the weighted vector of the first text and the weighted vector of the second text; determine the vector length of the weighted vector of the first text and the vector length of the weighted vector of the second text; and determine first similarity information based on the vector dot product, the vector length of the weighted vector of the first text, and the vector length of the weighted vector of the second text.

[0118] In some embodiments, the determining module 703 is further configured to: determine a first similarity parameter based on the vector dot product, the vector length of the weighted vector of the first text, and the vector length of the weighted vector of the second text; determine a second similarity parameter based on the vector dot product and the vector length of the weighted vector of the second text; and determine first similarity information based on the relationship between the first similarity parameter and the first preset threshold, and the relationship between the second similarity parameter and the second preset threshold.

[0119] In some embodiments, the processing module 702 is further configured to: perform word segmentation on the first text to obtain each word contained in the first text; generate a feature vector of the first text based on the association between each word in the first text and the keyword, wherein the feature vector of the first text is a one-hot vector; determine the regression coefficient information of each keyword contained in the first text based on the positional relationship between each word in the first text and the keyword; and weight the feature vector of the first text based on the regression coefficient information of each keyword contained in the first text to obtain the weighted features of the first text.

[0120] In some embodiments, the first text includes dialogue text between an agent and a user in a target scenario; the second text includes scripted text matching the user's dialogue intent in the target scenario; the dialogue intent is obtained by performing intent recognition on the dialogue text. Furthermore, the determining module 703 is also used to perform service management for the agent based on the similarity between the first text and the second text.

[0121] Below, for reference Figure 8 This describes an electronic device according to embodiments of the present application. Figure 8 The diagram shown is a structural schematic of an electronic device provided in an exemplary embodiment of this disclosure. Figure 8 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this disclosure.

[0122] Figure 8 The diagram shown is a schematic diagram of an electronic device structure provided in an embodiment of this disclosure. Figure 8 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this disclosure. Figure 8 The electronic device 800 shown (specifically, it can be a computer device) includes a memory 801, a processor 802, a communication interface 803, and a bus 804. The memory 801, processor 802, and communication interface 803 are interconnected via the bus 804.

[0123] The memory 801 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 801 may store a program, and when the program stored in the memory 801 is executed by the processor 802, the processor 802 and the communication interface 803 are used to execute the various steps in the text processing method of the embodiments of this disclosure.

[0124] The processor 802 may be a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), graphics processing unit (GPU), or one or more integrated circuits, for executing relevant programs to achieve the functions required to be performed by the various units in the text processing apparatus of this disclosure embodiment.

[0125] The processor 802 can also be an integrated circuit chip with signal processing capabilities. In implementation, each step of the text processing method of this disclosure can be completed by the integrated logic circuitry in the hardware of the processor 802 or by instructions in software form. The processor 802 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this disclosure can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory 801. The processor 802 reads the information in the memory 801 and, in conjunction with its hardware, performs the functions required by the units included in the text processing apparatus of this disclosure embodiment, or executes the text processing method of this disclosure embodiment.

[0126] The communication interface 803 uses transceiver devices, such as, but not limited to, transceivers, to enable communication between the electronic device 800 and other devices or communication networks. For example, first text and / or second text can be obtained through the communication interface 803.

[0127] Bus 804 may include a pathway for transmitting information between various components of electronic device 800 (e.g., memory 801, processor 802, communication interface 803).

[0128] It should be noted that, although Figure 8The illustrated electronic device 800 only shows the memory, processor, and communication interface. However, those skilled in the art should understand that in specific implementations, the electronic device 800 may also include other devices necessary for normal operation. Furthermore, depending on specific needs, those skilled in the art should understand that the electronic device 800 may also include hardware devices for implementing other additional functions. Moreover, those skilled in the art should understand that the electronic device 800 may only include the devices necessary for implementing the embodiments of this disclosure, and may not necessarily include... Figure 8 All the devices shown.

[0129] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.

[0130] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0131] In the embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0132] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0133] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0134] Embodiments of this disclosure can also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the steps of the methods described above according to various embodiments of this disclosure. If the functionality is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks. The computer-readable storage medium can be any combination of one or more readable media. A readable medium can be a readable signal medium or a readable storage medium. A readable storage medium can be, for example, including but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof.

[0135] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.

Claims

1. A text processing method, characterized in that, include: In response to a trigger event that calculates text similarity in a target scene, keywords corresponding to the target scene are obtained; Based on the keywords contained in the first text, each word in the first text is weighted to obtain the weighted features of the first text; Based on the keywords contained in the second text, each word in the second text is weighted to obtain the weighted features of the second text; wherein, the weighting process refers to weighting the one-hot vector of the text based on the regression coefficient information of each keyword contained in the text, and the regression coefficient information is determined based on the positional relationship between each word in the text and the keyword; The similarity between the first text and the second text is determined by calculating the similarity based on the weighted features of the first text and the weighted features of the second text.

2. The text processing method according to claim 1, characterized in that, The step of calculating similarity based on the weighted features of the first text and the weighted features of the second text to determine the similarity between the first text and the second text includes: Based on the weighted features of the first text and the weighted features of the second text, the first similarity information between the first text and the second text is determined; Based on the word order information of the first text and the second text respectively, a second similarity information between the first text and the second text is determined; Based on the first similarity information and the second similarity information, the similarity between the first text and the second text is determined.

3. The text processing method according to claim 2, characterized in that, The step of determining the second similarity information between the first text and the second text based on the word order information of the first text and the second text respectively includes: Based on the word order information of the first text and the second text, determine the longest common subsequence between the first text and the second text; Based on the keywords, the words in the longest common subsequence are weighted to obtain the weighted features of the longest common subsequence; The second similarity information is obtained by summing the elements of the weighted features of the longest common subsequence.

4. The text processing method according to claim 2, characterized in that, Determining the similarity between the first text and the second text based on the first similarity information and the second similarity information includes: If both the first similarity information and the second similarity information indicate that the first text and the second text are similar, then the similarity between the first text and the second text is determined to be similar. If at least one of the first similarity information and the second similarity information indicates that the first text and the second text are not similar, then the similarity between the first text and the second text is determined to be dissimilar.

5. The text processing method according to claim 2, characterized in that, The weighted features of the first text include a weighted vector of the first text, and the weighted features of the second text include a weighted vector of the second text. Determining the first similarity information between the first text and the second text based on the weighted features of the first text and the second text includes: Determine the dot product of the weighted vector of the first text and the weighted vector of the second text; Determine the vector length of the weighted vector of the first text and the vector length of the weighted vector of the second text; The first similarity information is determined based on the vector inner product, the vector length of the weighted vector of the first text, and the vector length of the weighted vector of the second text.

6. The text processing method according to claim 5, characterized in that, Determining the first similarity information based on the vector inner product, the vector length of the weighted vector of the first text, and the vector length of the weighted vector of the second text includes: The first similarity parameter is determined based on the inner product of the vectors, the vector length of the weighted vector of the first text, and the vector length of the weighted vector of the second text. The second similarity parameter is determined based on the vector length of the inner product of the vectors and the weighted vector of the second text. The first similarity information is determined based on the relationship between the first similarity parameter and the first preset threshold, and the relationship between the second similarity parameter and the second preset threshold.

7. The text processing method according to any one of claims 1 to 6, characterized in that, Based on the keywords contained in the first text, the first text is weighted to obtain weighted features of the first text, including: Perform word segmentation on the first text to obtain the individual words contained in the first text; Based on the association between each word in the first text and the keyword, a feature vector of the first text is generated, wherein the feature vector of the first text is a one-hot vector; Based on the positional relationship between each word in the first text and the corresponding keyword, the regression coefficient information of each keyword contained in the first text is determined; Based on the regression coefficient information of the keywords contained in the first text, the feature vector of the first text is weighted to obtain the weighted features of the first text.

8. The text processing method according to any one of claims 1 to 6, characterized in that, The first text includes the dialogue text between the agent and the user in the target scenario; the second text includes the dialogue text matching the user's dialogue intent in the target scenario; the dialogue intent is obtained by performing intent recognition on the dialogue text; The method further includes, after determining the similarity between the first text and the second text by calculating similarity based on the weighted features of the first text and the weighted features of the second text: Service management is performed on the agents based on the similarity between the first text and the second text.

9. A text processing device, characterized in that, include: The acquisition module is used to acquire keywords corresponding to the target scene in response to a trigger event that calculates text similarity in the target scene; The processing module is used to perform weighted processing on each word in the first text based on the keywords contained in the first text, so as to obtain the weighted features of the first text; The determination module is used to perform weighted processing on each word in the second text based on the keywords contained in the second text to obtain the weighted features of the second text; wherein, the weighted processing refers to weighting the one-hot vector of the text based on the regression coefficient information of each keyword contained in the text, and the regression coefficient information is determined based on the positional relationship between each word in the text and the keyword; The determining module is further configured to perform similarity calculation based on the weighted features of the first text and the weighted features of the second text to determine the similarity between the first text and the second text.

10. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions. The processor is used to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • A method for computing text similarity by using semantic information

    CN109325229A

  • Text similarity judgment method and device and computer equipment

    CN112364620A

  • Text infringement detection method and device, electronic equipment and storage medium

    CN114564936A