Text processing method and apparatus based on artificial intelligence, and electronic device, computer program product and computer-readable storage medium

By splicing and multi-dimensional evaluation of integrated text, the problem of low accuracy of traditional text polishing evaluation is solved, and a more efficient and accurate text polishing quality evaluation is achieved.

WO2025152674A1PCT designated stage expired Publication Date: 2025-07-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Application Number
PCT/CN2024/139267
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-19
Filing Date
2024-12-13
Publication Date
2025-07-24

AI Technical Summary

Technical Problem

The traditional text polishing quality evaluation scheme relies on reference answers and cannot objectively reflect the real polishing effect. The evaluation accuracy is low and time-consuming.

Method used

By obtaining integrated text, performing multi-dimensional evaluation after splicing, including semantics, grammar and typesetting evaluation, and fusion processing of evaluation results to improve evaluation accuracy and efficiency.

Benefits of technology

It has achieved improvements in the accuracy and efficiency of text polishing quality evaluation, and can simulate the manual evaluation process and provide multi-dimensional evaluation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024139267_24072025_PF_FP_ABST
    Figure CN2024139267_24072025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a text processing method and apparatus based on artificial intelligence, and an electronic device, a computer program product and a computer-readable storage medium. The present application can be applied to the field of artificial intelligence and the field of large models. The method comprises: acquiring first integrated text, wherein the first integrated text is obtained by means of correcting first original text; splicing the first integrated text and the first original text to obtain spliced text; performing multi-dimensional evaluation processing on the spliced text to obtain an evaluation result corresponding to each dimension, wherein the multi-dimensional evaluation processing comprises at least two of the following: semantic evaluation processing, grammar evaluation processing and typesetting evaluation processing; and fusing evaluation results of at least two dimensions to obtain a correction evaluation result of the first integrated text.
Need to check novelty before this filing date? Find Prior Art

Description

Artificial intelligence-based text processing method, device, electronic device, computer program product, and computer-readable storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application is based on the Chinese patent application with application number 202410078244.5 and application date of January 19, 2024, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this application as a reference. Technical Field

[0003] The present application relates to the field of computer technology, and in particular to an artificial intelligence-based text processing method, device, electronic device, computer-readable storage medium, and computer program product. Background Art

[0004] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to achieve the best results.

[0005] Related technologies offer automated text polishing capabilities for grammatical correction and text completion, thereby achieving text correction. However, the effectiveness of polishing is difficult to quantify. Traditional automated evaluation schemes require the polished text and a reference answer, and then compare the degree of literal overlap between the two. This reliance on the reference answer fails to objectively reflect the actual polishing effect. While traditional automated evaluation schemes in related technologies use models to improve evaluation speed, they also suffer from low accuracy. Summary of the Invention

[0006] The embodiments of the present application provide an artificial intelligence-based text processing method, device, electronic device, computer-readable storage medium, and computer program product, which can simultaneously improve the accuracy and efficiency of text polishing quality assessment.

[0007] The technical solution of the embodiment of the present application is implemented as follows:

[0008] An embodiment of the present application provides an artificial intelligence-based text processing method, which is executed by an electronic device and includes:

[0009] Obtaining a first integrated text, wherein the first integrated text is obtained by correcting the first original text;

[0010] splicing the first integrated text and the first original text to obtain a spliced ​​text;

[0011] Performing a multi-dimensional evaluation process on the concatenated text to obtain an evaluation result corresponding to each dimension, wherein the multi-dimensional evaluation process includes at least two of the following: a semantic evaluation process, a grammatical evaluation process, and a typesetting evaluation process;

[0012] The evaluation results of at least two of the dimensions are fused to obtain a revised evaluation result of the first integrated text.

[0013] The present invention provides an artificial intelligence-based text processing device, comprising:

[0014] an acquisition module configured to acquire a first integrated text, wherein the first integrated text is obtained by correcting the first original text;

[0015] a splicing module configured to splice the first integrated text and the first original text to obtain a spliced ​​text;

[0016] An evaluation module configured to perform a multi-dimensional evaluation process on the concatenated text to obtain an evaluation result corresponding to each dimension, wherein the multi-dimensional evaluation process includes at least two of the following: a semantic evaluation process, a grammatical evaluation process, and a typesetting evaluation process;

[0017] The fusion module is configured to fuse the evaluation results of at least two of the dimensions to obtain a revised evaluation result of the first integrated text.

[0018] An embodiment of the present application provides an electronic device, comprising:

[0019] a memory for storing computer-executable instructions;

[0020] The processor is used to implement the artificial intelligence-based text processing method provided in the embodiment of the present application when executing the computer-executable instructions stored in the memory.

[0021] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for implementing the artificial intelligence-based text processing method provided in an embodiment of the present application when executed by a processor.

[0022] An embodiment of the present application provides a computer program product, including computer-executable instructions. When the computer-executable instructions are executed by a processor, the artificial intelligence-based text processing method provided in the embodiment of the present application is implemented.

[0023] The embodiments of the present application have the following beneficial effects:

[0024] By obtaining a first integrated text obtained by correcting the first original text, splicing the first integrated text and the first original text to obtain a spliced ​​text, and inputting the first integrated text and the first original text as a whole, data processing efficiency can be improved, and the spliced ​​text is subjected to multi-dimensional evaluation processing to obtain an evaluation result corresponding to each dimension. The multi-dimensional evaluation processing includes at least two of the following: semantic evaluation processing, grammatical evaluation processing, and typesetting evaluation processing, so that multiple evaluation dimensions can be provided to adapt to different evaluation needs. The evaluation results of at least two dimensions are fused to obtain a corrected evaluation result of the first integrated text. The fusion of the evaluation results of multiple dimensions can improve the evaluation accuracy of the text correction quality evaluation. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] FIG1 is a schematic diagram of the architecture of an artificial intelligence-based text processing system provided in an embodiment of the present application;

[0026] FIG2 is a schematic diagram of the structure of a server provided in an embodiment of the present application;

[0027] FIG3A is a flow chart of an artificial intelligence-based text processing method according to an embodiment of the present application;

[0028] FIG3B is a first optional flow chart of an artificial intelligence-based text processing method provided in an embodiment of the present application;

[0029] FIG3C is a second optional flow chart of the artificial intelligence-based text processing method provided in an embodiment of the present application;

[0030] FIG3D is a third optional flow chart of the artificial intelligence-based text processing method provided in an embodiment of the present application;

[0031] FIG4 is a flow chart of an evaluation model training method provided in an embodiment of the present application;

[0032] FIG5A is a schematic diagram of a text polishing interface for semantic and grammatical polishing provided by an embodiment of the present application;

[0033] FIG5B is a schematic diagram of a text polishing interface for polishing semantics, grammar, and layout dimensions provided by an embodiment of the present application;

[0034] FIG6 is a diagram showing the overall architecture of the text polishing evaluation solution provided in an embodiment of the present application;

[0035] FIG7 is a schematic diagram of the structure of the evaluation model provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0037] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0038] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0039] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0040] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0041] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0042] 1) Large Language Models (LLMs): These are AI models designed to understand and generate human language. They are trained on large amounts of text data and can perform a wide range of tasks, including text summarization, translation, sentiment analysis, and more. LLMs are characterized by their large scale, containing billions of transferable parameters, which helps them learn complex patterns in language data.

[0043] 2) Text polishing: Text polishing refers to correcting errors (such as spelling errors and grammatical errors) in the original input text without changing the original meaning, and making the expression more fluent and the layout clearer.

[0044] 3) Pre-training model (PTM): Also known as a cornerstone model or large model, this refers to a large-parameter deep neural network (DNN). It is trained on massive amounts of unlabeled data. Leveraging the function approximation capabilities of large-parameter DNNs, the PTM extracts common features from the data. Through techniques such as fine tuning, parameter-efficient fine-tuning (PEFT), and prompt tuning, the model is then adapted for downstream tasks. Therefore, pre-trained models can achieve ideal results in few-shot or zero-shot scenarios.

[0045] 4) Natural Language Processing (NLP): This is an important field in the fields of computer science and artificial intelligence. It studies various theories and methods that enable effective communication between humans and computers using natural language. Natural language processing involves natural language, the language people use in daily life, and is closely related to linguistic research. Pre-trained models, an important technology for model training in the field of artificial intelligence, are developed from large language models (LLMs) in the field of NLP. After fine-tuning, large language models can be widely used in downstream tasks. Natural language processing technologies generally include text processing, semantic understanding, machine translation, robot question answering, knowledge graphs, and other technologies.

