Script quality inspection method and device, equipment and medium, and training method of classification model
By combining literal and semantic features for detection, the problem of low accuracy in detecting illegal statements in online insurance sales marketing has been solved, achieving more efficient and accurate detection of illegal statements and optimizing customer experience.
Patent Information
- Application Number
- CN202311626883.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-11-29
AI Technical Summary
Current technologies have low accuracy in detecting inappropriate sales pitches in online insurance marketing, which negatively impacts customer experience.
By acquiring the literal and semantic features of the quality inspection text samples, a pre-trained semantic feature vector extraction model and keyword matching are used, combined with a deep learning neural network for speech quality inspection, and the literal and semantic feature vectors are fused to determine the labels.
It improved the accuracy of detecting inappropriate statements, optimized the customer experience, reduced the workload of manual detection, and improved detection efficiency and accuracy.
Smart Images

Figure CN118069834B_ABST
Abstract
Description
Technical Field
[0001] This invention is applicable to the financial and insurance field, and particularly relates to a method, device, equipment and medium for quality inspection of sales scripts, and a training method for classification models. Background Technology
[0002] In the online marketing field of insurance sales, customers and sales agents frequently communicate through social media. To ensure the compliance of insurance product sales and prevent sales agents from using inappropriate language that could offend or upset customers, it is necessary to conduct quality checks on the communication scripts used by sales agents and customers. This allows for the timely identification of non-compliant violations and the remedial correction of those violations. Existing technology primarily relies on rule detection to determine whether the scripts comply with regulations; however, this method has low accuracy in detecting non-compliant scripts, negatively impacting the customer experience. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a method, apparatus, equipment and medium for speech quality inspection, and a training method for a classification model, in order to solve the problem of low accuracy in detecting illegal speech in the prior art.
[0004] Firstly, a method for quality inspection of sales scripts is provided, the method comprising:
[0005] Obtain the text sample to be inspected, input the text sample to be inspected into the pre-trained speech quality inspection classification model, and obtain the quality inspection result of the text sample to be inspected;
[0006] The training process of the script quality inspection classification model includes:
[0007] Obtain several quality inspection text samples and determine the label for each quality inspection text sample;
[0008] The initial verbal quality inspection classification model is trained using quality inspection text samples and corresponding labels until the preset stopping training condition is met, thus obtaining a pre-trained verbal quality inspection classification model.
[0009] The labels for each of the aforementioned quality inspection text samples include:
[0010] The quality inspection text samples are subjected to keyword-based fuzzy search to obtain the search score of the quality inspection text samples; when the search score is greater than the preset threshold, the quality inspection text samples are recalled.
[0011] The recalled quality inspection text samples are matched with n preset quality inspection rules to obtain a literal feature vector based on a certain quality inspection rule.
[0012] The quality inspection text sample is input into a pre-trained semantic feature vector extraction model to obtain the semantic feature vector of the quality inspection text sample;
[0013] The literal and semantic feature vectors based on a certain quality inspection rule are fused to obtain the literal and semantic feature fusion vector of the quality inspection text sample. The literal and semantic feature fusion vector is then determined as the label of the quality inspection text sample.
[0014] Secondly, a training method for a script quality inspection classification model is provided, the training method of which includes:
[0015] Obtain each quality inspection text sample and the corresponding label for each quality inspection text sample;
[0016] The initial verbal quality inspection classification model is trained using quality inspection text samples and corresponding labels until the preset stopping training condition is met, thus obtaining a pre-trained verbal quality inspection classification model.
[0017] Obtaining each quality inspection text sample includes:
[0018] The quality inspection text samples are subjected to keyword-based fuzzy search to obtain the search score of the quality inspection text samples; when the search score is greater than the preset threshold, the quality inspection text samples are recalled.
[0019] The recalled quality inspection text samples are matched with n preset quality inspection rules, where n>2, and the matching yields a literal feature vector based on a certain quality inspection rule.
[0020] The quality inspection text sample is input into a pre-trained semantic feature vector extraction model to obtain the semantic feature vector of the quality inspection text sample;
[0021] The literal and semantic feature vectors based on a certain quality inspection rule are fused to obtain the literal and semantic feature fusion vector of the quality inspection text sample. The literal and semantic feature fusion vector is then determined as the label of the quality inspection text sample.
[0022] Thirdly, a script quality inspection device is provided, the script quality inspection device comprising:
[0023] The text sample recall module is used to obtain several quality inspection text samples, perform keyword-based fuzzy search on the quality inspection text samples to obtain the search score of the quality inspection text samples; when the search score is greater than the preset threshold, the quality inspection text samples are recalled.
[0024] The literal feature matching module is used to match the recalled quality inspection text samples with n preset quality inspection rules to obtain a literal feature vector based on a certain quality inspection rule.
[0025] The semantic feature acquisition module is used to input the quality inspection text sample into the pre-trained semantic feature vector extraction model to obtain the semantic feature vector of the quality inspection text sample;
[0026] The sample label determination module is used to fuse the literal feature vector and semantic feature vector based on a certain quality inspection rule to obtain the literal and semantic feature fusion vector of the quality inspection text sample, and to determine the literal and semantic feature fusion vector as the label of the quality inspection text sample.
[0027] Fourthly, embodiments of the present invention provide a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the speech quality inspection method as described in the first aspect and the speech quality inspection method as described in the second aspect.
[0028] Fifthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the speech quality inspection method as described in the first aspect and the speech quality inspection method as described in the second aspect.
[0029] Sixthly, embodiments of the present invention provide a computer program product that, when run on a computer device, causes the computer device to execute the script quality inspection method of the first aspect and the script quality inspection method of the second aspect.
[0030] The beneficial effects of this invention compared to existing technologies are as follows: it simultaneously detects the literal and semantic features of quality inspection text samples, checking whether the quality inspection text samples meet the requirements from two aspects, resulting in a more comprehensive detection, improved accuracy in detecting non-compliant statements, optimized customer experience, training models to identify the label types of quality inspection text samples, reduced workload of manual detection, and more efficient and convenient processing of non-compliant statements. The use of labels to record statement types is more intuitive and facilitates subsequent problem summarization and analysis. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a schematic diagram of an application environment for a speech quality inspection method provided in an embodiment of the present invention;
[0033] Figure 2 This is a flowchart illustrating a speech quality inspection method according to an embodiment of the present invention;
[0034] Figure 3 This is a schematic diagram of the keyword retrieval process in a speech quality inspection method provided by an embodiment of the present invention;
[0035] Figure 4 This is a flowchart illustrating the semantic detection process in a speech quality inspection method according to an embodiment of the present invention.
[0036] Figure 5 This is a flowchart illustrating the representation of literal feature vectors in a speech quality inspection method provided by an embodiment of the present invention;
[0037] Figure 6 This is a flowchart illustrating the calculation of Euclidean distance in a speech quality inspection method according to an embodiment of the present invention.
[0038] Figure 7 This is a flowchart illustrating the semantic feature vector representation in a speech quality inspection method according to an embodiment of the present invention;
[0039] Figure 8 This is a flowchart illustrating a training method for a speech quality inspection classification model according to an embodiment of the present invention.
[0040] Figure 9 This is a schematic diagram of the structure of a speech quality inspection device provided in an embodiment of the present invention;
[0041] Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0042] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.
[0043] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0044] It should also be understood that the term “and / or” as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0045] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."
[0046] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0047] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0048] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0049] To illustrate the technical solution of the present invention, specific embodiments are described below.
[0050] An embodiment of the present invention provides a discourse quality inspection method for model training, which can be applied to, for example... Figure 1 In this application environment, the client communicates with the server. Clients include, but are not limited to, handheld computers, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, and personal digital assistants (PDAs). The server can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0051] The above-mentioned script quality inspection methods can be applied to Figure 1The server-side component connects to relevant databases and rule bases to retrieve data. These same computer devices can also connect to clients to collect data and control commands sent by client users.
[0052] In this application, a financial service system can refer to a system applied in financial scenarios that provides business services to users. This financial service system is configured with corresponding service interfaces, which can be called by client users to implement the corresponding services. These services include computational, querying, storage, and downloading processes tailored to different business needs. For example, a financial service system can refer to insurance underwriting systems and insurance claims systems in the insurance industry, or mobile banking systems and online banking systems in the banking industry.
[0053] See Figure 2 This is a flowchart illustrating a script quality inspection method according to an embodiment of the present invention. The script quality inspection method described above can be applied to... Figure 1 The client, whose corresponding computer device connects to the target database via a pre-defined Application Programming Interface (API), generates task logs as the target database is driven to perform corresponding tasks. These task logs can be collected via the API. For example... Figure 2 As shown, this script quality inspection method may include the following steps:
[0054] Obtain the text sample to be inspected, input the text sample to be inspected into the pre-trained speech quality inspection classification model, and obtain the quality inspection result of the text sample to be inspected.
[0055] Among them, the script quality inspection classification model can determine the type of the input quality inspection text sample and output the type of the text sample to be inspected.
[0056] The training process of the script quality inspection classification model includes:
[0057] Obtain several quality inspection text samples and determine the label of each quality inspection text sample.
[0058] Obtain labeled quality inspection text samples to train the speech quality inspection classification model. These labeled quality inspection text samples can be speech examples from common problems.
[0059] The initial verbal quality inspection classification model is trained using the quality inspection text samples and corresponding labels until the preset stop training condition is met, thus obtaining the pre-trained verbal quality inspection classification model.
[0060] Specifically, the quality inspection text samples are input into the speech quality inspection classification model, and the output labels are compared with the standard labels. The BEC loss function can be used to calculate the loss. The parameters of the speech quality inspection classification model are adjusted according to the loss, and a new speech quality inspection classification model is updated. The quality inspection text samples are input into the new speech quality inspection classification model repeatedly, and the operation of the speech quality inspection classification model is corrected according to the output loss, until the speech quality inspection classification model meets the actual application requirements. Then, training is stopped, and a well-trained speech quality inspection classification model is obtained.
[0061] This involves obtaining the labels corresponding to each of the quality inspection text samples, such as... Figure 2 As shown, it includes:
[0062] Step S101: Obtain several quality inspection text samples, perform keyword-based fuzzy search on the quality inspection text samples to obtain the search score of the quality inspection text samples; when the search score is greater than the preset threshold, recall the quality inspection text samples.
[0063] The quality inspection text sample is the script text used by sales representatives to communicate with customers; the keywords are preset prohibited words; the search score is the similarity matching degree between the quality inspection text sample and the keywords; when the search score is greater than the preset threshold, it means that the quality inspection text sample is sufficiently similar to the prohibited keywords, and that is, the quality inspection text sample may have reached the violation standard.
[0064] In one implementation, during communication between a sales agent and a customer regarding insurance business, if the customer has a misunderstanding of the insurance service and the agent tries to reply, "It's not like that, our service includes...", the agent directly denies the customer's doubts, which may offend the customer; therefore, this statement is inappropriate. The judgment process is as follows: a fuzzy search is performed on the statement. If the phrase "It's not like that" has a high similarity match with negative keywords, exceeding the set violation threshold, then the statement is recalled for further analysis in subsequent steps.
[0065] Step S102: Match the recalled quality inspection text samples with n preset quality inspection rules to obtain a literal feature vector based on a certain quality inspection rule.
[0066] The quality inspection rules include, but are not limited to: prohibiting the use of language that affects customer experience, such as contemptuous language, irritating language, negative language, and rhetorical questions.
[0067] In the above implementation, the recalled "not like that" is matched with various rules in the rule base, and a vector is output that indicates which rule the recalled statement does not conform to. That is, the output literal feature vector can indicate that the statement violates the rule of prohibiting negative words.
[0068] Step S103: Input the quality inspection text sample into the pre-trained semantic feature vector extraction model to obtain the semantic feature vector of the quality inspection text sample.
[0069] The semantic feature vector extraction model is a deep learning neural network that maps natural language text into a low-dimensional semantic space and represents it as a vector. For example, this deep learning neural network can use the Word2Vec model to input the quality inspection text sample into the trained semantic feature vector extraction model, and then output a feature vector that can represent the semantics of the quality inspection text sample, which is the semantic feature vector.
[0070] Step S104: The literal feature vector and semantic feature vector based on a certain quality inspection rule are fused to obtain the literal and semantic feature fusion vector of the quality inspection text sample, and the literal and semantic feature fusion vector is determined as the label of the quality inspection text sample.
[0071] In one implementation, the Deep&Wide model can be used to fuse the obtained literal feature vectors and semantic feature vectors. The Deep&Wide model contains two modules: the Deep module and the Wide module. The Deep module is a 3-layer neural network (Deep network), and the Wide module is a 1-layer neural network (Wide network). The semantic feature vector of the quality inspection text sample is input into the Deep network, and the literal feature vector is input into the Wide network. The outputs of the Deep network and the Wide network are concatenated together to form a fused vector that can represent both literal and semantic features. This fused vector is the label of the quality inspection text sample.
[0072] The text quality inspection method of this invention performs fuzzy retrieval on the quality inspection text sample based on keywords, and retrieves words and phrases with a high degree of matching with keywords that do not meet the regulations, thereby expanding the retrieval scope and making the retrieval more comprehensive and specific; it obtains the literal features and semantic features of the quality inspection text sample respectively, and performs fusion processing on the two features to represent the feature information of the quality inspection text sample in detail, making the features specific and refining the label categories of the quality inspection text sample.
[0073] In other embodiments, a method for script quality inspection is provided, such as Figure 3 As shown, in step S101, several quality inspection text samples are obtained, and the quality inspection text samples are subjected to keyword-based fuzzy search processing to obtain the search score of the quality inspection text samples, including the following steps:
[0074] Step S201: Construct a keyword dictionary for scripts that fail quality control and store the keyword dictionary in the search engine.
[0075] In one implementation, non-compliant keywords are collected by analyzing existing script quality inspection records, customer complaint feedback, and frequently asked questions. These keywords may include sensitive words, inappropriate terms, inaccurate information, etc. After these keywords are compiled into a dictionary file, they are imported into a search engine, which may be the ES search engine, which can provide API for batch import.
[0076] Step S202: Input the quality inspection text sample into the keyword dictionary of the search engine for retrieval and obtain the retrieval score of the quality inspection text sample.
[0077] In one implementation, quality inspection text samples can be entered into the ES search engine. The matching precision, matching fields, and matching positions can be set as required. The quality inspection text samples are used as input for the query. The results returned by the search engine are parsed to obtain the retrieval score for each quality inspection text sample.
[0078] The script quality inspection method of this invention constructs a keyword dictionary, which can be updated and adjusted in a timely manner to adapt to constantly changing business needs and user feedback. It can more comprehensively retrieve problems in the script, and by using existing search engines, it can set search parameters, making the search more efficient and convenient. The text sample is judged as qualified based on the search score, reducing the influence of subjective factors, reducing the workload of manual review, and improving the efficiency of quality inspection.
[0079] In other embodiments, a method for script quality inspection is provided, such as Figure 4 As shown, in step S102, before matching the recalled quality inspection text samples with n preset quality inspection rules to obtain a literal feature vector based on a certain quality inspection rule, the following steps are also included:
[0080] Step S301: Input the quality inspection text sample into the pre-trained semantic vector conversion model to obtain the semantic vector of the quality inspection text sample.
[0081] The semantic vector transformation model can be the Sentence BERT model or other semantic vector transformation models such as Word2Vec. The quality inspection text sample is converted into the input format required by the model, preprocessed, and then input into the trained semantic vector transformation model to output the semantic vector of the quality inspection text sample.
[0082] Step S302: Input the semantic vector of the quality inspection text sample into the preset semantic search engine for retrieval, and obtain the Euclidean distance of the semantic vector.
[0083] The semantic search engine encompasses the semantic vectors of various violating texts. When the semantic vectors of the quality inspection text samples are input into the semantic search engine, the engine calculates the Euclidean distance between the input semantic vectors and the semantic vectors stored in the search engine.
[0084] Alternatively, other metrics such as Manhattan distance and cosine similarity can be used to measure the distance between vectors.
[0085] Step S303: When the Euclidean distance is less than a preset threshold, recall the quality inspection text sample.
[0086] Specifically, after inputting the semantic vector of the quality inspection text sample into the semantic search engine, the text sample most similar to the input vector and the corresponding Euclidean distance are obtained. A threshold is set, and when the Euclidean distance is less than the threshold, it is determined that the quality inspection text sample is similar to the non-compliant text sample in the search engine, and the quality inspection text sample is recalled. According to specific needs, one or more of the most similar text samples are selected as the recall results.
[0087] In this step, the preset threshold is adjustable. The threshold can be adjusted according to actual needs in order to achieve a better recall effect.
[0088] The text quality inspection method of this invention converts text samples into quantifiable and comparable vector forms through a semantic vector conversion model, reducing the workload of manual judgment, improving retrieval efficiency, and using a search engine to initially determine whether the quality inspection text samples meet the requirements. It recalls text samples from both semantic and literal violations, making the quality inspection of text more comprehensive and able to detect potentially missed entries, such as "osmanthus tree," thus making the quality inspection more accurate.
[0089] In other embodiments, a method for script quality inspection is provided, such as Figure 5 As shown, in step S102, the recalled quality inspection text samples are matched with n preset quality inspection rules to obtain a literal feature vector based on a certain quality inspection rule, including the following steps:
[0090] Step S401: Set n quality inspection rules, n>2, and set an initial rule vector, which is a vector represented by n zero elements.
[0091] In this step, the number of quality inspection rules can be set according to specific circumstances. In one implementation, six quality inspection rules can be set, and the initial rule vector is a row vector of length 6. 0 represents the initial state of each rule, so the initial rule vector is [0,0,0,0,0,0], which means that none of the six rules are triggered initially.
[0092] In another implementation, 10 quality inspection rules can be set, and the initial rule vector is a vector of length 10. The initial state of each rule is represented by 0, so the initial rule vector is [0,0,0,0,0,0,0,0,0,0], which means that none of the 10 rules are triggered at the beginning.
[0093] Step S402: The recalled quality inspection text samples are matched with each quality inspection rule. When the quality inspection text sample is successfully matched with the i-th quality inspection rule, 0 < i ≤ n. The i-th 0 element in the initial rule vector is replaced with 1, and the literal feature vector is updated.
[0094] When a quality inspection text sample matches a certain rule, that rule is triggered, indicating that the quality inspection text sample does not comply with a certain procedure and has a violation. At this time, the corresponding position in the rule vector is replaced with 1, indicating that the rule has been triggered.
[0095] In one implementation, when an initial rule vector of length 6 is set as [0,0,0,0,0,0], it is found through matching that the recalled quality inspection text sample matches the 1st, 4th, and 5th quality inspection rules. The 1st, 4th, and 5th elements of the initial rule vector [0,0,0,0,0,0] are replaced with 1, and the literal feature vector of the quality inspection text sample is obtained as [1,0,0,1,1,0].
[0096] The speech quality inspection method of this invention uses a vector of length n to represent the matching status with the quality inspection rules, which concisely and clearly reflects the literal features of the text, facilitates rule update judgment and statistics, and improves the efficiency of speech quality inspection.
[0097] In other embodiments, a method for script quality inspection is provided, such as Figure 6 As shown, in step S302, the semantic vector of the quality inspection text sample is input into a preset semantic search engine for retrieval, and the Euclidean distance of the semantic vector is obtained. This includes the following steps:
[0098] Step S501: Collect illegal texts, input the illegal texts into the trained semantic vector extraction model to obtain the semantic vectors of the illegal texts, and store the semantic vectors of the illegal texts in the semantic storage engine.
[0099] In one implementation, non-compliant texts are collected by analyzing existing script quality inspection records, customer complaint feedback, and frequently asked questions. These non-compliant texts are then converted into vector form using a semantic vector extraction model, and their semantic vectors are stored in a semantic storage engine for subsequent retrieval.
[0100] Step S502: Input the semantic vector of the quality inspection text sample into the semantic search engine for retrieval, and obtain the vector in the semantic storage engine that is most similar to the semantic vector of the quality inspection text sample. The semantic storage engine and the semantic search engine constitute a unified storage and retrieval system.
[0101] The semantic storage engine and semantic search engine are integrated. The semantic vectors of the non-compliant texts are now stored in the system. Simply input the semantic vector of the quality inspection text sample into the semantic search engine for retrieval. Based on the results returned by the semantic search engine, the vector most similar to the semantic vector of the quality inspection text sample can be obtained.
[0102] Step S503: Calculate the Euclidean distance between the semantic vector of the quality inspection text sample and the most similar vector.
[0103] Based on the vector that is most similar to the semantic vector of the quality inspection text sample, the Euclidean distance between the semantic vector of the quality inspection text sample and the most similar vector can be calculated, which is used to represent the degree of similarity between the two vectors.
[0104] The verbal quality inspection method of this invention extensively collects and stores non-compliant texts, and can be updated and supplemented with new problems encountered at any time. The text samples are compared in the form of vectors, which improves the comparison efficiency and finds the non-compliant texts that are semantically closest to the recalled quality inspection text samples more quickly and accurately, reducing the workload of manual processing.
[0105] In other embodiments, a method for script quality inspection is provided, such as Figure 7 As shown, in step S103, the quality inspection text sample is input into the pre-trained semantic feature vector extraction model to obtain the semantic feature vector of the quality inspection text sample, which includes the following steps:
[0106] Step S601: Use a preset word segmenter to segment the input quality inspection text sample and add special markers to obtain the segmented text.
[0107] In one implementation, a word segmentation library of a computer programming language can be used for word segmentation and special markers can be added. For example, the input sentence "This product quality is too poor." After word segmentation, the output is "[CLS]This product quality is too poor.[SEP]". This processing adds the special markers [CLS] and [SEP], where [CLS] indicates the beginning of the text and [SEP] indicates the end of the text.
[0108] Optionally, special tags can be added to either [CLS] or [SEP], or both, or other special tags can be added.
[0109] Step S602: Input the segmented text into the semantic feature vector extraction model to obtain the first output text.
[0110] In one implementation, the segmented text is input into a trained BERT model. The model extracts word vectors for each word, then concatenates and combines these word vectors to output the semantic vector of the entire text. The semantic feature vector extraction model can be the BERT model or a word embedding model such as Word2Vec.
[0111] Step S603: Extract the vectors at the corresponding feature positions in the first output text to obtain the semantic feature vector.
[0112] The vector at the corresponding feature position is the vector at the preset label position, which can be one or more vectors at other positions such as [CLS] and [SEP]. The extracted vector represents the semantic feature vector.
[0113] The speech quality inspection method of this invention first divides sentences into individual words, which facilitates the processing of text by the semantic feature vector extraction model and improves the efficiency of converting text into semantic feature vectors. It selects vectors at special positions to represent semantic feature vectors, which simplifies vector representation and makes processing vector information more convenient and concise.
[0114] In other embodiments, a training method for a speech quality inspection classification model is provided, such as... Figure 8 As shown, it includes:
[0115] Step S701: Obtain each quality inspection text sample and the corresponding label for each quality inspection text sample in the script quality inspection method.
[0116] Obtain labeled quality inspection text samples to train the speech quality inspection classification model. These labeled quality inspection text samples can be speech examples from common problems.
[0117] Step S702: Use the quality inspection text samples and corresponding labels to train the initial verbal quality inspection classification model until the preset stop training condition is met, and obtain the pre-trained verbal quality inspection classification model.
[0118] Step S703: Perform keyword-based fuzzy search processing on the quality inspection text sample to obtain the search score of the quality inspection text sample; when the search score is greater than the preset threshold, recall the quality inspection text sample.
[0119] Step S704: Match the recalled quality inspection text samples with n preset quality inspection rules, n>2, and obtain the literal feature vector based on a certain quality inspection rule.
[0120] Step S705: Input the quality inspection text sample into the pre-trained semantic feature vector extraction model to obtain the semantic feature vector of the quality inspection text sample;
[0121] Step S706: The literal feature vector and semantic feature vector based on a certain quality inspection rule are fused to obtain the literal and semantic feature fusion vector of the quality inspection text sample, and the literal and semantic feature fusion vector is determined as the label of the quality inspection text sample.
[0122] Steps S703 to S706 are the same as steps S101 to S104 above, and can be referred to the description of steps S101 to S104, which will not be repeated here.
[0123] The training method of the speech quality inspection classification model in this embodiment of the invention trains the speech quality inspection classification model to meet the needs of actual application. During use, it can obtain the label classification of the input quality inspection text sample, which is convenient for classification and organization. Obtaining the label of the quality inspection text sample facilitates the processing and analysis of similar problems. It can provide processing templates for a certain type of label, reducing the amount of manual work.
[0124] Corresponding to the speech quality inspection method in the above embodiment, Figure 9 A structural block diagram of a script quality inspection device according to an embodiment of the present invention is shown. This device is applied to a computer device, which connects to a target database via a preset application programming interface (API). When the target database is driven to run and perform corresponding tasks, corresponding task logs are generated. These task logs can be collected via the API. For ease of explanation, only the parts relevant to the embodiment of the present invention are shown.
[0125] See Figure 9 The speech quality inspection device includes: a quality inspection result acquisition module 81, a model training module 82, a text sample recall module 83, a literal feature matching module 84, a semantic feature acquisition module 85, and a sample label determination module 86.
[0126] The quality inspection result acquisition module 81 is used to acquire the text sample to be inspected, input the text sample to be inspected into the pre-trained speech quality inspection classification model, and obtain the quality inspection result of the text sample to be inspected.
[0127] Model training module 82, used for training the speech quality inspection classification model, includes the following processes:
[0128] Obtain several quality inspection text samples and determine the label for each quality inspection text sample;
[0129] The initial dialogue quality inspection classification model is trained using quality inspection text samples and corresponding labels until a preset stopping condition is met, resulting in a pre-trained dialogue quality inspection classification model.
[0130] The text sample recall module 83 is used to obtain several quality inspection text samples, perform keyword-based fuzzy search processing on the quality inspection text samples to obtain the search score of the quality inspection text samples; when the search score is greater than the preset threshold, the quality inspection text samples are recalled.
[0131] The literal feature matching module 84 is used to match the recalled quality inspection text samples with n preset quality inspection rules to obtain a literal feature vector based on a certain quality inspection rule.
[0132] The semantic feature acquisition module 85 is used to input the quality inspection text sample into the pre-trained semantic feature vector extraction model to obtain the semantic feature vector of the quality inspection text sample.
[0133] The sample label determination module 86 is used to fuse the literal feature vector and semantic feature vector based on a certain quality inspection rule to obtain the literal and semantic feature fusion vector of the quality inspection text sample, and to determine the literal and semantic feature fusion vector as the label of the quality inspection text sample.
[0134] Optionally, the text sample recall module 83 mentioned above includes:
[0135] The keyword dictionary building unit is used to build a keyword dictionary for scripts that fail quality control and store the keyword dictionary in the search engine.
[0136] The retrieval score acquisition unit is used to input the quality inspection text sample into the keyword dictionary of the search engine for retrieval and obtain the retrieval score of the quality inspection text sample.
[0137] Optionally, the aforementioned literal feature matching module 84 includes:
[0138] The semantic vector acquisition unit is used to input the quality inspection text sample into the pre-trained semantic vector conversion model to obtain the semantic vector of the quality inspection text sample;
[0139] The semantic vector retrieval unit is used to input the semantic vectors of the quality inspection text samples into the preset semantic search engine for retrieval and to obtain the Euclidean distance of the semantic vectors.
[0140] The recall sample judgment unit is used to recall quality inspection text samples when the Euclidean distance is less than a preset threshold.
[0141] Optionally, the literal feature matching module 84 mentioned above also includes:
[0142] The initial vector setting unit is used to set n quality inspection rules (n>2) and set the initial rule vector, which is a vector represented by n zero elements.
[0143] The literal feature vector acquisition unit is used to match the recalled quality inspection text samples with each quality inspection rule. When the quality inspection text sample is successfully matched with the i-th quality inspection rule, 0 < i ≤ n, the i-th 0 element in the initial rule vector is replaced with 1, and the literal feature vector is updated.
[0144] Optionally, the semantic vector retrieval unit mentioned above includes:
[0145] The illegal text storage subunit is used to collect illegal texts, input the illegal texts into the trained semantic vector extraction model to obtain the semantic vectors of the illegal texts, and store the semantic vectors of the illegal texts in the semantic storage engine.
[0146] The similarity vector acquisition subunit is used to input the semantic vector of the quality inspection text sample into the semantic search engine for retrieval, and obtain the vector in the semantic storage engine that is most similar to the semantic vector of the quality inspection text sample. The semantic storage engine and the semantic search engine constitute a unified storage and retrieval system.
[0147] The Euclidean distance calculation subunit is used to calculate the Euclidean distance between the semantic vector of the quality inspection text sample and the most similar vector.
[0148] Optionally, the semantic feature acquisition module 85 mentioned above includes:
[0149] The word segmentation text acquisition unit is used to segment the input second recall text using a preset word segmenter and add special tags to obtain the segmented text;
[0150] The output text acquisition unit is used to input the segmented text into the semantic feature vector extraction model to obtain the output text.
[0151] The semantic feature vector acquisition unit is used to extract the vectors at the corresponding feature positions in the output text to obtain the semantic feature vector.
[0152] It should be noted that the information interaction and execution process between the above modules are based on the same concept as the method embodiments of the present invention. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0153] Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Figure 10 As shown, the computer device of this embodiment includes: at least one processor ( Figure 10 Only one is shown in the diagram), a memory, and a computer program stored in the memory and capable of running on at least one processor, which, when executed by the processor, implements the steps in any of the above-described speech quality inspection method embodiments.
[0154] This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 5 The examples of computer devices are merely examples and do not constitute a limitation on computer devices. Computer devices may include more or fewer components than shown in the illustration, or combinations of certain components, or different components, such as network interfaces, displays, and input devices.
[0155] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0156] Memory includes readable storage media, internal memory, etc., wherein internal memory can be the RAM of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of a computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal storage units and external storage devices of a computer device. Memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. Memory can also be used to temporarily store data that has been output or will be output.
[0157] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments 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. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy distinction and are not intended to limit the scope of protection of this invention.
[0158] The specific working process of the units and modules in the above-mentioned device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit 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, all or part of the processes in the above-mentioned method embodiments of the present invention can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above-mentioned method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0159] The present invention can implement all or part of the processes in the methods of the above embodiments, or it can be accomplished by a computer program product. When the computer program product is run on a computer device, the computer device executes the steps in the above method embodiments.
[0160] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0161] 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 implementations should not be considered beyond the scope of this invention.
[0162] In the embodiments provided by this invention, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or 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 mutual 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.
[0163] 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.
[0164] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for quality inspection of sales scripts, characterized in that, The script quality inspection methods include: Obtain a text sample to be inspected, input the text sample to be inspected into a pre-trained speech quality inspection classification model, and obtain the quality inspection result of the text sample to be inspected; The training process of the speech quality inspection classification model includes: Obtain several quality inspection text samples and determine the label of each quality inspection text sample; The initial verbal quality inspection classification model is trained using the quality inspection text samples and corresponding labels until the preset training stop condition is met, thus obtaining the pre-trained verbal quality inspection classification model. The labels for each of the aforementioned quality inspection text samples include: The quality inspection text sample is subjected to keyword-based fuzzy search processing to obtain the search score of the quality inspection text sample; when the search score is greater than a preset threshold value, the quality inspection text sample is recalled. The recalled quality inspection text samples are matched with n preset quality inspection rules, where n>2, to obtain a literal feature vector based on a certain quality inspection rule. The quality inspection text sample is input into a pre-trained semantic feature vector extraction model to obtain the semantic feature vector of the quality inspection text sample; The literal feature vector based on a certain quality inspection rule and the semantic feature vector are fused to obtain the literal and semantic feature fusion vector of the quality inspection text sample, and the literal and semantic feature fusion vector is determined as the label of the quality inspection text sample.
2. The script quality inspection method according to claim 1, characterized in that, The step of performing keyword-based fuzzy search processing on the quality inspection text sample to obtain the search score of the quality inspection text sample includes: Construct a keyword dictionary for scripts that fail quality control, and store the keyword dictionary in a search engine; The quality inspection text sample is input into the keyword dictionary of the search engine for retrieval, and the retrieval score of the quality inspection text sample is obtained.
3. The script quality inspection method according to claim 1, characterized in that, Before matching the recalled quality inspection text samples with n preset quality inspection rules, the process also includes: The quality inspection text sample is input into a pre-trained semantic vector conversion model to obtain the semantic vector of the quality inspection text sample; The semantic vector of the quality inspection text sample is input into a preset semantic search engine for retrieval, and the Euclidean distance of the semantic vector is obtained. When the Euclidean distance is less than a preset threshold, the quality inspection text sample is recalled.
4. The script quality inspection method according to claim 1, characterized in that, The step of matching the recalled quality inspection text samples with n preset quality inspection rules to obtain a literal feature vector based on a certain quality inspection rule includes: Set n quality inspection rules, where n > 2, and set an initial rule vector, which is a vector represented by n zero elements; The quality inspection text samples to be recalled are matched with each of the quality inspection rules respectively. When the quality inspection text sample is successfully matched with the i-th quality inspection rule, 0 < i ≤ n. The i-th 0 element in the initial rule vector is replaced with 1, and the literal feature vector is updated.
5. The script quality inspection method according to claim 3, characterized in that, The step of inputting the semantic vector of the quality inspection text sample into a preset semantic search engine for retrieval, and obtaining the Euclidean distance of the semantic vector, includes: Collect illegal texts, input the illegal texts into the trained semantic vector extraction model to obtain the semantic vectors of the illegal texts, and store the semantic vectors of the illegal texts in the semantic storage engine; The semantic vector of the quality inspection text sample is input into the semantic search engine for retrieval, and the most similar vector to the semantic vector of the quality inspection text sample in the semantic storage engine is obtained. The semantic storage engine and the semantic search engine constitute a unified storage and retrieval system. The Euclidean distance between the semantic vector of the quality inspection text sample and the most similar vector is calculated.
6. The script quality inspection method according to claim 1, characterized in that, The step of inputting the quality inspection text sample into a pre-trained semantic feature vector extraction model to obtain the semantic feature vector of the quality inspection text sample includes: The input quality inspection text sample is segmented using a preset word segmenter, and special markers are added to obtain the segmented text. The segmented text is input into the semantic feature vector extraction model to obtain the first output text; Extract the vectors at the corresponding feature positions in the first output text to obtain the semantic feature vector.
7. A training method for a speech quality inspection classification model, characterized in that, The training method for the script quality inspection classification model includes: Obtain each quality inspection text sample and the label corresponding to each quality inspection text sample; The initial verbal quality inspection classification model is trained using the quality inspection text samples and corresponding tags until the preset stop training condition is met, thus obtaining a pre-trained verbal quality inspection classification model. Obtaining each of the quality inspection text samples includes: The corresponding tags are used to perform keyword-based fuzzy search processing on the quality inspection text sample to obtain the search score of the quality inspection text sample; when the search score is greater than a preset threshold, the quality inspection text sample is recalled. The recalled quality inspection text samples are matched with n preset quality inspection rules, where n>2, to obtain a literal feature vector based on a certain quality inspection rule. The quality inspection text sample is input into a pre-trained semantic feature vector extraction model to obtain the semantic feature vector of the quality inspection text sample; The literal feature vector based on a certain quality inspection rule and the semantic feature vector are fused to obtain the literal and semantic feature fusion vector of the quality inspection text sample, and the literal and semantic feature fusion vector is determined as the label of the quality inspection text sample.
8. A speech quality inspection device, characterized in that, The script quality inspection device includes: The quality inspection result acquisition module is used to acquire the text sample to be inspected, input the text sample to be inspected into the pre-trained speech quality inspection classification model, and obtain the quality inspection result of the text sample to be inspected. The model training module is used to train the speech quality inspection classification model. The training process includes: Obtain several quality inspection text samples and determine the label of each quality inspection text sample; The initial verbal quality inspection classification model is trained using the quality inspection text samples and corresponding labels until the preset training stop condition is met, thus obtaining the pre-trained verbal quality inspection classification model. The text sample recall module is used to perform keyword-based fuzzy search processing on the quality inspection text sample to obtain the retrieval score of the quality inspection text sample; when the retrieval score is greater than a preset threshold value, the quality inspection text sample is recalled. The literal feature matching module is used to match the recalled quality inspection text samples with n preset quality inspection rules to obtain a literal feature vector based on a certain quality inspection rule. The semantic feature acquisition module is used to input the quality inspection text sample into a pre-trained semantic feature vector extraction model to obtain the semantic feature vector of the quality inspection text sample. The sample label determination module is used to fuse the literal feature vector based on a certain quality inspection rule and the semantic feature vector to obtain the literal and semantic feature fusion vector of the quality inspection text sample, and to determine the literal and semantic feature fusion vector as the label of the quality inspection text sample.
9. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the speech quality inspection method as described in any one of claims 1 to 6, or the training method for the speech quality inspection classification model as described in claim 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the script quality inspection method as described in any one of claims 1 to 6, or the training method for the script quality inspection classification model as described in claim 7.
Citation Information
Patent Citations
Voice session quality inspection method and device, equipment and storage medium
CN115223592A
Intelligent customer service telephone traffic text service quality inspection method and system
CN116628166A
