Search

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

CN122019732ACN 122019732 ACN122019732 ACN 122019732ACN-122019732-A

Abstract

The application provides a text processing method, a text processing device, electronic equipment, a computer readable storage medium and a computer program product, wherein the method comprises the steps of extracting a first keyword from a first session text, determining a second keyword from the first keyword through a first model, determining a first session object from which the first session text is sourced based on the second keyword, analyzing the first session text, the first keyword and the first session object to obtain processing logic for determining the second keyword from the first keyword through the first model, and generating a second session text from the second session object through the second model based on the processing logic, the first keyword and a first intention label of the first session text, wherein the second session object and the first session object are different objects participating in the same session. According to the method and the device, the accuracy of generating the session text of different session objects in the same session by the model can be improved.

Inventors

  • BAI ANQI
  • LI KUAN

Assignees

  • 马上消费金融股份有限公司

Dates

Publication Date
20260512
Application Date
20260410

Claims (12)

  1. 1. A method of text processing, the method comprising: extracting a first keyword from the first session text; Determining a second keyword from the first keyword through a first model, and determining a first session object from which the first session text is derived based on the second keyword; processing logic for analyzing based on the first session text, the first keyword, and the first session object to obtain a determination of the second keyword from the first keyword by the first model; generating, by a second model, second session text derived from a second session object, the second session object being a different object participating in the same session than the first session object, based on the processing logic, the first keyword, and the first intent tag of the first session text.
  2. 2. The method of claim 1, wherein generating, by the second model, second conversation text derived from the second conversation object based on the processing logic, the first keyword, and the first intent tag of the first conversation text comprises: Performing joint coding on the processing logic, the first intention label and a second intention label corresponding to the first intention label through a first network layer of a second model to obtain a first vector; Encoding each first keyword through a second network layer of the second model to obtain a second vector corresponding to each first keyword, and splicing a plurality of second vectors to obtain a third vector; Fusing the first vector, the second vector and the third vector through a third network layer of the second model to obtain a fourth vector; And decoding the fourth vector to obtain a second session text from the second session object.
  3. 3. The method of claim 2, wherein the fusing the first vector, the second vector, the third vector to obtain a fourth vector comprises: calculating a vector product of the first vector and the third vector; A product of the vector product and the second vector is calculated, and the product is determined to be a fourth vector.
  4. 4. The method of claim 1, wherein the processing logic that analyzes based on the first session text, the first keyword, and the first session object to obtain the first model to determine the second keyword from the first keyword comprises: Combining the first session text, the first keyword and the first session object into a first prompt word, wherein the first prompt word is used for indicating a third model to generate the first model and determining the second keyword from the first keyword; and inputting the first prompt word into the third model for text analysis to obtain processing logic for determining the second keyword from the first keyword by the first model.
  5. 5. The method of claim 4, wherein the processing logic for inputting the first prompt word into the third model for text analysis to obtain the first model to determine the second keyword from the first keyword comprises: encoding the first keyword to obtain a fifth vector; encoding the position of the first keyword in the first session text to obtain a sixth vector; performing syntactic analysis on the first session text to obtain a syntactic analysis result, extracting syntactic components corresponding to the first keywords from the syntactic analysis result, and encoding the syntactic components to obtain a seventh vector; Fusing the fifth vector, the sixth vector and the seventh vector to obtain an eighth vector; And decoding the eighth vector to obtain processing logic for determining the second keyword from the first keyword by the first model.
  6. 6. The method of claim 5, wherein encoding the syntax element to obtain a seventh vector comprises: Constructing a syntax analysis tree based on the logical relationship between the syntax elements; determining, for each of the syntax elements, a hierarchy of the syntax element in the syntax analysis tree, different ones of the hierarchies corresponding to different vectors; Mapping the names of the syntax components into a ninth vector according to a preset mapping relation; and splicing the ninth vector and the vector corresponding to the hierarchy into a seventh vector.
  7. 7. The method of claim 1, wherein the extracting the first keyword from the first session text comprises: word segmentation processing is carried out on the first session text to obtain a plurality of candidate words; text analysis is carried out on the plurality of candidate words, and a first correlation degree between each candidate word and a preset object is obtained; And determining the candidate word with the first relevance being greater than or equal to a first relevance threshold as a first keyword.
  8. 8. The method of claim 1, wherein the determining, by the first model, the second keyword from the first keywords comprises: determining a first numerical value through a first model, wherein the first numerical value is used for representing the contradiction degree of each first keyword pointing to each preset object; And selecting a second keyword from the first keywords based on the first value corresponding to each first keyword.
  9. 9. A text processing apparatus, the apparatus comprising: the data extraction module is used for extracting a first keyword from the first session text; a source determining module, configured to determine a second keyword from the first keywords through a first model, and determine a first session object from which the first session text originates based on the second keyword; The logic analysis module is used for analyzing based on the first conversation text, the first keyword and the first conversation object to obtain processing logic of the first model for determining the second keyword from the first keyword; And the text generation module is used for generating a second session text from a second session object based on the processing logic, the first keyword and the first intention label of the first session text through a second model, wherein the second session object and the first session object are different objects participating in the same session.
  10. 10. An electronic device, the electronic device comprising: A memory for storing computer executable instructions or computer programs; a processor for implementing the text processing method of any of claims 1 to 8 when executing computer executable instructions or computer programs stored in the memory.
  11. 11. A computer-readable storage medium storing computer-executable instructions or a computer program, which when executed by a processor implements the text processing method of any one of claims 1 to 8.
  12. 12. A computer program product comprising computer executable instructions or a computer program, which when executed by a processor implements the text processing method of any of claims 1 to 8.

