Text processing method and apparatus, and electronic device, computer-readable storage medium and computer program product

WO2025066553A9PCT designated stage expired Publication Date: 2026-03-26TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2026-03-26

AI Technical Summary

Technical Problem

The prior art has hallucinations in the text processing process, which leads to the target text not being authentic in the prediction dimension, thereby reducing the accuracy of text processing.

Method used

By feature encoding of the text to be processed, the initial text features are obtained, the authenticity prediction is made in at least one prediction dimension based on the initial text features, the corrected features are obtained, the initial text features are characterized by feature decoding, and the target text with authenticity in each prediction dimension is obtained.

Benefits of technology

It effectively improves the accuracy of text processing, so that the target text has authenticity in all prediction dimensions, and improves the accuracy of text processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024109812_26032026_PF_FP_ABST
    Figure CN2024109812_26032026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a text processing method and apparatus, and an electronic device, a storage medium and a program product. The method comprises: performing feature coding on text to be processed, so as to obtain an initial text feature of said text; on the basis of the initial text feature, performing authenticity prediction on the logic of said text in at least one prediction dimension to obtain an authenticity prediction result of said text in each prediction dimension; for each prediction dimension, when the authenticity prediction result in the prediction dimension indicates that said text is not authentic in the prediction dimension, acquiring a correction feature of the initial text feature in the prediction dimension; on the basis of the correction feature, performing feature correction on the initial text feature to obtain a target text feature corresponding to the initial text feature; and performing feature decoding on the target text feature to obtain target text corresponding to said text, wherein the target text is authentic in each prediction dimension.
Need to check novelty before this filing date? Find Prior Art

Description

Text processing method, device, electronic device, computer-readable storage medium, and computer program product

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application is based on the Chinese patent application with application number 2023112948269 and application date September 28, 2023, 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 a text processing method, device, electronic device, computer-readable storage medium, and computer program product. Background Art

[0004] Artificial Intelligence (AI) is the theory, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. Foundational AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, pre-trained model technologies, operating / interaction systems, and mechatronics. Pre-trained models, also known as large models or basic models, can be fine-tuned and widely applied to downstream tasks across various AI domains. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0005] In related technologies, for text processing, feature encoding and feature decoding are usually performed directly on the text to be processed to obtain the target text of the text to be processed. In this way, due to the existence of hallucination phenomena in the text processing process, the target text will not be authentic under the prediction dimension, resulting in low accuracy of the determined target text and low accuracy of text processing.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a text processing method, device, electronic device, computer-readable storage medium, and computer program product, which can effectively improve the accuracy of text processing.

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

[0009] This embodiment of the present application provides a text processing method, including:

[0010] Performing feature encoding on the text to be processed to obtain initial text features of the text to be processed;

[0011] Based on the initial text features, performing authenticity prediction on the logic of the text to be processed in at least one prediction dimension to obtain authenticity prediction results of the text to be processed in each of the prediction dimensions;

[0012] When the authenticity prediction result indicates that the to-be-processed text is not authentic under the corresponding prediction dimension, obtaining a modified feature of the initial text feature under the corresponding prediction dimension;

[0013] Based on the modified features, the initial text features are modified to obtain target text features corresponding to the initial text features;

[0014] The target text features are decoded to obtain a target text corresponding to the text to be processed, wherein the target text has the authenticity under each of the prediction dimensions.

[0015] The present invention provides a text processing device, including:

[0016] A feature encoding module is configured to perform feature encoding on the text to be processed to obtain initial text features of the text to be processed;

[0017] an authenticity prediction module configured to perform authenticity prediction on the logic of the text to be processed in at least one prediction dimension based on the initial text features, and obtain authenticity prediction results of the text to be processed in each of the prediction dimensions;

[0018] an acquisition module configured to acquire, when the authenticity prediction result indicates that the to-be-processed text is not authentic under the corresponding prediction dimension, a modified feature of the initial text feature under the corresponding prediction dimension;

[0019] a feature correction module configured to perform feature correction on the initial text feature based on the correction feature to obtain a target text feature corresponding to the initial text feature;

[0020] A feature decoding module is configured to perform feature decoding on the target text features to obtain a target text corresponding to the text to be processed, wherein the target text has the authenticity under each of the prediction dimensions.

[0021] a memory configured to store computer-executable instructions or computer programs;

[0022] The processor is configured to implement the text processing method provided in the embodiment of the present application when executing the computer executable instructions or computer program stored in the memory.

[0023] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for causing a processor to execute and implement the text processing method provided in the embodiment of the present application.

[0024] An embodiment of the present application provides a computer program product, which includes a computer program or 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 text processing method described in the embodiment of the present application.

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

[0026] By performing feature encoding on the text to be processed, the initial text features of the text to be processed are obtained. Based on the initial text features, authenticity prediction is performed on the logic of the text to be processed in at least one prediction dimension to obtain the authenticity prediction results of the text to be processed in each prediction dimension. When the authenticity prediction result indicates that the text to be processed is not authentic under the corresponding prediction dimension, the correction features under the corresponding prediction dimension are obtained. Based on the correction features, the initial text features are feature-corrected to obtain the target text features corresponding to the initial text features. The target text features are feature-decoded to obtain the target text that is authentic under each prediction dimension. In this way, by performing authenticity prediction on the logic of the text to be processed in at least one prediction dimension based on the initial text features, the authenticity prediction results of the text to be processed in each prediction dimension are obtained. By performing feature correction on the initial text features to obtain the target text features, the target text features are feature-decoded, so that the target text is authentic under each prediction dimension, thereby effectively improving the accuracy of the target text and effectively improving the accuracy of text processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] FIG1 is a schematic diagram of the architecture of a text processing system provided in an embodiment of the present application;

[0028] FIG2 is a schematic diagram of the structure of an electronic device for text processing provided in an embodiment of the present application;

[0029] FIG3 is a flowchart of a text processing method according to an embodiment of the present application;

[0030] FIG4 is a second flow chart of the text processing method provided in an embodiment of the present application;

[0031] FIG5 is a first schematic diagram of the principle of the text processing method provided in an embodiment of the present application;

[0032] FIG6 is a third flow chart of the text processing method provided in an embodiment of the present application;

[0033] FIG7 is a fourth flow chart of a text processing method according to an embodiment of the present application;

[0034] FIG8 is a fifth flow chart of a text processing method provided in an embodiment of the present application;

[0035] FIG9 is a second schematic diagram of the principle of the text processing method provided in an embodiment of the present application;

[0036] FIG10 is a schematic diagram of the experimental effect of the text processing method provided in an embodiment of the present application. DETAILED DESCRIPTION

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

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

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

[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this 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) Artificial Intelligence (AI): The theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. AI technology is an interdisciplinary discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics.

[0043] 2) Convolutional Neural Networks (CNN): These are a type of feed-forward neural network (FNN) that incorporates convolutional computations and possesses a deep structure. They are a representative algorithm for deep learning. CNNs possess representation learning capabilities and can perform shift-invariant classification of input images based on their hierarchical structure.

[0044] 3) Machine Learning (ML): This is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specializes in studying how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance.

[0045] 4) In response to: used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed can be in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations executed are executed.

[0046] 5) Large Language Model (LLM): A large language model is a deep learning model trained using large amounts of text data. It can generate natural language text or understand the meaning of text. Large language models can handle a variety of natural language tasks, such as text classification, question-answering, and conversation, and are an important path to artificial intelligence. Large language models are 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, and sentiment analysis. Large language models are characterized by their large scale and billions of parameters, which help them learn complex patterns in language data. These models are often based on deep learning architectures such as transformers, which contributes to their impressive performance on various natural language processing tasks. Pre-trained models, a key technology for model training in the field of artificial intelligence, are derived from large language models in the field of natural language processing. After fine-tuning, large language models can be widely applied to downstream tasks.

[0047] 6) Natural Language Processing (NLP): This field is a key area in computer science and artificial intelligence. It studies the theories and methods that enable effective communication between humans and computers using natural language. Natural language processing (NLP) is a discipline that integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language we use daily—so it shares close ties with linguistics, yet also has important differences. Natural language processing isn't simply the study of natural language in general, but rather the development of computer systems, particularly software systems, that can effectively implement natural language communication. As such, it's a part of computer science, with applications primarily in machine translation, public opinion detection, automatic summarization, opinion extraction, text classification, question answering, text semantic comparison, and speech recognition.

[0048] During the implementation of the embodiments of this application, the applicant discovered that the related technology has the following problems:

[0049] In related technologies, for text processing, feature encoding and feature decoding are usually performed directly on the text to be processed to obtain the target text of the text to be processed. In this way, due to the existence of hallucination phenomena in the text processing process, the target text will not be authentic under the prediction dimension, resulting in low accuracy of the determined target text and low accuracy of text processing.

[0050] Embodiments of the present application provide a text processing method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can effectively improve the accuracy of text processing. The following describes an exemplary application of the text processing system provided by the embodiments of the present application.

[0051] Refer to Figure 1, which is a schematic diagram of the architecture of a text processing system 100 provided in an embodiment of the present application. The terminal (terminal 400 is shown as an example) is connected to the 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.

[0052] The terminal 400 is used for the user to use the client 410 to display the target text on the graphical interface 410-1 (graphic interface 410-1 is shown as an example). The terminal 400 and the server 200 are connected to each other via a wired or wireless network.

[0053] 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 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 basic cloud computing services such as 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 TV, a smart watch, a car terminal, etc., but is not limited to this. The electronic device provided in the embodiment of the present application can be implemented as a terminal or as a server. The terminal and the server can be directly or indirectly connected by wired or wireless communication, which is not limited in the embodiment of the present application.

[0054] In some embodiments, the server 200 performs feature encoding on the text to be processed to obtain the initial text features of the text to be processed, determines the target text features corresponding to the initial text features, performs feature decoding on the target text features to obtain the target text corresponding to the text to be processed, and sends the target text to the terminal 400.

[0055] In other embodiments, the terminal 400 performs feature encoding on the text to be processed to obtain the initial text features of the text to be processed, determines the target text features corresponding to the initial text features, and performs feature decoding on the target text features to obtain the target text corresponding to the text to be processed, and sends the target text to the server 200.

[0056] In other embodiments, the embodiments of the present application can be implemented with the help of cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network within a wide area network or local area network to realize data calculation, storage, processing, and sharing.

[0057] Cloud technology is a general term for network, information, integration, management platform, and application technologies used in the cloud computing business model. It can form a resource pool that can be used flexibly and conveniently on demand. Cloud computing technology will become a key support. The backend services of technical network systems require a large amount of computing and storage resources.

[0058] Referring to Figure 2, Figure 2 is a schematic diagram of the structure of an electronic device 500 for text processing provided in an embodiment of the present application, wherein the electronic device 500 shown in Figure 2 can be the server 200 or the terminal 400 in Figure 1, and the electronic device 500 shown in Figure 2 includes: at least one processor 430, a memory 450, and at least one network interface 420. The various components in the electronic device 500 are coupled together through a bus system 440. It can be understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as bus system 440 in Figure 2.

[0059] The processor 430 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.

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

[0061] The memory 450 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 450 described in the embodiments of the present application is intended to include any suitable type of memory.

[0062] In some embodiments, the memory 450 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.

[0063] Operating system 451, 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;

[0064] The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include Bluetooth, Wireless Fidelity (WiFi), and Universal Serial Bus (USB).

[0065] In some embodiments, the text processing device provided in the embodiments of the present application can be implemented in software. FIG2 shows a text processing device 455 stored in memory 450. The text processing device 455 can be software in the form of a program or plug-in, and includes the following software modules: a feature encoding module 4551, a authenticity prediction module 4552, an acquisition module 4553, a feature correction module 4554, and a feature decoding module 4555. 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.

[0066] In other embodiments, the text processing device provided in the embodiments of the present application can be implemented in hardware. As an example, the text processing device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the text processing method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0067] In some embodiments, the terminal or server can implement the text processing method provided in the embodiments of the present application by running a computer program or computer executable instructions. For example, the computer program can be a native program (e.g., a dedicated text processing program) or a software module in the operating system, for example, a text processing module that can be embedded in any program (such as an instant messaging client, a photo album program, an electronic map client, a navigation client); for example, it can be a local (Native) application (APP, Application), that is, a program that needs to be installed in the operating system to run. In short, the above-mentioned computer program can be any form of application, module or plug-in.

[0068] The 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 or terminal provided in the embodiment of the present application.

[0069] Refer to Figure 3, which is a flow chart of the text processing method provided in an embodiment of the present application. It will be explained in conjunction with steps 101 to 105 shown in Figure 3. The text processing method provided in an embodiment of the present application can be implemented by the server or the terminal alone, or by the server and the terminal in collaboration. The following will be explained using the server alone as an example.

[0070] In step 101, feature encoding is performed on the text to be processed to obtain initial text features of the text to be processed.

