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

By extracting keywords from conversation text and using a model to determine the second keyword, the problem of inaccurate conversation text generation in existing technologies is solved, achieving accurate matching and identity recognition of conversation objects, and improving the accuracy and adaptability of conversation text generation.

CN122019732BActive Publication Date: 2026-07-07MASHANG CONSUMER FINANCE CO LTD

Patent Information

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

Smart Images

  • Figure CN122019732B_ABST
    Figure CN122019732B_ABST
Patent Text Reader

Abstract

The application provides a text processing method and device, electronic equipment, computer readable storage medium and computer program product; the method comprises the following steps: extracting a first keyword from a first conversation text; determining a second keyword from the first keyword by a first model, determining a first conversation object to which the first conversation text is derived based on the second keyword; analyzing based on the first conversation text, the first keyword and the first conversation object, obtaining the processing logic of the first model for determining the second keyword from the first keyword; generating a second conversation text derived from a second conversation object based on the processing logic, the first keyword and the first intention label of the first conversation text by a second model, the second conversation object and the first conversation object are different objects participating in the same conversation. Through the application, the accuracy of the model generating conversation texts of different conversation objects in the same conversation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a text processing method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology

[0002] In the field of natural language processing, model training based on conversational text is widely used in scenarios such as conversation generation and identity recognition. Due to the increasing demand for model training for conversational interaction scenarios, it is necessary to optimize the model using information related to the conversational text to generate conversational text for different conversational objects within the same conversation. In related technologies, model training often relies on single-dimensional textual features or keyword matching to associate conversational objects and update the model. This results in the model-generated conversational text failing to accurately match the identities of different conversational objects within the same conversation, leading to low accuracy in the generated conversational text. Summary of the Invention

[0003] This application provides a text processing method, apparatus, electronic device, computer-readable storage medium, and computer program product that can improve the accuracy of model-generated conversation text for different conversation objects in the same session.

[0004] The technical solution of this application embodiment is implemented as follows:

[0005] This application provides a text processing method, the method comprising:

[0006] Extract the first keyword from the first conversation text;

[0007] The first keyword is determined from the first keyword using the first model, and the first conversation object from which the first conversation text originates is determined based on the second keyword;

[0008] Based on the analysis of the first conversation text, the first keyword, and the first conversation object, the processing logic of the first model to determine the second keyword from the first keyword is obtained;

[0009] The second model generates a second conversation text from a second conversation object based on the processing logic, the first keyword, and the first intent tag of the first conversation text. The second conversation object and the first conversation object are different objects participating in the same conversation.

[0010] This application provides a text processing apparatus, the apparatus comprising:

[0011] The data extraction module is used to extract the first keyword from the first conversation text;

[0012] The source determination module is used to determine a second keyword from the first keyword using a first model, and to determine the first session object from which the first session text originates based on the second keyword;

[0013] The logic analysis module is used to analyze the first conversation text, the first keyword, and the first conversation object to obtain the processing logic of the first model to determine the second keyword from the first keyword.

[0014] The text generation module is used to generate second conversation text from a second conversation object based on the processing logic, the first keyword, and the first intent tag of the first conversation text, using the second model. The second conversation object and the first conversation object are different objects participating in the same conversation.

[0015] This application provides an electronic device, the electronic device comprising:

[0016] Memory is used to store executable instructions or computer programs.

[0017] The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the text processing method provided in the embodiments of this application.

[0018] This application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the text processing method provided in this application when executed by a processor.

[0019] This application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, they implement the text processing method provided in this application.

[0020] The embodiments of this application have the following beneficial effects:

[0021] By extracting the first keyword from the first conversation text, then using the first model to filter and determine the second keyword, and finally identifying the first conversation object based on the second keyword, a progressive keyword filtering mechanism is established. This constructs a direct mapping path between keywords and the identities of conversation objects, enhancing the correlation between the second keyword and the identities of conversation objects, and improving the accuracy and reliability of conversation object determination. Combining the analysis of the first conversation text, the first keyword, and the first conversation object, the processing logic of the first model is obtained. Through the second model, based on this processing logic, the first keyword, and the first intent tag of the first conversation text, the complete processing logic of the first model in filtering the second keyword can be fully reconstructed. This processing logic makes the update process of the second model highly targeted and clearly directional, ensuring that the second model can accurately adapt to the identity of the second conversation object. Furthermore, since the second conversation object and the first conversation object are different objects participating in the same conversation, the second model can accurately match the identities of different conversation objects in the conversation scenario, generating conversation text that matches the corresponding identity. This improves the adaptability of the second model in conversation interaction scenarios and the accuracy of generating conversation text that matches the identity. Attached Figure Description

[0022] Figure 1 This is a schematic diagram of the architecture of the text processing system 100 provided in an embodiment of this application;

[0023] Figure 2 This is a schematic diagram of the structure of the server 200 provided in the embodiments of this application;

[0024] Figure 3A This is a first flowchart illustrating the text processing method provided in this application embodiment;

[0025] Figure 3B This is a second flowchart illustrating the text processing method provided in the embodiments of this application;

[0026] Figure 3C This is a schematic diagram of the third process of the text processing method provided in the embodiments of this application;

[0027] Figure 3D This is a schematic diagram of the fourth process of the text processing method provided in the embodiments of this application;

[0028] Figure 3E This is a schematic diagram of the fifth process of the text processing method provided in the embodiments of this application;

[0029] Figure 3F This is a sixth flowchart illustrating the text processing method provided in the embodiments of this application;

[0030] Figure 3G This is a schematic diagram of the seventh process of the text processing method provided in the embodiments of this application;

[0031] Figure 4 This is a schematic diagram of the structure of the syntactic analysis tree provided in the embodiments of this application;

[0032] Figure 5 This is a schematic diagram of the process for subject-based text enhancement based on deep learning, provided in an embodiment of this application.

[0033] It should be noted that the terms "first" and "second" mentioned above are only used to distinguish between different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation

[0034] To make the objectives, 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 limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0035] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is 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.

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

[0037] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0038] Unless otherwise specified, "at least one" as used below refers to one or more cases, and "multiple" can refer to two or more cases.

[0039] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.

[0040] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0041] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0042] 1) Responding to: used to indicate the conditions or states on which the operation is performed depends. When the conditions or states on which it depends are met, one or more operations can be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations are performed.

[0043] 2) Human-computer interaction interface, which is an interface used to provide human-computer interaction functions / display conversation text.

[0044] For example, graphical user interfaces (GUIs) include augmented reality (AR) interfaces, virtual reality (VR) interfaces, voice user interfaces (VUIs), interactive projection interfaces (using projection technology to display information on a flat surface), eye-tracking interfaces (interfaces controlled by detecting the user's gaze), holographic interfaces (three-dimensional holograms formed by projecting images using holographic projection technology, allowing users to see stereoscopic images without wearing special glasses), multimodal interfaces (interfaces that combine multiple interaction methods, such as tactile, visual, and auditory interaction), and brain-machine interfaces (BMIs).

[0045] 3) Conversation text refers to the text content generated by the interaction between objects with different identities participating in the same conversation. It includes the initial text that initiates the conversation and the reply text used to respond to the initial text. It is the basic data for extracting keywords, determining the identity of conversation objects, analyzing syntactic features and training models. It has scene relevance and interaction coherence. It can be divided into the first conversation text and the second conversation text. The first conversation text is the text generated by the conversation initiator, and the second conversation text is the text generated by the conversation responder.

[0046] 4) Conversation objects refer to interactive subjects that participate in the same conversation and have different identity attributes. They are the source of conversation text generation and are divided into first conversation objects and second conversation objects. Their identities correspond to each other and together constitute a complete conversation interaction scenario. The first conversation object is the subject that generates the first conversation text, and the second conversation object is the subject that generates the second conversation text. Their identity attributes are the core basis that needs to be adapted during model training and text generation.

[0047] 5) Processing logic refers to a set of clear and quantifiable decision rules followed by the pre-trained first model in the process of selecting and determining the second keyword from the first keyword. It is formed by analyzing the relationship between the first conversation text, the first keyword and the first conversation object. The core covers the keyword relevance calculation rules, relevance fusion rules and the second keyword selection priority rules, providing clear logical support for generating the second conversation text through the second model.

[0048] 6) Syntactic analysis results refer to the output results obtained after using syntactic analysis methods to perform structural parsing on the conversational text. They can reflect the grammatical relationships, hierarchical structure and functional associations between various language units in the conversational text. They are the basis for extracting syntactic components and constructing syntactic analysis trees. Their content includes, but is not limited to, the dependency relationships, phrase structures and hierarchical relationships of various language units.

[0049] 7) Syntactic components refer to the categories of language units with specific grammatical functions extracted from the syntactic analysis results of conversational text. They are the basic building blocks of syntactic structure. Their types include subject, predicate, object, attributive, adverbial, complement, etc. There are clear logical relationships between different syntactic components, and they occupy specific hierarchical positions in the syntactic analysis tree. They are the core elements that characterize the grammatical features of conversational text.

[0050] In related technologies, model training often relies on single-dimensional text features or keyword matching to associate conversation objects and update the model. This makes it difficult for the conversation text generated by the model to accurately match the identities of different conversation objects in the same conversation, resulting in low accuracy of the conversation text generated by the model.

[0051] Based on the above analysis, the applicant found that the text processing methods of related technologies cannot quickly and accurately generate conversation texts of different conversation objects in the same session. In response to the above problem, this application provides a text processing method that can improve the accuracy of the model in generating conversation texts of different conversation objects in the same session.

