Artificial intelligence-based text quality inspection methods, devices, computer equipment, and media

By combining temporal convolutional networks and text compliance recognition models, the problems of low accuracy and long processing time in existing Chinese text quality inspection technologies are solved, achieving efficient and accurate text quality inspection.

CN114792090BActive Publication Date: 2026-03-13ONE CONNECT SMART TECH CO LTD SHENZHEN
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-25
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing text quality inspection methods cannot accurately distinguish quality inspection categories when faced with highly complex quality inspection scenarios, resulting in inaccurate quality inspection results and long processing times.

Method used

A temporal convolutional network is used to obtain the field information of the text to be identified, and the information is concatenated according to the temporal relationship to form a quality inspection prompt template. The template is then combined with a trained text compliance recognition model to make a judgment and generate a compliance judgment result.

Benefits of technology

It improves the accuracy of text quality inspection, shortens the inspection time, adapts to the classification of text quality inspection with greater complexity, and enhances the relevance of field information and the efficiency of quality inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114792090B_ABST
    Figure CN114792090B_ABST
Patent Text Reader

Abstract

This invention relates to the field of artificial intelligence technology, and more particularly to a text quality inspection method, apparatus, computer device, and medium based on artificial intelligence. The method acquires text information to be identified, inputs this text information into a trained temporal convolutional network for iterative processing, obtains N fields with temporal relationships, concatenates the field categories of each field according to their temporal relationships to obtain a quality inspection prompt template, concatenates the text information to be identified with the quality inspection prompt template to form the prompt text information to be identified, inputs this prompt text information into a trained text compliance recognition model to obtain a compliance judgment result, and finally fills the occlusion field of the quality inspection prompt template with the compliance judgment result and outputs the filled quality inspection prompt template. This method can effectively improve the accuracy of text quality inspection and shorten the text quality inspection time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a text quality inspection method, apparatus, computer equipment, and medium based on artificial intelligence. Background Technology

[0002] Currently, the text quality inspection process uses prompt templates to display the inspection results. The existing prompt templates pre-set the positions and quantities of unused and obscured fields. The text is inspected by a classifier, and the inspection results are displayed in the obscured fields of the prompt template.

[0003] However, in quality inspection scenarios with high text complexity, the numerous quality inspection categories mean that pre-set prompt templates cannot distinguish between them. This leads to inaccurate compliance assessments of the text after adding prompt templates, and the lack of semantically meaningful fields in the prompt templates further prolongs the quality inspection process. Therefore, improving the accuracy of text quality inspection and reducing its time has become an urgent problem to be solved. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide an artificial intelligence-based text quality inspection method to solve the problems of low accuracy and long inspection time in text quality inspection.

[0005] In a first aspect, embodiments of the present invention provide a text quality inspection method based on artificial intelligence, the text quality inspection method comprising:

[0006] The text information to be identified is obtained, and the text information to be identified is input into a trained temporal convolutional network for iteration to obtain N fields with temporal relationship, where N is an integer greater than 1;

[0007] The field categories of each field information are concatenated sequentially according to the time sequence to obtain the quality inspection prompt template. The field categories include unused fields and obscured fields.

[0008] The text information to be identified is concatenated with the quality inspection prompt template to form the prompt text information to be identified, and the prompt text information to be identified is input into the trained text compliance recognition model to obtain the compliance judgment result;

[0009] Fill the compliance determination result into the obscuring field of the quality inspection prompt template, and output the filled quality inspection prompt template.

[0010] Secondly, embodiments of the present invention provide an artificial intelligence-based text quality inspection device, the text quality inspection device comprising:

[0011] The field information acquisition module is used to acquire the text information to be recognized, input the text information to be recognized into the trained temporal convolutional network for iteration, and obtain N field information with temporal relationship, where N is an integer greater than 1;

[0012] The template splicing module is used to sequentially splice the field categories of each field information according to the time sequence relationship to obtain a quality inspection prompt template. The field categories include unused fields and obscured fields.

[0013] The text compliance determination module is used to concatenate the text information to be identified with the quality inspection prompt template to form the prompt text information to be identified, and input the prompt text information to be identified into the trained text compliance recognition model to obtain the compliance determination result.

[0014] The quality inspection result display module is used to fill the compliance judgment result into the obscuring field of the quality inspection prompt template and output the filled quality inspection prompt template.