[0071] In some embodiments, feature encoding refers to the process of converting the text to be processed into initial text features in vector form. In machine learning, pattern recognition, and image processing, feature encoding starts with an initial set of measurement data and establishes derived values ​​(features) designed to provide information and non-redundancy, thereby facilitating subsequent learning and generalization steps and, in some cases, providing better interpretability. Feature encoding is related to dimensionality reduction. The quality of features has a crucial impact on generalization ability.

[0072] In some embodiments, feature encoding in natural language processing (NLP) and machine learning refers to the process of converting text data into numerical features that machine learning models can understand and process. In natural language processing, text data is unstructured and contains rich information and complex semantic structures, while most machine learning models require structured, quantitative input. Feature encoding enables text data to be effectively utilized by algorithms.

[0073] In some embodiments, the above-mentioned feature encoding is implemented by at least one feature encoding network. When the number of feature encoding networks is one, step 101 can be implemented as follows: Call the feature encoding network to perform feature encoding on the text to be processed, and obtain the initial text features of the text to be processed.

[0074] In some embodiments, the above-mentioned feature encoding network can be implemented by an encoding network. The encoding network can be a machine learning network with a multi-head self-attention network as the network framework. The specific implementation manner of the above-mentioned feature encoding network does not limit the embodiments of the present application.

[0075] In some embodiments, an encoding network is a neural network structure that is used to map input data (such as text) to a more abstract and compact representation form, and is usually used to capture the complex features and structures of the data. In natural language processing (NLP), the encoding network can convert text into a vector representation that can characterize its semantic and syntactic information.

[0076] In some embodiments, the above-mentioned feature encoding is implemented by at least one feature encoding network. Referring to FIG. 4, FIG. 4 is a second schematic flowchart of the text processing method provided by the embodiment of the present application. When the number of feature encoding networks is multiple, the extraction scales of each feature encoding network are different. Step 101 shown in FIG. 3 can be implemented by steps 1011 to 1013 shown in FIG. 4.

[0077] In step 1011, call the first feature encoding network to perform feature encoding on the text to be processed, and obtain the first initial text features.

[0078] As an example, referring to FIG. 5, FIG. 5 is a first schematic diagram of the principle of the text processing method provided by the embodiment of the present application. Call the first feature encoding network 51 to perform feature encoding on the text to be processed, and obtain the first initial text features.

[0079] In step 1012, traverse i and perform the following processing: Call the i-th feature encoding network to perform feature encoding on the text to be processed based on the (i - 1)-th initial text features, and obtain the i-th initial text features.

[0080] In some embodiments, 1 < i ≤ N, where N is used to indicate the number of feature encoding networks.

[0081] As an example, referring to FIG. 5, call the second feature encoding network 52 to perform feature encoding on the text to be processed based on the first initial text features, and obtain the second initial text features; call the n-th feature encoding network 5n to perform feature encoding on the text to be processed based on the (n - 1)-th initial text features, and obtain the n-th initial text features.

[0082] In some embodiments, before executing the above step 1012, the i-1th target text feature can be determined in the following manner: based on the i-1th initial text feature, the logic of the text to be processed is predicted to be true in each prediction dimension, and the i-1th truth prediction result of the text to be processed in each prediction dimension is obtained; based on the i-1th truth prediction result, the i-1th initial text feature is checked to obtain the i-1th target text feature.

[0083] In some embodiments, this iterative feature processing and authenticity prediction significantly improves the accuracy of text authenticity detection. In each iterative step, authenticity prediction is performed based on the initial text features of the previous step, which can promptly identify and correct inaccuracies or inconsistencies in text features. Subsequently, through feature inspection, the text features are further optimized to ensure that they match the authenticity prediction results, thereby obtaining more accurate target text features. This dynamic adjustment and optimization process makes the feature representation more focused on the authenticity of the text, thereby improving the model's ability to recognize authenticity. In addition, through multiple iterations, the model can gradually refine deeper and more subtle features, which is crucial for understanding and evaluating the authenticity of the text, and ultimately more accurate prediction performance may be achieved in all prediction dimensions.

[0084] In some embodiments, the above-mentioned authenticity prediction of the logic of the text to be processed in each prediction dimension based on the i-1th initial text feature to obtain the i-1th authenticity prediction result of the text to be processed in each prediction dimension can be achieved as follows: obtain the authenticity prediction network corresponding to each of the prediction dimensions, and perform the following processing for each of the prediction dimensions: call the corresponding authenticity prediction network, and based on the i-1th initial text feature, perform authenticity prediction on the logic of the text to be processed in the prediction dimension to obtain the i-1th authenticity score of the text to be processed in the prediction dimension; when the i-1th authenticity score is greater than or equal to the score threshold, determine the i-1th authenticity prediction result of the prediction dimension as the first result; when the i-1th authenticity score is less than the score threshold, determine the i-1th authenticity prediction result of the prediction dimension as the second result.

[0085] In some embodiments, the first result is used to indicate that the text to be processed is authentic under the predicted dimension, and the second result is used to indicate that the text to be processed is not authentic under the predicted dimension.

[0086] As an example, in the application scenario of online news authenticity detection, the prediction dimensions may include: content authenticity, used to evaluate whether news content is based on facts; source reliability, used to evaluate the credibility and reliability of the news source; and logical consistency, used to evaluate the logical coherence within the news content. For content authenticity: a deep learning-based classification network is trained specifically to determine whether news content is authentic. For source reliability: a model that assesses the history and credibility of the news source. For logical consistency: a network that detects internal contradictions and logical errors in the text. Processed text: a newly published online news article. The i-1th initial text feature: the text feature representation obtained in the previous iteration. A score threshold: for example, 0.5, used to determine the authenticity score. Obtain a classification network for content authenticity from the model library. Obtain an assessment model for source reliability from the model library. Obtain a detection network for logical consistency from the model library. Call the content authenticity classification network, input the i-1th initial text feature, and obtain an authenticity score, for example, 0.6. Judgment: 0.6>=0.5, so the prediction result of the content authenticity is determined to be the first result (true). Call the evaluation model of source reliability, input the i-1th initial text feature, and obtain the authenticity score, for example, 0.4. Judgment: 0.4<0.5, so the prediction result of source reliability is determined to be the second result (untrue). Call the detection network of logical consistency, input the i-1th initial text feature. Obtain the authenticity score, for example, 0.7. Judgment: 0.7>=0.5, so the prediction result of logical consistency is determined to be the first result (true). For the content authenticity dimension, the prediction result is the first result (true). For the source reliability dimension, the prediction result is the second result (untrue). For the logical consistency dimension, the prediction result is the first result (true). In this way, each prediction dimension is evaluated using a dedicated network, and the authenticity prediction result is determined according to the score threshold, thereby achieving a comprehensive evaluation of the authenticity of the text, thereby improving the accuracy of the entire authenticity detection system.

[0087] This allows for customized assessments to be provided for each prediction dimension, significantly improving the overall accuracy and reliability of text authenticity detection. By assigning a dedicated network to each prediction dimension, information specific to that dimension can be better captured and processed, making authenticity predictions more accurate. Authenticity scoring based on the i-1th initial text features not only fully leverages the valuable information extracted from previous iterations, but also provides a clear decision criterion for each dimension through the application of score thresholds. This not only makes the prediction results more interpretable, but also provides more refined guidance for subsequent decision-making or processing by distinguishing between the first and second results.

[0088] In some embodiments, when the number of the prediction dimensions is one, the acquisition of the authenticity prediction network corresponding to each of the prediction dimensions can be achieved in the following manner: obtaining an initial prediction network, and obtaining multiple text feature samples corresponding to the text sample, and the authenticity label score of each of the text feature samples; for each of the text feature samples, calling the initial prediction network, and based on the text feature sample, performing authenticity prediction on the logic of the text sample in the prediction dimension to obtain the authenticity score corresponding to the text feature sample, and combining the authenticity score and the corresponding authenticity label score to determine the loss value corresponding to the text feature sample; based on the loss value corresponding to each of the text feature samples, training the initial prediction network to obtain the authenticity prediction network corresponding to the prediction dimension.

[0089] In some embodiments, the above-mentioned acquisition of multiple text feature samples corresponding to the text sample can be achieved by: acquiring a text sample, and performing feature encoding on the text sample to obtain the initial text features of the text sample; performing feature splitting on the initial text features of the text sample to obtain multiple text feature samples corresponding to the text sample.

[0090] As an example, in the application scenario of checking the authenticity of comments on social media platforms, the initial prediction network can be a deep learning-based classification model used to predict the authenticity of text. The text feature samples can be feature vectors obtained through preprocessing and feature extraction of comments collected from social media platforms. The authenticity label score can be the authenticity label of each comment, typically manually annotated, indicating whether the comment is real or fake. Text sample 1: The comment content "This product is really great, I love it!"; Text feature sample 1: The feature vector obtained through feature extraction, such as a bag-of-words model or word embedding. Authenticity label score 1: 0.9 (indicating that this comment is likely authentic). Collect a large number of social media comments and their corresponding authenticity label scores. Preprocess these comments and extract text features to obtain a set of text feature samples and corresponding authenticity label scores. For each text feature sample, call the initial prediction network to make an authenticity prediction. Assume that for text feature sample 1, the initial prediction network gives an authenticity score of 0.85. Use a loss function (such as cross-entropy loss or mean squared error) to calculate the difference between the predicted score and the true label score. For text feature sample 1, the loss might be calculated as (0.9-0.85)^2. The loss values ​​for all text feature samples are used to train the initial prediction network. Optimization algorithms such as backpropagation and gradient descent are used to adjust network parameters and reduce the loss. After sufficient training iterations, the initial prediction network gradually learns and improves its prediction capabilities. Ultimately, the trained network becomes a truth prediction network for a specific prediction dimension.

[0091] In some embodiments, the above-mentioned combination of the authenticity score and the corresponding authenticity label score to determine the loss value corresponding to the text feature sample can be achieved as follows: determine the difference between the authenticity score and the corresponding authenticity label score, and determine the difference as the loss value corresponding to the text feature sample.

[0092] In this way, the initial prediction network is used to assess the authenticity of the processed text feature samples. Through continuous iterative prediction and loss calculation, the network gradually learns and captures the complex relationship between text features and authenticity. This training method enables the prediction network to be specifically optimized for different prediction dimensions, significantly improving its performance on authenticity detection tasks. Ultimately, a fully trained prediction network can more accurately predict the authenticity of text, providing powerful tools for scenarios such as social media platforms and news aggregators to identify and filter false information, enhancing the credibility of information dissemination and user safety.

[0093] In some embodiments, when the number of the prediction dimensions is multiple, the above-mentioned acquisition of the authenticity prediction network corresponding to each of the prediction dimensions can be achieved in the following manner: obtaining an initial prediction network, and obtaining the first text feature sample corresponding to the text sample of the first prediction dimension, and the first authenticity label score of the first text feature sample; calling the initial prediction network, based on the first text feature sample, performing authenticity prediction on the logic of the text sample of the first prediction dimension to obtain the first authenticity score, and combining the first authenticity score and the first authenticity label score to train the initial prediction network to obtain the authenticity prediction network corresponding to the first prediction dimension; traversing j to perform the following processing: obtaining the j-1th authenticity score corresponding to the text sample of the j-1th prediction dimension, training the initial prediction network based on the j-1th authenticity score, and obtaining the authenticity prediction network corresponding to the j-1th prediction dimension.

[0094] As an example, in the application scenario of multi-dimensional authenticity prediction of online news, a general deep learning classification model is used to predict the authenticity of text. Text sample: news articles collected from the Internet. Feature extraction: preprocess the text sample and extract features, such as TF-IDF, word embedding, etc. First prediction dimension: content authenticity: obtain the first text feature sample and authenticity label score: select news samples related to content authenticity, such as news health statements, etc. Perform feature extraction on these news to obtain the first text feature sample. Assign authenticity label scores to each sample, which are usually generated by experts or manual annotations. Text sample 1: a news article about the effectiveness of vaccines. First text feature sample 1: feature vector extracted by TF-IDF. First authenticity label score 1: 0.8 (indicating that this news is considered to be true). Use the initial prediction network to predict the authenticity of the first text feature sample and obtain the first authenticity score. Assume that for the first text feature sample 1, the output authenticity score of the initial prediction network is 0.75. Calculate a loss value, such as cross-entropy loss, and combine the first authenticity score and the first authenticity label score. Train the initial prediction network through backpropagation and gradient descent to optimize the network parameters. j-1 prediction dimension: source reliability, logical consistency, etc. For each subsequent prediction dimension j, perform the following steps: Obtain text samples and authenticity scores for the j-1 prediction dimension: Using the same text samples as the previous step, extract features related to the j-1 prediction dimension. Obtain the manually annotated authenticity scores for the j-1 prediction dimension. Train the authenticity prediction network for the j-1 prediction dimension: Further train the initial prediction network based on the text samples and authenticity scores for the j-1 prediction dimension. For each sample, calculate the loss value and update the network parameters. Ultimately, a specialized prediction network is obtained for each prediction dimension. A dedicated authenticity prediction network is trained independently for each prediction dimension, and each network is specialized for its corresponding authenticity evaluation criterion, ensuring that each dimension receives sufficient attention and optimization, thereby achieving higher accuracy and reliability in multi-dimensional authenticity detection tasks.