[0046] Related technologies have proposed the following scheme for evaluating text polishing quality: given a polished text and a reference answer, the degree of literal overlap between the two is compared, and evaluation is performed by calculating the Bilingual Evaluation Understudy (BLEU) and Recall-Oriented Understudy for Gisting Evaluation (Rouge).

[0047] When implementing the embodiments of this application, the applicant discovered that the related technology has the following defects:

[0048] Traditional automated evaluation: This method is time-consuming and cost-effective, but its effectiveness is poor. This is because the calculation of these indicators relies heavily on reference answers. However, there is no standard answer for text editing. If the indicators are calculated based on only one (or a few) reference answers, it cannot objectively reflect the actual editing results.

[0049] The artificial intelligence-based text processing method provided in the embodiments of the present application involves natural language processing technology in the field of artificial intelligence and pre-training model technology in the field of large models, which is specifically illustrated by the following embodiments.

[0050] The embodiments of the present application provide an artificial intelligence-based text processing method, device, electronic device, computer-readable storage medium, and computer program product, which can simultaneously improve the accuracy and efficiency of text polishing quality assessment.

[0051] The following describes exemplary applications of electronic devices provided by embodiments of the present application. The devices provided by embodiments of the present application can be implemented as various types of user terminals, such as laptop computers, tablet computers, desktop computers, set-top boxes, mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), smartphones, smart speakers, smart watches, smart TVs, and in-vehicle terminals. They can also be implemented as servers. The following describes exemplary applications of electronic devices implemented as servers.

[0052] Refer to Figure 1, which is a schematic diagram of the architecture of an artificial intelligence-based text processing system 100 provided in an embodiment of the present application. In order to support an artificial intelligence-based text processing application, a terminal 400 is connected to a server 200 through a network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.

[0053] The terminal 400 is used to obtain a text processing request. For example, the user terminal 400 generates a text processing request through the graphical interface 410 of the terminal 400. The server 200 is used to obtain a first integrated text based on the text processing request, wherein the first integrated text is obtained by correcting the first original text, the first integrated text and the first original text are spliced ​​to obtain a spliced ​​text, the spliced ​​text is multi-dimensionally evaluated to obtain an evaluation result corresponding to each dimension, wherein the multi-dimensional evaluation includes at least two of the following: semantic evaluation, grammatical evaluation, and typesetting evaluation. The evaluation results of at least two dimensions are fused to obtain a corrected evaluation result of the first integrated text, and the corrected evaluation result is fed back to the terminal 400.

[0054] In some embodiments, the server 200 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal 400 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a car terminal, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.

[0055] Referring to Figure 2, Figure 2 is a schematic diagram of the structure of a server 200 provided in an embodiment of the present application. The server 200 shown in Figure 2 includes: at least one processor 210, a memory 250, at least one network interface 220, and a user interface 230. The various components in the terminal 200 are coupled together via a bus system 240. It will be understood that the bus system 240 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in Figure 2, various buses are labeled as bus system 240.

[0056] The processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0057] The user interface 230 includes one or more output devices 231 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 230 also includes one or more input devices 232, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0058] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 250 may optionally include one or more storage devices that are physically remote from the processor 210.

[0059] The memory 250 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 250 described in the embodiments of the present application is intended to include any suitable type of memory.

[0060] In some embodiments, the memory 250 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.

[0061] Operating system 251, including system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, and driver layer, which are used to implement various basic services and process hardware-based tasks;

[0062] A network communication module 252 for reaching other electronic devices via one or more (wired or wireless) network interfaces 220 , exemplary network interfaces 220 including Bluetooth, Wi-Fi, and Universal Serial Bus (USB);

[0063] In some embodiments, the apparatus provided in the embodiments of the present application can be implemented in software. FIG2 shows an artificial intelligence-based text processing apparatus 253 stored in memory 250. This apparatus 253 can be software in the form of a program or plug-in, and includes the following software modules: an acquisition module 2531, a splicing module 2532, an evaluation module 2533, and a fusion module 2534. These modules are logical and can be arbitrarily combined or further separated according to the functions implemented. The functions of each module will be described below.

[0064] In some embodiments, the terminal or server can implement the text processing method based on artificial intelligence provided by the embodiment of the present application by running various computer executable instructions or computer programs. For example, computer executable instructions can be commands, machine instructions or software instructions at the microprogram level. The computer program can be a native program or software module in the operating system; it can be a local (Native) application (APPlication, APP), that is, a program that needs to be installed in the operating system to run, such as an instant messaging APP; it can also be a small program that can be embedded in any APP, that is, a program that only needs to be downloaded to a browser environment to run. In short, the above-mentioned computer executable instructions can be instructions in any form, and the above-mentioned computer program can be an application, module or plug-in in any form.

[0065] The artificial intelligence-based text processing method provided in the embodiment of the present application will be explained in combination with the exemplary application and implementation of the server provided in the embodiment of the present application.

[0066] It should be noted that the text processing examples below are illustrated using text polishing as an example. Based on their understanding of the following text, those skilled in the art can apply the artificial intelligence-based text processing method provided in the embodiments of this application to the evaluation of other text processing including text polishing.

[0067] The following will describe in detail the artificial intelligence-based text processing method provided by the embodiment of the present application with reference to the accompanying drawings. The artificial intelligence-based text processing method provided by the embodiment of the present application can be executed independently by the terminal 400 or the server 200 in Figure 1, or can be executed collaboratively by the terminal 400 and the server 200 in Figure 1.

[0068] The following description uses the example of server 200 in Figure 1 executing the AI-based text processing method provided by the embodiment of the present application alone. Referring to Figure 3A , Figure 3A is a schematic flow chart of the AI-based text processing method provided by the embodiment of the present application, which will be described in conjunction with steps 101 to 104 shown in Figure 3A .

[0069] In step 101, a first integrated text is obtained.

[0070] As an example, the first integrated text is obtained by correcting the first original text. The user constructs the first original text, takes the first original text as input, and uses a text processing model to perform a text processing operation on the first original text for polishing (correcting) the text. In the embodiment of the present application, the text processing operation can be a text polishing operation, and the text processing model can be a text polishing model commonly used in related technologies. The input of the text polishing model is the first original text. The first original text to be polished is input into the model. The text polishing model analyzes the text, identifies errors and improvement opportunities, and provides improvement suggestions, including but not limited to grammatical errors, spelling errors, punctuation errors, and style suggestions, and corrects the first original text based on these improvement suggestions to obtain the first integrated text.

[0071] In step 102, the first integrated text and the first original text are spliced ​​to obtain a spliced ​​text.

[0072] 3B , which is a schematic diagram of an optional flow chart of an artificial intelligence-based text processing method provided in an embodiment of the present application. In some embodiments, step 102 in FIG. 3A can be implemented by steps 1021 and 1022 shown in FIG. 3B , which are described in detail below.

[0073] In step 1021, a splicing template is obtained.

[0074] As an example, the splicing template can be set as needed. For example, for the first original text "I will go to 502 for a meeting later" and the first integrated text "I will go to 502 for a meeting later", the splicing template is "Input text: XXXXX\n Polished text: YYYYY", where XXXXX is the text content of the first original text "I will go to 502 for a meeting later", YYYYY corresponds to the text content of the first integrated text "I will go to 502 for a meeting later", and \n represents a formal delimiter, which can be a hard return, soft return, etc. This application does not limit this.

[0075] In step 1022, the first original text and the first integrated text are spliced ​​based on the splicing template to obtain a spliced ​​text.

[0076] As an example, based on the splicing template "Input text: XXXXX\nPolished text: YYYYY", the first original text "Go to 502 for a meeting later" and the first integrated text "Go to 502 for a meeting later" are spliced ​​to obtain the spliced ​​text "Input text: Go to 502 for a meeting later\nPolished text: Go to 502 for a meeting later".

[0077] By setting a splicing template, the first original text and the first integrated text are spliced ​​into a whole, and the subsequent evaluation processing is carried out as a spliced ​​text, so that the evaluation model only needs to perform one feature extraction processing in one evaluation processing, thereby improving the evaluation speed of text processing quality evaluation.

[0078] Continuing to refer to FIG3A , in step 103 , a multi-dimensional evaluation process is performed on the concatenated text to obtain an evaluation result corresponding to each dimension.