[0015] Thirdly, 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 text quality inspection method as described in the first aspect.

[0016] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the text quality inspection method as described in the first aspect.

[0017] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows:

[0018] This invention acquires the text information to be identified, inputs it into a trained temporal convolutional network for iteration, and obtains N fields with temporal relationships. The field categories of each field are then concatenated sequentially according to the temporal relationships to obtain a quality inspection prompt template. The text information to be identified is then concatenated with the quality inspection prompt template to form the prompt text information to be identified. This prompt text information is then input into a trained text compliance recognition model to obtain a compliance judgment result. The compliance judgment result is then filled into the occlusion field of the quality inspection prompt template, and the filled quality inspection prompt template is output. The iterative prediction of the field information of the quality inspection prompt template using a temporal convolutional network enables the acquisition of a non-fixed number and non-fixed position of field information based on the semantic information of the text information to be identified. This allows the quality inspection prompt template constructed from the field information to adapt to various quality inspection category classifications of complex texts, improving the accuracy of text quality inspection. Furthermore, because the field information is obtained through iterative prediction in a temporal sequence, the correlation between the field information and the information is strong, playing a guiding role in the quality inspection process and preventing the generation of poor-performing quality inspection prompt templates for text quality inspection, thereby greatly shortening the time required for text quality inspection. Attached Figure Description

[0019] 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.

[0020] Figure 1 This is a schematic diagram of an application environment for an artificial intelligence-based text quality inspection method provided in Embodiment 1 of the present invention;

[0021] Figure 2 This is a flowchart illustrating an artificial intelligence-based text quality inspection method provided in Embodiment 2 of the present invention;

[0022] Figure 3 This is a schematic diagram of a text quality inspection method based on artificial intelligence provided in Embodiment 3 of the present invention;

[0023] Figure 4 This is a schematic diagram of the structure of a text quality inspection device based on artificial intelligence provided in Embodiment 4 of the present invention;

[0024] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 5 of the present invention. Detailed Implementation

[0025] 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.

[0026] 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.

[0027] 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.

[0028] 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]."

[0029] 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.

[0030] 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.

[0031] The embodiments of this invention can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that utilize digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0032] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0033] 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.

[0034] To illustrate the technical solution of the present invention, specific embodiments are described below.

[0035] See Figure 1 This is an application environment for an artificial intelligence-based text quality inspection method provided in Embodiment 1 of the present invention, in which the client and the server communicate. The client includes, but is not limited to, computer devices such as PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud terminal devices, and personal digital assistants (PDAs). The server can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0036] See Figure 2 This is a flowchart illustrating an artificial intelligence-based text quality inspection method provided in Embodiment 2 of the present invention. The above-described text quality inspection method can be applied to... Figure 1 The client, corresponding to a computer device, connects to a relevant database to retrieve the text information to be recognized. For example... Figure 2 As shown, this text quality inspection method may include the following steps:

[0037] Step S201: Obtain the text information to be recognized. Input the text information to be recognized into the trained temporal convolutional network for iteration to obtain N fields with temporal relationships.

[0038] Wherein, N is an integer greater than 1, and the text information to be recognized can be text information obtained from speech conversion, text information obtained from handwritten character recognition, and text information of printed characters, etc. The above temporal relationship is a sequential relationship, that is, the temporal relationship of the field information is determined according to the sequential order of the generation time of the field information. In this embodiment, the field information is the attribute information of the field. The attribute information can be used to represent the basic attributes of the field, such as the category attribute, cutoff attribute, and component attribute of the field, etc.

[0039] In one implementation, the field information can also be a semantic field, such as a Chinese field, an English field, and a numeric field.

[0040] In this embodiment, after collecting the text information to be identified, the text information to be identified needs to be processed by a word segmentation algorithm to obtain M word segmentation results of the text information to be identified. The M word segmentation results are determined to be M semantic fields, where M is an integer greater than 0. The word segmentation algorithm is an existing technology in the field of natural language processing, and will not be described in detail here. Implementers can choose algorithms such as maximum matching word segmentation algorithm, shortest path word segmentation algorithm, generative model word segmentation algorithm, etc.

[0041] In one implementation, when the text information to be identified is a single word, there is no need to process it through a word segmentation algorithm.