[0095] In some embodiments, 2≤j≤M, where M indicates the number of prediction dimensions.

[0096] In some embodiments, the above-mentioned feature check of the i-1th initial text feature based on the i-1th authenticity prediction result to obtain the i-1th target text feature can be achieved as follows: when there is an i-1th authenticity prediction result indicating that the text to be processed is not authentic under the corresponding prediction dimension, the i-1th initial text feature is feature corrected to obtain the i-1th target text feature; when each i-1th authenticity prediction result indicates that the text to be processed is authentic under the corresponding prediction dimension, the i-1th initial text feature is determined as the i-1th target text feature.

[0097] As an example, the i-1th authenticity prediction result corresponds one-to-one to the prediction dimension, and the prediction dimension includes prediction dimension A, prediction dimension B and prediction dimension C. The i-1th authenticity prediction result includes the prediction result corresponding to prediction dimension A, the prediction result corresponding to prediction dimension B, and the prediction result corresponding to prediction dimension C. The prediction result corresponding to prediction dimension A indicates that the text to be processed is not authentic under prediction dimension A, the prediction result corresponding to prediction dimension B indicates that the text to be processed is authentic under prediction dimension B, and the prediction result corresponding to prediction dimension C indicates that the text to be processed is not authentic under prediction dimension C. That is, there is an i-1th authenticity prediction result indicating that the text to be processed is not authentic under the corresponding prediction dimension. At this time, it is necessary to perform feature correction on the i-1th initial text feature to obtain the i-1th target text feature.

[0098] As an example, the i-1th authenticity prediction result corresponds one-to-one to the prediction dimension, and the prediction dimension includes prediction dimension A, prediction dimension B and prediction dimension C. The i-1th authenticity prediction result includes the prediction result corresponding to prediction dimension A, the prediction result corresponding to prediction dimension B, and the prediction result corresponding to prediction dimension C. The prediction result corresponding to prediction dimension A indicates that the text to be processed is authentic under prediction dimension A, the prediction result corresponding to prediction dimension B indicates that the text to be processed is authentic under prediction dimension B, and the prediction result corresponding to prediction dimension C indicates that the text to be processed is authentic under prediction dimension C. That is, when each i-1th authenticity prediction result indicates that the text to be processed is authentic under the corresponding prediction dimension, the i-1th initial text feature can be directly determined as the i-1th target text feature.

[0099] In this way, when the authenticity prediction results indicate that the text to be processed may be untrue under a specific prediction dimension, feature correction can beneficially improve the accuracy of text authenticity detection. By making targeted adjustments to the i-1th initial text features to obtain the i-1th target text features, the impact of features inconsistent with the prediction results can be effectively removed or reduced, allowing subsequent feature encoding and network training to focus more on real text information. When all prediction dimensions indicate that the text to be processed is authentic, keeping the i-1th initial text features unchanged helps retain important information in the text and avoid unnecessary feature distortion. This dynamic feature processing method not only improves the robustness of the model, but also optimizes the model's ability to recognize real text, ultimately significantly improving the performance and reliability of authenticity detection.

[0100] In some embodiments, the above step 1012 can be implemented as follows: calling the i-th feature encoding network, performing feature encoding on the text to be processed based on the i-1-th target text feature, and obtaining the i-th initial text feature.

[0101] In some embodiments, before calling the i-th feature encoding network, the i-1th initial text feature is subjected to feature check to obtain the i-1th target text feature, thereby calling the i-th feature encoding network, and based on the i-1th target text feature, feature encoding is performed on the text to be processed to obtain the i-th initial text feature, so that in multiple feature encoding networks, feature checks are performed layer by layer to ensure that the input of each layer of feature encoding network is the target text feature after strict feature check, so that the feature encoding network can gradually realize the feature encoding optimization of the text to be processed, thereby effectively improving the accuracy of feature encoding.

[0102] In step 1013, the Nth initial text feature is determined as the initial text feature of the text to be processed.

[0103] As an example, referring to FIG5 , the Nth initial text feature (ie, the output of the Nth feature encoding network 5 n ) is determined as the initial text feature of the text to be processed.

[0104] In this way, before calling the i-th feature encoding network, the i-1th initial text feature is subjected to feature check to obtain the i-1th target text feature, thereby calling the i-th feature encoding network, and based on the i-1th target text feature, feature encoding is performed on the text to be processed to obtain the i-th initial text feature, so that in multiple feature encoding networks, feature checks are performed layer by layer to ensure that the input of each layer of feature encoding network is the target text feature after strict feature check, so that the feature encoding network can gradually realize the feature encoding optimization of the text to be processed, thereby effectively improving the accuracy of feature encoding.

[0105] In step 102, based on the initial text features, authenticity prediction is performed on the logic of the text to be processed in at least one prediction dimension to obtain authenticity prediction results of the text to be processed in each prediction dimension.

[0106] In some embodiments, the above-mentioned authenticity prediction can be achieved through an authenticity prediction network. The above-mentioned authenticity prediction network corresponds one-to-one to the prediction dimension, that is, different prediction dimensions correspond to different authenticity prediction networks. The network structure of the authenticity prediction network under different prediction dimensions is the same, but the network parameters are different. The network structure of the authenticity prediction network can include convolutional layers, pooling layers and normalization layers.

[0107] In some embodiments, the above-mentioned predicted dimensions are used to indicate the logical dimensions of the text to be processed. The predicted dimensions correspond one-to-one to the logical dimensions of the text to be processed. The logical dimensions of the text to be processed include various language logic types such as common sense logic and grammatical logic. For example, common sense logic includes that refrigerators are smaller than elephants and there is no oxygen on the moon.

[0108] In some embodiments, authenticity prediction and prediction dimensions are concepts in the field of natural language processing (NLP) and are typically used to assess the authenticity or credibility of text content in specific aspects. Authenticity prediction refers to the use of machine learning models or algorithms to predict the authenticity of a piece of text content. This prediction is typically based on factors such as the text's grammar, semantics, context, and relationship to other known information. The purpose of authenticity prediction is to determine whether the text content is factually accurate, deceptive, or contains inaccurate information.

[0109] As an example, predictive dimensions refer to the different aspects or attributes that are considered when making a truthfulness prediction. These dimensions can be varied, and here are some common examples of predictive dimensions: Content authenticity: Evaluates whether the content of a text is based on facts, such as the accuracy of a news article. Source credibility: Evaluates the credibility of the source of a text, such as judging whether a social media account is reliable. Sentiment consistency: Evaluates whether the sentiment of the text is consistent with the author's true sentiment, such as detecting fake reviews. Logical consistency: Evaluates whether the logic within the text is coherent and free of obvious contradictions. Contextual relevance: Evaluates whether the content of the text is relevant to the given context.

[0110] As an example, if in the authenticity prediction of a news article, the prediction result on the content authenticity dimension shows that the article contains false information, then it can be concluded that the article is not authentic on the content authenticity dimension.

[0111] For example, in a news verification scenario, the prediction dimensions are: content authenticity, source reliability, and logical consistency. The text to be processed is a financial news article about a company's performance report. Authenticity prediction: Content authenticity: After fact-checking, the data in the news article is found to be inconsistent with the official performance report, and the prediction result is not authentic. Source reliability: The news source is a well-known financial media outlet, and the prediction result is authentic. Logical consistency: The data analysis and logical reasoning within the news article do not contain obvious contradictions, and the prediction result is authentic.

[0112] For example, in a social media anti-fraud application, prediction dimensions might include sentiment consistency and contextual relevance. The processed text might be a social media review about a product experience. Authenticity prediction: Sentiment consistency: If sentiment analysis of the review reveals an unusually positive evaluation of the product, inconsistent with other reviews in the user's purchase history, the prediction is negative. Contextual relevance: If the review content doesn't match the product's characteristics or context, the prediction is negative.

[0113] As an example, in the application scenario of academic integrity testing, the prediction dimensions are: content authenticity and originality. The processed text is a submitted academic paper. Authenticity prediction: Content authenticity: After comparing with academic databases, it is found that some data in the paper has been tampered with, and the prediction result is not authentic. Originality: After checking with plagiarism detection software, it is found that large sections of the paper are plagiarized from other documents, and the prediction result is not authentic.

[0114] For example, in the application scenario of online language detection, the prediction dimensions include content authenticity, source reliability, and logical consistency. The processed text is a widely circulated online post. Authenticity prediction: Content authenticity: If the information mentioned in the post cannot be verified through reliable channels, the prediction result is not authentic. Source reliability: If the poster's account has a history of posting false information, the prediction result is not authentic. Logical consistency: If the argument in the post contains obvious logical loopholes, the prediction result is not authentic.

[0115] In some embodiments, referring to FIG. 6 , FIG. 6 is a flowchart diagram three of the text processing method provided in an embodiment of the present application. Step 102 shown in FIG. 3 can be implemented through steps 1021 to 1024 shown in FIG. 6 .

[0116] In step 1021 , the authenticity prediction network corresponding to each prediction dimension is obtained, and the following steps 1022 to 1024 are performed for each prediction dimension.

[0117] In some embodiments, the above-mentioned authenticity prediction can be achieved through an authenticity prediction network. The above-mentioned authenticity prediction network corresponds one-to-one to the prediction dimension, that is, different prediction dimensions correspond to different authenticity prediction networks. The network structure of the authenticity prediction network under different prediction dimensions is the same, but the network parameters are different. The network structure of the authenticity prediction network can include convolutional layers, pooling layers and normalization layers.

[0118] In some embodiments, when the number of prediction dimensions is one, the above-mentioned acquisition of the authenticity prediction network corresponding to each prediction dimension can be achieved in the following manner: obtaining an initial prediction network, and obtaining multiple text feature samples corresponding to the text sample, as well as the authenticity label score of each text feature sample; for each text feature sample, calling the initial prediction network, and based on the text feature sample, performing authenticity prediction on the logic of the text sample in the prediction dimension, obtaining the authenticity score corresponding to the text feature sample, and combining the authenticity score and the corresponding authenticity label score to determine the loss value corresponding to the text feature sample; based on the loss value corresponding to each text feature sample, training the initial prediction network to obtain the authenticity prediction network corresponding to the prediction dimension.

[0119] As an example, in the application scenario of checking the authenticity of comments on social media platforms, the initial prediction network can be a deep learning-based classification model used to predict the authenticity of text. The text feature samples can be feature vectors obtained through preprocessing and feature extraction of comments collected from social media platforms. The authenticity label score can be the authenticity label of each comment, typically manually annotated, indicating whether the comment is real or fake. Text sample 1: The comment content "This product is really great, I love it!"; Text feature sample 1: The feature vector obtained through feature extraction, such as a bag-of-words model or word embedding. Authenticity label score 1: 0.9 (indicating that this comment is likely authentic). Collect a large number of social media comments and their corresponding authenticity label scores. Preprocess these comments and extract text features to obtain a set of text feature samples and corresponding authenticity label scores. For each text feature sample, call the initial prediction network to make an authenticity prediction. Assume that for text feature sample 1, the initial prediction network gives an authenticity score of 0.85. Use a loss function (such as cross-entropy loss or mean squared error) to calculate the difference between the predicted score and the true label score. For text feature sample 1, the loss might be calculated as (0.9-0.85)^2. The loss values ​​for all text feature samples are used to train the initial prediction network. Optimization algorithms such as backpropagation and gradient descent are used to adjust network parameters and reduce the loss. After sufficient training iterations, the initial prediction network gradually learns and improves its prediction capabilities. Ultimately, the trained network becomes a truth prediction network for a specific prediction dimension.

[0120] In some embodiments, the above-mentioned authenticity scores correspond one-to-one to text feature samples, and the text feature samples correspond one-to-one to authenticity label scores. The above-mentioned combination of authenticity scores and corresponding authenticity label scores is used to determine the loss value corresponding to the text feature sample. This can be achieved in the following way: subtract the authenticity score of the text feature sample from the authenticity label score of the text feature sample to obtain the loss value corresponding to the text feature sample.

[0121] As an example, the loss expression of a text feature sample can be:

[0122] L1=F1-F2 (1)

[0123] Among them, L1 is used to indicate the loss value of the text feature sample, F1 is used to indicate the authenticity score of the text feature sample, and F2 is used to indicate the authenticity label score of the text feature sample.

[0124] In some embodiments, the above-mentioned acquisition of multiple text feature samples corresponding to the text sample can be achieved by: acquiring the text sample and performing feature encoding on the text sample to obtain the initial text features of the text sample; performing feature splitting on the initial text features of the text sample to obtain multiple text feature samples corresponding to the text sample.