[0079] As an example, the multi-dimensional evaluation process includes at least two of the following: semantic evaluation process, grammatical evaluation process, and typesetting evaluation process. Semantic evaluation process refers to the evaluation of whether the text semantics of the first integrated text and the first original text are consistent, for example, whether the content of the first original text has been modified, added or deleted; grammatical evaluation process refers to the evaluation of whether the expression of the first integrated text is accurate, for example, whether there are typos or grammatical errors in the first integrated text; typesetting evaluation process refers to the evaluation of whether the typesetting of the first integrated text is reasonable, for example, whether there are unreasonable paragraphing, line breaks and other typesetting formatting issues in the first integrated text. These three evaluation processing angles are three evaluation angles that simulate the manual evaluation process. In actual applications, other evaluation processing angles can be introduced as needed to evaluate the text processing quality, and this application does not limit this.

[0080] Referring to Figure 3C , Figure 3C is a second optional flow diagram of an artificial intelligence-based text processing method provided in an embodiment of the present application. In some embodiments, the typesetting evaluation process in step 103 in Figure 3A can be implemented through steps 1031 to 1033 shown in Figure 3C , which are described in detail below.

[0081] In step 1031, text vectorization processing is performed on each character in the spliced ​​text to obtain a text vector representation of each character, and the text vector representations of multiple characters are spliced ​​into a spliced ​​text vector representation.

[0082] In some embodiments, step 1031 of performing text vectorization on each character in the concatenated text to obtain a text vector representation of each character can be achieved by: performing the following processing on each character: performing word vectorization on the character to obtain a word vector representation of the character; performing sentence vectorization on the character based on the sentence to which the character belongs to obtain a sentence vector representation of the character, wherein the sentence comes from the concatenated text; performing position vectorization on the character based on the position of the character in the concatenated text to obtain a position vector representation of the character; and fusing the word vector representation, sentence vector representation and position vector representation of the corresponding character to obtain a text vector representation of the corresponding character.

[0083] As an example, for the spliced ​​text "Input text: Go to 502 for a meeting later\nPolished text: Go to 502 for a meeting later", the input text here is the first original text, and the polished text here is the first integrated text. First, the spliced ​​text is formally processed to obtain the spliced ​​text form [CLS]Input text: Go to 502 for a meeting later\nPolished text: Go to 502 for a meeting later[EOS], where [CLS] is the text start symbol and [EOS] is the text end symbol. Each character in the spliced ​​text form is word vectorized to obtain the word vector representation of the character. For example, in the input text The word vector representation of character A is the same as that of character A in the polished text, while the word vector representation of character A in the input text is different from that of character B in the input text. For each character, a corresponding sentence vector representation is obtained based on its sentence source. Character A in the input text and character A in the polished text have different sentence vector representations, while character A in the input text and character B in the input text have the same sentence vector representation. The first character A and the third character A in the input text have different position vector representations, while the first character A in the input text and the first character A in the polished text have the same position vector representation.

[0084] As an example, in natural language processing (NLP), positional vectorization is achieved through positional embedding, a technique for introducing positional information of elements in a sequence, usually used together with word embedding. Positional embedding is usually achieved by learning an embedding matrix with the same length as the sequence, where each row in the matrix corresponds to an embedding vector for a specific position in the sequence. This embedding vector is added to the corresponding word embedding vector to form a complete input representation, so that the transformer can learn positional information. The embedding vector for position i is generated by sine and cosine functions in different dimensions. The introduction of positional embedding enables the transformer model to process sequence data without sacrificing its parallel processing capabilities.

[0085] By determining the text vector representation of each character based on the character, its sentence source, and its position in the concatenated text, the information of each character is accurately expressed to ensure that the information in the features obtained in the subsequent feature extraction processing is accurate and rich, thereby ensuring the accuracy of the subsequent evaluation processing.

[0086] In step 1032, the layout feature extraction process is performed on the vector representation of the spliced ​​text to obtain the layout features of the corresponding spliced ​​text.

[0087] In some embodiments, step 1032 can be implemented in the following manner: perform the following processing on the text vector representation of each character in the spliced ​​text vector representation: when the character corresponding to the text vector representation of the character is the first character of the spliced ​​text, perform typesetting feature extraction processing on the text vector representation of the character to obtain the character typesetting feature of the character; when the character corresponding to the text vector representation of the character is not the first character of the spliced ​​text, perform typesetting feature extraction processing on the text vector representation of the character and the previous character sorted before the character in the spliced ​​text to obtain the character typesetting feature of the character; and use the character typesetting feature of the last character in the spliced ​​text as the typesetting feature of the spliced ​​text.

[0088] As an example, take the [CLS] input text: "Go to Meeting Room 502 later\nPolished text: "Go to Meeting Room 502 in a while" [EOS] as an example. For the character "输", only the typesetting feature extraction process is performed on the character "输", and its character typesetting feature is only the character typesetting feature of "输"; for the character "入", the typesetting feature extraction process is performed on the character "入" and the character "输" to obtain the character typesetting feature of the character "入", and so on. For the last character (i.e., the character corresponding to the [EOS] position) "会", the typesetting feature extraction process is performed on the text vector representation of the character "会" and the preceding characters sorted before "会" in the concatenated text to obtain the character typesetting feature of the character "会", and the character typesetting feature of the character "会" is used as the typesetting feature of the concatenated text. Among them, the typesetting feature extraction process is performed on the concatenated text vector representation to obtain the typesetting feature corresponding to the concatenated text, which is implemented by calling the typesetting evaluation model.

[0089] By performing the typesetting feature extraction process on each character and using the character typesetting feature of the last character that includes the character typesetting features of all characters as the typesetting feature of the concatenated text, the information of the typesetting feature is ensured to be accurate and rich, so as to ensure the accuracy of subsequent evaluation processing.

[0090] In step 1033, a first mapping process is performed on the typesetting feature to obtain a typesetting evaluation result.

[0091] In some embodiments, step 1033 can be implemented in the following manner: perform a multi-layer perception process on the typesetting feature to obtain a predicted score value corresponding to the concatenated text, and based on an activation function, perform a normalization process on the predicted score value to obtain a typesetting evaluation score, and use the typesetting evaluation score as the typesetting evaluation result.

[0092] As an example, call the typesetting scoring network in the typesetting evaluation model to perform a first mapping process on the typesetting feature. Among them, the typesetting scoring network includes a first multi-layer perceptron (Multi-Layer Perceptron, MLP) and a first normalization layer. Use the first multi-layer perceptron to perform a multi-layer perception process on the typesetting feature to obtain a predicted typesetting score value corresponding to the concatenated text. This predicted typesetting score value is a real number, and it is not easy to represent the evaluation result with a real number. Therefore, through the activation function in the first normalization layer, such as the Sigmoid activation function, the predicted typesetting score value is mapped to a typesetting evaluation score with a value range of [0, 1] as the typesetting evaluation result of the concatenated text.

[0093] As an example, a multilayer perceptron (MLP) is a feedforward artificial neural network consisting of at least three layers of nodes: an input layer, one or more hidden layers, and an output layer. Each node (also called a neuron) is connected to the nodes in the next layer through weights, and each connection weight affects the transmission of the signal. The following is a detailed description of the multilayer perceptron: Input Layer, which receives input data. Each input node represents a feature in the dataset; Hidden Layers, which are one or more hidden layers. Each layer contains several neurons. These neurons do not directly interact with external input or output, but are used for internal data processing. The number of hidden layers and the number of neurons in each hidden layer are hyperparameters that need to be adjusted according to the specific problem; Output Layer, the number of neurons in the output layer depends on the specific task. For example, for classification problems, the number of nodes in the output layer is usually the same as the number of categories, and each node represents the predicted probability of a category.

[0094] By calling the multi-layer perceptron and activation function to perform the first mapping processing on the typesetting features, a typesetting evaluation result with a value range of [0, 1] is obtained to characterize the typesetting quality of the spliced ​​text. On the one hand, it can evaluate the typesetting quality of text processing, and on the other hand, it can evaluate the text processing quality in combination with other evaluation angles to improve the evaluation accuracy of text processing.