Description

Text processing method, apparatus, electronic device, computer readable storage medium and computer program product Technical Field The present application relates to the field of data processing technology, and in particular, to a text processing method, a text processing device, an electronic device, a computer readable storage medium, and a computer program product. Background In the field of natural language processing, model training based on conversation text is widely applied to scenes such as conversation generation and identity recognition. Because the model training requirement for the session interaction scene is increasing, the model is optimized through the related information of the session text, so that the session text generation of different session objects in the same session is realized. In the related art, the model training is carried out by matching text features or keywords with multiple single dimensions to carry out session object association and model updating, so that the session text generated by the model is difficult to match the identities of different session objects in the same session accurately, and the accuracy of the session text generated by the model is low. Disclosure of Invention The embodiment of the application provides a text processing method, a text processing device, electronic equipment, a computer readable storage medium and a computer program product, which can improve the accuracy of generating conversation texts of different conversation objects in the same conversation by a model. The technical scheme of the embodiment of the application is realized as follows: the embodiment of the application provides a text processing method, which comprises the following steps: extracting a first keyword from the first session text; Determining a second keyword from the first keyword through a first model, and determining a first session object from which the first session text is derived based on the second keyword; processing logic for analyzing based on the first session text, the first keyword, and the first session object to obtain a determination of the second keyword from the first keyword by the first model; generating, by a second model, second session text derived from a second session object, the second session object being a different object participating in the same session than the first session object, based on the processing logic, the first keyword, and the first intent tag of the first session text. The embodiment of the application provides a text processing device, which comprises: the data extraction module is used for extracting a first keyword from the first session text; a source determining module, configured to determine a second keyword from the first keywords through a first model, and determine a first session object from which the first session text originates based on the second keyword; The logic analysis module is used for analyzing based on the first conversation text, the first keyword and the first conversation object to obtain processing logic of the first model for determining the second keyword from the first keyword; And the text generation module is used for generating a second session text from a second session object based on the processing logic, the first keyword and the first intention label of the first session text through a second model, wherein the second session object and the first session object are different objects participating in the same session. An embodiment of the present application provides an electronic device, including: A memory for storing computer executable instructions or computer programs; And the processor is used for realizing the text processing method provided by the embodiment of the application when executing the computer executable instructions or the computer programs stored in the memory. The embodiment of the application provides a computer readable storage medium, which stores a computer program or computer executable instructions for implementing the text processing method provided by the embodiment of the application when being executed by a processor. The embodiment of the application provides a computer program product, which comprises a computer program or a computer executable instruction, and the computer program or the computer executable instruction realize the text processing method provided by the embodiment of the application when being executed by a processor. The embodiment of the application has the following beneficial effects: By extracting the first keyword from the first session text, then screening and determining the second keyword by the first model, determining the first session object based on the second keyword, a progressive keyword screening mechanism is established, a direct mapping path of the keyword and the identity of the session object is established, the relevance of the second keyword and the identity of the session object is improved, and the accuracy