[0042] Specifically, the input to the temporal convolutional network is the semantic fields of the text to be recognized of any length, that is, M can be any integer greater than 0. The implementer can pre-set the sliding window length according to actual needs. The sliding window length is used to determine the number of semantic fields input to the temporal convolutional network in a single input. In this embodiment, the sliding window length L is set to 5. It should be noted that when the number of semantic fields input to the temporal convolutional network in a single input is less than the sliding window length, a zero-padding operation is performed, that is, zeros are padded at positions that do not contain semantic fields according to the temporal relationship.

[0043] The network structure of a temporal convolutional network includes an input layer, hidden layers, and an output layer. The hidden layer is used to extract the feature information of the input. The number of hidden layers is an integer greater than 0. Usually, the number of hidden layers is set to L-1 to fully extract the feature information of the input. The output layer is a fully connected layer, which is used to map the feature tensor extracted by the hidden layer to the output space.

[0044] Since the input data being processed is text data, to avoid missing information, the window stride of the temporal convolutional network is set to 1, and a non-dilated causal convolution is used.

[0045] For example, if the semantic fields of the text information to be recognized are A, B, and C, then after padding with zeros, the single input of the temporal convolutional network is [0, 0, A, B, C]. Non-dilated causal convolution is used, meaning that in each hidden layer, the i-th input and the (i+1)-th input are convolved for feature extraction, where i∈{1,2,…,L-1}. In this example, the first input 0 and the second input 0 are processed through the first hidden layer to obtain the feature tensor. The second input 0 and the third input A are processed through the first hidden layer to obtain the feature tensor. The third input A and the fourth input B are processed through the first hidden layer to obtain the feature tensor. The fourth input B and the fifth input C are processed through the first hidden layer to obtain the feature tensor. Feature tensor and feature tensor The feature tensor is obtained through processing in the second hidden layer. Feature tensor and feature tensor The feature tensor is obtained through processing in the second hidden layer. Feature tensor and feature tensor The feature tensor is obtained through processing in the second hidden layer. Feature tensor and feature tensor The feature tensor is obtained through processing in the third hidden layer. Feature tensor and feature tensor The feature tensor is obtained through processing in the third hidden layer. Feature tensor and feature tensor The feature tensor is obtained through processing in the fourth hidden layer. Feature tensor This is the final output of the hidden layer, the feature tensor. The output layer maps the information to a single field.

[0046] Optionally, the text information to be recognized is input into a pre-trained temporal convolutional network for iteration to obtain N fields of information with temporal relationships, including:

[0047] The text information to be recognized is used as input, the number of iterations is initialized to 0, and the input is fed into the trained temporal convolutional network to output field information.

[0048] The field information is appended to the end of the input to obtain the concatenated information, and the iteration count is incremented by one.

[0049] Using the concatenated information as input, the process returns to the step of executing the input-trained temporal convolutional network and outputting field information, until the number of iterations reaches N, resulting in N field information.

[0050] The iteration count refers to the number of inferences performed by the temporal convolutional network, which is the number of times the temporal convolutional network runs. The concatenation method used to append the above field information to the end of the input is concatenation.

[0051] For example, suppose the initial output field information is represented by 1, and the initial input is [0, 0, A, B, C]. Then the concatenated information is [0, 0, A, B, C, 1]. The iteration count increases to 1. Since the window stride of the temporal convolutional network in this embodiment is 1, when the temporal convolutional network is run again, the input [0, 0, A, B, C, 1] is extracted by the window and becomes [0, A, B, C, 1]. The second output field information is also represented by 1. The concatenated information is then [0, 0, A, B, C, 1, 1]. The iteration count increases to 1. 2. During the third runtime of the domain convolutional network, the input [0, 0, A, B, C, 1, 1] is extracted by a sliding window to become [A, B, C, 1, 1], resulting in the field information of the second output, denoted by 2. The concatenated information is then [0, 0, A, B, C, 1, 1, 2]. The number of iterations increases to 3. When the number of iterations increases to N, the iteration stops. The output of a single iteration is the field information output in that iteration. Thus, after N iterations, N field information can be obtained. In this example, N is empirically set to 5. Implementers can adjust the value of N according to the actual situation.