[0095] By performing text vectorization processing on each character in the spliced ​​text, a text vector representation of each character is obtained, and the text vector representations of multiple characters are spliced ​​into a spliced ​​text vector representation, thereby enriching the latent information in the spliced ​​text vector representation, performing typesetting feature extraction processing on the spliced ​​text vector representation, obtaining the typesetting features of the corresponding spliced ​​text, performing a first mapping processing on the typesetting features, and obtaining a typesetting evaluation result, it is ensured that the features used to characterize the typesetting quality of the spliced ​​text contain rich information, thereby improving the evaluation accuracy of the text processing quality assessment.

[0096] In some embodiments, the semantic evaluation processing in step 103 can be implemented by: performing text vectorization processing on each character in the spliced ​​text to obtain a text vector representation of each character, and splicing the text vector representations of multiple characters into a spliced ​​text vector representation, calling the semantic evaluation model, performing semantic feature extraction processing on the spliced ​​text vector representation to obtain the semantic features of the corresponding spliced ​​text, calling the semantic scoring network in the semantic evaluation model to perform a second mapping processing on the semantic features, wherein the semantic scoring network in the semantic evaluation model performs a second mapping processing on the semantic features, wherein the semantic scoring network includes a second multi-layer perceptron and a second normalization layer, and uses the second multi-layer perceptron to perform a first multi-layer perceptron processing on the semantic features to obtain a predicted semantic score value of the corresponding spliced ​​text, which is a real number, and through the activation function in the second normalization layer, the predicted semantic score value is mapped to a semantic evaluation score with a value range of [0, 1] as the semantic evaluation result of the spliced ​​text.

[0097] In some embodiments, the grammar evaluation processing in step 103 can be implemented by: performing text vectorization processing on each character in the spliced ​​text to obtain a text vector representation of each character, and splicing the text vector representations of multiple characters into a spliced ​​text vector representation, calling the grammar evaluation model, performing grammatical feature extraction processing on the spliced ​​text vector representation to obtain the grammatical features of the corresponding spliced ​​text, calling the grammar scoring network in the grammar evaluation model to perform a third mapping processing on the grammatical features, wherein the grammar scoring network includes a second multi-layer perceptron and a second normalization layer, and uses the second multi-layer perceptron to perform a second multi-layer perceptron processing on the grammatical features to obtain a predicted grammatical score value of the corresponding spliced ​​text, which is a real number. Through the activation function in the second normalization layer, the predicted grammatical score value is mapped to a grammar evaluation score with a value range of [0, 1] as the grammar evaluation result of the spliced ​​text.

[0098] By performing text vectorization processing on each character in the spliced ​​text, a text vector representation of each character is obtained, and the text vector representations of multiple characters are spliced ​​into a spliced ​​text vector representation, thereby enriching the hidden information in the spliced ​​text vector representation, performing semantic feature extraction processing and grammatical feature extraction processing on the spliced ​​text vector representation, and obtaining the semantic features and grammatical features of the corresponding spliced ​​text, mapping the semantic features and grammatical features to obtain evaluation results, ensuring that the features used to represent the semantics and grammar of the spliced ​​text contain rich information, thereby improving the evaluation accuracy of text processing quality assessment.

[0099] Continuing with FIG. 3A , in step 104 , the evaluation results of at least two dimensions are fused to obtain a revised evaluation result of the first integrated text.

[0100] 3D , which is a third optional flow chart of an artificial intelligence-based text processing method provided in an embodiment of the present application. In some embodiments, step 104 in FIG. 3A can be implemented by steps 1041 and 1042 shown in FIG. 3D , which are described in detail below.

[0101] In step 1041 , a weight combination adapted to the evaluation requirement is obtained, where the weight combination includes a first weight corresponding to the semantic evaluation result, a second weight corresponding to the grammatical evaluation result, and a third weight corresponding to the typesetting evaluation result.

[0102] As an example, a weight combination adapted to the evaluation requirements is set. For example, if the evaluation needs to be carried out from three perspectives, namely, semantics, grammar, and typesetting, then a first weight corresponding to the semantic evaluation result, a second weight corresponding to the grammar evaluation result, and a third weight corresponding to the typesetting evaluation result are set. The sum of the first weight, the second weight, and the third weight is 1. The size of each weight can be set according to actual needs. For example, if the actual evaluation has the highest requirements for semantics, then the value of the first weight is the largest value among all the weights. In addition, the semantic evaluation results and the grammar evaluation results can be obtained through relevant technologies, or can be obtained by the method in step 103 above, which will not be repeated here.

[0103] In step 1042 , a weighted summation process is performed on the semantic evaluation result, the grammatical evaluation result, and the typesetting evaluation result based on the weight combination to obtain a revised evaluation result of the first integrated text.

[0104] As an example, the semantic evaluation result is 0.7, the grammatical evaluation result is 0.99, and the typesetting evaluation result is 0.99. The score fusion module is called to perform weighted summation processing on the typesetting score, semantic score and grammatical score to obtain the revised evaluation result of the first integrated text, wherein the revised evaluation result = first weight × semantic evaluation result + second weight × grammatical evaluation result + third weight × typesetting evaluation result = 0.35 × 0.7 + 0.35 × 0.99 + 0.3 × 0.99 = 0.89, wherein the first weight + second weight + third weight = 0.35 + 0.35 + 0.3 = 1.

[0105] By setting corresponding weights according to actual needs, combining the evaluation results of at least two evaluation angles, and performing weighted addition processing, a revised evaluation angle corresponding to the first integrated text is obtained. On the one hand, the text processing quality can be evaluated according to actual needs to provide an accurate basis for the subsequent screening of the optimal text processing results. On the other hand, manual evaluation is simulated to evaluate the text processing quality, thereby improving the accuracy of text processing quality evaluation.

[0106] See Figure 4, which is a flow chart of the evaluation model training method provided by an embodiment of the present application. In some embodiments, before executing step 103, steps 201 to 205 shown in Figure 4 may also be executed, which will be described in detail below.

[0107] In step 201, a second integrated text is obtained.

[0108] As an example, the second integrated text is obtained by correcting the second original text. This step is the same as the above step 101 and will not be repeated here.

[0109] In step 202 , the second integrated text and the second original text are spliced ​​to obtain a spliced ​​text sample.

[0110] As an example, this step is the same as the above step 102 and will not be described again here.

[0111] In step 203, the concatenated text sample is forward propagated in the pre-trained model to obtain a prediction evaluation result of the concatenated text sample in the target dimension.

[0112] In some embodiments, step 203 can be implemented in the following manner: calling a pre-trained model to perform the following operations on the spliced ​​text sample: performing text vectorization processing on each sample character in the spliced ​​text sample to obtain a sample text vector representation of each sample character, and splicing the sample text vector representations of multiple sample characters into a spliced ​​text sample representation, performing feature extraction processing corresponding to the target dimension on the spliced ​​text sample representation to obtain text sample features in the target dimension, performing multi-layer perception processing on the text sample features to obtain a sample prediction score value of the corresponding spliced ​​text sample in the target dimension, and normalizing the sample prediction score value based on the activation function to obtain a sample evaluation score, wherein the value range of the text sample evaluation score is not less than 0 and not greater than 1, and the sample evaluation score is used as the prediction evaluation result of the spliced ​​text sample in the target dimension.

[0113] As an example, when the target dimension is semantic evaluation, the embodiment of the present application involves forward propagation processing of the spliced ​​text sample in the pre-training model, which is actually a semantic evaluation process of the spliced ​​text sample to obtain a semantic evaluation result. When the target dimension is grammatical evaluation, the embodiment of the present application involves forward propagation processing of the spliced ​​text sample in the pre-training model, which is actually a grammatical evaluation process of the spliced ​​text sample to obtain a grammatical evaluation result. When the target dimension is typesetting evaluation, the embodiment of the present application involves forward propagation processing of the spliced ​​text sample in the pre-training model, which is actually a typesetting evaluation process of the spliced ​​text sample to obtain a typesetting evaluation result. The specific implementation method of the above-mentioned evaluation process is the same as described above, the only difference is that the processing object is a spliced ​​text sample. As an example, the target dimension comes from multiple dimensions, and the text vectorization processing, feature extraction processing, multi-layer perception processing and normalization processing here are the same as the above-mentioned step 103, except that the evaluation model used is a pre-training model, which will not be repeated here.

[0114] By calling the pre-trained model to perform text vectorization, feature extraction, multi-layer perception and normalization on the spliced ​​text samples based on the target dimension, the pre-trained model can acquire the evaluation knowledge and capabilities of the corresponding target dimension, which can be applied to subsequent text processing quality assessment tasks to improve the evaluation speed.