[0125] In some embodiments, the above-mentioned feature splitting of the initial text features of the text sample to obtain multiple text feature samples corresponding to the text sample can be achieved as follows: the following processing is performed on each feature character in the initial text feature: the feature character is determined as the target feature character, and the target feature character and other feature characters in the initial text feature are randomly combined to obtain at least one text feature sample corresponding to the target feature character.

[0126] In some embodiments, each text feature sample corresponding to the text sample is a sub-feature of the initial text feature of the text sample.

[0127] As an example, the initial text feature may be: 1234567, and the multiple text feature samples corresponding to the text sample may be: 12, 123, 1234, 12345, 123456, 23, 234, and so on.

[0128] In this way, by feature encoding the text sample, the initial text feature of the text sample is obtained, and the initial text feature of the text sample is feature split to obtain multiple text feature samples corresponding to the text sample, thereby effectively expanding the number of training samples of the initial prediction network and effectively improving the prediction performance of the trained authenticity prediction network.

[0129] In some embodiments, when there are multiple prediction dimensions, the above-mentioned acquisition of the authenticity prediction network corresponding to each prediction dimension can be implemented as follows: obtain an initial prediction network, and obtain the first text feature sample corresponding to the text sample of the first prediction dimension, and the first authenticity label score of the first text feature sample; call the initial prediction network, and based on the first text feature sample, perform authenticity prediction on the logic of the text sample of the first prediction dimension to obtain the first authenticity score, and combine the first authenticity score and the first authenticity label score to train the initial prediction network to obtain the authenticity prediction network corresponding to the first prediction dimension; traverse j to perform the following processing: obtain the j-1th authenticity score corresponding to the text sample of the j-1th prediction dimension, and train the initial prediction network based on the j-1th authenticity score to obtain the authenticity prediction network corresponding to the j-1th prediction dimension.

[0130] In some embodiments, 2≤j≤M, where M indicates the number of prediction dimensions.

[0131] As an example, in the application scenario of multi-dimensional authenticity prediction of online news, a general deep learning classification model is used to predict the authenticity of text. Text sample: news articles collected from the Internet. Feature extraction: preprocess the text sample and extract features, such as TF-IDF, word embedding, etc. First prediction dimension: content authenticity: obtain the first text feature sample and authenticity label score: select news samples related to content authenticity, such as news health statements, etc. Perform feature extraction on these news to obtain the first text feature sample. Assign authenticity label scores to each sample, which are usually generated by experts or manual annotations. Text sample 1: a news article about the effectiveness of vaccines. First text feature sample 1: feature vector extracted by TF-IDF. First authenticity label score 1: 0.8 (indicating that this news is considered to be true). Use the initial prediction network to predict the authenticity of the first text feature sample and obtain the first authenticity score. Assume that for the first text feature sample 1, the output authenticity score of the initial prediction network is 0.75. Calculate a loss value, such as cross-entropy loss, and combine the first authenticity score and the first authenticity label score. Train the initial prediction network through backpropagation and gradient descent to optimize the network parameters. j-1 prediction dimension: source reliability, logical consistency, etc. For each subsequent prediction dimension j, perform the following steps: Obtain text samples and authenticity scores for the j-1 prediction dimension: Using the same text samples as the previous step, extract features related to the j-1 prediction dimension. Obtain the manually annotated authenticity scores for the j-1 prediction dimension. Train the authenticity prediction network for the j-1 prediction dimension: Further train the initial prediction network based on the text samples and authenticity scores for the j-1 prediction dimension. For each sample, calculate the loss value and update the network parameters. Ultimately, a specialized prediction network is obtained for each prediction dimension. A dedicated authenticity prediction network is trained independently for each prediction dimension, and each network is specialized for its corresponding authenticity evaluation criterion, ensuring that each dimension receives sufficient attention and optimization, thereby achieving higher accuracy and reliability in multi-dimensional authenticity detection tasks.

[0132] In some embodiments, the above-mentioned acquisition of the first text feature sample corresponding to the text sample of the first prediction dimension can be achieved by: obtaining the text sample of the first prediction dimension, and performing feature encoding on the text sample of the first prediction dimension to obtain the initial text features of the text sample of the first prediction dimension; and performing feature splitting on the initial text features of the text sample of the first prediction dimension to obtain multiple first text feature samples of the text sample of the first prediction dimension.

[0133] In some embodiments, the above-mentioned combination of the first authenticity score and the first authenticity label score to train the initial prediction network to obtain the authenticity prediction network corresponding to the first prediction dimension can be achieved as follows: the difference between the first authenticity score and the first authenticity label score is determined as the loss value of the first prediction dimension, and based on the loss value of the first prediction dimension, the initial prediction network is trained to obtain the authenticity prediction network corresponding to the first prediction dimension.

[0134] In some embodiments, by obtaining the j-1th authenticity score corresponding to the text sample of the j-1th prediction dimension, the initial prediction network is trained based on the j-1th authenticity score to obtain the authenticity prediction network corresponding to the j-1th prediction dimension, so that the authenticity prediction network corresponding to the j-1th prediction dimension can effectively refer to the network parameters of the authenticity prediction network corresponding to the j-1th prediction dimension, so that the prediction direction of the authenticity prediction network corresponding to the j-1th prediction dimension remains orthogonal to the prediction direction of the authenticity prediction network corresponding to the j-1th prediction dimension, thereby effectively improving the prediction independence between the authenticity prediction networks of different prediction dimensions.

[0135] As an example, the first authenticity score corresponding to the text sample of the first prediction dimension is obtained, and the initial prediction network is trained based on the first authenticity score to obtain the authenticity prediction network corresponding to the second prediction dimension; the second authenticity score corresponding to the text sample of the second prediction dimension is obtained, and the initial prediction network is trained based on the second authenticity score to obtain the authenticity prediction network corresponding to the third prediction dimension.

[0136] In some embodiments, the above-mentioned training of the initial prediction network based on the j-1th authenticity score to obtain the authenticity prediction network corresponding to the j-th prediction dimension can be achieved as follows: obtaining the j-th text feature sample corresponding to the text sample of the j-th prediction dimension, and the j-th authenticity label score of the j-th text feature sample; calling the initial prediction network, and performing authenticity prediction on the logic of the text sample of the j-th prediction dimension based on the j-th text feature sample to obtain the j-th authenticity score; combining the j-th authenticity score and the j-1th authenticity score to determine the first loss value, and combining the j-th authenticity score and the j-th authenticity label score to determine the second loss value; combining the first loss value and the second loss value to train the initial prediction network to obtain the authenticity prediction network corresponding to the j-th prediction dimension.

[0137] In some embodiments, the expression of the first loss value may be:

[0138] Among them, L orth Used to indicate the first loss value, θ t Used to indicate the j-th authenticity score, θ rUsed to indicate the j-1th authenticity score.

[0139] In some embodiments, the expression of the second loss value may be:

[0140] L2=F3-F4 (3)

[0141] Among them, L2 is used to indicate the second loss value, F3 is used to indicate the j-th authenticity score, and F4 is used to indicate the j-th authenticity label score.

[0142] In some embodiments, the above-mentioned combination of the first loss value and the second loss value to train the initial prediction network to obtain the authenticity prediction network corresponding to the j-th prediction dimension can be achieved as follows: summing the first loss value and the second loss value to obtain the total loss of the j-th prediction dimension, and based on the total loss, training the initial prediction network to obtain the authenticity prediction network corresponding to the j-th prediction dimension.

[0143] In this way, by obtaining the j-1th authenticity score corresponding to the text sample of the j-1th prediction dimension, the initial prediction network is trained based on the j-1th authenticity score to obtain the authenticity prediction network corresponding to the j-1th prediction dimension, so that the authenticity prediction network corresponding to the j-1th prediction dimension can effectively refer to the network parameters of the authenticity prediction network corresponding to the j-1th prediction dimension, so that the prediction direction of the authenticity prediction network corresponding to the j-1th prediction dimension remains orthogonal to the prediction direction of the authenticity prediction network corresponding to the j-1th prediction dimension, thereby effectively improving the prediction independence between the authenticity prediction networks of different prediction dimensions.

[0144] In step 1022, the corresponding authenticity prediction network is called to perform authenticity prediction on the logic of the text to be processed in the prediction dimension based on the initial text features to obtain the authenticity score of the text to be processed in the prediction dimension.

[0145] In some embodiments, the above step 1022 can be implemented as follows: for each prediction dimension, call the authenticity prediction network corresponding to the prediction dimension, and based on the initial text features, perform authenticity prediction on the logic of the text to be processed in the prediction dimension to obtain the authenticity score of the text to be processed in the prediction dimension.

[0146] As an example, the prediction dimensions include prediction dimension A, prediction dimension B and prediction dimension C. The authenticity prediction network corresponding to prediction dimension A is called, and based on the initial text features, the authenticity prediction is performed on the logic of the text to be processed in prediction dimension A to obtain the authenticity score of the text to be processed in prediction dimension A; the authenticity prediction network corresponding to prediction dimension B is called, and based on the initial text features, the authenticity prediction is performed on the logic of the text to be processed in prediction dimension B to obtain the authenticity score of the text to be processed in prediction dimension B; the authenticity prediction network corresponding to prediction dimension C is called, and based on the initial text features, the authenticity prediction is performed on the logic of the text to be processed in prediction dimension C to obtain the authenticity score of the text to be processed in prediction dimension C.

[0147] In step 1023, when the authenticity score is greater than or equal to the score threshold, the authenticity prediction result of the prediction dimension is determined as the first result.

[0148] In some embodiments, the first result is used to indicate that the text to be processed is true under the predicted dimension.

[0149] In some embodiments, the above-mentioned score threshold can be specifically set according to the actual application scenario, and the above-mentioned score threshold is used to determine whether the text to be processed is authentic under the prediction dimension.

[0150] In step 1024, when the authenticity score is less than the score threshold, the authenticity prediction result of the prediction dimension is determined as the second result.

[0151] In some embodiments, the second result is used to indicate that the text to be processed is not authentic under the predicted dimension.

[0152] In some embodiments, after the above step 102, the target text can also be determined in the following manner: when the authenticity prediction results of each prediction dimension indicate that the text to be processed is authentic under the corresponding prediction dimension, the initial text features are feature decoded to obtain the target text corresponding to the text to be processed.

[0153] In some embodiments, when the authenticity prediction results of each prediction dimension indicate that the text to be processed is authentic under the corresponding prediction dimension, it means that the text obtained by feature decoding the initial text features can be authentic under each prediction dimension. At this time, the text obtained by feature decoding the initial text features can be determined as the target text corresponding to the text to be processed.

[0154] In this way, when the authenticity prediction results indicate that the text to be processed may be untrue under a specific prediction dimension, feature correction can beneficially improve the accuracy of text authenticity detection. By making targeted adjustments to the i-1th initial text features to obtain the i-1th target text features, the impact of features inconsistent with the prediction results can be effectively removed or reduced, allowing subsequent feature encoding and network training to focus more on real text information. When all prediction dimensions indicate that the text to be processed is authentic, keeping the i-1th initial text features unchanged helps retain important information in the text and avoid unnecessary feature distortion. This dynamic feature processing method not only improves the robustness of the model, but also optimizes the model's ability to recognize real text, ultimately significantly improving the performance and reliability of authenticity detection.

[0155] In step 103, for each prediction dimension, when the authenticity prediction result of the prediction dimension indicates that the text to be processed does not have authenticity under the prediction dimension, a modified feature of the initial text feature under the prediction dimension is obtained.

[0156] As an example, the prediction dimensions correspond one-to-one to the authenticity prediction results. When the authenticity prediction result indicates that the text to be processed is not authentic under the prediction dimension A, the corrected features of the initial text features under the prediction dimension A are obtained. When the authenticity prediction result indicates that the text to be processed is not authentic under the prediction dimension B, the corrected features of the initial text features under the prediction dimension B are obtained.

[0157] In some embodiments, the above-mentioned correction features are used to correct the corresponding feature dimensions of the initial text features, so that the text obtained by feature decoding the corrected initial text features can be authentic under the corresponding feature dimensions.

[0158] For example, in the application scenario of news source reliability testing, the prediction dimension is: Source reliability: The processed text is a news report from an unknown source. The authenticity prediction result: The prediction result indicates that the reliability of the news source is low. Correction features: Adjust the initial text features to add signals related to source reliability, such as the news source's domain reputation and historical publication history, thereby increasing the feature weight of the text from an unreliable source.

[0159] In some embodiments, the above-mentioned acquisition of the corrected features of the initial text features under the corresponding prediction dimension can be achieved in the following manner: obtaining a dimension-feature mapping relationship, when the authenticity prediction result indicates that the text to be processed is not authentic under the corresponding prediction dimension, determining the corresponding prediction dimension as the target prediction dimension, querying the target index entry including the target prediction dimension from the dimension-feature mapping relationship, and determining the features in the target index entry as the corrected features of the target prediction dimension.

[0160] In step 104 , feature correction is performed on the initial text feature based on the correction feature to obtain the target text feature corresponding to the initial text feature.