[0052] The above process uses a single text information to be identified as input and obtains N field information through network iteration, where N can be any positive integer. This greatly improves the flexibility of quality inspection prompt template construction. Furthermore, it generates subsequent field information based on semantic fields and previously generated field information, taking into account the temporal and semantic correlations between field information. This plays a guiding role in the field information generation process, improving the efficiency of quality inspection template construction and thus improving quality inspection efficiency.

[0053] Step S202: Concatenate the field categories of each field information in sequence according to the time sequence to obtain the quality inspection prompt template. The field categories include unused fields and obscured fields.

[0054] Unused fields are represented by [unused], which means that the corresponding field does not belong to the fields to be filled. Unused fields do not represent any fields with specific semantic information. They represent high-dimensional vectors that can be used to construct quality inspection prompt templates. Masked fields are represented by [mask], which means that the corresponding field belongs to the fields to be filled and is used to display the filling results.

[0055] A quality inspection prompt template can refer to a template containing fields to be filled, used to guide the encoder in feature extraction of the text information to be recognized in different quality inspection scenarios. For example, the field categories of each field information are concatenated in sequence according to the temporal relationship, and the concatenation method is concatenation. The quality inspection prompt template obtained after concatenation is in the form of: [unused][unused][unused][mask][unused].

[0056] Optionally, the field categories of each field are concatenated sequentially according to their chronological order to obtain the quality inspection prompt template, which includes:

[0057] Based on the temporal relationship, determine the concatenation order of all field information, use the field category of the first field information as the header information, and check whether the first field information meets the stopping condition.

[0058] If the first field information does not meet the stopping condition, the next field information is taken as the field information to be concatenated, the field category of the field information to be concatenated is taken as the tail information, and the tail information is appended to the head information to obtain the combined information.

[0059] The combined information is used as the header information, and the information of the fields to be concatenated is checked to see if the stopping condition is met;

[0060] If the field information to be concatenated does not meet the stopping condition, the next field information is taken as the field information to be concatenated, and the field category of the field information to be concatenated is taken as the tail information. The tail information is then appended to the header information to obtain the combined information. This process continues until the field information to be concatenated meets the stopping condition, and the final header information is determined to be the quality inspection prompt template.

[0061] The concatenation order refers to the order in which the field information is generated.

[0062] For example, suppose the field information generated in sequence is [unused], [unused], [unused], [mask], [unused]. The field category [unused] of the first field information is used as the header information, and the first field information is checked to see if it meets the stopping condition. If it does, the header information [unused] is used as the quality inspection prompt template. If it does not meet the stopping condition, the next field information is used as the field information to be concatenated, and the field category [unused] of the field information to be concatenated is used as the tail information. The tail information is appended to the header information to obtain the combined information [unused][unused]. The combined information [unused][unused] is used as the header information, and the first field information is checked again to see if it meets the stopping condition. This process continues until the field information to be concatenated meets the stopping condition. The final header information is then determined as the quality inspection prompt template. Assuming that only the fifth field information [unused] meets the stopping condition, the determined quality inspection prompt template is [unused][unused][unused][mask][unused].

[0063] Optionally, the field information also includes a judgment category, which includes cut-off and not cut-off;

[0064] Whether the detection field information meets the stopping conditions includes:

[0065] The detection field determines whether the category is the end and whether the field information is the last character in the concatenation order.

[0066] If the field information is detected to be either the cutoff or the last character in the concatenation order, then the field information is determined to meet the stopping condition.

[0067] Specifically, when the judgment category of the field information is "cutoff", it means that the concatenation will stop after the field information is concatenated; when the judgment category of the field information is "not cutoff", it means that the concatenation will continue after the field information is concatenated.

[0068] The last one refers to the Nth field information after sorting the N fields output by the above temporal convolutional network in chronological order.

[0069] The above process uses field categories to construct quality inspection prompt templates, which gets rid of the limitations of field information containing specific semantics. This allows for the search of high-dimensional vectors that are more effective in extracting features of the text to be identified as field information, thereby constructing quality inspection prompt templates that are more suitable for the text to be identified and have a higher recognition accuracy.

[0070] Step S203: The text information to be identified is concatenated with the quality inspection prompt template to form the prompt text information to be identified, and the prompt text information to be identified is input into the trained text compliance recognition model to obtain the compliance judgment result.