[0115] In step 204, the true evaluation result of the concatenated text sample in the target dimension is obtained.

[0116] In some embodiments, step 204 can be implemented in the following manner: when the second original text and the second integrated text are in a positive sample relationship in the target dimension, the value one is determined as the true evaluation result of the spliced ​​text sample in the target dimension; when the second original text and the second integrated text are in a negative sample relationship in the target dimension, the value zero is determined as the true evaluation result of the spliced ​​text sample in the target dimension.

[0117] As an example, when the second original text and the second integrated text are in a positive sample relationship in the target dimension, 1 is determined as the true evaluation result of the spliced ​​text sample in the target dimension; when the second original text and the second integrated text are in a negative sample relationship in the target dimension, 0 is determined as the true evaluation result of the spliced ​​text sample in the target dimension.

[0118] By setting the real evaluation results of the target dimensions of positive samples and negative samples, they are used as the basis for parameter adjustment during the model training process to adjust the parameters of the evaluation model, thereby improving the evaluation accuracy of the evaluation model and thus improving the evaluation accuracy of the text processing quality.

[0119] In step 205, based on the predicted evaluation results and the actual evaluation results of the target dimension, a loss function is determined, and the pre-trained model is updated based on the loss function to obtain an evaluation model.

[0120] As an example, the evaluation model is used to perform target dimension evaluation on the concatenated text. For example, when the target dimension is typesetting evaluation, a typesetting loss function is determined based on the predicted typesetting evaluation results and the actual typesetting evaluation results. Based on the typesetting loss function, the pre-trained model is updated. For example, the parameters of the language model network and multi-layer perceptron in the pre-trained model are adjusted and updated to obtain the typesetting evaluation model.

[0121] As an example, when the target dimension is the typesetting dimension, the positive samples and negative samples corresponding to the typesetting evaluation are collected as typesetting evaluation training samples, the second original text in the typesetting evaluation training sample is spliced ​​with the corresponding second integrated text to obtain a typesetting evaluation spliced ​​text sample, each sample character in the typesetting evaluation spliced ​​text sample is subjected to text vectorization processing to obtain a sample text vector representation of each sample character, and the sample text vector representations of multiple sample characters are spliced ​​into a typesetting evaluation spliced ​​text sample representation, the first pre-trained model is called to perform typesetting feature extraction processing on the typesetting evaluation spliced ​​text sample representation to obtain the typesetting features of the text sample in the typesetting dimension, and the text is subjected to text vectorization processing. The typesetting features of this sample are processed with multi-layer perception to obtain the sample predicted typesetting score value of the corresponding typesetting evaluation splicing text sample in the typesetting dimension. Based on the activation function, the sample predicted typesetting score value is normalized to obtain the sample typesetting evaluation score. The sample typesetting evaluation score is used as the predicted typesetting evaluation result of the typesetting evaluation splicing text sample in the typesetting dimension. According to the positive and negative sample attributes of the typesetting evaluation training samples, the actual typesetting evaluation result of the typesetting evaluation splicing text sample in the typesetting dimension is determined. Based on the predicted typesetting evaluation result and the actual typesetting evaluation result, the typesetting loss function is determined. Based on the typesetting loss function, the first pre-trained model is updated to obtain the typesetting evaluation model.

[0122] As an example, when the target dimension is a semantic dimension, positive samples and negative samples corresponding to the semantic evaluation are collected as semantic evaluation training samples, the second original text in the semantic evaluation training sample is spliced ​​with the corresponding second integrated text to obtain a semantic evaluation spliced ​​text sample, each sample character in the semantic evaluation spliced ​​text sample is subjected to text vectorization processing to obtain a sample text vector representation of each sample character, and the sample text vector representations of multiple sample characters are spliced ​​into a semantic evaluation spliced ​​text sample representation, the second pre-trained model is called to perform semantic feature extraction processing on the semantic evaluation spliced ​​text sample representation to obtain the semantic features of the text sample in the semantic dimension, and the text is subjected to text vectorization processing. The semantic features of this sample are subjected to multi-layer perception processing to obtain the sample predicted semantic score value of the corresponding semantic evaluation spliced ​​text sample in the semantic dimension. Based on the activation function, the sample predicted semantic score value is normalized to obtain the sample semantic evaluation score. The sample semantic evaluation score is used as the predicted semantic evaluation result of the semantic evaluation spliced ​​text sample in the semantic dimension. According to the positive and negative sample attributes of the semantic evaluation training sample, the true semantic evaluation result of the semantic evaluation spliced ​​text sample in the semantic dimension is determined. Based on the predicted semantic evaluation result and the true semantic evaluation result, the semantic loss function is determined. Based on the semantic loss function, the second pre-trained model is updated to obtain the semantic evaluation model.

[0123] As an example, when the target dimension is the grammatical dimension, the positive samples and negative samples corresponding to the grammatical evaluation are collected as grammatical evaluation training samples, the second original text in the grammatical evaluation training sample is spliced ​​with the corresponding second integrated text to obtain a grammatical evaluation spliced ​​text sample, each sample character in the grammatical evaluation spliced ​​text sample is subjected to text vectorization processing to obtain a sample text vector representation of each sample character, and the sample text vector representations of multiple sample characters are spliced ​​into a grammatical evaluation spliced ​​text sample representation, the third pre-training model is called to perform grammatical feature extraction processing on the grammatical evaluation spliced ​​text sample representation to obtain the grammatical features of the text sample in the grammatical dimension, and the text is analyzed. The grammatical features of this sample are processed with multi-layer perception to obtain the sample predicted grammatical score value of the corresponding grammatical evaluation splicing text sample in the grammatical dimension. Based on the activation function, the sample predicted grammatical score value is normalized to obtain the sample grammatical evaluation score. The sample grammatical evaluation score is used as the predicted grammatical evaluation result of the grammatical evaluation splicing text sample in the grammatical dimension. According to the positive and negative sample attributes of the grammatical evaluation training sample, the true grammatical evaluation result of the grammatical evaluation splicing text sample in the grammatical dimension is determined. Based on the predicted grammatical evaluation result and the true grammatical evaluation result, the grammatical loss function is determined. Based on the grammatical loss function, the third pre-training model is updated to obtain the grammatical evaluation model.

[0124] By pre-training the pre-trained model, an evaluation model that can be applied to the target dimension is obtained, which can be applied to the text processing quality assessment task to improve the assessment speed and accuracy of text processing quality assessment.

[0125] The following describes an exemplary application of the embodiment of the present application in an actual text polishing application scenario.

[0126] See Figure 5A, which is a schematic diagram of the text polishing interface for semantic and grammatical polishing provided by an embodiment of the present application. On the product side of the text polishing application, the user enters the original text in the input box of the input method and calls the optimized expression function. The input method's recommendation interface displays the polished text corresponding to the original text. The user clicks the "Use" function item to replace the original text in the input box with the polished text. The text polishing function can polish the semantics and grammar of the original text. As shown in Figure 5A, the user enters the original text a in the input box "By the way, that's the one that said, have you eaten today? I was originally going to ask you out for dinner tomorrow." The user calls the optimized expression function, and the input method's recommendation interface displays the polished text A corresponding to the original text a "By the way, have you eaten today? I was originally going to ask you out for dinner tomorrow." The user clicks the "Use" function item to replace the original text a in the input box with the polished text A. The user clicks the send function item to send the polished text A as an instant message. In addition, the text polishing function can also polish the semantics, grammar, and layout of the original text. See Figure 5B, which is a schematic diagram of the text polishing interface for semantic, grammatical and typesetting polishing provided in an embodiment of the present application. As shown in Figure 5B, the user enters the original text b "Afternoon Management Meeting: Recent Store Management Situation (Products, Performance, Team) Problems, Optimization Points Personal Work Report (Summary and Plan) June Cost Analysis and Material Manager Renewal Discussion" in the input box. The user calls the optimized expression function, and the input method's recommendation interface displays the polished text B "Afternoon Management Meeting:

[0127] 1. Problems and optimization points in recent store management (products, performance, team).

[0128] 2. Personal work report (summary and plan).

[0129] 3. Discuss June's cost analysis and material manager renewal. Clicking "Use" replaces the content in the input box (original text b) with the polished text B. If the user needs to adjust the polished text B, they can do so in the input box. Clicking "Send" sends the polished text in the input box as an instant message.