[0052] The following describes exemplary applications of the electronic devices provided in the embodiments of this application. These electronic devices can be implemented as various types of terminals such as laptops, tablets, desktop computers, set-top boxes, smartphones, smart speakers, smartwatches, smart TVs, and in-vehicle terminals, or as servers. The following will describe exemplary applications when the electronic device is implemented as a server.

[0053] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of the text processing system 100 provided in the embodiments of this application. In order to support a model training application, the terminal 400 connects to the server 200 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.

[0054] Server 200 is used to extract the first keyword from the first conversation text of the first conversation object, and based on the processing logic of determining the second keyword from the first keyword, generate the second conversation text from the second conversation object through the second model, based on the processing logic, the first keyword and the first intent tag of the first conversation text.

[0055] Terminal 400 is used to display a text input control on human-computer interaction interface 410. In response to an input operation on the text input control for the first conversation text, the terminal 400 sends the first conversation text to server 200. Server 200 is used to extract a first keyword from the first conversation text of the first conversation object, and based on the processing logic of determining a second keyword from the first keyword, through a second model, based on the processing logic, the first keyword, and the first intent tag of the first conversation text, generate a second conversation text from the second conversation object, and send the second conversation text of the second conversation object to terminal 400 for display on human-computer interaction interface 410.

[0056] In some embodiments, server 200 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminals and servers can be connected directly or indirectly via wired or wireless communication, which is not limited in this embodiment.

[0057] See Figure 2 , Figure 2 This is a schematic diagram of the structure of the server 200 provided in the embodiments of this application. Figure 2The server 200 shown includes at least one processor 210, memory 230, and at least one network interface 220. The various components of server 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to implement communication between these components. In addition to a data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2 The general labeled all buses as Bus System 240.

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

[0059] The memory 230 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 230 may optionally include one or more storage devices physically located away from the processor 210.

[0060] The memory 230 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 230 described in this application embodiment is intended to include any suitable type of memory.

[0061] In some embodiments, memory 230 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0062] Operating system 231 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;

[0063] The network communication module 232 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 220, exemplary network interfaces 220 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.

[0064] In some embodiments, the apparatus provided in this application can be implemented in software. Figure 2 A text processing device 233 stored in memory 230 is shown. This device can be software in the form of programs and plug-ins, and includes the following software modules: a data extraction module 2331, a source determination module 2332, a logic analysis module 2333, and a text generation module 2334. These modules are logically related and can therefore be arbitrarily combined or further separated according to their implemented functions. The functions of each module will be described below.

[0065] The text processing method provided in this application will be described in conjunction with exemplary applications and implementations of the server provided in the embodiments of this application.

[0066] See Figure 3A , Figure 3A This is a first flowchart illustrating the text processing method provided in this application embodiment, with the server as the main component, and combining... Figure 3A The steps shown are explained.

[0067] In step 101, the first keyword is extracted from the first conversation text.

[0068] In some embodiments, a first keyword related to the identity of the conversation object is extracted from the first conversation text. Before "extracting the first keyword from the first conversation text", the text can be preprocessed to obtain a preprocessed first conversation text, and the first keyword is extracted from the preprocessed first conversation text.

[0069] For example, preprocessing includes at least one of the following: removing invalid characters, unifying text format, text segmentation, and stop word filtering. A pre-trained text generation model can extract the first keyword from the first conversation text. The input length threshold of the pre-trained text generation model can be adjusted to adapt to the keyword extraction needs of first conversation texts of different lengths (short text, long text).

[0070] In some embodiments, see Figure 3B , Figure 3B This is a schematic diagram of the second process of the text processing method provided in the embodiments of this application. Figure 3A Step 101, "Extracting the first keyword from the first conversation text," can be done through... Figure 3B Steps 1011 to 1013 are implemented, and the details are explained below.

[0071] In step 1011, the first conversation text is segmented to obtain multiple candidate words.

[0072] In some embodiments, the first conversation text to be processed is obtained, and a preset word segmentation algorithm is used to split the first conversation text into the smallest linguistic units with independent semantics. Invalid delimiters (such as meaningless punctuation and whitespace characters) are removed from the text to obtain multiple candidate words. It can adapt to first conversation texts in different languages, selecting the corresponding word segmentation algorithm to meet the word segmentation needs in multilingual scenarios. Custom word segmentation rules are supported, allowing for the setting of exclusive word segmentation templates for common professional terms and fixed collocations in the conversation text, avoiding the splitting of semantically complete phrases. The word segmentation results can be filtered by length, removing candidate words that are too short (such as single-character words without substantive meaning) or too long (such as redundant semantic fragments) to optimize the quality of candidate words. Batch word segmentation processing is supported, allowing word segmentation operations to be performed on multiple first conversation texts simultaneously, improving processing efficiency.

[0073] For example, word segmentation algorithms include any of the following: maximum matching algorithm, shortest path algorithm, hidden Markov model, recurrent neural network, bidirectional long short-term memory network, and N-gram (N-Gram). First conversation text: “This business transaction requires our staff to assist you in completing the document verification,” candidate words: [this, business transaction, requires, by, our, staff, assist, you, complete, document verification].

[0074] In step 1012, text analysis is performed on multiple candidate words to obtain the first relevance of each candidate word to a preset object.

[0075] In some embodiments, semantic parsing is performed on each candidate word to extract its semantic features; multiple preset objects are vectorized to obtain object vectors corresponding to each preset object; the similarity between the semantic features of the candidate word and the object vectors of each preset object is determined as the first relevance score. The calculation dimensions of semantic matching can be adjusted, and in addition to core semantic matching, matching weights for dimensions such as part-of-speech and collocation patterns are added to optimize the calculation accuracy of the first relevance score.