[0161] In some embodiments, the feature correction is used to correct the initial text features so that the obtained target text features are feature decoded and the obtained target text is authentic in each prediction dimension.

[0162] In some embodiments, when the number of correction features is one, the correction feature is used as a reference correction feature, and step 104 shown in Figure 3 can be implemented as follows: based on the reference correction feature, the initial text feature is feature corrected to obtain the target text feature corresponding to the initial text feature.

[0163] In some embodiments, referring to FIG7 , FIG7 is a flow chart diagram four of the text processing method provided in an embodiment of the present application. The correction features correspond one-to-one to the target prediction dimensions. The text to be processed is not authentic under the target prediction dimensions. When the number of correction features is multiple, step 104 shown in FIG3 can be implemented through steps 1041 to 1043 shown in FIG7 .

[0164] In step 1041, the authenticity scores of the text to be processed under each target prediction dimension are obtained, and each authenticity score is determined as the weight of the corresponding correction feature.

[0165] As an example, the correction features correspond one-to-one to the target prediction dimensions, which include prediction dimension 1, prediction dimension 2, and prediction dimension 3. The authenticity score 11 of the text to be processed under the target prediction dimension 1 is obtained, the authenticity score 21 of the text to be processed under the target prediction dimension 2 is obtained, and the authenticity score 31 of the text to be processed under the target prediction dimension 3 is obtained. The authenticity score 11 is determined as the weight of the correction feature corresponding to the target prediction dimension 1, the authenticity score 21 is determined as the weight of the correction feature corresponding to the target prediction dimension 2, and the authenticity score 31 is determined as the weight of the correction feature corresponding to the target prediction dimension 3.

[0166] In step 1042, weighted fusion is performed on each correction feature according to its weight to obtain a reference correction feature.

[0167] As an example, the expression of the reference correction feature can be:

[0168] T=ω1T1+ω2T2+…ω t T t (4)

[0169] Where T is used to indicate the reference correction characteristic, ω1 to ω tIndicates the weight of each correction feature, T1 to T t Used to indicate a correction feature.

[0170] In step 1043 , feature correction is performed on the initial text feature based on the reference correction feature to obtain the target text feature corresponding to the initial text feature.

[0171] In some embodiments, the above-mentioned step 1043 can be implemented as follows: obtain the feature dimension of the initial text feature and the feature dimension of the reference correction feature; when the feature dimension of the initial text feature is different from the feature dimension of the reference correction feature, adjust the feature dimension of the reference correction feature to obtain the target correction feature; when the feature dimension of the initial text feature is the same as the feature dimension of the reference correction feature, determine the reference correction feature as the target correction feature; based on the number of correction features, determine the correction strength of the initial text feature, and the correction strength is positively correlated with the number of correction features; determine the product of the correction strength and the target correction feature as the fusion feature, and add the initial text feature and the fusion feature to obtain the target text feature.

[0172] In some embodiments, when the feature dimension of the initial text feature is different from the feature dimension of the reference correction feature, the feature dimension of the reference correction feature is adjusted to obtain a target correction feature, and the feature dimension of the target correction feature is the same as the feature dimension of the initial text feature.

[0173] As an example, the expression of the above target text feature can be:

[0174] Q=Q1+Q2 (5)

[0175] Among them, Q is used to indicate the target text features, Q1 is used to indicate the initial text features, and Q2 is used to indicate the fusion features.

[0176] As an example, the expression of the above fusion feature can be:

[0177] Q2=αT m (6)

[0178] Among them, Q2 is used to indicate the fusion feature, α is used to indicate the correction strength, and T m Used to indicate target correction characteristics.

[0179] In this way, by correcting the corresponding feature dimensions of the initial text features, the text obtained by feature decoding the corrected initial text features can be authentic under the corresponding feature dimensions, thereby effectively improving the accuracy of the generated target text.

[0180] In this way, by dynamically adjusting feature weights based on the text authenticity assessment of each prediction dimension, we can maintain key information while weakening or eliminating potentially untrue or misleading information. The reference corrected features obtained by weighted fusion of the corrected features can more accurately reflect the authenticity of the text, and the initial text features can then be precisely corrected based on these reference corrected features. Ultimately, the resulting target text features not only better represent the authenticity of the text, but also improve the performance and reliability of subsequent authenticity prediction models, making them more effective and robust when processing complex and diverse text data.

[0181] In step 105, the target text features are decoded to obtain the target text corresponding to the text to be processed, and the target text is authentic under each prediction dimension.

[0182] In some embodiments, referring to FIG8 , FIG8 is a flowchart diagram five of the text processing method provided in an embodiment of the present application, and step 105 shown in FIG3 can be implemented through steps 1051 to 1053 shown in FIG8 .

[0183] In step 1051, the task type of the text to be processed is obtained, and the task prediction network corresponding to the task type is obtained.

[0184] In some embodiments, the task types of the text to be processed may include various natural language processing task types such as translation task type, public opinion detection task type, automatic summarization task type, opinion extraction task type, text classification task type, question answering task type, text semantic comparison task type, and speech recognition task type. The task types correspond one-to-one to the task prediction networks.

[0185] In step 1052, when the task type is an answer prediction task for answering the text to be processed, the task prediction network corresponding to the answer prediction task is called to predict the answer to the text to be processed based on the target text features to obtain the answer text corresponding to the text to be processed.

[0186] In some embodiments, the answer text is true under each prediction dimension.

[0187] In some embodiments, the network structure of the task prediction network may include a convolution layer and a prediction layer. The above-mentioned calling of the task prediction network corresponding to the answer prediction task, performing answer prediction on the text to be processed based on the target text features, and obtaining the answer text corresponding to the text to be processed can be achieved in the following way: calling the convolution layer of the task prediction network corresponding to the answer prediction task, performing feature convolution on the target text features, obtaining target convolution features, calling the prediction layer of the task prediction network corresponding to the answer prediction task, performing text prediction on the target text features, and obtaining the answer text corresponding to the text to be processed.

[0188] As an example, the text to be processed is "How old are you today?", and the answer text corresponding to the text to be processed may be "I am 26 years old this year."

[0189] In step 1053, when the task type is a translation task for translating a text to be processed, the task prediction network corresponding to the translation task is called to translate the text to be processed based on the target text features to obtain a translation text corresponding to the text to be processed.

[0190] In some embodiments, the translated text is true in each prediction dimension.

[0191] In some embodiments, the network structure of the task prediction network may include a convolution layer and a prediction layer. The above-mentioned calling of the task prediction network corresponding to the translation task, translating the text to be processed based on the target text features, and obtaining the translation text corresponding to the text to be processed can be achieved in the following way: calling the convolution layer of the task prediction network corresponding to the translation task, performing feature convolution on the target text features, obtaining target convolution features, calling the prediction layer of the task prediction network corresponding to the translation task, performing text prediction on the target text features, and obtaining the translation text corresponding to the text to be processed.

[0192] For example, the text to be processed is “How old are you this year?”, and the translation text corresponding to the text to be processed can be “How old are you this year?”.

[0193] In this way, by performing feature encoding on the text to be processed, the initial text features of the text to be processed are obtained. Based on the initial text features, authenticity prediction is performed on the logic of the text to be processed in at least one prediction dimension to obtain the authenticity prediction results of the text to be processed in each prediction dimension. When the authenticity prediction result indicates that the text to be processed is not authentic under the corresponding prediction dimension, the correction features under the corresponding prediction dimension are obtained. Based on the correction features, the initial text features are feature-corrected to obtain the target text features corresponding to the initial text features. The target text features are feature-decoded to obtain the target text that is authentic under each prediction dimension. In this way, by performing authenticity prediction on the logic of the text to be processed in at least one prediction dimension based on the initial text features, the authenticity prediction results of the text to be processed in each prediction dimension are obtained. By performing feature correction on the initial text features to obtain the target text features, the target text features are feature-decoded, so that the target text is authentic under each prediction dimension, thereby effectively improving the accuracy of the target text and effectively improving the accuracy of text processing.

[0194] Below, an exemplary application of the embodiment of the present application in an actual application scenario of answering questions will be described.

[0195] In recent years, Transformer-based pre-trained language models have achieved remarkable success in natural language processing tasks. However, these models often produce unrealistic information in generation tasks. The text processing method provided in the embodiments of this application can identify the true direction within the model through multi-directional probes and use them to intervene in the language model generation process to improve the authenticity of the generated results.

[0196] To clarify notation and context, we will briefly introduce some key elements of the Transformer architecture and consider the multi-head attention mechanism (MHA) as a way to independently add attention-weighted vectors to the residual stream.

[0197] The core component of the Transformer is a series of Transformer layers of equal size. In this application example, the variable l is used to represent these layers. Each Transformer layer contains two key modules: a multi-head attention (MHA) mechanism and a standard multi-layer perceptron (MLP) layer. This application example mainly introduces the MHA layer, which is where TrFr implements training probes and intervention generation.

[0198] In each Transformer layer, MHA consists of H independent linear operations, while MLP is responsible for all nonlinear operations. Specifically, MHA can be expressed as:

[0199] in, Map the stream activation to a D-dimensional low-dimensional head space (Head), Map it back to the original high-dimensional space. Att is an attention calculation operator used to communicate with other input tokens. The probe training and intervention in the embodiment of this application occur after Att. Previously, activation was performed by x l ∈R D express.

[0200] The text processing method provided in the embodiment of the present application aims to identify the true direction inside the large model through multi-directional probes, and use it to intervene in the generation process of the large language model to improve the authenticity of the generated results.

[0201] The embodiment of the present application is based on the following assumption: when the large model outputs real and hallucinated content, the internal states are different. Specifically, when the large model inputs a text sequence, the neural network inside the large model will generate some implicit vector outputs (the embodiment of the present application uses the head output of the multi-head attention as a probe of the authenticity of the large model). The embodiment of the present application constructs a batch of probes to judge whether the content generated by the large model at this time is real content and hallucination based on these implicit vector outputs. These probes can also assist the model in conducting authenticity intervention on the results generated by the large model, so that the large model can make relevant but more objective and true responses.

[0202] In some embodiments, referring to FIG9 , FIG9 is a second schematic diagram of the principle of the text processing method provided by an embodiment of the present application, by focusing on the smallest state unit in the Transformer - the head in the multi-head attention (MHA), and using this as a target for positioning and intervention. The embodiment of the present application introduces multiple probes for each head (the 1st layer, the 2nd layer... the nth layer as shown in FIG9 ), and enforces orthogonal constraints between the probes to prevent the model from collapsing. By optimizing the orthogonal probes, and introducing an orthogonality loss function to maintain the orthogonality between the probes. Studies on the internal state probes of language models have shown that language models often have the ability to distinguish lies from the truth, but cannot effectively generate facts. The embodiment of the present application extracts features by considering the extended range in the sequence. Specifically, the embodiment of the present application samples from a predefined distribution and truncates the sequence at different positions to obtain different features, so that the learned direction is more stable and can be generalized to different positions during the generation process. After the training is completed, an orthogonal vector pointing to the authenticity can be obtained. In the embodiment of the present application, the final orthogonal vector is calculated by using exponential decay weights and the heads are sorted to obtain the final intervention vector. When intervening in the MHA layer, it is modified to a constant. Since the additional term in each step is a constant, the time complexity of using TrFr is O(1).

[0203] In some embodiments, referring to FIG9 , for the probe shown in FIG9 , for each head, the present application embodiment introduces a classifier As a probe, the input is in is the result of l2-norm.

[0204] This embodiment of the application introduces multiple probes for each head and enforces orthogonal constraints between the probes:

[0205] Θ={θ1,θ2,…,θ k}, θ i ⊥θ j ,i≠j (8)

[0206] The embodiment of the present application optimizes orthogonal probes and introduces an orthogonality loss function:

[0207] By minimizing the loss, the embodiments of the present application encourage probes to remain orthogonal to each other, thereby capturing different aspects of the authenticity of the model's internal representation. The total loss function for each probe is:

[0208] L total =L ce +λL orth +μL2 (10)

[0209] By adjusting λ and μ, the embodiments of the present application can control the trade-off between the accuracy and orthogonality of the probe.

[0210] The present embodiment extracts features by considering the extended range in the sequence. Specifically, the present embodiment samples from a predefined distribution and truncates the sequence at different positions to obtain different features, making the learned direction more stable and generalizable to different positions during the generation process.

[0211] In some embodiments, the embodiments of the present application stipulate that D is a question-and-answer dataset about hallucinations, and each question contains wrong and correct answers; Φ can be an arbitrarily defined distribution, and Transformer is the generative model to be intervened in the embodiments of the present application.

[0212] As an example, the pseudo code for extracting features by considering the extended range in the sequence provided in the embodiment of the present application is described in detail below:

[0213] Input: dataset D, language model LM, predefined distribution The number of layers is num_layers, the number of heads is num_heads;

[0214] Output: multi-head attention feature F;

[0215] Initialize the function list: F is an empty table;