[0071] The concatenation of the text information to be identified and the quality inspection prompt template refers to the connection used to unify the size to meet the input size requirements of the trained text compliance recognition model. In the text information to be identified, the text information to be identified comes first, followed by the quality inspection prompt template. The compliance judgment result includes compliance and violation. In actual use, the compliance judgment result is represented by different judgment fields according to different quality inspection scenarios. In this embodiment, the judgment field "yes" corresponds to the compliance judgment result "compliant", and the judgment field "no" corresponds to the compliance judgment result "violation".

[0072] In one implementation, the judgment field can still be a field that meets the opposite conditions, such as "yes" and "no", "correct" and "incorrect". For example, the judgment field "yes" corresponds to the compliance judgment result of "compliant", and the judgment field "no" corresponds to the compliance judgment result of "non-compliant".

[0073] Optionally, the trained text compliance recognition model includes a trained text feature extraction encoder and a trained text compliance classifier.

[0074] Input the text information to be identified into the trained text compliance recognition model to obtain compliance judgment results, including:

[0075] Input the text information to be recognized into the trained text feature extraction encoder to obtain the text feature tensor;

[0076] The text feature tensor is classified using a trained text compliance classifier, and the classification result is determined as the compliance judgment result.

[0077] The text feature extraction encoder described above contains K one-dimensional convolutional layers, where K is an integer greater than 0. The implementer can adjust the value of K according to actual needs. The text feature extraction encoder is used to extract the feature tensor of the prompt text information to be recognized. Since the input size of the text feature extraction encoder is fixed, it needs to be expanded to the maximum size for different prompt text information to be recognized. The maximum size can be determined based on the maximum size of the historical prompt text information to be recognized. The text compliance classifier described above is a fully connected layer used to map the text feature tensor to the category partitioning space and determine the partitioning result based on the mapping result. In one embodiment, K is set to 5.

[0078] The above process enables text quality inspection tasks to be implemented through a text compliance recognition model constructed by a text feature extraction encoder and a text compliance classifier. It can output text quality inspection results in an end-to-end manner without the need for complex post-processing of the model output, thereby effectively improving the efficiency of text quality inspection.

[0079] Step S204: Fill the compliance judgment result into the obscured field of the quality inspection prompt template, and output the quality inspection prompt template after filling.

[0080] The compliance determination result is represented in the form of a judgment field. The above filling process is to replace the judgment field with the masked field of the quality inspection prompt template. For example, if the judgment field is "yes" and the quality inspection prompt template is [unused][unused][unused][mask][unused], then the quality inspection prompt template after filling will be [unused][unused][unused][yes][unused].

[0081] The above process visualizes the compliance judgment results and displays them in the quality inspection prompt template, making it easy for implementers to understand the text quality inspection results. At the same time, when it is necessary to store the text quality inspection results, it can improve the storage efficiency of the text quality inspection and the retrieval efficiency after storage.

[0082] This embodiment employs a temporal convolutional network for iterative prediction of the field information in the quality inspection prompt template. This allows for the acquisition of a non-fixed number and non-fixed position of field information based on the semantic information of the text to be identified, thereby improving the flexibility of constructing the quality inspection prompt template from the field information. This makes it adaptable to various quality inspection categories of complex texts, improving the accuracy of text quality inspection. Furthermore, since the field information is obtained through iterative prediction in a temporal sequence, the correlation between the field information and the template is strong, playing a guiding role in the quality inspection process and preventing the generation of poor-performing quality inspection prompt templates for text quality inspection, thus significantly shortening the time required for text quality inspection.

[0083] See Figure 3 This is a flowchart illustrating an artificial intelligence-based text quality inspection method provided in Embodiment 3 of the present invention. The training process of the pre-trained temporal convolutional network and the pre-trained text compliance recognition model used in this text quality inspection method can be carried out by training them separately or by joint training. The training samples used for separate training are different from those used for joint training.

[0084] When training alone, the training samples of the temporal convolutional network are truncated text samples. The qth to q+Lth fields of the obtained complete text sample are used as training samples, and the q+L+1th field is used as the corresponding label of the training sample, where q∈{1,2,…,QL-1}, and Q is the number of fields of the text sample.

[0085] During joint training, the complete text samples obtained above are used as initial training samples, and the compliance recognition results of the initial training samples are used as annotations;

[0086] When using joint training with cross-entropy as the loss function, the joint training includes the following steps:

[0087] Step S301: Input the initial training samples into the temporal convolutional network to obtain N sample field information;