[0076] For example, the first relevance can be calculated using any of the following algorithms: Euclidean distance, cosine distance, Hamming distance, edit distance, Manhattan distance, etc. Taking Euclidean distance as an example, for each object vector of a preset object, the difference between the semantic features of the candidate word and each dimension of the object vector of the preset object is determined. The sum of squares of the differences across multiple dimensions is then determined, and the root of the sum of squares is taken as the distance between the semantic features of the candidate word and the object vector of the preset object, which is used as the first relevance. For example, if the semantic features of the candidate word are (… , The object vector of the preset object is ( , ), determine the distance between the semantic features of the candidate word and the object vector of the preset object, that is The first relevance is determined by the following criteria: If the candidate words are: [our side, staff, you, data verification], the preset object is the service provider, and the first relevance of the preset object to each candidate word is as follows: our side (0.92), staff (0.85), you (0.31), and data verification (0.43).

[0077] In step 1013, candidate words with a first relevance greater than or equal to the first relevance threshold are selected as first keywords.

[0078] In some embodiments, a first relevance threshold is preset. This threshold can be a fixed value or a dynamically adjusted value set based on the needs of the conversation scenario. The first relevance of each candidate word is compared with the first relevance threshold. Candidate words with a first relevance greater than or equal to the first relevance threshold are selected as the first keywords. The first relevance threshold can be manually adjusted according to the accuracy requirements of the conversation scenario; the threshold can be increased for high accuracy requirements and decreased for broad coverage requirements. A dynamic threshold adjustment mechanism can be set to automatically calculate a reasonable first relevance threshold (e.g., 1.2 times the average relevance) based on the distribution of the first relevance of candidate words, adapting to the keyword extraction needs of different texts. When the number of selected candidate words exceeds a certain threshold, they can be sorted in descending order of first relevance, and a preset number or proportion of candidate words from the top of the sorted results can be selected as the first keywords, provided the first relevance threshold is met.

[0079] For example, the first relevance scores for each candidate word are: "our side" (0.92), "staff" (0.85), "you" (0.31), and "data verification" (0.43). The first relevance score threshold is 0.6, so the first keyword is: [our side, staff].

[0080] This application embodiment achieves systematic extraction of the first keyword through a progressive process of word segmentation, relevance calculation, and threshold filtering. First, basic candidate words are obtained by splitting the text through word segmentation. Then, relevance is calculated based on preset object features. Finally, the first keyword related to the identity of the conversation object is accurately focused through the first relevance threshold filtering, ensuring that the first keyword has strong identity relevance. The whole process is logically clear and the steps are controllable, effectively avoiding interference from irrelevant words and improving the accuracy and reliability of the first keyword extraction.

[0081] See also Figure 3A In step 102, a second keyword is determined from the first keyword using the first model, and the first conversation object from which the first conversation text originates is determined based on the second keyword.

[0082] In some embodiments, the pre-trained first model can be trained by performing the following processes: collecting sample data in a conversational scenario, each sample data including a first keyword sample list and a corresponding first conversation object sample label, wherein the first keyword sample list is a set of identity-related first keyword samples extracted from the sample conversation text, and the first conversation object sample label is the identity type of the actual source of the sample conversation text; cleaning the collected sample data, removing invalid samples with empty first keyword sample lists or unclear first conversation object sample labels to ensure the validity of the training data; dividing the cleaned sample data into training set, validation set, and test set according to a preset ratio for model training, parameter tuning, and performance verification. According to task requirements, adjusting the input layer structure of the initialized first model to receive input in the format of a first keyword sample list, and setting the output dimension of the initialized first model to match the preset number of first conversation object sample types to ensure the model can output the judgment result of the first conversation object sample. The core training task of the initialized first model is set as a joint task of first keyword sample selection and conversation object sample judgment, that is, the initialized first model must first select second keyword samples from the input first keyword sample list, and then output the corresponding first conversation object sample label based on the second keyword samples. The first keyword sample list in the training set is formatted according to the model requirements and input into the initialized first model. The initialized first model performs identity indication strength quantification analysis on each first keyword sample in the first keyword sample list, filters out the second keyword samples through internal competition processing logic, and then outputs the predicted first conversation object samples based on the mapping relationship between the second keyword samples and the first conversation object sample labels. The difference between the first conversation object sample predicted by the model and the real first conversation object sample labels in the training samples is calculated to construct a loss function. Based on the calculation results of the loss function, the model parameters are adjusted through backpropagation to optimize the initial first model's filtering accuracy of second keyword samples and the judgment accuracy of first conversation object samples. The above training steps are executed iteratively. After each iteration, the model performance is evaluated using a validation set. If the validation set performance does not reach the preset threshold, the parameters of the initialized first model are adjusted and training is iterated. If the preset threshold is reached, training is stopped and the parameters of the currently initialized first model are saved to obtain the pre-trained first model. Input the list of first keyword samples in the test set into the pre-trained first model, and obtain the prediction results of the second keyword samples and the first conversation object samples output by the pre-trained first model; compare the prediction results with the actual second keyword samples and first conversation object sample labels in the test set, and calculate the comprehensive performance indicators of the pre-trained first model (such as screening accuracy, judgment correctness, and recall); if the performance of the test set does not meet expectations, analyze the reasons for the error, supplement the training samples for the corresponding scenarios, and retrain locally until the model performance meets the standards.

[0083] For example, the first pre-trained model can be any of the following: Generative Pre-trained Language Model (GPLM), Bidirectional Encoder Representations from Transformers (BERT), Text-to-Text Transfer Transformer (T5), Generative Conversational Pre-trained Model (GCPM), or Enhanced Semantic Understanding Pre-trained Model (ESUPM).

[0084] In some embodiments, see Figure 3C , Figure 3C This is a schematic diagram of the third process of the text processing method provided in the embodiments of this application. Figure 3A Step 102, "Determining the second keyword from the first keyword using the first model," can be achieved through... Figure 3C Steps 1021 to 1022 are implemented, and the details are explained below.

[0085] In step 1021, a first value is determined by the first model. The first value is used to characterize the degree of contradiction between each first keyword and each preset object.

[0086] In some embodiments, a first conversation text and multiple first keywords extracted from it are obtained. For each first keyword, if the first keyword points to a preset object (such as a service provider, a client, etc.), the degree of contradiction between the first keyword and other components in the first conversation text or the preset object itself is calculated using a pre-trained first model, and this degree of contradiction is used as a first value. To improve the accuracy of the first value, the calculation of the first value (degree of contradiction) can be achieved through the sentence confusion degree after word collocation, or through the semantic distance between the first keyword and the preset object's vocabulary itself, or by weighted fusion of the two to obtain the final first value.

[0087] The first value is determined by calculating sentence perplexity: the first keyword and the preset object are concatenated into a reconstructed sentence according to a preset collocation; the reconstructed sentence is input into a pre-trained language model (such as a causal language model or a masked language model), and the perplexity (PPL) or negative log-likelihood value of the reconstructed sentence is calculated, which is used as the sentence perplexity. The collocation can be "preset object + statement + first keyword" or "preset object + promise + first keyword". The higher the perplexity of the reconstructed sentence in the language model, the less the expression conforms to natural language logic or business common sense, that is, the higher the degree of contradiction (first value) of the first keyword pointing to the preset object. Suppose the first conversation text is: "Our company will promise you a certain degree of credit limit increase", the extracted first keyword is "our company". The preset objects include "service provider (agent)" and "demand party (customer)". Using the combination of "preset object + commitment + primary keyword," reconstructed sentences were created. Reconstructed sentence A: "The service provider commits to our company." The language model calculated a confusion level (PPL) of 3.2. Reconstructed sentence B: "The demander commits to our company." The language model calculated a confusion level (PPL) of 18.5. Therefore, the degree of contradiction (first value) between the primary keyword "our company" and "service provider" is 3.2; the degree of contradiction (first value) between "our company" and "demander" is 18.5.

[0088] The first value is determined by calculating semantic distance: The first keyword and the preset object are vectorized separately to obtain the word vector of the first keyword and the object vector of the preset object; the distance distribution between the word vector and the object vector in multi-dimensional space is calculated. The greater the distance, the greater the semantic difference between the two, i.e., the higher the degree of contradiction (first value). The calculation dimensions of semantic matching can be adjusted. In addition to core semantic matching, the encoding weights of dimensions such as part-of-speech and context can be increased to optimize the calculation accuracy of the first value. The semantic distance (degree of contradiction) can be determined using any of the following algorithms: Euclidean distance, Manhattan distance, or distance based on cosine similarity transformation (such as 1-cosine similarity). Taking Euclidean distance as an example, for each preset object's object vector, the difference between the word vector of the first keyword and the object vector in each dimension is determined. The sum of squares of the differences in multiple dimensions is determined, and the root of the sum of squares is taken as the semantic distance, i.e., the degree of contradiction. For example, if the word vector of the first keyword is (… , The object vector of the preset object is ( , Then the semantic distance, i.e. the degree of contradiction, is... Let's take this as the first value. Assume the first keyword is "staff," and its word vector is (0.8, 0.6). Preset object A is "service provider," with its object vector (0.9, 0.5), and the Euclidean distance yields a first value of approximately 0.14. Preset object B is "demand side," with its object vector (0.1, 0.2), and the Euclidean distance yields a first value of approximately 0.80. Therefore, the contradiction between "staff" and "service provider" (first value 0.14) is far lower than the contradiction between "staff" and "demand side" (first value 0.80).

[0089] For example, the first value can be determined as follows: The first conversation text is: "Our staff will assist you in completing this business transaction." The extracted first keywords are: [our side, you]. The preset objects include: service provider and requester. Assuming the first keyword "our side" points to "service provider," by calculating sentence confusion and semantic distance, the first value for its contradiction level is 0.1; assuming "our side" points to "requester," the first value for the contradiction level is 0.85. Similarly, assuming the first keyword "you" points to "service provider," the first value for the contradiction level is 0.9; assuming "you" points to "requester," the first value for the contradiction level is 0.15.

[0090] In step 1022, a second keyword is selected from the first keywords based on the first value corresponding to each first keyword.

[0091] In some embodiments, since the first numerical value represents the degree of contradiction, the smaller the first numerical value, the higher the rationality of the first keyword pointing to the corresponding preset object. Therefore, the minimum first numerical values ​​corresponding to each first keyword are sorted in ascending order, and the first keyword corresponding to the combination with the smallest first numerical value (i.e., the lowest degree of contradiction) is selected as the second keyword. If both confusion degree and semantic distance are used, a weighted summation method can be adopted. The normalized value of sentence confusion degree and the normalized value of semantic distance are fused according to a preset weight (e.g., each accounting for 0.5) to obtain a comprehensive first numerical value, which is then compared and selected.

[0092] For example, the overall contradiction level (first value) of "our company" pointing to "service provider" is 0.12, and the overall contradiction level (first value) of "staff" pointing to "service provider" is 0.14. Among the two, "our company" has the lowest first value, so "our company" is selected as the second keyword.

[0093] Here, the difference in the first value (i.e., the contradiction difference) when the same first keyword points to different preset objects can be calculated. If the contradiction difference is greater than the preset contradiction threshold, it indicates that the first keyword has a very clear tendency to point to a specific object, and the first keyword is written into the candidate pool. The first keyword with the smallest absolute value of the first value is selected from the candidate pool as the second keyword.

[0094] This application embodiment combines quantitative analysis of the degree of contradiction between the first keyword and the preset object, achieving dual accuracy in the screening of the second keyword and the determination of the first conversation object; it ensures the strong correlation between the second keyword and the identity of the conversation object by minimizing the degree of contradiction, and eliminates the interference of isolated keywords and irrelevant identities by using confusion degree and semantic distance, making the determination of the first conversation object more comprehensive and logically rigorous, and improving the accuracy and reliability of identity determination.

[0095] See also Figure 3A In step 103, the first conversation text, the first keyword, and the first conversation object are analyzed to obtain the processing logic of the first model to determine the second keyword from the first keyword.

[0096] Here, the processing logic refers to a set of explicit and quantifiable decision rules followed by the pre-trained first model in determining the second keyword from the first keyword. This set of rules is formed based on the correlation analysis of the first conversation text, the first keyword, and the first conversation object, accurately reflecting the core decision-making basis and priority ranking logic of the first model in selecting the second keyword. The processing logic is a concrete breakdown of the decision-making process of the pre-trained first model, clearly demonstrating how the model achieves accurate selection of the second keyword by analyzing the relevance features and textual context features of the first keyword, providing clear rule support for subsequent updates to the second model based on this logic. The processing logic is scenario-adaptable, with its rule content strongly correlated with the conversation scenario of the first conversation text and the identity type of the first conversation object; it is also transferable, allowing for the extraction of generalized rules based on the analysis results of similar conversation scenarios to adapt to the training needs of more models.

[0097] In some embodiments, see Figure 3D , Figure 3D This is a schematic diagram of the fourth process of the text processing method provided in the embodiments of this application. Figure 3A Step 103, "Analyzing the first conversation text, the first keyword, and the first conversation object to obtain the processing logic of the first model determining the second keyword from the first keyword," can be achieved through... Figure 3D Steps 1031 to 1032 are implemented, and the details are explained below.

[0098] In step 1031, the first conversation text, the first keyword, and the first conversation object are combined into a first prompt word. The first prompt word is used to instruct the third model to generate the processing logic of the first model to determine the second keyword from the first keyword.

[0099] In some embodiments, a first conversation text, a first keyword, and a first conversation object are obtained. Following a preset prompt word template, the first conversation text, the first keyword, and the first conversation object are sequentially filled into the prompt word template. Guiding statements are added to the prompt word template to explicitly instruct the third model to generate the processing logic for the first model to determine the second keyword from the first keyword, thus obtaining the first prompt word. The combination order of the first conversation text, the first keyword, and the first conversation object can be adjusted. Based on the text understanding habits of the pre-trained third model, the structure of the first prompt word can be optimized (e.g., first labeling the first conversation object, then presenting the first conversation text and the first keyword). Constraints can be added to the guiding statements (e.g., "the processing logic must include relevance fusion rules and filtering priorities") to ensure that the generated processing logic meets the requirements.

[0100] For example, the first conversation text is: "Our staff will assist you in completing this transaction." The first keyword is "[our staff]," the first conversation recipient is the service provider, and the first prompt is: "First conversation text: Our staff will assist you in completing this transaction; First keyword: [our staff]; First conversation recipient: Service provider. Please generate the first model to determine the processing logic for the second keyword from the above first keyword."

[0101] In step 1032, the first prompt word is input into the third model for text analysis to obtain the processing logic of the first model to determine the second keyword from the first keyword.

[0102] Here, the pre-trained third model can be any of the following: GPLM, BERT, T5, General Language Model (GLM), ESUPM, Conversational Generative Pre-trained Model (CGPM), or Multi-Task Language Understanding Model (MTLUM).

[0103] In some embodiments, see Figure 3E , Figure 3E This is a schematic diagram of the fifth process of the text processing method provided in the embodiments of this application. Figure 3DStep 1032, "Inputting the first prompt word into the third model for text analysis, and obtaining the processing logic of the first model determining the second keyword from the first keyword," can be achieved through... Figure 3E Steps 10321 to 10325 are implemented, and the details are explained below.

[0104] In step 10321, the first keyword is encoded to obtain the fifth vector.

[0105] In some embodiments, the first keyword is encoded using a third model to obtain the fifth vector. A set of first keywords is obtained; each first keyword is encoded using a pre-trained third model, converting it into a dense numerical vector of fixed dimensions. This vector is the fifth vector, used to quantify the semantic information of the first keyword. Different pre-trained word embedding models can be selected, and domain-appropriate word vectors can be chosen based on the domain of the first conversation text (e.g., law, medicine, finance) to improve the accuracy of the encoded semantics. Word segmentation of the first keyword is supported (if the keyword itself consists of multiple words), followed by encoding and fusion of the segmentation results to obtain a more refined fifth vector. The encoded fifth vector can be normalized to ensure that the vectors of different first keywords are in the same scale space, facilitating subsequent calculations.

[0106] For example, the first keyword is [our side, staff], the fifth vector of the first keyword "our side" is [0.23, 0.45, -0.12, ..., 0.89], and the fifth vector of the first keyword "staff" is [0.11, 0.67, 0.34, ..., 0.56].

[0107] In step 10322, the position of the first keyword in the first conversation text is encoded to obtain the sixth vector.

[0108] In some embodiments, the specific location information (such as the start character index, end character index, or position index in the word sequence after word segmentation) of each first keyword in the first conversation text is determined. This location information is then encoded using a location encoding method (such as sine / cosine location encoding or trainable location embedding) to generate a location vector with the same dimension as the fifth vector. This sixth vector is used to capture the location features of the first keyword in the text sequence. Relative location encoding can be used instead of absolute location encoding to more accurately capture the relative distance relationship between first keywords, rather than just their absolute position in the entire text. The scope and granularity of location encoding can be adaptively adjusted for first conversation texts of different lengths to ensure effective representation of location information. Location encoding can be combined with text length information, for example, assigning different weights to keyword positions in long texts to highlight their role in long-distance dependencies.

[0109] For example, the first conversation text: "Our staff will assist you in completing this business transaction", after word segmentation, we get multiple words: [our, staff, will, assist, you, complete, this, business transaction]. The position index of the first keyword "our" is 0, and the position index of the first keyword "staff" is 1. The position code of the position index 0 is [0.01, 0.02, 0.03, ..., 0.05], which is the sixth vector of the first keyword "our". The position code of the position index 1 is [0.06, 0.07, 0.08, ..., 0.10], which is also the sixth vector of the first keyword "staff".

[0110] In step 10323, syntactic analysis is performed on the first conversation text to obtain the syntactic analysis result. The syntactic components corresponding to the first keyword are extracted from the syntactic analysis result, and the syntactic components are encoded to obtain the seventh vector.

[0111] In some embodiments, a pre-trained syntactic analysis model is used to perform syntactic analysis on the first conversation text to generate syntactic analysis results such as a syntactic tree or dependency graph; based on the position of the first keyword in the first conversation text, the syntactic components (such as subject, predicate, object, attributive, adverbial, etc., or specific dependency roles) corresponding to each first keyword are located and extracted from the analysis results; the syntactic components are encoded to obtain the seventh vector.

[0112] For example, the first conversation text, "Our staff will assist you in completing this business transaction," has the following syntactic analysis results (dependency relationship illustration): "Our staff" is an attributive modifier of "staff," "staff" is the subject of "assist," "will" is an adverbial modifier of "assist," "you" is the object of "assist," "complete" is the complement of "assist," "this time" is an attributive modifier of "business transaction," and "business transaction" is the object of "complete." Among these, the syntactic component corresponding to the first keyword "our staff" is an attributive modifier, and the syntactic component corresponding to the first keyword "staff" is the subject.

[0113] In some embodiments, see Figure 3F , Figure 3F This is a schematic diagram of the sixth process of the text processing method provided in the embodiments of this application. Figure 3E Step 10323, "Encoding syntactic components to obtain the seventh vector," can be achieved through... Figure 3F Steps 201 to 204 are implemented, and the details are explained below.

[0114] In step 201, a syntactic parsing tree is constructed based on the logical relationships between syntactic components.

[0115] In some embodiments, the syntactic analysis results of the first conversation text are obtained, identifying all syntactic components (such as subject, predicate, object, attributive, adverbial, etc.). Based on the dependency or hierarchical relationships between these components (e.g., an attributive modifies a subject, and the subject is the agent of the predicate's action), these components are organized into a tree structure. The nodes of the tree represent syntactic components, and the edges represent the logical relationships between them. The resulting tree structure is the syntactic analysis tree. Different syntactic analysis theories (such as phrase structure grammar and dependency grammar) can be selected as the construction basis to adapt to different types of syntactic analysis results. The syntactic analysis tree can be pruned and optimized, removing branches and leaves unrelated to the first keyword and focusing on core syntactic relationships. The syntactic analysis tree can be associated with the word segmentation results of the first conversation text, supplementing the tree nodes with word information to enhance the richness of subsequent encoding.

[0116] For example, see Figure 4 , Figure 4 This is a schematic diagram of the structure of the syntactic analysis tree provided in an embodiment of this application. Figure 4 In the first conversation text: “Our staff will assist you in completing this business transaction”, the syntactic components are: [our (attributive), staff (subject), will (adverbial), assist (predicate), you (object), complete (complement), this (attributive), business transaction (object)].

[0117] In step 202, for each syntactic component, the level of the syntactic component in the syntactic parsing tree is determined, and different levels correspond to different vectors.

[0118] In some embodiments, the root node of the syntactic parsing tree (usually the core predicate) is used as a reference. The level of the root node is set to 1, the level of its direct child nodes is 2, the level of its child nodes' child nodes is 3, and so on, to determine the specific level of each syntactic component in the tree. A mapping relationship between levels and vectors is preset (e.g., level 1 corresponds to vector A, level 2 corresponds to vector B), and the corresponding vector is matched according to the level of each syntactic component. The counting method of levels can be adjusted, such as calculating the relative level based on the node where the target first keyword is located, highlighting the positional relationship between the keyword and other components. Differentiated level weights can be set for different types of syntactic components (e.g., subject, object), incorporating component type information into the vectors. When the syntactic parsing tree structure is complex, levels can be merged (e.g., level 3 and above can be uniformly grouped into level 3) to simplify the encoding logic.

[0119] For examples, see below. Figure 4, assist (predicate): level 1, staff (subject), will (adverbial), you (object), complete (complement): level 2, our side (attributive), business handling (object): level 3, this time (attributive): level 4; the vectors corresponding to different levels are: level 1 [0.1, 0.05, 0.02, ..., 0.01], level 2 [0.08, 0.04, 0.015, ..., 0.008], level 3 [0.06, 0.03, 0.01, ..., 0.006], level 4 [0.04, 0.02, 0.005, ..., 0.004].

[0120] In step 203, the names of the syntactic components are mapped to the ninth vector according to a preset mapping relationship.

[0121] In some embodiments, the names of all syntactic components (such as subject, predicate, object, attributive, adverbial, etc.) are collected to construct a set of syntactic component names. A unique vector representation is assigned to each syntactic component name, forming a preset mapping relationship (vectors can be generated through random initialization or pre-training). For each syntactic component, its name is used to find the corresponding vector in the mapping relationship; this vector is the ninth vector. The set of syntactic component names can be dynamically expanded, and corresponding mapping relationships are automatically added when new syntactic component types appear. The ninth vector can be normalized to ensure that vectors of different component names are in the same scale space, facilitating subsequent fusion calculations. The ninth vector can be weighted according to the importance of the syntactic component in the conversational text (e.g., the vector of core components has a higher weight).

[0122] For example, the set of syntactic component names is: [subject, predicate, object, attributive, adverbial, complement]; the preset mapping relationship is: subject [0.2, 0.3, 0.1, ..., 0.05], predicate [0.4, 0.2, 0.3, ..., 0.08], object [0.15, 0.1, 0.2, ..., 0.04], attributive [0.08, 0.15, 0.05, ..., 0.02], adverbial [0.05, 0.08, 0.1, ..., 0.03], complement [0.1, 0.05, 0.15, ..., 0.06]; the ninth vector corresponding to the syntactic component "attributive" is [0.08, 0.15, 0.05, ..., 0.02].

[0123] In step 204, the ninth vector and the vector corresponding to the level are concatenated to form the seventh vector.

[0124] In some embodiments, the ninth vector corresponding to each syntactic component and the vector corresponding to the level are obtained. The two vectors are concatenated in a preset order (e.g., the ninth vector first, then the level-corresponding vector, or vice versa) to form a new vector with a dimension equal to the sum of the two, which serves as the seventh vector. This vector is used to comprehensively represent the type information of the syntactic component and its position information in the syntactic parsing tree. The order of vector concatenation can be adjusted, and the structure of the seventh vector can be optimized according to the processing habits of subsequent models. The dimensions of the ninth vector and the level-corresponding vector can be unified before concatenation (e.g., by adjusting the vector dimensions to be the same through linear transformation) to avoid dimension mismatch problems. Nonlinear transformations (e.g., through activation functions) can be applied to the concatenated seventh vector to enhance its expressive power and nonlinear fitting ability.

[0125] For example, the ninth vector (modifier) ​​of the syntactic component "our side" is [0.08, 0.15, 0.05, ..., 0.02], the vector corresponding to the level where the syntactic component "our side" is located (level 3) is [0.06, 0.03, 0.01, ..., 0.006], and the concatenated seventh vector is: [0.08, 0.15, 0.05, ..., 0.02, 0.06, 0.03, 0.01, ..., 0.006].

[0126] This application embodiment achieves multi-dimensional feature fusion of syntactic components through a progressive process of constructing a syntactic analysis tree, determining the vector corresponding to the level, mapping to obtain the ninth vector, and concatenating to generate the seventh vector. It not only preserves the type attribute of the syntactic component through the ninth vector, but also incorporates its positional features in the syntactic structure through the vector corresponding to the level, enabling the seventh vector to comprehensively and accurately represent the core characteristics of the syntactic component. This provides solid syntactic feature support for the extraction of subsequent processing logic and helps to improve the accuracy and reliability of the processing logic.

[0127] See also Figure 3E In step 10324, the fifth, sixth, and seventh vectors are merged to obtain the eighth vector.

[0128] In some embodiments, a vector fusion strategy is employed to concatenate, add, or weightedly fuse the fifth, sixth, and seventh vectors to obtain the eighth vector. An attention mechanism can be introduced for weighted fusion, dynamically adjusting the weights of the fifth, sixth, and seventh vectors during the fusion process based on different task requirements or contextual information, highlighting more important information. Nonlinear transformations (such as activation functions) of each vector before fusion are supported to enhance the vector's expressive power and nonlinear fitting ability.

[0129] For example, the fifth vector ("our side"): [0.23, 0.45, -0.12, ..., 0.89], the sixth vector ("our side" at position 0): [0.01, 0.02, 0.03, ..., 0.05], the seventh vector ("our side" is a modifier): [0.15, 0.22, -0.08, ..., 0.33], and the fusion method is addition, resulting in the eighth vector: [0.23+0.01+0.15, 0.45+0.02+0.22, -0.12+0.03+(-0.08), ..., 0.89+0.05+0.33]=[0.39, 0.69, -0.17, ..., 1.27].

[0130] In step 10325, the eighth vector is decoded to obtain the processing logic of the first model determining the second keyword from the first keyword.

[0131] In some embodiments, the eighth vector corresponding to each first keyword is input to the decoder (such as a decoder based on a recurrent neural network, a decoder structure based on Transformer, or a simple multilayer perceptron). The decoder processes the eighth vector and outputs a score representing the probability that the first keyword will become the second keyword, or directly generates descriptive processing logic rule text. Based on the output results of all first keywords, the processing logic for the first model to determine the second keyword from the first keywords is organized and refined. If the output is a score, a score threshold can be set, and the first keyword with a score higher than the score threshold is determined as the second keyword. If the output is rule text, the text can be further structured (such as extracting key phrases and building a rule base) for subsequent applications. Strategies such as beam search can be introduced during the decoding process to improve the quality and diversity of the generated processing logic rule text. Post-processing of the decoder output results is supported, such as filtering redundant rules and merging similar rules, making the final processing logic more concise and efficient.

[0132] For example, the sixth vector ("our side") is [0.39, 0.69, -0.17, ..., 1.27], and the eighth vector ("staff") is [0.11+0.06+0.44, 0.67+0.07+0.19, 0.34+0.08+0.55, ..., 0.56+0.10+0.27] = [0.61, 0.93, 0.97, ..., 0.93]. The eighth vector corresponding to each first keyword is input into the decoder to obtain the confidence score for each to become the second keyword. For example, the confidence score for the first keyword "our side" is 0.85, and the confidence score for the first keyword "staff" is 0.72. The processing logic is: select the first keyword "our side" with the highest confidence score as the second keyword.

[0133] This application's embodiments leverage the text understanding and logical extraction capabilities of the third model to achieve efficient and accurate generation of processing logic. The first prompt word contains complete information about the first conversation text, the first keyword, and the first conversation object, providing a comprehensive analytical basis for the third model. This ensures that the generated processing logic accurately reproduces the core decision rules of the first model for selecting the second keyword, providing clear and reliable logical support for subsequent updates to the second model. By encoding and fusing multi-dimensional information (the fifth semantic vector, the sixth positional vector, and the seventh syntactic vector) of the first keyword, an eighth vector that comprehensively represents the characteristics of the first keyword is obtained. Decoding based on the eighth vector allows the third model to analyze the internal mechanism of the first model's selection of the second keyword from a richer perspective, thereby more accurately and deeply extracting the processing logic of the first model. This method avoids the one-sidedness that may result from a single information source and enhances the reliability and generalization ability of the processing logic.

[0134] See also Figure 3A In step 104, the second model generates a second conversation text from the second conversation object based on the processing logic, the first keyword, and the first intent tag of the first conversation text. The second conversation object and the first conversation object are different objects participating in the same conversation.

[0135] Here, the pre-trained second model refers to the initial model with basic text generation capabilities, which has not undergone adaptation and optimization of processing logic, and the text it generates is not customized for the identity of a specific conversation object. The second conversation object and the first conversation object are different entities participating in the same conversation (such as service provider and requester, consultant and answerer, etc.), and their identity attributes correspond to each other, together constituting a complete conversation interaction scenario.

[0136] In some embodiments, see Figure 3G , Figure 3G This is a schematic diagram of the seventh process of the text processing method provided in the embodiments of this application. Figure 3A Step 104, "Generate second conversation text from the second conversation object based on the processing logic, the first keyword, and the first intent tag of the first conversation text using the second model," can be achieved through... Figure 3G Steps 1041 to 1044 are implemented, and the details are explained below.

[0137] In step 1041, the processing logic, the first intent label, and the second intent label corresponding to the first intent label are jointly encoded through the first network layer of the second model to obtain the first vector.

[0138] In some embodiments, since the first conversation text and the second conversation text to be generated have a logical correspondence in the interaction scenario, the corresponding second intent label (e.g., agent intent: identify oneself) can be determined through the first intent label (e.g., customer intent: verify identity). Each rule, first intent label, and second intent label in the processing logic are converted into numerical features and input into the first network layer of the second model (e.g., a fully connected layer or a multimodal feature fusion layer). The first network layer jointly encodes these numerical features and outputs a dense vector of fixed dimensions, which is the first vector. Through the first network layer, the second model can directly learn the core features of the processing logic and the mapping of the intents of both parties in the conversation. The processing logic can be hierarchically divided (core rules, auxiliary rules), and different weights can be assigned according to the hierarchy before encoding to strengthen the feature expression of the core logic.

[0139] For example, the processing logic is: "Rule 1: Combine the first relevance score (0.6) and the second relevance score (0.4) to obtain the third relevance score; Rule 2: Select the first keyword with the highest third relevance score as the second keyword", the first intent label is "verify identity", and the second intent label is "confirm identity"; after the first network layer jointly encodes the above information, the output first vector is [0.6, 0.4, 0.95, 0.05, ..., 0.8], which carries the global features of the processing logic and intent transformation.

[0140] In step 1042, each first keyword is encoded through the second network layer of the second model to obtain a second vector corresponding to each first keyword. Multiple second vectors are concatenated to obtain a third vector.

[0141] In some embodiments, the second network layer of the second model can be a pre-trained word embedding layer or a feature extraction network. This second network layer encodes each first keyword, generating a fixed-dimensional dense vector (second vector) corresponding to each first keyword. Following the original order of appearance of the first keywords in the first conversation text, the second vectors corresponding to all first keywords are concatenated end-to-end to form a longer-dimensional vector (third vector). The third vector retains the sequence features and semantic information of the keywords. A domain-adapted pre-trained word embedding model can be used as the second network layer to improve the accuracy of keyword semantic representation. Dimensional compression can be performed on the concatenated third vector to reduce the computational cost while retaining core features. Positional encoding markers can be added during concatenation to clarify the positional relationship of the first keywords corresponding to each second vector in the text.

[0142] For example, the first keyword is: [our side, staff] (in the first conversation text, "our side" comes first and "staff" comes last). After being encoded by the second network layer, the second vector corresponding to "our side" is [0.23, 0.45, -0.12, ..., 0.89], and the second vector corresponding to "staff" is [0.11, 0.67, 0.34, ..., 0.56]. The second vectors are concatenated according to the order of the first keyword in the first conversation text to obtain the third vector [0.23, 0.45, -0.12, ..., 0.89, 0.11, 0.67, 0.34, ..., 0.56].

[0143] In step 1043, the first vector, the second vector, and the third vector are fused through the third network layer of the second model to obtain the fourth vector.

[0144] In some embodiments, the third network layer of the second model is a network unit that performs feature interaction and tensor operations. Step 1043, "merging the first vector, the second vector, and the third vector to obtain the fourth vector," can be achieved by performing the following processing: calculating the vector product of the first vector and the third vector; calculating the product of this vector product and the second vector, and determining the product as the fourth vector. Through the above calculation logic, the first vector carrying the processing logic and intent features can first interact (vector product) with the third vector representing the global sequence features of the keywords, forming a global context weight that integrates identity logic; subsequently, this weight is multiplied with each independent second vector (individual word features), realizing precise control from macro-logic to micro-word meaning, so that the final fourth vector has both global logical constraints and retains accurate entity semantics.

[0145] For example, the first vector is [0.6, 0.4, 0.95, ..., 0.8], the third vector is [0.23, 0.45, -0.12, ..., 0.56], the second vector corresponding to "our side" is [0.23, 0.45, ..., 0.89], and the second vector corresponding to "staff" is [0.11, 0.67, ..., 0.56]. First, calculate the vector product of the first and third vectors: [0.6×0.23, 0.4×0.45, 0.95×(-0.12), ..., 0.8×0.56] = [0.138, 0.18, -0.114, ..., 0.448]. Then, multiply this vector product with each of the second vectors (multiplying along the corresponding dimensions). The product with the second vector corresponding to "our side" is: [0.138×0.23, 0.18×0.45, ..., 0.448×0.89] = [0.0317, 0.081, ..., 0.3987], the product of the second vector corresponding to "staff" is [0.138×0.11, 0.18×0.67, ..., 0.448×0.56] = [0.0152, 0.1206, ..., 0.2509]. Combining the two product results, the integrated fourth vector is [0.0317, 0.081, ..., 0.3987, 0.0152, 0.1206, ..., 0.2509].

[0146] In step 1044, the fourth vector is decoded to obtain the second session text originating from the second session object.

[0147] In some embodiments, the second model includes a decoder that receives the fourth vector, which integrates logic, intent, and identity features, and performs autoregressive or parallel decoding on the fourth vector to ultimately convert it into second conversational text in the form of a natural language sequence. Since the fourth vector has deeply absorbed the identity adaptation capabilities of the first and third network layers during the encoding and interaction stages, the second model can accurately generate response content that matches the identity of the second conversational object, improving the adaptability and accuracy of the generated second conversational text.

[0148] Here, in the process of generating the second conversation text through the second model, the following processing can be performed: construct a second prompt word based on the first conversation text and the second conversation object. The second prompt word is used to assist the second model in generating a second conversation text that is more in line with the scenario. The second prompt word is used as an additional input feature to input the second model for text generation, resulting in the second conversation text derived from the second conversation object. The second conversation text is used to reply to the first conversation text.

[0149] For example, following a fixed structure, the first conversation text and the second conversation object are combined in an orderly manner. Guiding statements are added to the combined content to explicitly require the generation of a second conversation text that conforms to the identity of the second conversation object and is used to reply to the first conversation text. The combined complete text is the second prompt word.

[0150] The order of combining the first conversation text and the second conversation object can be adjusted, and the structure of the prompt words can be optimized according to the text understanding habits of the second model (e.g., clarifying the second conversation object first, then presenting the first conversation text). Text generation constraints can be added to the guiding statements (e.g., "formal tone," "concise content," "fitting the business scenario") to ensure the second conversation text meets specific needs. Key information can be annotated in the first conversation text (e.g., using specific symbols to highlight core requests) to help the second model quickly focus on the key points of the response. The second prompt words are formatted according to the input format required by the second model; the formatted second prompt words are input into the second model, and the second model, guided by the features of the fourth vector, combines the context and core information of the first conversation text to generate a second conversation text that conforms to the identity characteristics of the second conversation object. Generation parameters for the second conversation text (e.g., text length, sentence style) can be set to adapt to the response needs of different conversation scenarios. The generation results of the second model can be optimized in multiple rounds; if the initially generated second conversation text does not meet expectations, additional prompt words (e.g., "confirm processing time") can be added and re-entered into the model for generation. For example, the first conversation text is: "Our staff will assist you in completing this transaction." The second conversation recipient is the requester. The second prompt could be: "First conversation text: Our staff will assist you in completing this transaction; Second conversation recipient: Requester. Please generate a second conversation text from the requester to reply to this first conversation text, with a friendly tone and confirmation of relevant matters." The second conversation text generated by the second model would be: "Thank you for your staff's assistance. We have clarified the relevant arrangements for the transaction and look forward to a smooth process."

[0151] This application embodiment deeply integrates the features of the first, second, and third network layers of the second model, and can construct a second prompt word by combining the first conversation text and the second conversation object. The second model then generates the second conversation text in a targeted manner, achieving accurate adaptation of the conversation response. The second prompt word clarifies the identity and purpose of the generated text, providing a clear basis for the generation of the second model. This ensures that the second conversation text not only conforms to the identity characteristics of the second conversation object, but also accurately responds to the core requirements of the first conversation text, thereby improving the coherence and adaptability of the conversation interaction.

[0152] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.

[0153] See Figure 5 , Figure 5 This is a flowchart illustrating the process of subject-based text enhancement based on deep learning provided in this application embodiment. It obtains the agent-side (i.e., the first conversation object mentioned above) text corpus (i.e., the first conversation text mentioned above) of all telemarketing conversation data. The agent-side text corpus includes text and intent tags (i.e., the first intent tags mentioned above). Traditional text enhancement expands the data under a specific intent tag to achieve enhancement. However, the subject-based text enhancement in this application embodiment is actually a data enhancement of corresponding tags between subjects, using intent tags as the basis for enhancement. For example, the agent's intent is to introduce themselves, and the customer's (i.e., the second conversation object mentioned above) intent (i.e., the second intent tag mentioned above) is to verify their identity. These different intents from the two subjects have a logical correspondence. If we want to enhance the customer's intent to "verify their identity" data based on the agent's intent "introduce themselves," we need the existing intent tag for "introduce themselves" and its text data. The text in this data format is "If you complete the withdrawal before 10 days, our system will increase your credit limit accordingly," and the tag is "credit limit increase commitment."

[0154] The main purpose of this application is to optimize the text enhancement model of related technologies, that is, to modify the method of "enhancing similar texts of A from text of type A" in related technologies to "enhancing texts similar to B from text of type A", that is, to achieve subject-specific enhancement between A and B. Because it is text enhancement between opposing subjects, unlike the training model of related technologies, the input parameters during the model training process not only include the initial text, but also the intent of the initial text and the subject-specific labels of the initial text.

[0155] During processing, the text on the agent side is first grouped according to the main node of the conversation. Then, the text is input into the pre-processing network of the first model (original model_1) one by one to obtain the subjectivity marker factors (i.e., the first keyword mentioned above) list for each text. The pre-processing network is essentially a text generation model. The input is the content of the text, such as "Our company will promise to increase your credit limit to a certain extent". The output is the content in the text that indicates the subjectivity of the text, that is, the identity information of the sender of the text, such as "[Our company]". If the input is "Please tell A to complete the repayment operation before 5 pm. Our relevant staff will deduct the payment at 5:30 pm", the output is "[You tell A, our relevant staff]". The training process is as follows: Load the pre-trained language model, such as qwen2.5-72B; send the labeled data into the pre-trained language model, with all the subjectivity marker factors in the text as labels. Set the training task as text generation, where the text is "Our company will promise to increase your credit limit to a certain extent", and the labels are "[Our company, promise to increase your credit limit to a certain extent]". The trained model is used as part of the first model.

[0156] The list of subject-specific marker factors is input into the subsequent classification network of the first model (original model_2). This classification network outputs the comprehensive competition result of multiple subject-specific marker factors (that is, the second keyword mentioned above is determined from it). That is, when marker factors or fuzzy indicator factors pointing to different subjects appear in the same text, the category with the highest confidence is output. Here, this classification network is essentially a text classification model. The input is the list of subject-specific marker factors, and the output is the subject category that the text is finally determined to be. The training process is as follows: load the pre-trained language model, such as qwen2.5-72B; input the labeled data into the pre-trained language model, select the category with higher frequency of occurrence from the categories of each subject-specific marker factor as the label, set the training task as text generation, for example, the text is the list of subject-specific marker factors and [Our company (seat), promises to give you... credit increase (seat)], the label is the subject category that the text is finally determined to be: seat; use the trained model as another part of the first model.

[0157] The text, subjectivity judgment results, and subjectivity marker factor list are input into the large model (i.e., the third model mentioned above). The large model assists in constructing the internal competition logic of the subjectivity marker factors (i.e., the final subjectivity judgment logic, also known as the processing logic mentioned above). The process of the large model analyzing the underlying internal competition logic of the subjectivity marker factors is actually a process of generating prompt words and repeatedly verifying and regenerating them using a thought chain approach. The text itself, subjectivity judgment results, and subjectivity marker factor list are input into the large model. The subjectivity marker factor list and subjectivity judgment results are used as input and output, respectively, and filled into the input and output slots of the guide words designed for the model. The combined whole is used as the input of the large model. Guide words are designed and input into the large model along with the input and output according to a preset logical expression. For example, "Because the subjectivity marker factor list appearing in the text is: [Our company (seat), promises to give you... a credit limit increase (seat)], through step-by-step thinking, we believe that the subjectivity category ultimately determined by the text is: seat."

[0158] The internal structure of the large model includes an encoding layer and a decoding layer. The encoding layer includes a positional encoding layer and a syntactic encoding layer. The encoding layer is used to encode each factor in the input list of subjectivity marker factors into sentence vectors and positional encodings, and to encode the context information of each factor's sentence vector through a multi-head self-attention mechanism. The above steps are the same as those in the encoding layer of the Transformer framework. The difference is that a syntactic encoding layer is added on top of the positional encoding layer. The syntactic encoding layer is used to perform syntactic analysis on the output pos (syntactic analysis unit) of the text itself to obtain the syntactic analysis result of the text. Then, it selects the part that exists in the list of subjectivity marker factors and obtains the syntactic component corresponding to the marker factor. According to the analysis layer label and the name of the syntactic component, syntactic encoding is performed to obtain the syntactic encoding vector. For example, if the syntactic component is in the first analysis layer, then

[01] is used as the value of the first two dimensions of the syntactic encoding vector. If the syntactic analysis result of the syntactic component is a predicate, then

[01000] is used as the value of the last dimension of the syntactic encoding vector. The concatenation results in [0101000]. The decoding layer is used to convert the final vector into text. Specifically, it merges the vector encoded by the network layer with the thinking template of the large model as the vector of the thinking summary, and converts this vector into text form as the text expression of the thinking result of the large model.

[0159] The concatenated text is input into the large model, and its sentence vector is obtained through the Sentence_Bert module. For example, "Input content, since the list of subjectivity marker factors appearing in the text is: [Our company (seat), promises to give you... credit increase (seat)], through step-by-step thinking, we believe that the subjectivity category of the text is finally determined to be: seat; obtain input vector". The reasoning process of the large model is encoded into text as inference vector. The input vector, inference vector and output vector are concatenated to obtain the concatenated vector, that is, output vector = inference vector + input vector + output vector.

[0160] Since the list of subjectivity markers in the text is: [Our company (seat), promises to give you... credit limit increase (seat)], the subjectivity category of the text is finally determined to be: seat. The thought process is as follows: "Large model output thought process: 1) Dimensions of thought: What is the problem, why, and how; What: Subjectivity markers such as ABCDE appear in the text, where ACD indicates subject a, BE indicates subject b, and the subjectivity category of the text is finally determined to be a; Why: Make an assumption that if the final subject a is selected, then calculate the sum of the contradiction values ​​between the markers BE and a (which do not indicate a) and a (i.e., the first value mentioned above), that is, Contradiction_with_a = Contradiction_with_aB + Contradiction_with_aE; If the final subject b is selected, then calculate the sum of the contradiction values ​​between the markers ACD and b (which do not indicate b), that is, Contradiction_with_b = Contradiction_with_bA + Contradiction_with_bC +Contradiction_with_bD; How to handle this: If the sum of contradiction values ​​corresponding to subject 'a' is greater than the sum of contradiction values ​​corresponding to subject 'b', then select 'b' as the subject; if the sum of contradiction values ​​corresponding to subject 'b' is greater than the sum of contradiction values ​​corresponding to subject 'a', then select 'a' as the subject; if the sum of contradiction values ​​corresponding to subject 'b' is equal to the sum of contradiction values ​​corresponding to subject 'a', then either 'a' or 'b' can be selected as the subject. The contradiction value can be determined by the sentence confusion level after word collocation. The higher the confusion level, the higher the contradiction value. The collocation method can be "subject + statement + labeling factor" or "subject + promise + labeling factor," selecting the lower confusion level as the final confusion level value; it can also be determined by the semantic distance between the labeling factor and the subject's own words. The greater the semantic distance, the higher the contradiction value; or the confusion level and semantic distance can be added together to obtain the contradiction value.

[0161] The internal competitive logic of the subjectivity marker factors is deeply encoded to form a subjectivity network layer, which represents the subjectivity tendency score of each factor. First, the first layer of the subjectivity network (i.e., the first network layer mentioned above) is used to input the logical text into any large model and complete sentence vector encoding. This encoding aims to represent subjectivity information, so the text describing the subjectivity information (logical text) must first be represented. This is achieved by encoding the sentence vectors of each sentence in the logical text. Next, the second layer of the subjectivity network (i.e., the second network layer mentioned above) is used to encode individual subjectivity marker factors using word vectors, arranged according to the order of the marker factors in the original text. The encoding layers are used for vector encoding of various dimensions of the input text. The first encoding layer is used for sentence vector encoding, and the second encoding layer is used for subjectivity marker factor encoding. Since the encoding result of the complete encoding operation of the specific network layers is a vector matrix, the subjectivity marker factors are the focus, and are encoded separately. The system first emphasizes the representation of subjectivity marker factors to obtain a total vector of multiple marker factors. Then, the third layer of the subjectivity network (i.e., the aforementioned third network layer) serves as a cross-representation layer for the marker factors and subjectivity result determination. It is used to determine the vector product of the vectors from the first and second layers, and multiply the vector product by the vectors in the second layer. The purpose of this third layer is to obtain a subjectivity marker factor vector carrying contextual information, which supplements the subjectivity marker factors obtained in the second layer. Finally, the aforementioned subjectivity network layer is added to the traditional text enhancement model (i.e., the aforementioned second model) as the last layer in the enhancement network. The subjectivity network layer mainly achieves text enhancement based on subject A by adding the fusion of subjectivity information of the input content in the decoding layer in the encoder-decoder interactive attention mechanism, and achieving text enhancement based on subject A to complete subject B in the text enhancement content through simple subject twisting. Specifically, the three network layers are located in the calculation unit of the loss function of the enhancement model. Specifically, the loss function layer concatenates the generated customer text (i.e., the second conversation text mentioned above), the obtained list of subject identity identifiers for that text, and the default subject identity labels (such as "customer") into a single logical text. This concatenation is then fed into the larger model, assuming that the generated text conforms to the customer subject identity. Subsequently, the logical quality of the generated logical text is used to infer whether the customer text meets the role requirements. This process achieves network innovation in the text augmentation model by integrating text subject identity information into the training and inference processes of the text augmentation model, enabling personalized text augmentation solutions that reverse the subject identity for both parties in the conversation.

[0162] In the specific attention-based vector fusion computation, the agent's text, intent label, and subject label are taken as input, and the corresponding customer text, intent label, and subject label are taken as output, and fed into the original model. The model's encoder encodes the agent's text, intent label, and subject label into sentence vectors respectively, and concatenates these three encodings as the final input encoding. The model's decoder encodes the customer's text, intent label, and subject label into sentence vectors respectively, and concatenates these three encodings as the final output encoding. The agent's subject vector encoding (Q and K) is used for attention calculation (using vector dot product) with the customer's subject vector encoding (V) in the output content to obtain a new information vector. The agent's intent vector encoding (Q and K) is used for attention calculation with the customer's intent vector encoding (V) in the output content to obtain a new intent information vector. Finally, the output vector is concatenated with the new information vector as the output vector encoding for fusing the input information, and the output vector encoding is then fed into a fully connected layer and a softmax layer for processing.

[0163] This application takes subjectivity as its starting point and proposes a text subjectivity discrimination scheme by identifying and summarizing subjectivity markers in text. In practice, in addition to subjectivity markers, other contextual background factors can be combined to jointly determine text subjectivity, thereby improving the accuracy of text subjectivity discrimination. Meanwhile, deep learning mainly adopts the method of adding a subjectivity network layer to integrate text subjectivity information into the training and inference process of the text enhancement model. In practice, a large-scale model prompting strategy can be used for black-box text enhancement.

[0164] Based on the generative model using the classic transformer framework (i.e., encoder-decoder network), a secondary generation process is added to transform the text from subject A to subject B. This process can be completely independent or integrated into the model. In telemarketing scenarios, if the amount of text representing all or part of the customer's intent in the existing data analysis for customer intent recognition is too small to train a robust customer intent recognition model, text augmentation can be performed to expand the existing training set. However, due to the limited existing data, directly using existing customer text data to augment the data multiple times will lead to two situations: the augmented data deviates from the actual text expression; and the augmented text has high homogeneity with the existing text, lacking diversity. Both of these situations negatively impact subsequent model training. Therefore, we can start from the text of the customer's counterpart, i.e., the agent, and augment the customer text from the agent text based on the semantic symmetry between the agent text and the customer text. This process utilizes subject recognition. For example, the agent's intent is to verify identity, while the customer's intent is to confirm identity. These two different intents from two entities have a logical correspondence. If we want to enhance the customer's intent to confirm identity based on the agent's intent to verify identity, we need the original intent tags and their text data. For example, the original agent text is: "Are you Mr. A?", and the enhanced customer text is: "I am Mr. A." Performing subject-based enhancement on the enhanced customer text yields Customer Text 1: I am A, and Customer Text 2: I am A. First, the agent text is input into the intent recognition model to obtain intent tags. Then, the agent text is input into the subject-based marker factor acquisition model to obtain marker factors. For example, if the agent text is: "Are you Mr. A?", the marker factor is [Are you...Mr.?], and the subject of the marker is: agent. Based on the correspondence between the agent's intent and the customer's intent, the selectable range of customer intents is determined. Simultaneously, the focus is on reversing the subject-based marker factors appearing in the text. For example, the marker factor is [Are you...Mr.?]. The text is transformed into "[I am Mr. A]" after twisting. The twisted part is then concatenated with the original text except for the marker factor to obtain the candidate enhanced text, for example, "I am Mr. A" + "A" = "I am Mr. A". The enhanced text is then subjected to subject identification. If the subject matches the enhancement purpose, i.e., the subject is the customer, the text is retained; otherwise, it is discarded. The enhanced text is then fed into the intent recognition model for intent verification. For example, the intent recognition result for "I am Mr. A" is: the customer's intent is to confirm identity. If the intent of the enhanced text matches the intent correspondence between the two subjects, the enhancement result is retained; otherwise, it is discarded.

[0165] This application's embodiments propose the concept of text subjectivity, refine subjectivity marker factors, integrate various subjectivity marker factors, and jointly determine the subjectivity of the text; by quantifying the text subjectivity information and integrating it into the text enhancement process, personalized text enhancement that reverses subjectivity for both parties in the conversation is achieved.

[0166] The following description continues to illustrate the exemplary structure of the text processing device 233 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 2 As shown, the software modules stored in the text processing device 233 of the memory 230 may include:

[0167] The data extraction module 2331 is used to extract the first keyword from the first conversation text.

[0168] The source determination module 2332 is used to determine the second keyword from the first keyword through the first model, and to determine the first conversation object from which the first conversation text originates based on the second keyword.

[0169] The logic analysis module 2333 is used to analyze the first conversation text, the first keyword, and the first conversation object to obtain the processing logic of the first model to determine the second keyword from the first keyword.

[0170] The text generation module 2334 is used to generate second conversation text from a second conversation object based on the processing logic, the first keyword, and the first intent tag of the first conversation text through the second model. The second conversation object and the first conversation object are different objects participating in the same conversation.

[0171] In some embodiments, the data extraction module 2331 is further configured to perform word segmentation on the first conversation text to obtain multiple candidate words; perform text analysis on the multiple candidate words to obtain the first relevance of each candidate word to a preset object; and use the candidate words with the first relevance greater than or equal to the first relevance threshold as the first keywords.

[0172] In some embodiments, the source determination module 2332 is further configured to determine a first value through a first model, the first value being used to characterize the degree of contradiction between each first keyword and each preset object; and to select a second keyword from the first keywords based on the first value corresponding to each first keyword.

[0173] In some embodiments, the logic analysis module 2333 is further configured to combine the first conversation text, the first keyword, and the first conversation object into a first prompt word, the first prompt word being used to instruct the third model to generate processing logic for the first model to determine the second keyword from the first keyword; inputting the first prompt word into the third model for text analysis to obtain the processing logic for the first model to determine the second keyword from the first keyword.

[0174] In some embodiments, the logic analysis module 2333 is further configured to encode the first keyword to obtain a fifth vector; encode the position of the first keyword in the first conversation text to obtain a sixth vector; perform syntactic analysis on the first conversation text to obtain syntactic analysis results; extract the syntactic components corresponding to the first keyword from the syntactic analysis results; encode the syntactic components to obtain a seventh vector; fuse the fifth vector, the sixth vector, and the seventh vector to obtain an eighth vector; and decode the eighth vector to obtain the processing logic of the first model determining the second keyword from the first keyword.

[0175] In some embodiments, the logic analysis module 2333 is further configured to construct a syntactic analysis tree based on the logical relationships between syntactic components; for each syntactic component, determine the level of the syntactic component in the syntactic analysis tree, with different levels corresponding to different vectors; map the name of the syntactic component to a ninth vector according to a preset mapping relationship; and concatenate the ninth vector and the vector corresponding to the level to form a seventh vector.

[0176] In some embodiments, the text generation module 2334 is further configured to: encode the processing logic, the first intent label, and the second intent label corresponding to the first intent label through the first network layer of the second model to obtain a first vector; encode each first keyword through the second network layer of the second model to obtain a second vector corresponding to each first keyword; concatenate multiple second vectors to obtain a third vector; fuse the first vector, the second vector, and the third vector through the third network layer of the second model to obtain a fourth vector; and decode the fourth vector to obtain the second conversation text originating from the second conversation object.

[0177] In some embodiments, the text generation module 2334 is further configured to calculate the vector product of the first vector and the third vector; calculate the product of the vector product and the second vector, and determine the product as the fourth vector.

[0178] This application provides a computer program product comprising 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 above in this application.

[0179] This application provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will execute the text processing method provided in this application, for example, such as... Figure 3A The text processing method shown.

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

[0181] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, 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 stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.

[0182] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).

[0183] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.

[0184] In summary, through the embodiments of this application, a progressive keyword filtering mechanism is established by extracting the first keyword from the first conversation text, then using the first model to filter and determine the second keyword, and finally determining the first conversation object based on the second keyword. This constructs a direct mapping path between keywords and the identity of the conversation object, improving the correlation between the second keyword and the identity of the conversation object, and enhancing the accuracy and reliability of conversation object determination. By combining the analysis of the first conversation text, the first keyword, and the first conversation object, the processing logic of the first model is obtained. Through the second model, based on this processing logic, the first keyword, and the first intent tag of the first conversation text, the complete processing logic of the first model for filtering the second keyword can be fully restored. This processing logic makes the update process of the second model highly targeted and clearly directional, ensuring that the updated second model can accurately adapt to the identity of the second conversation object. Furthermore, since the second conversation object and the first conversation object are different objects participating in the same conversation, the second model can accurately match the identities of different conversation objects in the conversation scenario, generating conversation text that conforms to the corresponding identity. This improves the adaptability of the second model in conversation interaction scenarios and the accuracy of generating conversation text that conforms to the identity.

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

Claims

1. A text processing method, characterized in that, The method includes: Extract the first keyword related to the identity of the conversation object from the first conversation text; The first keyword is determined from the first keyword using the first model, and the first conversation object from which the first conversation text originates is determined based on the second keyword; Based on the analysis of the first conversation text, the first keyword, and the first conversation object, the processing logic of the first model to determine the second keyword from the first keyword is obtained; The second model generates a second conversation text from a second conversation object based on the processing logic, the first keyword, and the first intent tag of the first conversation text. The second conversation object and the first conversation object are different objects participating in the same conversation.

2. The method according to claim 1, characterized in that, The step of generating second conversation text from a second conversation object through a second model, based on the processing logic, the first keyword, and the first intent tag of the first conversation text, includes: The first vector is obtained by jointly encoding the processing logic, the first intent label, and the second intent label corresponding to the first intent label through the first network layer of the second model. The second network layer of the second model encodes each first keyword to obtain a second vector corresponding to each first keyword. Multiple second vectors are concatenated to obtain a third vector. The third network layer of the second model is used to fuse the first vector, the second vector, and the third vector to obtain the fourth vector; Decoding the fourth vector yields the second session text originating from the second session object.

3. The method according to claim 2, characterized in that, The process of fusing the first vector, the second vector, and the third vector to obtain the fourth vector includes: Calculate the vector product of the first vector and the third vector; Calculate the product of the vector product and the second vector, and determine the product as the fourth vector.

4. The method according to claim 1, characterized in that, The processing logic for determining the second keyword from the first keyword by analyzing the first conversation text, the first keyword, and the first conversation object includes: The first conversation text, the first keyword, and the first conversation object are combined into a first prompt word. The first prompt word is used to instruct the third model to generate the processing logic of the first model to determine the second keyword from the first keyword. The first prompt word is input into the third model for text analysis, and the processing logic of the first model to determine the second keyword from the first keyword is obtained.

5. The method according to claim 4, characterized in that, The step of inputting the first prompt word into the third model for text analysis to obtain the processing logic of the first model determining the second keyword from the first keyword includes: The first keyword is encoded to obtain the fifth vector; The position of the first keyword in the first conversation text is encoded to obtain the sixth vector; Perform syntactic analysis on the first conversation text to obtain syntactic analysis results, extract the syntactic components corresponding to the first keyword from the syntactic analysis results, encode the syntactic components, and obtain the seventh vector; The fifth vector, the sixth vector, and the seventh vector are merged to obtain the eighth vector; Decoding the eighth vector yields the processing logic for the first model to determine the second keyword from the first keyword.

6. The method according to claim 5, characterized in that, The encoding of the syntactic components to obtain the seventh vector includes: Construct a syntactic analysis tree based on the logical relationships between the syntactic components; For each syntactic component, the level of the syntactic component in the syntactic parsing tree is determined, and different levels correspond to different vectors; The names of the syntactic components are mapped to a ninth vector according to a preset mapping relationship; The ninth vector and the vector corresponding to the level are concatenated to form the seventh vector.

7. The method according to claim 1, characterized in that, The extraction of the first keyword from the first conversation text includes: The first conversation text was segmented to obtain multiple candidate words; Text analysis is performed on the multiple candidate words to obtain the first relevance of each candidate word to a preset object; Candidate words whose relevance is greater than or equal to the first relevance threshold are identified as first keywords.

8. The method according to claim 1, characterized in that, The step of determining the second keyword from the first keyword using the first model includes: A first value is determined by a first model, and the first value is used to characterize the degree of contradiction between each first keyword and each preset object. Based on the first value corresponding to each of the first keywords, a second keyword is selected from the first keywords.

9. A text processing device, characterized in that, The device includes: The data extraction module is used to extract the first keyword related to the identity of the conversation object from the first conversation text; The source determination module is used to determine a second keyword from the first keyword using a first model, and to determine the first session object from which the first session text originates based on the second keyword; The logic analysis module is used to analyze the first conversation text, the first keyword, and the first conversation object to obtain the processing logic of the first model to determine the second keyword from the first keyword. The text generation module is used to generate second conversation text from a second conversation object based on the processing logic, the first keyword, and the first intent tag of the first conversation text, using the second model. The second conversation object and the first conversation object are different objects participating in the same conversation.

10. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the text processing method according to any one of claims 1 to 8.

11. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the text processing method according to any one of claims 1 to 8.

12. A computer program product comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the text processing method according to any one of claims 1 to 8.