[0216] For each (Q, A)∈D do; / / For each pair (Q, A) belonging to D, perform the following processing:

[0217] Sample / / Sampling Z follows the distribution

[0218] S=(Q,A), S1=(Q,A1), where A1=(a1,a2,…,az), and A=(a1,a2,…,aL); / / Define S1 as (Q,A1), where A1 is a subsequence of A containing the first z elements (a1,a2,…,az), and A contains all elements (a1,a2,…,aL);

[0219] For each layer l in range(num_layer) do; / / For each layer l from 0 to num_layers-1, execute:

[0220] For each head h in range(num_heads) do; / / For each head h from 0 to num_heads-1:

[0221] Transformer(S1)=Xh; / / Transformer(S1) obtains Xh;

[0222] Append Xh to F; / / Add Xh to the end of F;

[0223] End for;

[0224] End for;

[0225] End for;

[0226] Return F;

[0227] In some embodiments, after the training is completed, the embodiment of the present application obtains an orthogonal vector pointing to the authenticity. The embodiment of the present application calculates the final orthogonal vector by using exponential decay weights and sorts the heads to obtain the final intervention vector:

[0228] Among them, w k is the weight factor, θ l,h,k is the kth orthogonal vector at position (l, h).

[0229] When intervening in the MHA layer, the embodiment of the present application modifies it to a constant:

[0230] Among them, x l and x l+1 represents the input and output of layer l, and is the MHA component, H is the number of heads, α is the intervention intensity, The embodiment of the present application uses another data set with the same distribution to calculate and restore the standard deviation of the directional modulus before l2-norm normalization. is the effective intervention vector of the probe after the Top-K accuracy screening. Since the intervention term in each step is a constant, the time complexity of using TrFr is O(1).

[0231] In some embodiments, a question-and-answer dataset is obtained, which contains questions and their corresponding common correct or incorrect answers. The embodiment of the present application first uses the language model to be intervened (such as LLaMA-7B) to extract features. Then, the embodiment of the present application selects a suitable sampling distribution based on the hyperparameter, uses the random peeking method to truncate the input sequence from different positions, and obtains the features of each position inside the language model after inputting the model. These features are then used to train probes that are orthogonal to each other at each position. The embodiment of the present application can capture different aspects of the authenticity of the representation inside the model. After the training is completed, the embodiment of the present application obtains an orthogonal vector pointing to the authenticity. The final intervention vector is obtained after integrating the direction of the probe group. In the generation task, that is, during actual reasoning, the embodiment of the present application selects effective probes for intervention (the embodiment of the present application obtains effective probes through some strategies, such as thresholds or topk screening). The embodiment of the present application can control the authenticity of the generated results by adjusting the intervention intensity. For example, when the embodiment of the present application hopes to generate an answer that is relevant to the question and true and neutral, a larger intervention intensity can be used. In this way, the generated answer will be more able to avoid hallucination results.

[0232] In this way, the embodiment of the present application improves the authenticity of the generated results through multi-directional intervention. The text processing method provided by the embodiment of the present application may include using orthogonal probes to represent authenticity, using random peeking methods to alleviate the generation-discrimination gap, and implementing a true forest and intervention process. By training orthogonal probes, the embodiment of the present application can capture different aspects of the authenticity of the internal representation of the model, and the random peeking method makes the learned direction more stable, which can be generalized to different positions in the generation process. In the generation task, the embodiment of the present application can control the authenticity of the generation result by adjusting the intervention intensity. In practical applications, the embodiment of the present application can be applied to various natural language processing tasks, such as text generation, question-answering systems, dialogue systems, etc. In addition, the embodiment of the present application can also be used in combination with other generation models (such as other large models, etc.) to further improve the authenticity and reliability of the generation results.

[0233] The embodiment of the present application tested the effectiveness of the method in open source datasets and open source models, and compared it with the mainstream fact-enhanced solution. By selecting an experimental dataset, a dataset that is strongly related to hallucination questions, and using multiple open source models for experiments. In this experiment, the indicators of the embodiment of the present application can be: Judgment index (True%): If the GPT model determines that the answer given by the language model is false, it is 0, otherwise it is 1, and the average is calculated in all questions and answers. Detailedness index (True*Info%): Info% measures the detailedness of the language model's answer. Info% is generated in the same way and then multiplied by True% to prevent the high True% caused by the language model's continuous refusal to answer. Probability index (MC%): Calculate the generation probability of the Ground True answer given by each TruthfulQA. If the correct answer ranks first, it is recorded as 1, otherwise it is 0, and then the average of all samples is calculated. First intervention index (CE): Calculate the Cross Entropy in the pre-training data, which represents the pre-training task loss of the language model, as one of the indicators to measure the intensity of intervention. The second intervention indicator (KL): Calculate the distribution distance of each word generated before and after the intervention as one of the indicators to measure the intensity of the intervention.

[0234] As an example, see Table 1 below, which is a schematic table (1) of experimental parameters provided in the examples of this application.

[0235] Table 1 Schematic table of experimental parameters provided in the examples of this application (1)

[0236] As an example, see Table 2 below, which is a schematic table (2) of experimental parameters provided in the examples of this application.

[0237] Table 2 Schematic table of experimental parameters provided in the examples of this application (2)

[0238] In some embodiments, the base model (Baseline) is the LLaMA-7B model before intervention, Random direction is a sample sampled from a random normal distribution as the direction, and TOP-K positions are randomly selected for intervention, which serves as a control group; ITI is two methods to improve the factuality of the language model, which serve as the baseline; Supervised Finetuning is a common downstream fine-tuning scheme in the language model, and Few-shot Prompting is a contextual learning method. In the embodiment of the present application, 80 correct question-answer pairs are extracted from TruthfulQA as prompt learning.

[0239] In some embodiments, in order to compare fairly with Few-shot Prompting, all methods in Few-shot setting use only 80 samples. In Full Data setting, the present embodiment uses the full dataset of TruthfulQA for 2-fold cross validation, with the ratio of train:valid:test = 4:1:5 for each fold.

[0240] Experimental results show that the text processing method provided by the embodiment of the present application has achieved significant performance improvements in a variety of scenarios. On a complete data set, the embodiment of the present application has better performance than the implementation method of the related art. Experimental results show that the embodiment of the present application can significantly improve True*Info% with minimal intervention at any stage. The embodiment of the present application was compared with the related art. In a small sample setting, the embodiment of the present application achieved better results while being compatible with FSP. CE and KL results show that the embodiment of the present application achieved better performance with minimal intervention while maintaining the amount of information.

[0241] Table 3 Schematic table of experimental parameters provided in the examples of this application (3)

[0242] The embodiments of the present application were tested on the fine-tuning model before fine-tuning the relevant model (pre-training model) and after fine-tuning. After introducing the text processing method provided by the embodiments of the present application, the performance of the models at different stages was significantly improved.

[0243] In some embodiments, referring to FIG10 , FIG10 is a schematic diagram of the experimental effect of the text processing method provided in an embodiment of the present application. By comparing the performance of the text generation model of the present application and related technologies on different types of data sets (for example, an educational topic data set, a financial topic data set, a fine-tuning data set, etc.), it can be seen from FIG10 that the embodiment of the present application can improve the performance of the text generation model on almost all categories of data sets.

[0244] In this way, the embodiment of the present application improves the authenticity of the generated results through multi-directional intervention, which can effectively solve the problem of pre-trained language models generating untrue information in generation tasks. The embodiment of the present application can effectively alleviate the generation-discrimination gap, make the learned direction more stable, and generalize to different positions in the generation process. The embodiment of the present application has low time complexity and is easy to implement and apply. The embodiment of the present application can be applied to various natural language processing tasks and has wide practicality. The embodiment of the present application can be used in combination with other generation models to further improve the authenticity and reliability of the generation results. By adjusting the intervention intensity, the user can control the authenticity of the generation results as needed and improve the quality of the generation results.

[0245] In this way, by performing feature encoding on the text to be processed, the initial text features of the text to be processed are obtained. Based on the initial text features, authenticity prediction is performed on the logic of the text to be processed in at least one prediction dimension to obtain the authenticity prediction results of the text to be processed in each prediction dimension. When the authenticity prediction result indicates that the text to be processed is not authentic under the corresponding prediction dimension, the correction features under the corresponding prediction dimension are obtained. Based on the correction features, the initial text features are feature-corrected to obtain the target text features corresponding to the initial text features. The target text features are feature-decoded to obtain the target text that is authentic under each prediction dimension. In this way, by performing authenticity prediction on the logic of the text to be processed in at least one prediction dimension based on the initial text features, the authenticity prediction results of the text to be processed in each prediction dimension are obtained. By performing feature correction on the initial text features to obtain the target text features, the target text features are feature-decoded, so that the target text is authentic under each prediction dimension, thereby effectively improving the accuracy of the target text and effectively improving the accuracy of text processing.

[0246] It is understandable that in the embodiments of the present application, when it involves relevant data such as text to be processed, 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.

[0247] The following continues to describe an exemplary structure of a text processing device 455 provided in an embodiment of the present application implemented as a software module. In some embodiments, as shown in FIG2 , the software modules stored in the text processing device 455 of the memory 450 may include: a feature encoding module 4551, configured to perform feature encoding on the text to be processed to obtain the initial text features of the text to be processed; an authenticity prediction module 4552, configured to perform authenticity prediction on the logic of the text to be processed in at least one prediction dimension based on the initial text features to obtain the authenticity prediction results of the text to be processed in each of the prediction dimensions; and obtaining Module 4553 is configured to obtain, for each prediction dimension, a corrected feature of the initial text feature under the prediction dimension when the authenticity prediction result of the prediction dimension indicates that the text to be processed is not authentic under the prediction dimension; a feature correction module 4554 is used to perform feature correction on the initial text feature based on the corrected feature to obtain a target text feature corresponding to the initial text feature; a feature decoding module 4555 is configured to perform feature decoding on the target text feature to obtain a target text corresponding to the text to be processed, and the target text has the authenticity under each of the prediction dimensions.

[0248] In some embodiments, the above-mentioned feature encoding is implemented by at least one feature encoding network. The above-mentioned feature encoding module is further configured to call the first feature encoding network to perform feature encoding on the to-be-processed text, obtaining the first initial text feature; traverse i and perform the following processing: call the i-th feature encoding network, and based on the (i - 1)-th initial text feature, perform feature encoding on the to-be-processed text, obtaining the i-th initial text feature; where 1 < i ≤ N, and N is used to indicate the number of the feature encoding networks; determine the N-th initial text feature as the initial text feature of the to-be-processed text.

[0249] In some embodiments, the above-mentioned text processing device further includes: a feature checking module, configured to perform authenticity prediction on the logic of the to-be-processed text in each of the prediction dimensions based on the (i - 1)-th initial text feature, obtaining the (i - 1)-th authenticity prediction result of the to-be-processed text in each of the prediction dimensions; perform feature checking on the (i - 1)-th initial text feature based on the (i - 1)-th authenticity prediction result, obtaining the (i - 1)-th target text feature; the above-mentioned feature encoding module is further configured to call the i-th feature encoding network, and based on the (i - 1)-th target text feature, perform feature encoding on the to-be-processed text, obtaining the i-th initial text feature.

[0250] In some embodiments, the above-mentioned feature checking module is further configured to, when there is a (i - 1)-th authenticity prediction result indicating that the to-be-processed text does not have the authenticity in the corresponding prediction dimension, perform feature correction on the (i - 1)-th initial text feature, obtaining the (i - 1)-th target text feature; when each of the (i - 1)-th authenticity prediction results indicates that the to-be-processed text has the authenticity in the corresponding prediction dimension, determine the (i - 1)-th initial text feature as the (i - 1)-th target text feature.

[0251] In some embodiments, the above-mentioned authenticity prediction module is further configured to obtain the authenticity prediction networks respectively corresponding to each of the prediction dimensions, and perform the following processing for each of the prediction dimensions respectively: call the corresponding authenticity prediction network, and based on the initial text feature, perform authenticity prediction on the logic of the to-be-processed text in the prediction dimension, obtaining the authenticity score of the to-be-processed text in the prediction dimension; when the authenticity score is greater than or equal to the score threshold, determine the authenticity prediction result of the prediction dimension as the first result, and the first result is used to indicate that the to-be-processed text has the authenticity in the prediction dimension; when the authenticity score is less than the score threshold, determine the authenticity prediction result of the prediction dimension as the second result, and the second result is used to indicate that the to-be-processed text does not have the authenticity in the prediction dimension.

[0252] In some embodiments, the above-mentioned authenticity prediction module is further configured to obtain an initial prediction network, and obtain multiple text feature samples corresponding to the text sample, as well as the authenticity label score of each of the text feature samples; for each of the text feature samples, the initial prediction network is called, and based on the text feature sample, the authenticity prediction of the logic of the text sample is performed in the prediction dimension to obtain the authenticity score corresponding to the text feature sample, and the loss value corresponding to the text feature sample is determined in combination with the authenticity score and the corresponding authenticity label score; based on the loss value corresponding to each of the text feature samples, the initial prediction network is trained to obtain the authenticity prediction network corresponding to the prediction dimension.