[0130] See Figure 6, which is an overall architecture diagram of the text polishing evaluation solution provided by the embodiment of the present application. As shown in Figure 6, the original text "Afternoon Management Meeting: Recent Store Management Situation (Products, Performance, Team) Problems, Optimization Points, Personal Work Situation Report (Summary and Plan) June Cost Analysis and Material Manager Renewal Discussion" and the polished text "Afternoon Management Meeting:

[0131] 1. Problems and optimization points in recent store management (products, performance).

[0132] 2. Personal work report (summary and plan).

[0133] 3. Discuss June cost analysis and material manager renewal. Input the original text and polished text into the text polishing quality assessment framework. The text polishing quality assessment framework includes a typesetting assessment model, a semantic assessment model, a grammatical assessment model, and a score fusion module. The three assessment models correspond to the three assessment perspectives of typesetting, semantics, and grammar in manual evaluation. Each assessment model will output a score between 0 and 1. See Table 1 for details.

[0134] Table 1 Evaluation angle analysis table

[0135] Continuing to refer to Figure 6, the typesetting evaluation model scores and evaluates the original text and the polished text from the perspective of typesetting, and obtains a typesetting score of 0.99. The semantic evaluation model scores and evaluates the original text and the polished text from the perspective of semantics, and obtains a semantic score of 0.7 (the "product, performance, team" in the original text is only "product, performance" in the polished text, and "team" is omitted, so the semantic score is lower, 0.7). The grammar evaluation model scores and evaluates the original text and the polished text from the perspective of grammar, and obtains a grammar score of 0.99. The score fusion module scores the typesetting score, semantic score, and grammar score. The scores and grammar scores are weightedly added to obtain an evaluation score of 0.89, where the evaluation score = first weight × semantic score + second weight × grammar score + third weight × typesetting score = 0.35 × 0.7 + 0.35 × 0.99 + 0.3 × 0.99 = 0.89, where the first weight + second weight + third weight = 0.35 + 0.35 + 0.3 = 1. The values ​​of the first weight, the second weight and the third weight can be set according to actual needs. For example, in actual application scenarios, if the accuracy of grammar is required to be higher, the third weight can be increased accordingly.

[0136] See Figure 7, which is a schematic diagram of the structure of the evaluation model provided in the embodiment of the present application. The structure of the typesetting evaluation model, semantic evaluation model, and grammar evaluation model is the same, and they are all sentence classification models based on a large language model. The above three models are collectively referred to as the evaluation model. The structure of the evaluation model is shown in Figure 7. The evaluation model includes a language model for feature extraction and a scoring network for scoring. During the scoring process, the original input is the input text (i.e., the first original text) and the polished text (i.e., the first integrated text). The input text and the polished text are spliced ​​into a single integrated text (i.e., spliced ​​text) "Input text: xxxxx\nPolished text: xxxxxx". The integrated text is input into the language model of the evaluation model. The language model performs feature extraction on the integrated text to obtain the overall features corresponding to the target dimension. The overall features are input into the scoring network. The multi-layer perceptron and activation function in the scoring network score the overall features to obtain a final score of 0.9. The type of overall features depends on the type of evaluation model. For example, when the typesetting evaluation model is used to extract features from the integrated text, the language model in the typesetting evaluation model performs feature extraction on the integrated text, and the overall features obtained are typesetting features. The overall features are input into the typesetting evaluation model. The typesetting scoring network in the typesetting scoring network performs a first mapping process on the typesetting features and an activation function to obtain a final typesetting score (i.e., a typesetting evaluation result); when the semantic evaluation model is used to extract features from the integrated text, the language model in the semantic evaluation model extracts semantic features from the integrated text, and the overall features obtained are semantic features. The semantic features are input into the semantic scoring network in the semantic evaluation model, and the multi-layer perceptron and activation function in the semantic scoring network perform a second mapping process on the semantic features to obtain a final semantic score (i.e., a semantic evaluation result); when the grammatical evaluation model is used to extract grammatical features from the integrated text, the grammatical language model in the grammatical evaluation model extracts grammatical features from the integrated text, and the overall features obtained are grammatical features. The grammatical features are input into the grammatical scoring network in the grammatical evaluation model, and the multi-layer perceptron and activation function in the grammatical scoring network perform a third mapping process on the grammatical features to obtain a final grammatical score (i.e., a grammatical evaluation result). The following describes this process in detail using a single evaluation model as an example.

[0137] The input format of the integrated text input into the language model is shown in Table 2.

[0138] Table 2 Example of input format for integrated text

[0139] The model calculation of each evaluation model includes the following two steps:

[0140] (1) Sentence-level feature extraction: The original input text and the corresponding polished text are concatenated into an integrated text, which is then fed into a language model. As shown in FIG7 , the language model is the large language model described above. The language model first processes the integrated text into an integrated text vector representation, and then performs feature extraction on the integrated text vector representation to obtain the integrated feature H of the corresponding integrated text. The integrated feature H is the last-layer output of the language model at the end-of-sequence (EOS) tag (i.e., the [EOS] tag):

[0141] H=LLM(INPUT TEXT\n REWRITE TEXT)

[0142] INPU TEXT is the content of the input text, REWRITE TEXT is the content of the polished text, and LLM (INPUT TEXT\REWRITE TEXT) is the final output of the language model after feature extraction, using the input text and the polished text as the concatenated text.

[0143] For example: the input text is "I will go to 502 for a meeting later", and the polished text is "I will go to 502 for a meeting in a while". The input text and the polished text are spliced ​​into the integrated text "Input text: I will go to 502 for a meeting later\nPolished text: I will go to 502 for a meeting in a while", and the integrated text is input into the language model of the evaluation model. The language model first performs a word segmentation operation on the integrated text, dividing the integrated text into individual tokens or characters, and generates corresponding special tags at the beginning and end of the text, such as [CLS] and [EOS]. For example, for the integrated text "Input text: I will go to 502 for a meeting later\nPolished text: I will go to 502 for a meeting in a while", the word segmentation result is in the form of [CLS]Input text: I will go to 502 for a meeting later\nPolished text: I will go to 502 for a meeting in a while[EOS].

[0144] The language model performs feature extraction on the word segmentation results of the integrated text. When extracting features for each character in the integrated text, only the features of the character and the characters before it can be combined to obtain the features of the character. Finally, the feature of the last character of the integrated text, that is, the character corresponding to the [EOS] symbol position, is used as the integrated feature H of the integrated text, and the integrated feature H of the corresponding integrated text is output:

[0145] H=LLM (Input text: Go to room 502 for a meeting later\nEdited text: Go to room 502 for a meeting later)

[0146] (2) Scoring module: Based on the multi-layer perceptron (MLP) in the scoring network, the integrated feature H is mapped and processed, and the output is an evaluation real number. The activation function, such as the Sigmoid function, processes the evaluation real number and outputs a value between 0 and 1 as the evaluation score of the corresponding integrated feature, so as to achieve the scoring of the integrated features of the integrated text:

[0147] Evaluation score = Sigmoid(MLP(H))

[0148] Where MLP(H) is the evaluation real number output by the multilayer perceptron.

[0149] During model training, the semantic evaluation model, grammatical evaluation model, and typographic evaluation model need to be trained separately. First, corresponding positive and negative samples are collected for each evaluation model. For the samples corresponding to the semantic evaluation model, see Table 3.

[0150] Table 3 Sample example table of semantic evaluation model

[0151] For samples of the corresponding grammar evaluation model, please see Table 4 for details.

[0152] Table 4 Sample example table of grammar evaluation model

[0153] For samples corresponding to the typesetting evaluation model, please see Table 5.

[0154] Table 5 Sample example table of typesetting evaluation model

[0155] The true evaluation score of positive samples in the training set (i.e., the true evaluation result of the target dimension) is 1, and the true evaluation score of negative samples is 0. After collecting sufficient training data (at least 10,000 per category), model training can be performed. The training process for an evaluation model is as follows:

[0156] First, according to the correspondence, the original text in the positive sample or negative sample and the corresponding polished text are spliced ​​to obtain a sample integrated text (i.e., a spliced ​​text sample). The sample integrated text includes the positive sample integrated text and the negative sample integrated text, which are input into the pre-trained model for processing to obtain a prediction score. For example, consider the input text x: "Input text: Meeting at room 502 later\nRefined text: Meeting at room 502 later." This text x is segmented into individual tokens or characters, and special markers are added at the beginning and end of the text: [CLS] and [EOS], respectively. [CLS] indicates the beginning of the text, and [EOS] indicates the end of the text. The resulting segmentation result is: [CLS]Input text: Meeting at room 502 later\nRefined text: Meeting at room 502 later[EOS]. Each character in the segmentation result is represented by a text vector, resulting in a text vector representation for the corresponding text x. Feature extraction is performed on this text vector representation to obtain the target dimension features for the corresponding text x. The multilayer perceptron and activation function in the scoring network are then used to map these target dimension features, resulting in the output y: the predicted evaluation score (i.e., the predicted evaluation result). A loss function is then calculated based on the predicted and true evaluation scores. The parameters of the pretrained model and the multilayer perceptron are updated based on the loss function to obtain the evaluation model. Among them, when the predicted evaluation score is the predicted typesetting evaluation score, the typesetting loss function is calculated based on the predicted typesetting evaluation score and the true typesetting evaluation score, and the parameters of the typesetting pre-training model and the typesetting multi-layer perceptron are updated based on the typesetting loss function to obtain the typesetting evaluation model; when the predicted evaluation score is the predicted semantic evaluation score, the semantic loss function is calculated based on the predicted semantic evaluation score and the true semantic evaluation score, and the parameters of the semantic pre-training model and the semantic multi-layer perceptron are updated based on the semantic loss function to obtain the semantic evaluation model; when the predicted evaluation score is the predicted grammatical evaluation score, the grammatical loss function is calculated based on the predicted grammatical evaluation score and the true grammatical evaluation score, and the parameters of the grammatical pre-training model and the grammatical multi-layer perceptron are updated based on the grammatical loss function to obtain the grammatical evaluation model.

[0157] Finally, 10% of the positive and negative samples are extracted as a test set, and the test set is used to test each evaluation model. If the test accuracy is above 90%, the evaluation model training is considered complete.

[0158] It is understandable that in the embodiments of the present application, when user information and other related data are involved, when the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0159] The following continues to describe an exemplary structure of the artificial intelligence-based text processing device 253 provided in an embodiment of the present application implemented as a software module. In some embodiments, as shown in Figure 2, the software modules stored in the artificial intelligence-based text processing device 253 of the memory 250 may include: an acquisition module 2531, configured to acquire a first integrated text, wherein the first integrated text is obtained by correcting the first original text. A splicing module 2532, configured to splice the first integrated text and the first original text to obtain a spliced ​​text. An evaluation module 2533, configured to perform multi-dimensional evaluation processing on the spliced ​​text to obtain an evaluation result corresponding to each dimension, wherein the multi-dimensional evaluation processing includes at least two of the following: semantic evaluation processing, grammatical evaluation processing, and typesetting evaluation processing. A fusion module 2534, configured to perform fusion processing on the evaluation results of at least two dimensions to obtain a corrected evaluation result of the first integrated text.

[0160] In some embodiments, the splicing module 2532 is further configured to obtain a splicing template, and splice the first original text and the first integrated text based on the splicing template to obtain a spliced ​​text.

[0161] In some embodiments, the evaluation module 2533 is further configured to perform typesetting feature extraction processing on the vector representation of the spliced ​​text to obtain typesetting features corresponding to the spliced ​​text, perform a first mapping processing on the typesetting features, and obtain a typesetting evaluation result.

[0162] In some embodiments, the evaluation module 2533 is further configured to perform the following processing on each character: perform word vectorization on the character to obtain a word vector representation of the character, perform sentence vectorization on the character based on the sentence to which the character belongs to obtain a sentence vector representation of the character, wherein the sentence comes from the concatenated text, perform position vectorization on the character based on the position of the character in the concatenated text to obtain a position vector representation of the character, and fuse the word vector representation, sentence vector representation and position vector representation of the corresponding character to obtain a text vector representation of the corresponding character.

[0163] In some embodiments, the evaluation module 2533 is further configured to perform the following processing on the text vector representation of each character in the spliced ​​text vector representation: when the character corresponding to the text vector representation of the character is the first character of the spliced ​​text, the text vector representation of the character is subjected to typesetting feature extraction processing to obtain the character typesetting feature of the character; when the character corresponding to the text vector representation of the character is not the first character of the spliced ​​text, the text vector representation of the character and the preceding character sorted before the character in the spliced ​​text are subjected to typesetting feature extraction processing to obtain the character typesetting feature of the character, and the character typesetting feature of the last character in the spliced ​​text is used as the typesetting feature of the spliced ​​text.

[0164] In some embodiments, the evaluation module 2533 is further configured to perform multi-layer perception processing on the typesetting features to obtain a predicted score value for the corresponding spliced ​​text, normalize the predicted score value based on the activation function to obtain a typesetting evaluation score, and use the typesetting evaluation score as the typesetting evaluation result.

[0165] In some embodiments, the evaluation results of at least two of the dimensions include semantic evaluation results, grammatical evaluation results, and typesetting evaluation results. The fusion module 2534 is further configured to obtain a weight combination that is adapted to the evaluation requirements. The weight combination includes a first weight corresponding to the semantic evaluation result, a second weight corresponding to the grammatical evaluation result, and a third weight corresponding to the typesetting evaluation result. Based on the weight combination, the semantic evaluation results, the grammatical evaluation results, and the typesetting evaluation results are weighted and summed to obtain a revised evaluation result of the first integrated text.

[0166] In some embodiments, the evaluation module 2533 is further configured to obtain a second integrated text, wherein the second integrated text is obtained by correcting the second original text, the second integrated text and the second original text are spliced ​​to obtain a spliced ​​text sample, the spliced ​​text sample is forward propagated in a pre-trained model to obtain a predicted evaluation result of the spliced ​​text sample in the target dimension, wherein the target dimension comes from multiple dimensions, the true evaluation result of the spliced ​​text sample in the target dimension is obtained, the loss function is determined based on the predicted evaluation result and the true evaluation result of the target dimension, the pre-trained model is updated based on the loss function, and the evaluation model is obtained, wherein the evaluation model is configured to perform target dimension evaluation processing on the spliced ​​text.

[0167] In some embodiments, the evaluation module 2533 is further configured to determine the value one as the true evaluation result of the spliced ​​text sample in the target dimension when the second original text and the second integrated text are in a positive sample relationship in the target dimension, and to determine the value zero as the true evaluation result of the spliced ​​text sample in the target dimension when the second original text and the second integrated text are in a negative sample relationship in the target dimension.

[0168] In some embodiments, the evaluation module 2533 is further configured to call the pre-trained model to perform the following operations on the spliced ​​text sample: perform text vectorization processing on each sample character in the spliced ​​text sample to obtain a sample text vector representation of each sample character, and splice the sample text vector representations of multiple sample characters into a spliced ​​text sample representation, perform feature extraction processing corresponding to the target dimension on the spliced ​​text sample representation to obtain text sample features in the target dimension, perform multi-layer perception processing on the text sample features to obtain a sample prediction score value of the corresponding spliced ​​text sample in the target dimension, and normalize the sample prediction score value based on the activation function to obtain a sample evaluation score, wherein the value range of the text sample evaluation score is not less than 0 and not greater than 1, and the sample evaluation score is used as the prediction evaluation result of the spliced ​​text sample in the target dimension.

[0169] An embodiment of the present application provides a computer program product comprising computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the artificial intelligence-based text processing method described in the embodiment of the present application.

[0170] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the processor will execute the artificial intelligence-based text processing method provided by an embodiment of the present application, for example, the artificial intelligence-based text processing method shown in Figure 3A.

[0171] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.

[0172] In some embodiments, computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0173] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, e.g., in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).

[0174] By way of example, computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed across multiple sites and interconnected by a communication network.

[0175] To sum up, through the embodiments of the present application, corresponding evaluation models are set for the three manual evaluation angles of semantics, grammar, and typesetting, so that the evaluation effect of the text processing method based on artificial intelligence provided by the embodiments of the present application is close to the accuracy of the evaluation effect of manual evaluation. At the same time, the language model is used for automated evaluation, and the evaluation speed is greatly improved compared with manual evaluation. Through the text processing method based on artificial intelligence provided by the embodiments of the present application, the defects of the text polishing model can be quickly discovered, and the subsequent iteration direction can be scientifically guided.