[0088] Step S302: Concatenate the field categories of each sample field information according to the time sequence to obtain the sample prompt template;

[0089] Step S303: Concatenate the initial training samples with the sample prompt template to form joint training samples, and input the joint training samples into the text compliance recognition model to obtain the joint sample output;

[0090] Step S304: Calculate the loss function based on the joint sample output and annotations. Update the parameters of the temporal convolutional network and the text compliance recognition model using the backpropagation algorithm based on the calculation results until the gradient of the loss function converges.

[0091] The cross-entropy loss function is:

[0092] L(y′ j ,y j )=-[y j log(y′ j )+(1-y j )log(1-y′ j )]

[0093] Among them, y j For the expected output of the joint sample, y′ j For the actual output of the joint sample, log is the logarithmic function, usually with base 2.

[0094] This embodiment employs a joint training approach to train the temporal convolutional network and the text compliance recognition model. This enables the generation of field information in the temporal convolutional network to improve the accuracy of text compliance recognition results, thereby guiding the temporal convolutional network to update its parameters, improving training efficiency, and resulting in higher efficiency in text quality inspection when using the trained temporal convolutional network and text compliance recognition model for text quality inspection tasks.

[0095] Corresponding to the AI-based text quality inspection method in the above embodiments, Figure 4A structural block diagram of an artificial intelligence-based text quality inspection device according to Embodiment 4 of the present invention is shown. This text quality inspection device is applied to a computer device, which connects to a target database through a preset interface to obtain text information to be identified. For ease of explanation, only the parts relevant to the embodiments of the present invention are shown.

[0096] See Figure 4 The AI-based text quality inspection device includes:

[0097] The field information acquisition module 41 is used to acquire the text information to be recognized. The text information to be recognized is input into the trained temporal convolutional network for iteration to obtain N field information with temporal relationship, where N is an integer greater than 1.

[0098] The template splicing module 42 is used to splice the field categories of each field information in sequence according to the time sequence to obtain the quality inspection prompt template. The field categories include unused fields and obscured fields.

[0099] The text compliance determination module 43 is used to concatenate the text information to be identified with the quality inspection prompt template to form the prompt text information to be identified, and input the prompt text information to be identified into the trained text compliance recognition model to obtain the compliance determination result.

[0100] The quality inspection result display module 44 is used to fill the compliance judgment result into the obscured field of the quality inspection prompt template and output the filled quality inspection prompt template.

[0101] Optionally, the above-mentioned field information acquisition module 41 includes:

[0102] The field information output unit is used to take the text information to be recognized as input, initialize the number of iterations to 0, input the input into the trained temporal convolutional network, and output the field information.

[0103] The concatenation information acquisition unit is used to concatenate field information to the end of the input quantity to obtain concatenation information and increment the iteration count by one.

[0104] The iterative execution unit is used to take the concatenated information as input, return the steps of executing the input trained temporal convolutional network and outputting field information, until the number of iterations reaches N and N field information are obtained.

[0105] Optionally, the template splicing module 42 mentioned above includes:

[0106] The splicing order determination unit is used to determine the splicing order of all field information according to the temporal relationship, and uses the field category of the first field information as the header information to check whether the first field information meets the stopping condition.

[0107] Combined with the information acquisition unit, if the first field information does not meet the stopping condition, the next field information is used as the field information to be concatenated, the field category of the field information to be concatenated is used as the tail information, and the tail information is appended to the head information to obtain the combined information;

[0108] The stop detection unit is used to take the combined information as header information and detect whether the field information to be concatenated meets the stop condition.

[0109] The template determination unit is used to determine the next field information as the field information to be concatenated if the detected field information to be concatenated does not meet the stopping condition, and to execute the step of taking the field category of the field information to be concatenated as the tail information and appending the tail information to the header information to obtain the combined information, until the detected field information to be concatenated meets the stopping condition, and to determine the final header information as the quality inspection prompt template.

[0110] Optionally, the field information also includes a judgment category, which includes cutoff and non-cutoff. The aforementioned stop detection unit is specifically used for:

[0111] The detection field determines whether the category is the end and whether the field information is the last character in the concatenation order.

[0112] If the field information is detected to be either the cutoff or the last character in the concatenation order, then the field information is determined to meet the stopping condition.

[0113] Optionally, the trained text compliance recognition model includes a trained text feature extraction encoder and a trained text compliance classifier, and the aforementioned text compliance determination module 43 includes:

[0114] The feature extraction unit is used to input the text information to be recognized into the trained text feature extraction encoder to obtain the text feature tensor.

[0115] The compliance determination unit is used to classify the text feature tensor using a trained text compliance classifier and determine the classification result as the compliance determination result.

[0116] Optionally, the temporal convolutional network and the text compliance recognition model are jointly trained. The initial training samples for joint training are texts labeled with compliance judgment results, and cross-entropy is used as the loss function. The aforementioned AI-based text quality inspection device also includes:

[0117] The sample field acquisition module is used to input the initial training samples into the temporal convolutional network and obtain N sample field information;

[0118] The sample template acquisition module is used to sequentially concatenate the field categories of each sample field information according to the time sequence to obtain the sample prompt template.

[0119] The sample output acquisition module is used to concatenate the initial training samples with the sample prompt template to form a joint training sample, and input the joint training sample into the text compliance recognition model to obtain the joint sample output.

[0120] The parameter update module is used to calculate the loss function based on the joint sample output and annotations. Based on the calculation results, the parameters of the temporal convolutional network and the text compliance recognition model are updated through the backpropagation algorithm until the gradient of the loss function converges.

[0121] It should be noted that the information interaction and execution process between the above modules and units 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, and they will not be repeated here.

[0122] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 5 of the present invention. Figure 5 As shown, the computer device of this embodiment includes: at least one processor ( Figure 5 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 text quality inspection method embodiments.

[0123] 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.

[0124] 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.

[0125] 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.

[0126] Those skilled in the art will understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the functions described above 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 differentiation and are not intended to limit the scope of protection of this invention. The specific working process of the units and modules in the above 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, the present invention can implement all or part of the processes in the methods of the above embodiments by instructing related hardware through a computer program. 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 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, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. 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.

[0127] 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.

[0128] 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.

[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 implementations should not be considered beyond the scope of this invention.

[0130] 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.

[0131] 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.

[0132] 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. An artificial intelligence-based text quality inspection method, characterized in that, The method comprises: acquiring to-be-recognized text information, inputting the to-be-recognized text information into a trained time domain convolution network for iteration, and obtaining N field information with a time sequence relationship, N being an integer greater than 1; sequentially splicing field categories of each field information according to the time sequence relationship to obtain a quality inspection prompt template, the field categories including an unused field and a shield field; the shield field is used to guide a feature extractor to extract features of the to-be-recognized text information under different quality inspection scenarios; splicing the to-be-recognized text information and the quality inspection prompt template into to-be-recognized prompt text information, inputting the to-be-recognized prompt text information into a trained text compliance recognition model, and obtaining a compliance determination result; the to-be-recognized prompt text information is text; the trained text compliance recognition model comprises a trained text feature extraction encoder and a trained text compliance classifier; the inputting of the to-be-recognized prompt text information into the trained text compliance recognition model to obtain the compliance determination result comprises: inputting the to-be-recognized prompt text information into the trained text feature extraction encoder to obtain a text feature tensor; the text feature extraction encoder comprises K one-dimensional convolution layers, K being an integer greater than 0; using the trained text compliance classifier to classify the text feature tensor to determine a classification result as the compliance determination result; the text compliance classifier is a fully connected layer, which is used to map the text feature tensor to a classification space, and determine the classification result according to the mapped result; filling the compliance determination result into the shield field of the quality inspection prompt template, and outputting the filled quality inspection prompt template.

2. The text inspection method of claim 1, wherein, the inputting of the to-be-recognized text information into the trained time domain convolution network for iteration to obtain N field information with a time sequence relationship comprises: inputting the to-be-recognized text information as an input quantity, initializing an iteration number as 0, inputting the input quantity into the trained time domain convolution network, and outputting field information; splicing the field information at the end of the input quantity to obtain spliced information, and increasing the iteration number by one; taking the spliced information as the input quantity, returning to the step of inputting the trained time domain convolution network and outputting the field information, until the iteration number reaches N, and obtaining N field information.

3. The text inspection method of claim 1, wherein, the sequentially splicing of field categories of each field information according to the time sequence relationship to obtain a quality inspection prompt template comprises: determining a splicing order of all field information according to the time sequence relationship, taking a field category of a first field information as head information, and detecting whether the first field information meets a stop condition; if it is detected that the first field information does not meet the stop condition, taking a next field information as to-be-spliced field information, taking a field category of the to-be-spliced field information as tail information, connecting the tail information after the head information to obtain combined information; taking the combined information as the head information, and detecting whether the to-be-spliced field information meets the stop condition; If it is detected that the field information to be spliced does not satisfy the stop condition, the next field information is taken as the field information to be spliced, the field category of the field information to be spliced is taken as tail information, the tail information is concatenated after the head information, and the step of obtaining combined information is performed until it is detected that the field information to be spliced satisfies the stop condition, and finally obtained head information is determined as a quality inspection prompt template.

4. The text inspection method of claim 3, wherein, The field information further comprises a judgment category, and the judgment category comprises cut-off and non-cut-off; The detection of whether the field information satisfies the stop condition comprises: The detection of whether the judgment category of the field information is cut-off and whether the field information is the last one in the splicing sequence; If it is detected that the judgment category of the field information is cut-off or the field information is the last one in the splicing sequence, it is determined that the field information satisfies the stop condition.

5. The text inspection method according to any one of claims 1 to 4, characterized in that, The time domain convolution network and the text compliance identification model are jointly trained, initial training samples of the joint training are texts with labeled compliance determination results, and cross entropy is taken as a loss function; The joint training comprises: The initial training samples are input into the time domain convolution network to obtain N sample field information; According to the time sequence relationship, field categories of each sample field information are spliced in sequence to obtain a sample prompt template; The initial training sample and the sample prompt template are spliced into a joint training sample, and the joint training sample is input into a text compliance identification model to obtain a joint sample output; According to the joint sample output and the labeling, a loss function is calculated, and according to a calculation result, parameters of the time domain convolution network and the text compliance identification model are updated through a back propagation algorithm until a gradient of the loss function converges.

6. An artificial intelligence-based text inspection device, characterized by comprising: The text quality inspection device comprises: A field information acquisition module is configured to acquire to-be-identified text information, input the to-be-identified text information into a trained time domain convolution network for iteration, and obtain N field information with a time sequence relationship, N being an integer greater than 1. A template splicing module is configured to splice field categories of each field information in sequence according to the time sequence relationship to obtain a quality inspection prompt template, the field categories comprising unused fields and occluded fields, and the occluded fields being used to guide a feature extractor of an encoder to extract features of to-be-identified text information in different quality inspection scenarios. A text compliance determination module is configured to splice the to-be-identified text information and the quality inspection prompt template into to-be-identified prompt text information, input the to-be-identified prompt text information into a trained text compliance identification model, and obtain a compliance determination result, the to-be-identified prompt text information being text. The trained text compliance identification model comprises a trained text feature extraction encoder and a trained text compliance classifier. The inputting of the to-be-identified prompt text information into the trained text compliance identification model to obtain the compliance determination result comprises: The to-be-identified prompt text information is input into the trained text feature extraction encoder to obtain a text feature tensor, and the text feature extraction encoder comprises K one-dimensional convolution layers, K being an integer greater than 0. The text feature tensor is classified by using the trained text compliance classifier, and a classification result is determined as a compliance determination result; the text compliance classifier is a full connection layer, which is used to map the text feature tensor to a classification space, and the classification result is determined according to the mapping result; The quality inspection result display module is configured to fill the compliance determination result into the shielding field of the quality inspection prompt template, and output the filled quality inspection prompt template.

7. The text inspection apparatus according to claim 6, wherein The field information acquisition module comprises: A field information output unit configured to input the to-be-identified text information as an input quantity, initialize an iteration number as 0, input the input quantity into the trained time domain convolution network, and output field information; A splicing information acquisition unit configured to splice the field information at the end of the input quantity to obtain splicing information, and increase the iteration number by one; A field information iteration unit configured to input the splicing information as the input quantity, return to execute the step of inputting the trained time domain convolution network and outputting the field information until the iteration number reaches N, and obtain N field information.

8. A computer device, comprising: The computer device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the text quality inspection method according to any one of claims 1 to 5 when executing the computer program.

9. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 8. The computer program is executed by the processor to implement the text quality inspection method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • An LSTM-based Chinese text grammar error correction model method

    CN109948152A

  • Voice quality inspection method and device based on artificial intelligence, equipment and storage medium

    CN113903361A