[0253] In some embodiments, the above-mentioned authenticity prediction module is further configured to obtain a text sample, and perform feature encoding on the text sample to obtain the initial text feature of the text sample; perform feature splitting on the initial text feature of the text sample to obtain multiple text feature samples corresponding to the text sample.

[0254] In some embodiments, the above-mentioned authenticity prediction module is further configured to obtain a text sample, and perform feature encoding on the text sample to obtain the initial text feature of the text sample; perform feature splitting on the initial text feature of the text sample to obtain multiple text feature samples corresponding to the text sample.

[0255] In some embodiments, the above-mentioned authenticity prediction module is further configured to obtain an initial prediction network, and obtain the first text feature sample corresponding to the text sample of the first prediction dimension, and the first authenticity label score of the first text feature sample; call the initial prediction network, and based on the first text feature sample, perform authenticity prediction on the logic of the text sample of the first prediction dimension to obtain the first authenticity score, and combine the first authenticity score and the first authenticity label score to train the initial prediction network to obtain the authenticity prediction network corresponding to the first prediction dimension; traverse j to perform the following processing: obtain the j-1th authenticity score corresponding to the text sample of the j-1th prediction dimension, and train the initial prediction network based on the j-1th authenticity score to obtain the authenticity prediction network corresponding to the j-1th prediction dimension; wherein, 2≤j≤M, M is used to indicate the number of the prediction dimensions.

[0256] In some embodiments, the above-mentioned authenticity prediction module is further configured to obtain the jth text feature sample corresponding to the text sample of the jth prediction dimension, and the jth authenticity label score of the jth text feature sample; call the initial prediction network, and perform authenticity prediction on the logic of the text sample of the jth prediction dimension based on the jth text feature sample to obtain the jth authenticity score; determine a first loss value in combination with the jth authenticity score and the j-1th authenticity score, and determine a second loss value in combination with the jth authenticity score and the jth authenticity label score; train the initial prediction network in combination with the first loss value and the second loss value to obtain the authenticity prediction network corresponding to the jth prediction dimension.

[0257] In some embodiments, the feature decoding module is further configured to perform feature decoding on the initial text features to obtain the target text corresponding to the text to be processed when the authenticity prediction results of each of the prediction dimensions indicate that the text to be processed has the authenticity under the corresponding prediction dimension.

[0258] In some embodiments, the above-mentioned correction features correspond one-to-one to the target prediction dimensions, and the text to be processed does not have the authenticity under the target prediction dimensions. The above-mentioned feature correction module is also configured to obtain the authenticity scores of the text to be processed under each of the target prediction dimensions, and determine each of the authenticity scores as the weight of the corresponding correction features; according to the weight of each of the correction features, weighted fusion is performed on each of the correction features to obtain the reference correction features; based on the reference correction features, feature correction is performed on the initial text features to obtain the target text features corresponding to the initial text features.

[0259] In some embodiments, the feature correction module is further configured to obtain the feature dimension of the initial text feature and the feature dimension of the reference correction feature; when the feature dimension of the initial text feature is different from the feature dimension of the reference correction feature, the feature dimension of the reference correction feature is adjusted to obtain a target correction feature; when the feature dimension of the initial text feature is the same as the feature dimension of the reference correction feature, the reference correction feature is determined as the target correction feature; based on the number of the correction features, the correction strength of the initial text feature is determined, and the correction strength is positively correlated with the number of the correction features; the product of the correction strength and the target correction feature is determined as a fusion feature, and the initial text feature and the fusion feature are added to obtain the target text feature.

[0260] In some embodiments, the feature decoding module is further configured to obtain the task type of the text to be processed and obtain a task prediction network corresponding to the task type; when the task type is an answer prediction task for answering the text to be processed, the task prediction network corresponding to the answer prediction task is called, and based on the target text features, the answer prediction is performed on the text to be processed to obtain the answer text corresponding to the text to be processed, and the answer text has the authenticity under each of the prediction dimensions; when the task type is a translation task for translating the text to be processed, the task prediction network corresponding to the translation task is called, and based on the target text features, the text to be processed is translated to obtain the translation text corresponding to the text to be processed, and the translation text has the authenticity under each of the prediction dimensions.

[0261] In some embodiments, the above-mentioned feature encoding module is further configured to obtain the authenticity prediction network corresponding to each of the prediction dimensions, and perform the following processing for each of the prediction dimensions: call the corresponding authenticity prediction network, and based on the i-1th initial text feature, perform authenticity prediction on the logic of the text to be processed in the prediction dimension to obtain the i-1th authenticity score of the text to be processed in the prediction dimension; when the i-1th authenticity score is greater than or equal to the score threshold, determine the i-1th authenticity prediction result of the prediction dimension as the text to be processed has authenticity under the prediction dimension; when the i-1th authenticity score is less than the score threshold, determine the i-1th authenticity prediction result of the prediction dimension as the text to be processed does not have authenticity under the prediction dimension.

[0262] In some embodiments, the feature encoding module is further configured to obtain an initial prediction network, obtain a first text feature sample corresponding to a text sample of the first prediction dimension, and a first authenticity label score of the first text feature sample; call the initial prediction network, perform authenticity prediction on the logic of the text sample of the first prediction dimension based on the first text feature sample, obtain a first authenticity score, and train the initial prediction network based on the first authenticity score and the first authenticity label score to obtain an authenticity prediction network corresponding to the first prediction dimension; traverse j and perform the following processing: obtain the j-1th authenticity score corresponding to the text sample of the j-1th prediction dimension, train the initial prediction network based on the j-1th authenticity score, and obtain an authenticity prediction network corresponding to the j-1th prediction dimension. Wherein, 2≤j≤M, M is used to indicate the number of prediction dimensions.

[0263] In some embodiments, the above-mentioned authenticity prediction module is further configured to perform the following processing for each feature character in the initial text feature: determine the feature character as the target feature character, and randomly combine the target feature character with other feature characters in the initial text feature to obtain at least one text feature sample corresponding to the target feature character.

[0264] In some embodiments, the above-mentioned acquisition module is further configured to obtain a dimension-feature mapping relationship; determine the predicted dimension as a target predicted dimension, and query a target index entry including the target predicted dimension from the dimension-feature mapping relationship; and determine the feature in the target index entry as a modified feature of the initial text feature under the target prediction dimension.

[0265] An embodiment of the present application provides a computer program product, which includes a computer program or 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 text processing method described in the embodiment of the present application.

[0266] 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 text processing method provided by an embodiment of the present application, for example, the text processing method shown in Figure 3.

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

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

[0269] 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, such as 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).

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

[0271] In summary, the embodiments of the present application have the following beneficial effects:

[0272] (1) By encoding the features of the text to be processed, the initial text features of the text to be processed are obtained. Based on the initial text features, the authenticity prediction of the logic of the text to be processed is performed in at least one prediction dimension to obtain the authenticity prediction results of the text to be processed in each prediction dimension. When the authenticity prediction result indicates that the text to be processed is not authentic under the corresponding prediction dimension, the correction features under the corresponding prediction dimension are obtained. Based on the correction features, the initial text features are corrected to obtain the target text features corresponding to the initial text features. The target text features are feature decoded to obtain the target text that is authentic under each prediction dimension. In this way, by performing authenticity prediction on the logic of the text to be processed in at least one prediction dimension based on the initial text features, the authenticity prediction results of the text to be processed in each prediction dimension are obtained. By performing feature correction on the initial text features, the target text features are obtained. The target text features are feature decoded, so that the target text is authentic under each prediction dimension, thereby effectively improving the accuracy of the target text and effectively improving the accuracy of text processing.

[0273] (2) Before calling the i-th feature encoding network, the i-1th target text feature is obtained by performing feature check on the i-1th initial text feature, thereby calling the i-th feature encoding network, and based on the i-1th target text feature, the feature encoding of the text to be processed is performed to obtain the i-th initial text feature, so that feature check is performed layer by layer in multiple feature encoding networks to ensure that the input of each layer of feature encoding network is the target text feature after strict feature check, so that the feature encoding network can gradually realize the feature encoding optimization of the text to be processed, thereby effectively improving the accuracy of feature encoding.

[0274] (3) By encoding the features of the text samples, the initial text features of the text samples are obtained, and the initial text features of the text samples are split to obtain multiple text feature samples corresponding to the text samples, thereby effectively expanding the number of training samples of the initial prediction network and effectively improving the prediction performance of the trained authenticity prediction network.

[0275] (4) By obtaining the j-1th authenticity score corresponding to the text sample of the j-1th prediction dimension, the initial prediction network is trained based on the j-1th authenticity score to obtain the authenticity prediction network corresponding to the j-1th prediction dimension, so that the authenticity prediction network corresponding to the j-1th prediction dimension can effectively refer to the network parameters of the authenticity prediction network corresponding to the j-1th prediction dimension, so that the prediction direction of the authenticity prediction network corresponding to the j-1th prediction dimension remains orthogonal to the prediction direction of the authenticity prediction network corresponding to the j-1th prediction dimension, thereby effectively improving the prediction independence between the authenticity prediction networks of different prediction dimensions.

[0276] (5) By correcting the corresponding feature dimensions of the initial text features, the text obtained by feature decoding the corrected initial text features can be authentic under the corresponding feature dimensions, thereby effectively improving the accuracy of the generated target text.

[0277] (6) The embodiments of the present application improve the authenticity of the generated results through multi-directional intervention, which can effectively solve the problem of pre-trained language models generating untrue information in generation tasks. The embodiments of the present application can effectively alleviate the generation-discrimination gap, make the learned directions more stable, and generalize to different positions in the generation process. The embodiments of the present application have low time complexity and are easy to implement and apply. The embodiments of the present application can be applied to various natural language processing tasks and have wide practicality. The embodiments of the present application can be used in combination with other generation models to further improve the authenticity and reliability of the generated results. By adjusting the intervention intensity, users can control the authenticity of the generated results as needed and improve the quality of the generated results.

[0278] (7) The embodiments of the present application were tested on the fine-tuned model before fine-tuning the relevant model (pre-training model) and after fine-tuning. After introducing the text processing method provided by the embodiments of the present application, the performance of the models at different stages was significantly improved.

[0279] (8) Experimental results show that the text processing method provided by the embodiment of the present application has achieved significant performance improvements in various scenarios. On a complete data set, the embodiment of the present application has better performance than the implementation method of the related art. Experimental results show that the embodiment of the present application can significantly improve True*Info% with minimal intervention at any stage. The embodiment of the present application was compared with the related art. In a few-sample setting, the embodiment of the present application achieved better results while being compatible with FSP. CE and KL results show that the embodiment of the present application achieved better performance with minimal intervention while maintaining the amount of information.

[0280] (9) It can provide customized evaluation for each prediction dimension, thereby significantly improving the overall accuracy and reliability of text authenticity detection. By assigning a dedicated network to each prediction dimension, it can better capture and process the information unique to that dimension, making the authenticity prediction more accurate. Authenticity scoring based on the i-1th initial text feature not only makes full use of the valuable information extracted in the previous iteration, but also provides a clear decision criterion for each dimension through the application of score thresholds, which not only makes the prediction results more interpretable, but also can provide more detailed guidance for subsequent decision-making or processing by distinguishing the first result from the second result.

[0281] (10) The initial prediction network is used to evaluate the authenticity of the processed text feature samples. By continuously iterating predictions and calculating loss values, the network can gradually learn and capture the complex relationship between text features and authenticity. This training method enables the prediction network to be specifically optimized for different prediction dimensions, thereby significantly improving its performance in the authenticity detection task. Ultimately, the fully trained prediction network can more accurately predict the authenticity of the text, providing powerful tools for scenarios such as social media platforms and news aggregators to identify and filter false information, thereby enhancing the credibility of information dissemination and user safety.

[0282] (11) When the authenticity prediction results indicate that the text to be processed may be untrue under a specific prediction dimension, feature correction can be beneficial to improve the accuracy of text authenticity detection. By making targeted adjustments to the i-1th initial text features, the i-1th target text features are obtained, which can effectively remove or reduce the influence of features that are inconsistent with the prediction results, so that subsequent feature encoding and network training can focus more on real text information. When all prediction dimensions indicate that the text to be processed is authentic, keeping the i-1th initial text features unchanged helps to retain important information of the text and avoid unnecessary feature distortion. This dynamic feature processing method not only improves the robustness of the model, but also optimizes the model's ability to recognize real text, ultimately significantly improving the performance and reliability of authenticity detection.

[0283] (12) By dynamically adjusting the weights of features based on the evaluation of text authenticity for each prediction dimension, possible untrue or misleading information can be weakened or excluded while maintaining key information. The reference correction features obtained by weighted fusion of the correction features can more accurately reflect the authenticity of the text, and then the initial text features can be accurately corrected based on these reference correction features. Ultimately, the target text features obtained not only better represent the authenticity of the text, but also improve the performance and reliability of the subsequent authenticity prediction model, making it more effective and robust when processing complex and diverse text data.