[0176] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.

Claims

1. A text processing method based on artificial intelligence, which is executed by an electronic device, and the method includes: Obtain a first integrated text, where the first integrated text is obtained by correcting a first original text; Perform a splicing process on the first integrated text and the first original text to obtain a spliced text; Perform a multi-dimensional evaluation process on the spliced text to obtain an evaluation result corresponding to each dimension, where the multi-dimensional evaluation process includes at least two of the following: semantic evaluation process, grammar evaluation process, and typesetting evaluation process; Perform a fusion process on the evaluation results of at least two dimensions to obtain a corrected evaluation result of the first integrated text.

2. The method according to claim 1, wherein The performing a splicing process on the first integrated text and the first original text to obtain a spliced text includes: Obtain a splicing template; Based on the splicing template, perform a splicing process on the first original text and the first integrated text to obtain the spliced text.

3. The method according to any one of claims 1 to 2, wherein, The typesetting evaluation process includes: Perform text vectorization processing on each character in the spliced text to obtain a text vector representation of each character, and splice the text vector representations of multiple characters into a spliced text vector representation; Perform typesetting feature extraction processing on the spliced text vector representation to obtain typesetting features corresponding to the spliced text; Perform a first mapping process on the typesetting features to obtain the typesetting evaluation result.

4. The method according to claim 3, wherein The performing text vectorization processing on each character in the spliced text to obtain a text vector representation of each character includes: Perform the following processing for each character: Perform word vectorization processing on the character to obtain a word vector representation of the character; Based on the sentence to which the character belongs, perform sentence vectorization processing on the character to obtain a sentence vector representation of the character, where the sentence is from the spliced text; Based on the position of the character in the spliced text, perform position vectorization processing on the character to obtain a position vector representation of the character; Perform a fusion process on the word vector representation, the sentence vector representation, and the position vector representation corresponding to the character to obtain a text vector representation corresponding to the character.

5. The method according to claim 3, wherein, The performing typesetting feature extraction processing on the spliced text vector representation to obtain typesetting features corresponding to the spliced text includes: Perform the following processing on the text vector representation of each character in the spliced text vector representation: When the character corresponding to the text vector representation of the character is the first character of the spliced text, perform typesetting feature extraction processing on the text vector representation of the character to obtain the character typesetting feature of the character; When the character corresponding to the text vector representation of the character is not the first character of the spliced text, perform typesetting feature extraction processing on the text vector representation of the character and the previous character to obtain the character typesetting feature of the character, where the previous character is the character sorted before the character in the spliced text; Use the character typesetting feature of the last character in the spliced text as the typesetting feature of the spliced text.

6. The method according to claim 3, wherein Performing a first mapping process on the typesetting features to obtain the typesetting evaluation result includes: Performing a multi-layer perception process on the typesetting features to obtain a predicted score value corresponding to the spliced text; Based on an activation function, performing a normalization process on the predicted score value to obtain a typesetting evaluation score, and using the typesetting evaluation score as the typesetting evaluation result.

7. The method according to any one of claims 1 to 6, wherein The semantic evaluation process includes: Performing text vectorization processing on each character in the spliced text to obtain a text vector representation of each character, and splicing the text vector representations of multiple characters into a spliced text vector representation; Performing semantic feature extraction processing on the spliced text vector representation to obtain semantic features corresponding to the spliced text; Performing a second mapping process on the semantic features to obtain the semantic evaluation result of the spliced text. The syntax evaluation process includes: Performing text vectorization processing on each character in the spliced text to obtain a text vector representation of each character, and splicing the text vector representations of multiple characters into a spliced text vector representation; Performing syntax feature extraction processing on the spliced text vector representation to obtain syntax features corresponding to the spliced text; Performing a third mapping process on the syntax features to obtain the syntax evaluation result of the spliced text.

8. The method according to any one of claims 1 to 7, wherein, The evaluation results of at least two of the dimensions include a semantic evaluation result, a syntax evaluation result, and a typesetting evaluation result. Performing a fusion process on the evaluation results of at least two of the dimensions to obtain a corrected evaluation result of the first integrated text includes: Obtaining a weight combination adapted to the evaluation requirements, where the weight combination includes a first weight corresponding to the semantic evaluation result, a second weight corresponding to the syntax evaluation result, and a third weight corresponding to the typesetting evaluation result; Performing a weighted summation process on the semantic evaluation result, the syntax evaluation result, and the typesetting evaluation result based on the weight combination to obtain the corrected evaluation result of the first integrated text.

9. The method according to any one of claims 1 to 8, wherein, The method further includes: Obtaining a second integrated text, where the second integrated text is obtained by performing a correction process on a second original text; Performing a splicing process on the second integrated text and the second original text to obtain a spliced text sample; Performing a forward propagation process on the spliced text sample in a pre-trained model to obtain a predicted evaluation result of the spliced text sample in a target dimension, where the target dimension is from the multi-dimensions; Obtaining a true evaluation result of the spliced text sample in the target dimension; Based on the predicted evaluation result and the true evaluation result of the target dimension, determining a loss function, and updating the pre-trained model based on the loss function to obtain an evaluation model, where the evaluation model is used to perform an evaluation process on the spliced text in the target dimension.

10. The method according to claim 9, wherein, The obtaining the true evaluation result of the spliced text sample in the target dimension includes: When the second original text and the second integrated text are in a positive sample relationship in the target dimension, determining the value one as the true evaluation result of the spliced text sample in the target dimension; When the second original text and the second integrated text are in a negative sample relationship in the target dimension, a numerical zero is determined as the true evaluation result of the spliced text sample in the target dimension.

11. The method according to claim 9, wherein, The forward propagation process of the spliced text sample in the pre-trained model to obtain the predicted evaluation result of the spliced text sample in the target dimension includes: Invoking the pre-trained model to perform the following operations on the spliced text sample: Performing text vectorization processing on each sample character in the spliced text sample to obtain a sample text vector representation of each sample character, and splicing the sample text vector representations of multiple sample characters into a spliced text sample representation; Performing feature extraction processing on the spliced text sample representation corresponding to the target dimension to obtain a text sample feature in the target dimension; Performing a multi-layer perception process on the text sample feature to obtain a sample prediction score value corresponding to the spliced text sample in the target dimension; Based on an activation function, performing normalization processing on the sample prediction score value to obtain a sample evaluation score, where the value range of the text sample evaluation score is not less than 0 and not greater than 1; Using the sample evaluation score as the predicted evaluation result of the spliced text sample in the target dimension.

12. An artificial intelligence-based text processing device, the device includes: An acquisition module configured to acquire a first integrated text, where the first integrated text is obtained by correcting a first original text; A splicing module configured to splice the first integrated text and the first original text to obtain a spliced text; An evaluation module configured to perform multi-dimensional evaluation processing on the spliced text to obtain an evaluation result corresponding to each dimension, where the multi-dimensional evaluation processing includes at least two of the following: semantic evaluation processing, grammar evaluation processing, and layout evaluation processing; A fusion module configured to perform fusion processing on the evaluation results of at least two dimensions to obtain a corrected evaluation result of the first integrated text.

13. An electronic device, the electronic device includes: A memory for storing computer-executable instructions; A processor for implementing the artificial intelligence-based text processing method according to any one of claims 1 to 10 when executing the computer-executable instructions stored in the memory.

14. A computer-readable storage medium storing computer-executable instructions, the computer-executable instructions being implemented as the artificial intelligence-based text processing method according to any one of claims 1 to 10 when executed by a processor.

15. A computer program product including computer-executable instructions, the computer-executable instructions being implemented as the artificial intelligence-based text processing method according to any one of claims 1 to 10 when executed by a processor.

Citation Information

Patent Citations

  • Article quality evaluation method, article recommendation method and corresponding devices

    CN111488931A

  • Text enhancement quality evaluation method, electronic equipment and storage medium

    CN116629238A

  • Description rewriting evaluation method, related device and medium

    CN117217204A

  • Text processing method and device based on artificial intelligence, equipment and storage medium

    CN117592468A

  • Automated text-evaluation of user generated text

    US20170147682A1

Cited By

  • News retouching method based on artificial intelligence and related device

    CN121117202A

  • Artificial intelligence-based automatic calibration method and system for creative and cultural patterns

    CN121280220A

  • Image correction effect evaluation method and device and electronic equipment

    CN121725320A