[0284] 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, the method comprising: Performing feature encoding on the text to be processed to obtain the initial text features of the text to be processed; Based on the initial text features, predicting the authenticity of the logic of the text to be processed in at least one prediction dimension to obtain the authenticity prediction results of the text to be processed in each of the prediction dimensions; For each of the prediction dimensions, when the authenticity prediction result of the prediction dimension indicates that the text to be processed does not have authenticity in the prediction dimension, obtaining the correction features of the initial text features in the prediction dimension; Based on the correction features, performing feature correction on the initial text features to obtain the target text features corresponding to the initial text features; Performing feature decoding on the target text features to obtain the target text corresponding to the text to be processed, and the target text has the authenticity in each of the prediction dimensions.

2. The method according to claim 1, wherein: The feature encoding is implemented by at least one feature encoding network. When the number of feature encoding networks is multiple, the performing feature encoding on the text to be processed to obtain the initial text features of the text to be processed includes: Invoking the first feature encoding network to perform feature encoding on the text to be processed to obtain the first initial text features; Traversing i and performing the following processing: invoking the i-th feature encoding network to perform feature encoding on the text to be processed based on the (i - 1)-th initial text features to obtain the i-th initial text features; where 1 < i ≤ N, and N is used to indicate the number of feature encoding networks; Determining the N-th initial text features as the initial text features of the text to be processed.

3. The method according to claim 1 or 2, wherein: Before the invoking the i-th feature encoding network to perform feature encoding on the text to be processed based on the (i - 1)-th initial text features to obtain the i-th initial text features, the method further includes: Based on the (i - 1)-th initial text features, predicting the authenticity of the logic of the text to be processed in each of the prediction dimensions to obtain the (i - 1)-th authenticity prediction results of the text to be processed in each of the prediction dimensions; Based on the (i - 1)-th authenticity prediction results, performing feature check on the (i - 1)-th initial text features to obtain the (i - 1)-th target text features; The invoking the i-th feature encoding network to perform feature encoding on the text to be processed based on the (i - 1)-th initial text features to obtain the i-th initial text features includes: Invoking the i-th feature encoding network to perform feature encoding on the text to be processed based on the (i - 1)-th target text features to obtain the i-th initial text features.

4. The method according to any one of claims 1 to 3, wherein: The performing feature check on the (i - 1)-th initial text features based on the (i - 1)-th authenticity prediction results to obtain the (i - 1)-th target text features includes: When there is an (i - 1)-th authenticity prediction result indicating that the text to be processed does not have the authenticity in the corresponding prediction dimension, performing feature correction on the (i - 1)-th initial text features to obtain the (i - 1)-th target text features; When each of the i-1th authenticity prediction results indicates that the text to be processed has the authenticity under the corresponding prediction dimension, the i-1th initial text feature is determined as the i-1th target text feature.

5. The method according to any one of claims 1 to 3, wherein: The step of performing authenticity prediction on the logic of the text to be processed in each of the prediction dimensions based on the i-1th initial text feature to obtain the i-1th authenticity prediction result of the text to be processed in each of the prediction dimensions, includes: Obtain the authenticity prediction network corresponding to each prediction dimension, and perform the following processing for each prediction dimension: Calling the corresponding authenticity prediction network, based on the i-1th initial text feature, logically predicting the authenticity of the text to be processed in the prediction dimension, and obtaining the i-1th authenticity score of the text to be processed in the prediction dimension; When the i-1th authenticity score is greater than or equal to the score threshold, the i-1th authenticity prediction result of the prediction dimension is If it is determined that the text to be processed is authentic under the prediction dimension; When the i-1th authenticity score is less than the score threshold, the i-1th authenticity prediction result of the prediction dimension is determined as the text to be processed not having authenticity under the prediction dimension.

6. The method according to claim 5, wherein: When there are multiple prediction dimensions, obtaining the authenticity prediction network corresponding to each prediction dimension includes: Obtaining an initial prediction network, and obtaining a first text feature sample corresponding to the text sample of the first prediction dimension, and a first authenticity label score of the first text feature sample; Calling the initial prediction network, based on the first text feature sample, logically predicting the authenticity of the text sample of the first prediction dimension to obtain a first authenticity score, and combining the first authenticity score and the first authenticity label score to train the initial prediction network to obtain an authenticity prediction network corresponding to the first prediction dimension; Traversing j, the following processing is performed: obtaining the j-1th authenticity score corresponding to the text sample of the j-1th prediction dimension, and training the initial prediction network based on the j-1th authenticity score to obtain the authenticity prediction network corresponding to the j-1th prediction dimension; Wherein, 2≤j≤M, and M is used to indicate the number of the prediction dimensions.

7. The method according to any one of claims 1 to 6, wherein: The step of performing authenticity prediction on the logic of the text to be processed in at least one prediction dimension based on the initial text features to obtain authenticity prediction results of the text to be processed in each prediction dimension respectively includes: Obtain the authenticity prediction network corresponding to each prediction dimension, and perform the following processing for each prediction dimension: Calling the corresponding authenticity prediction network, based on the initial text features, logically predicting the authenticity of the text to be processed in the prediction dimension, and obtaining the authenticity score of the text to be processed in the prediction dimension; When the authenticity score is greater than or equal to the score threshold, determining the authenticity prediction result of the prediction dimension as a first result, wherein the first result is used to indicate that the text to be processed has the authenticity under the prediction dimension; When the authenticity score is less than the score threshold, the authenticity prediction result of the prediction dimension is determined as a second result, and the second result is used to indicate that the text to be processed does not have the authenticity under the prediction dimension.

8. The method according to claim 7, wherein: When the number of the prediction dimensions is one, obtaining the authenticity prediction network corresponding to each of the prediction dimensions includes: Obtaining an initial prediction network, and obtaining a plurality of text feature samples corresponding to the text sample, and a truth label score of each of the text feature samples; For each of the text feature samples, calling the initial prediction network, based on the text feature sample, performing authenticity prediction on the logic of the text sample in the prediction dimension, obtaining an authenticity score corresponding to the text feature sample, and combining the authenticity score and the corresponding authenticity label score to determine the loss value corresponding to the text feature sample; Based on the loss value corresponding to each of the text feature samples, the initial prediction network is trained to obtain a authenticity prediction network corresponding to the prediction dimension.

9. The method according to claim 8, wherein: The step of obtaining a plurality of text feature samples corresponding to the text sample includes: Acquire a text sample, and perform feature encoding on the text sample to obtain initial text features of the text sample; The initial text features of the text sample are subjected to feature segmentation to obtain a plurality of text feature samples corresponding to the text sample.

10. The method according to claim 9, wherein: The step of performing feature splitting on the initial text features of the text sample to obtain a plurality of text feature samples corresponding to the text sample includes: The following processing is performed for each characteristic character in the initial text feature: The characteristic character is determined as a target characteristic character, and the target characteristic character is randomly combined with other characteristic characters in the initial text feature to obtain at least one text feature sample corresponding to the target characteristic character.

11. The method according to claim 7, wherein: When there are multiple prediction dimensions, obtaining the authenticity prediction network corresponding to each prediction dimension includes: Obtaining an initial prediction network, and obtaining a first text feature sample corresponding to the text sample of the first prediction dimension, and a first authenticity label score of the first text feature sample; Calling the initial prediction network, based on the first text feature sample, logically predicting the authenticity of the text sample of the first prediction dimension to obtain a first authenticity score, and combining the first authenticity score and the first authenticity label score to train the initial prediction network to obtain an authenticity prediction network corresponding to the first prediction dimension; Traversing j, the following processing is performed: obtaining the j-1th authenticity score corresponding to the text sample of the j-1th prediction dimension, and training the initial prediction network based on the j-1th authenticity score to obtain the authenticity prediction network corresponding to the j-1th prediction dimension; Wherein, 2≤j≤M, and M is used to indicate the number of the prediction dimensions.

12. The method according to claim 11, wherein: The training of the initial prediction network based on the j-1th authenticity score to obtain the authenticity prediction network corresponding to the jth prediction dimension includes: Obtaining a j-th text feature sample corresponding to the text sample of the j-th prediction dimension, and a j-th authenticity label score of the j-th text feature sample; Calling the initial prediction network, based on the j-th text feature sample, performing authenticity prediction on the logic of the text sample of the j-th prediction dimension, and obtaining the j-th authenticity score; Determine a first loss value by combining the j-th authenticity score and the j-1-th authenticity score, and determine a second loss value by combining the j-th authenticity score and the j-th authenticity label score; The initial prediction network is trained in combination with the first loss value and the second loss value to obtain a authenticity prediction network corresponding to the j-th prediction dimension.

13. The method according to any one of claims 1 to 12, wherein: After performing authenticity prediction on the logic of the to-be-processed text in at least one prediction dimension based on the initial text features and obtaining the authenticity prediction results of the to-be-processed text in each of the prediction dimensions, the method further includes: When the authenticity prediction results of each of the prediction dimensions indicate that the text to be processed has the authenticity under the corresponding prediction dimension, feature decoding is performed on the initial text features to obtain the target text corresponding to the text to be processed.

14. The method according to any one of claims 1 to 13, wherein: The modified features correspond to the target prediction dimensions one by one, the to-be-processed text does not have the authenticity under the target prediction dimensions, and based on the modified features, the initial text features are modified to obtain target text features corresponding to the initial text features, including: Obtaining the authenticity scores of the text to be processed under each of the target prediction dimensions, and determining each of the authenticity scores as the weight of the corresponding correction feature; According to the weights of the correction features, weighted fusion is performed on the correction features to obtain the reference correction features; Based on the reference correction feature, the initial text feature is corrected to obtain the target text feature corresponding to the initial text feature.

15. The method according to claim 14, wherein: The step of performing feature correction on the initial text feature based on the reference correction feature to obtain a target text feature of the initial text feature includes: Acquire the feature dimension of the initial text feature and the feature dimension of the reference correction feature; When the feature dimension of the initial text feature is different from the feature dimension of the reference correction feature, adjusting the feature dimension of the reference correction feature to obtain a target correction feature; When the feature dimension of the initial text feature is the same as the feature dimension of the reference correction feature, determining the reference correction feature as the target correction feature; Determining a correction strength of the initial text feature based on the number of the correction features, wherein the correction strength is positively correlated with the number of the correction features; The product of the correction strength and the target correction feature is determined as a fusion feature, and the initial text feature and the fusion feature are added to obtain the target text feature.

16. The method according to any one of claims 1 to 15, wherein: The feature decoding of the target text feature to obtain the target text corresponding to the text to be processed includes: Obtaining a task type of the text to be processed, and obtaining a task prediction network corresponding to the task type; When the task type is an answer prediction task for answering the text to be processed, calling the task prediction network corresponding to the answer prediction task, predicting the answer to the text to be processed based on the target text features, and obtaining the answer text corresponding to the text to be processed, wherein the answer text has the authenticity under each prediction dimension; When the task type is a translation task for translating the text to be processed, the task prediction network corresponding to the translation task is called, and the text to be processed is translated based on the target text features to obtain a translation text corresponding to the text to be processed, and the translation text has the authenticity under each of the prediction dimensions.

17. The method according to any one of claims 1 to 16, wherein: The obtaining of the modified features of the initial text features under the prediction dimension includes: Get dimension-feature mapping relationship; Determine the prediction dimension as a target prediction dimension, and query a target index entry including the target prediction dimension from the dimension-feature mapping relationship; The features in the target index entry are determined as modified features of the initial text features under the target prediction dimension.

18. A text processing device, comprising: A feature encoding module, configured to perform feature encoding on the text to be processed to obtain initial text features of the text to be processed; The authenticity prediction module is configured to perform authenticity prediction on the logic of the text to be processed in at least one prediction dimension based on the initial text features, and obtain the authenticity prediction results of the text to be processed in each of the prediction dimensions; an acquisition module configured to, for each of the prediction dimensions, acquire a modified feature of the initial text feature under the prediction dimension when the authenticity prediction result of the prediction dimension indicates that the text to be processed does not have authenticity under the prediction dimension; A feature correction module is configured to perform feature correction on the initial text feature based on the correction feature to obtain a target text feature corresponding to the initial text feature; The feature decoding module is configured to perform feature decoding on the target text features to obtain a target text corresponding to the text to be processed, wherein the target text has the authenticity under each of the prediction dimensions.

19. An electronic device, comprising: a memory configured to store computer executable instructions or computer programs; The processor is configured to implement the text processing method described in any one of claims 1 to 17 when executing the computer executable instructions or computer programs stored in the memory.

20. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the text processing method according to any one of claims 1 to 17.

21. A computer program product, comprising a computer program or a computer executable instruction, wherein when the computer program or the computer executable instruction is executed by a processor, the text processing method according to any one of claims 1 to 17 is implemented.