Intelligent text processing method, device, electronic device and storage medium

Through intelligent text processing methods, the neural network of text processing models is used to extract feature vectors and latent variables, and generate candidate word probabilities, which solves the problem of inaccurate text selection in traditional devices and improves text processing quality and user experience.

CN111144093BActive Publication Date: 2024-09-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201911367547.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-26
Publication Date
2024-09-27
Estimated Expiration
2039-12-26

AI Technical Summary

Technical Problem

When traditional touch screen electronic devices select text information, due to the limited operable area and the user's one-handed operation habit, the selection is inaccurate, affecting speed and accuracy.

Method used

Using intelligent text processing methods, by obtaining the chapter-level text content of the touch screen selection operation, using the neural network of the text processing model to extract feature vectors, determining sentence and word-level hidden variables, generating candidate words and their selection probabilities, selecting the target text and displayed on the touch screen.

Benefits of technology

It improves the generalization ability and training accuracy of the text processing model, adapts to different usage scenarios, reduces the impact of environmental noise, and improves the quality of text processing results and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111144093B
    Figure CN111144093B
Patent Text Reader

Abstract

The present invention provides an intelligent text processing method, including: obtaining the text content at the chapter level corresponding to the selected operation in the touch screen; extracting the feature vector matching the text content at the chapter level; determining the sentence vector corresponding to the text content; determining at least one word-level latent variable corresponding to the text content; generating candidate words corresponding to the word-level latent variables and the probability of the candidate words being selected; according to the probability of the candidate words being selected and the sentence vector corresponding to the text content, selecting at least one candidate word to form a target text corresponding to the text content. The present invention also provides a text processing device, an electronic device and a storage medium. The present invention can realize that when a user uses the touch screen to select text, the corresponding chapter-level sentences in the touch screen can be processed to improve the accuracy and readability of the generated text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to information processing technology, and in particular to an intelligent text processing method, device, electronic device and storage medium. Background Art

[0002] In traditional technology, when using touch screen electronic devices (mobile phones, iPads, etc.) to select text information, due to the limited operable area of ​​the touch screen and the user's habit of one-handed operation, the user's manual control of the cursor to select text is not accurate, and the user often encounters the situation where the ideal text cannot be selected, which affects the user's selection speed and selection accuracy for the text. For this reason, artificial intelligence technology (AI, Artificial Intelligence) provides an appropriate text processing process operation mechanism to support the above application solutions. Among them, artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that the machine has the functions of perception, reasoning and decision-making. In the field of speech processing, it is to realize the recognition of text information by using digital computers or machines controlled by digital computers. Summary of the invention

[0003] In view of this, the embodiments of the present invention provide an intelligent text processing method, device, electronic device and storage medium. The technical solution of the embodiments of the present invention is implemented as follows:

[0004] The embodiment of the present invention provides an intelligent text processing method, including:

[0005] Get the text content at the chapter level corresponding to the selected operation on the touch screen;

[0006] Extracting a feature vector matching the text content at the chapter level through a first neural network of the text processing model;

[0007] Determining, by means of a first neural network of the text processing model, a sentence vector corresponding to the text content according to the feature vector;

[0008] Determining at least one word-level latent variable corresponding to the text content according to the feature vector through a second neural network of the text processing model;

[0009] Generate, by means of a second neural network of the text processing model, candidate words corresponding to the latent variable at the word level and the probability of selection of the candidate words according to the latent variable at the word level;

[0010] According to the probability of the candidate words being selected and the sentence vector corresponding to the text content, at least one candidate word is selected to form a target text corresponding to the text content;

[0011] The target text is displayed on the touch screen in a display manner corresponding to the selection operation.

[0012] In the above scheme, the method further comprises:

[0013] Acquire a first training sample set, wherein the first training sample set includes at least one set of sentence samples at the chapter level input through a corresponding touch screen;

[0014] Performing denoising processing on the first training sample set to form a corresponding second training sample set;

[0015] Processing the second training sample set by a text processing model to determine initial parameters of a first neural network and initial parameters of a second neural network in the text processing model;

[0016] In response to initial parameters of the first neural network and initial parameters of the second neural network, the second training sample set is processed by the text processing model to determine update parameters corresponding to different neural networks of the text processing model;

[0017] According to the update parameters of the text processing model corresponding to different neural networks of the text processing model, the parameters of the first neural network and the parameters of the second neural network of the text processing model are iteratively updated respectively through the second training sample set to realize the processing of the corresponding chapter-level text content in the touch screen through the text processing model.

[0018] In the above solution, the denoising process is performed on the first training sample set to form a corresponding second training sample set, including:

[0019] Determining a dynamic noise threshold that matches the usage environment of the text processing model;

[0020] The first training sample set is denoised according to the dynamic noise threshold to form a second training sample set matching the dynamic noise threshold.

[0021] In the above solution, the denoising process is performed on the first training sample set to form a corresponding second training sample set, including:

[0022] Determining a fixed noise threshold corresponding to an environment in which the text processing model is used;

[0023] The first training sample set is denoised according to the fixed noise threshold to form a second training sample set matching the fixed noise threshold.

[0024] In the above scheme, the method further comprises:

[0025] In response to the training sample dictionary set of the text processing model, determining a set of attention parameters for the second training sample set;

[0026] According to the training sample dictionary set and the attention parameter set of the second training sample set, weighted processing is performed on the second training sample set to achieve adaptation of the second training sample set to the training sample dictionary set of the text processing model.

[0027] In the above scheme, the method further comprises:

[0028] Performing negative example processing on the first training sample set to form a negative example sample set corresponding to the first training sample set, wherein the negative example sample set is used to adjust encoder parameters and decoder parameters of the first neural network, or adjust encoder parameters and decoder parameters of the second neural network;

[0029] A corresponding evaluation research value is determined according to the negative sample set, wherein the evaluation research value is used as a supervision parameter to evaluate the text processing result of the text processing model.

[0030] In the above solution, the negative example processing of the first training sample set includes:

[0031] Randomly combining the sentences to be output generated by the text processing model to form a negative sample set corresponding to the first training sample set; or,

[0032] The sentences to be output generated by the text processing model are randomly deleted or replaced to form a negative sample set corresponding to the first training sample set.

[0033] In the above scheme, the updating parameters of the text processing model according to the updating parameters corresponding to different neural networks of the text processing model, and iteratively updating the parameters of the first neural network and the parameters of the second neural network of the text processing model respectively through the second training sample set, include:

[0034] Determining a second noise parameter that matches the second training sample set, where the second noise parameter is used to characterize noise values ​​of parallel sentence samples in the second training sample set;

[0035] Iteratively updating the encoder parameters and the decoder parameters of the first neural network according to the noise value of the second noise parameter until the loss function corresponding to the autoencoder network formed by the encoder and the decoder of the first neural network meets the corresponding convergence condition;

[0036] According to the noise value of the second noise parameter, the encoder parameters and the decoder parameters of the second neural network are iteratively updated until the loss function corresponding to the autoencoder network composed of the encoder and the decoder of the second neural network meets the corresponding convergence condition.

[0037] The embodiment of the present invention further provides an intelligent text processing device, the device comprising:

[0038] The information processing module is used to obtain the text content at the chapter level corresponding to the operation selected on the touch screen;

[0039] The information processing module is used to extract a feature vector matching the text content at the chapter level through the first neural network of the text processing model;

[0040] The information processing module is used to determine a sentence vector corresponding to the text content according to the feature vector through the first neural network of the text processing model;

[0041] The information processing module is used to determine at least one word-level latent variable corresponding to the text content according to the feature vector through the second neural network of the text processing model;

[0042] The information processing module is used to generate candidate words corresponding to the word-level latent variable and the probability of selection of the candidate words according to the at least one word-level latent variable through the second neural network of the text processing model;

[0043] The information processing module is used to select at least one candidate word to form a target text corresponding to the text content at the chapter level according to the probability of selection of the candidate word and the sentence vector corresponding to the text content;

[0044] The information transmission module is used to display the target text on the touch screen in a display mode corresponding to the selection operation.

[0045] In the above scheme,

[0046] The information processing module is used to trigger a corresponding word segmentation library according to the text parameter information carried by the text content at the chapter level displayed on the touch screen;

[0047] The information processing module is used to perform word segmentation processing on the text content at the chapter level displayed on the touch screen through the triggered word segmentation library dictionary to form different word-level feature vectors;

[0048] The information processing module is used to perform noise removal on the different word-level feature vectors to form a word-level feature vector set that matches the text content at the chapter level.

[0049] In the above scheme,

[0050] The information processing module is used to determine a dynamic noise threshold that matches the usage environment of the text processing model;

[0051] The information processing module is used to perform noise removal processing on the different word-level feature vectors according to the dynamic noise threshold, and trigger a dynamic word segmentation strategy that matches the dynamic noise threshold;

[0052] The information processing module is used to perform word segmentation processing on the text content at the chapter level displayed on the touch screen according to the dynamic word segmentation strategy matching the dynamic noise threshold, so as to form a corresponding dynamic word level feature vector set.

[0053] In the above scheme,

[0054] The information processing module is used to determine a fixed noise threshold corresponding to the use environment of the text processing model;

[0055] The information processing module is used to perform noise removal processing on the different word-level feature vectors according to the fixed noise threshold, and trigger a fixed word segmentation strategy that matches the fixed noise threshold;

[0056] According to the fixed word segmentation strategy that matches the fixed noise threshold, the target text at the chapter level displayed on the touch screen is segmented to form a corresponding fixed word-level feature vector set.

[0057] In the above scheme,

[0058] The information processing module is used to select at least one candidate word to form a target text corresponding to the text content according to the probability of the candidate word being selected and the sentence vector corresponding to the text content, including:

[0059] The information processing module is used to match the sentence vector corresponding to the text content with the text content displayed on the touch screen;

[0060] The information processing module is used to perform a fusion process on the selection probability of the candidate words according to the matching result of the sentence vector corresponding to the text content and the text content at the chapter level displayed on the touch screen;

[0061] The information processing module is used to select at least one candidate word to form a target text corresponding to the text content at the chapter level according to the fusion processing result of the selection probability of the candidate words.

[0062] In the above scheme,

[0063] The information transmission module is used to obtain a first training sample set, wherein the first training sample set includes at least one set of sentence samples at the chapter level input through a corresponding touch screen;

[0064] The information processing module is used to perform denoising on the first training sample set to form a corresponding second training sample set;

[0065] The information processing module is used to process the second training sample set through the text processing model to determine the initial parameters of the first neural network and the initial parameters of the second neural network in the text processing model;

[0066] The information processing module is used to process the second training sample set through the text processing model in response to the initial parameters of the first neural network and the initial parameters of the second neural network, and determine the update parameters corresponding to different neural networks of the text processing model;

[0067] The information processing module is used to iteratively update the parameters of the first neural network and the parameters of the second neural network of the text processing model according to the update parameters corresponding to the different neural networks of the text processing model, through the second training sample set, so as to realize the processing of the corresponding chapter-level text content in the touch screen through the text processing model.

[0068] In the above scheme,

[0069] The information processing module is used to determine a dynamic noise threshold that matches the usage environment of the text processing model;

[0070] The information processing module is used to perform denoising on the first training sample set according to the dynamic noise threshold to form a second training sample set matching the dynamic noise threshold.

[0071] In the above scheme,

[0072] The information processing module is used to determine a fixed noise threshold corresponding to the use environment of the text processing model;

[0073] The information processing module is used to perform denoising processing on the first training sample set according to the fixed noise threshold to form a second training sample set matching the fixed noise threshold.

[0074] In the above scheme,

[0075] The information processing module is used to substitute different sentence samples in the second training sample set into the loss function corresponding to the autoencoder network composed of the encoder and decoder of the first neural network of the text processing model;

[0076] The information processing module is used to determine the parameters of the encoder and the corresponding decoder parameters of the first neural network corresponding to the loss function satisfying the first convergence condition as update parameters of the first neural network;

[0077] The information processing module is used to substitute different sentence samples in the second training sample set into the loss function corresponding to the autoencoder network composed of the encoder and decoder of the second neural network of the text processing model;

[0078] The information processing module is used to determine the parameters of the encoder and the corresponding decoder parameters of the second neural network as the update parameters of the second neural network when the loss function satisfies the second convergence condition.

[0079] In the above scheme,

[0080] The information processing module is used to determine a second noise parameter that matches the second training sample set, where the second noise parameter is used to characterize the noise value of the parallel sentence samples in the second training sample set;

[0081] The information processing module is used to iteratively update the encoder parameters and the decoder parameters of the first neural network according to the noise value of the second noise parameter until the loss function corresponding to the autoencoder network composed of the encoder and the decoder of the first neural network meets the corresponding convergence condition;

[0082] The information processing module is used to iteratively update the encoder parameters and decoder parameters of the second neural network according to the noise value of the second noise parameter until the loss function corresponding to the autoencoder network composed of the encoder and decoder of the second neural network meets the corresponding convergence condition.

[0083] In the above scheme,

[0084] The information processing module is used to determine the attention parameter set of the second training sample set in response to the training sample dictionary set of the text processing model;

[0085] The information processing module is used to perform weighted processing on the second training sample set according to the training sample dictionary set and the attention parameter set of the second training sample set, so as to achieve adaptation of the second training sample set to the training sample dictionary set of the text processing model.

[0086] In the above scheme,

[0087] The information processing module is used to perform negative example processing on the first training sample set to form a negative example sample set corresponding to the first training sample set, wherein the negative example sample set is used to adjust the encoder parameters and the decoder parameters of the first neural network, or adjust the encoder parameters and the decoder parameters of the second neural network;

[0088] The information processing module is used to determine a corresponding evaluation research value according to the negative sample set, wherein the evaluation research value is used as a supervision parameter to evaluate the text processing result of the text processing model.

[0089] In the above scheme,

[0090] The information processing module is used to randomly combine the sentences to be output generated by the text processing model to form a negative sample set corresponding to the first training sample set;

[0091] The information processing module is used to randomly delete or replace the sentences to be output generated by the text processing model to form a negative sample set corresponding to the first training sample set.

[0092] An embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0093] A memory for storing executable instructions;

[0094] The processor is used to implement the preceding training method when running the executable instructions stored in the memory.

[0095] An embodiment of the present invention further provides a computer-readable storage medium storing executable instructions, which, when executed by a processor, implement the preceding intelligent text processing method.

[0096] The embodiments of the present invention have the following beneficial effects:

[0097] The present invention obtains a first training sample set, performs denoising processing on the first training sample set to form a corresponding second training sample set; processes the second training sample set through a text processing model to determine initial parameters of a first neural network and initial parameters of a second neural network in the text processing model; in response to the initial parameters of the first neural network and the initial parameters of the second neural network, processes the second training sample set through the text processing model to determine update parameters corresponding to different neural networks of the text processing model; according to the update parameters corresponding to different neural networks of the text processing model, the update parameters of the text processing model are iteratively updated through the second training sample set. Thus, the generalization ability of the text processing model is enhanced, the training accuracy and training speed of the text processing model are improved, and the text processing model can adapt to different usage scenarios, avoid the influence of environmental noise on the text processing model, so that the text processing model can produce high-quality text processing results, and improve the ability of the text processing model to process corresponding chapter-level sentences in the touch screen. BRIEF DESCRIPTION OF THE DRAWINGS

[0098] Figure 1 A schematic diagram of a usage scenario of the text processing model training method provided in an embodiment of the present invention;

[0099] Figure 2 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;

[0100] Figure 3 A schematic diagram of generating text processing results by a Seq2Seq model based on RNN in the prior art;

[0101] Figure 4 An optional flowchart of a text processing model training method provided in an embodiment of the present invention;

[0102] Figure 5 This is a schematic diagram of an optional structure of the second neural network in an embodiment of the present invention;

[0103] Figure 6 Schematic diagram of an optional word-level machine reading of the second neural network in an embodiment of the present invention;

[0104] Figure 7 Schematic diagram of an optional structure of an encoder in the second neural network in an embodiment of the present invention;

[0105] Figure 8 Schematic diagram of vector concatenation of the encoder in the second neural network in an embodiment of the present invention;

[0106] Fig. 9 Schematic diagram of the encoding process of the encoder in the second neural network in an embodiment of the present invention;

[0107] Fig.10 Schematic diagram of the decoding process of the decoder in the second neural network in an embodiment of the present invention;

[0108] Fig.11 Schematic diagram of the decoding process of the decoder in the second neural network in an embodiment of the present invention;

[0109] Fig.12 Schematic diagram of the decoding process of the decoder in the second neural network in an embodiment of the present invention;

[0110] Fig.13 Schematic diagram of an optional sentence-level text processing of the second neural network in an embodiment of the present invention;

[0111] Fig.14 An optional flowchart of a text processing model training method provided in an embodiment of the present invention;

[0112] Fig.15 A schematic diagram of an application environment for text selection using the relevant technology in an embodiment of the present invention;

[0113] Fig.16 A schematic diagram of an application environment for text selection using the relevant technology in an embodiment of the present invention;

[0114] Fig.17 A schematic diagram of an application environment for text selection using the relevant technology in an embodiment of the present invention;

[0115] Fig.18 A schematic diagram of the training process of the text processing model provided in an embodiment of the present invention;

[0116] Fig.19 A schematic diagram of the data structure of a text processing model provided in an embodiment of the present invention;

[0117] Fig. 20A A schematic diagram of text selection of a text processing model provided in an embodiment of the present invention;

[0118] Fig. 20B A schematic diagram of the use process of the text processing model provided in an embodiment of the present invention. DETAILED DESCRIPTION

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

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

[0121] Before further describing the embodiments of the present invention in detail, the nouns and terms involved in the embodiments of the present invention are described. The nouns and terms involved in the embodiments of the present invention are subject to the following interpretations.

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

[0123] 2) Word segmentation: Use Chinese word segmentation tools to segment Chinese text and obtain a set of fine-grained words. Stop words: Characters or words that do not contribute to the semantics of the text or whose contribution can be ignored. Cosine similarity: The cosine similarity of two texts after they are represented as vectors.

[0124] 3) Word segmentation library: also known as word segmentation library, refers to a specific word segmentation method. Different word segmentation libraries have corresponding word dictionaries, and can perform word segmentation on the corresponding text information according to their corresponding word dictionaries.

[0125] 4) Consistency: This means that the data accessed from different servers is always unique.

[0126] 5) Convolutional Neural Networks (CNN) is a type of feed-forward neural network that includes convolutional calculations and has a deep structure. It is one of the representative algorithms of deep learning. Convolutional neural networks have representation learning capabilities and can perform shift-invariant classification on input information according to their hierarchical structure.

[0127] 6) Model training, multi-classification learning of image datasets. The model can be built using deep learning frameworks such as Tensor Flow and torch, and uses multiple layers of neural network layers such as CNN to form a multi-classification model. The input of the model is a three-channel or original channel matrix formed by reading the image through tools such as openCV. The model output is a multi-classification probability, and the web page category is finally output through algorithms such as softmax. During training, the model approaches the correct trend through objective functions such as cross entropy.

[0128] 7) Neural Network (NN): Artificial Neural Network (ANN), referred to as neural network or quasi-neural network, is a mathematical model or computational model that imitates the structure and function of biological neural networks (the central nervous system of animals, especially the brain) in the field of machine learning and cognitive science, and is used to estimate or approximate functions.

[0129] 8) Encoder-decoder structure: A network structure commonly used in machine translation technology. It consists of two parts: an encoder and a decoder. The encoder converts the input text into a series of context vectors that can express the characteristics of the input text. The decoder receives the output of the encoder as its own input and outputs the corresponding text sequence in another language.

[0130] 9) Bidirectional Attention Neural Network Model (BERT Bidirectional Encoder Representationsfrom Transformers) Bidirectional Attention Neural Network Model proposed by Google.

[0131] 10) Token: Before any actual processing of the input text, it needs to be segmented into language units such as words, punctuation marks, numbers, or pure alphanumeric characters. These units are called tokens.

[0132] 11) Softmax: Normalized exponential function, which is a generalization of the logic function. It can "compress" a K-dimensional vector containing any real number into another K-dimensional real vector, so that each element is between [0,1] and the sum of all elements is 1.

[0133] 12) Transformers: A new network structure that uses an attention mechanism to replace the traditional encoder-decoder model that must rely on other neural networks. Word vector: A single word is represented by a distribution vector of fixed dimension. Compound word: A coarse-grained keyword composed of fine-grained keywords, whose semantics are richer and more complete than fine-grained keywords.

[0134] Figure 1A schematic diagram of a use scenario of the intelligent text processing method provided by an embodiment of the present invention, see Figure 1 , the terminal (including the terminal 10-1 and the terminal 10-2) is provided with a corresponding client capable of executing different functions, wherein the corresponding client is the terminal (including the terminal 10-1 and the terminal 10-2) obtaining different text information from the corresponding server 200 through the network 300 for browsing, the terminal is connected 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, using a wireless link to achieve data transmission, wherein the types of text information obtained by the terminal (including the terminal 10-1 and the terminal 10-2) from the corresponding server 200 through the network 300 are not the same, for example: the terminal (including the terminal 10-1 and the terminal 10-2) can obtain any type of text information from the corresponding server 200 through the network 300, and can also obtain only the text information matching the corresponding search instruction from the corresponding server 200 through the network 300 for browsing. The server 200 can store text information or corresponding inverted indexes that have been segmented through different word segmentation libraries. In some embodiments of the present invention, different types of text information stored in the server 200 may be written in software code environments of different programming languages, and code objects may be different types of code entities. For example, in a software code in C language, a code object may be a function. In a software code in JAVA language, a code object may be a class, and in an IOS-side OC language, it may be a section of target code. In a software code in C++ language, a code object may be a class or a function to execute text processing instructions from different terminals. In this application, the source of the text information to be processed by the text processing model is no longer distinguished.

[0135] In the process of the server 200 sending different types of text information to the terminal (terminal 10-1 and / or terminal 10-2) through the network 300, the server 200 needs to determine the text information selected by the user for monitoring. Therefore, as an example, the server 200 is used to obtain the text content at the chapter level corresponding to the selected operation in the touch screen; extract the feature vector matching the text content at the chapter level through the first neural network of the text processing model; determine the sentence vector corresponding to the text content according to the feature vector through the first neural network of the text processing model; determine at least one word-level latent variable corresponding to the text content according to the feature vector through the second neural network of the text processing model; generate candidate words corresponding to the word-level latent variable and the probability of selection of the candidate words through the second neural network of the text processing model according to at least one word-level latent variable; select at least one candidate word according to the probability of selection of the candidate word and the sentence vector corresponding to the text content to form a target text corresponding to the text content through the second neural network of the text processing model; and display the target text in a display mode corresponding to the selected operation on the touch screen.

[0136] Of course, before processing the paragraph-level sentence samples through the text processing model, the text processing model needs to be trained, including:

[0137] Acquire a first training sample set, wherein the first training sample set includes at least one group of sentence samples at the chapter level input through the corresponding touch screen; perform denoising on the first training sample set to form a corresponding second training sample set; process the second training sample set through a text processing model to determine initial parameters of a first neural network and initial parameters of a second neural network in the text processing model; in response to the initial parameters of the text processing model, process the second training sample set through the text processing model to determine update parameters corresponding to different neural networks of the text processing model; according to the update parameters of the text processing model corresponding to different neural networks of the text processing model, iteratively update the parameters of the first neural network and the parameters of the second neural network of the text processing model through the second training sample set, respectively, so as to realize processing of the corresponding chapter-level text content in the touch screen through the text processing model.

[0138] The structure of the electronic device of the embodiment of the present invention is described in detail below. The electronic device can be implemented in various forms, such as a dedicated terminal with a text processing function, or an electronic device with a text processing function, such as the aforementioned Figure 1 Servers in Figure 2 The schematic diagram of the structure of the electronic device provided by the embodiment of the present invention can be understood as follows: Figure 2Only exemplary structures of electronic devices are shown, not all structures, and may be implemented as needed. Figure 2 Partial or complete structure shown.

[0139] The electronic device provided in the embodiment of the present invention includes: at least one processor 201, a memory 202, a user interface 203 and at least one network interface 204. The various components in the electronic device are coupled together through a bus system 205. It can be understood that the bus system 205 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 205 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 205 is not used in the following examples. Figure 2 Various buses are labeled as bus system 205 .

[0140] The user interface 203 may include a display, a keyboard, a mouse, a trackball, a click wheel, keys, buttons, a touch pad or a touch screen.

[0141] It is understood that the memory 202 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. The memory 202 in the embodiment of the present invention can store data to support the operation of the terminal (such as 10-1). Examples of these data include: any computer program for operating on the terminal (such as 10-1), such as an operating system and an application. Among them, the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application can include various applications.

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

[0143] As an example of an intelligent text processing device provided by an embodiment of the present invention being implemented by a combination of software and hardware, the intelligent text processing device provided by an embodiment of the present invention can be directly embodied as a combination of software modules executed by a processor 201. The software module can be located in a storage medium, and the storage medium is located in the memory 202. The processor 201 reads the executable instructions included in the software module in the memory 202, and completes the intelligent text processing method provided by an embodiment of the present invention in combination with necessary hardware (for example, including the processor 201 and other components connected to the bus 205).

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

[0145] As an example of hardware implementation of the intelligent text processing device provided in an embodiment of the present invention, the device provided in an embodiment of the present invention can be directly executed by a processor 201 in the form of a hardware decoding processor, for example, one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs) or other electronic components to implement the intelligent text processing method provided in an embodiment of the present invention.

[0146] The memory 202 in the embodiment of the present invention is used to store various types of data to support the operation of the electronic device. Examples of such data include: any executable instructions for operating on the electronic device, such as executable instructions, and the program for implementing the intelligent text processing method of the embodiment of the present invention can be included in the executable instructions.

[0147] In other embodiments, the intelligent text processing device provided by the embodiments of the present invention may be implemented in software. Figure 2The intelligent text processing device 2020 stored in the memory 202 is shown, which may be software in the form of a program and a plug-in, and includes a series of modules. As an example of a program stored in the memory 202, an intelligent text processing device 2020 may be included, and the intelligent text processing device 2020 includes the following software modules: an information transmission module 2081, and an information processing module 2082. When the software modules in the intelligent text processing device 2020 are read into the RAM by the processor 201 and executed, the intelligent text processing method provided by the embodiment of the present invention will be implemented. The functions of each software module in the intelligent text processing device 2020 are introduced below:

[0148] The information transmission module 2081 is used to obtain the text content at the chapter level corresponding to the operation selected on the touch screen.

[0149] The information processing module 2082 is used to extract a feature vector matching the text content at the chapter level through the first neural network of the text processing model.

[0150] The information processing module 2082 is used to determine a sentence vector corresponding to the text content according to the feature vector through the first neural network of the text processing model;

[0151] The information processing module 2082 is used to determine at least one word-level latent variable corresponding to the text content according to the feature vector through the second neural network of the text processing model.

[0152] The information processing module 2082 is used to generate candidate words corresponding to the word-level latent variables and the probability of selection of the candidate words according to the at least one word-level latent variable through the second neural network of the text processing model.

[0153] The information processing module 2082 is used to select the candidate words based on their probability of being selected through the second neural network of the text processing model.

[0154] The information processing module 2082 is used to select at least one candidate word to form a target text corresponding to the text content according to the selection probability of the candidate word and the sentence vector corresponding to the text content.

[0155] The information transmission module 2081 is used to display the target text on the touch screen in a display mode corresponding to the selection operation.

[0156] Combination Figure 2The intelligent text processing device 2020 shown illustrates the intelligent text processing method provided by the embodiment of the present invention. Before introducing the intelligent text processing method provided by the embodiment of the present invention, the process of generating the corresponding text processing result (target text) according to the text content at the chapter level by the text processing model in the present application is first introduced. Figure 3 The following is a schematic diagram of generating text processing results in a traditional solution, where the eq2seq model is an architecture represented by an encoder and a decoder. The seq2seq model generates an output sequence Y based on an input sequence X. In the seq2seq model represented by an encoder and a decoder, the encoder converts the input sequence into a fixed-length vector, and the decoder decodes the input fixed-length vector into an output sequence. Figure 3 As shown, the encoder (Encoder) encodes the input sentence to be processed to obtain the text features of the sentence to be processed; the decoder (Decoder) decodes the text features and outputs the corresponding text processing results, wherein the encoder (Encode) and the decoder (Decode) are one-to-one corresponding.

[0157] It can be seen that for Figure 3 As for the related technologies shown in the figure, the disadvantage of the text processing model based on the Seq2Seq model is that the model itself in the related technology only establishes a one-to-one relationship with the target text y of the training data. In many actual scenarios, the text content at the same chapter level can have many word segmentation methods. The existing Seq2Seq model cannot effectively process this kind of chapter-level text because the encoder (Encode) and decoder (Decode) are one-to-one corresponding. At the same time, it is easily disturbed by noise information, triggering useless recognition or selection, and the user experience is poor.

[0158] To address the deficiencies in this related art, see Figure 4 , Figure 4 An optional flow chart of the text processing model training method provided in an embodiment of the present invention is provided. It can be understood that: Figure 4 The steps shown can be performed by various electronic devices running the intelligent text processing device, such as a dedicated terminal with text processing function, a server or server cluster with text processing model training function. Figure 4 The steps shown are explained.

[0159] Step 401: The intelligent text processing apparatus obtains a first training sample set.

[0160] Wherein, the first training sample set includes at least one set of sentence samples at the chapter level input through the corresponding touch screen. For some specific scenarios, such as novel reading and news reading, the data to be processed through the touch screen is often the entire chapter-level text. Compared with the short text in the WeChat chat and browser search scenarios, the chapter-level text can be processed through word segmentation to form hundreds of word units. Among them, the so-called word segmentation has both verbal meaning and noun meaning; each word segmentation is a word or phrase, that is, the smallest semantic unit with a certain meaning; for the different users or different text processing models received, the smallest semantic unit contained therein needs to be divided is also different, and adjustments need to be made in time. This process is called word segmentation, that is, word segmentation can refer to the above-mentioned process of dividing the smallest semantic unit; on the other hand, the smallest semantic unit obtained after the division is often also called word segmentation, that is, the word obtained after the word segmentation operation is performed; sometimes in order to distinguish the two meanings from each other, the smallest semantic unit referred to by the latter meaning is called a word segmentation object (Term); the word segmentation object is used in this application; the word segmentation object corresponds to the keyword used as the index basis in the inverted list. For Chinese, since words, as the smallest semantic units, are often composed of different numbers of characters, and there are no natural distinguishing marks in phonetic characters such as blank spaces between words, for Chinese, accurately segmenting words to obtain reasonable segmentation objects is an important step.

[0161] Step 402: The intelligent text processing apparatus performs denoising processing on the first training sample set to form a corresponding second training sample set.

[0162] In some embodiments of the present invention, denoising the first training sample set to form a corresponding second training sample set may be implemented in the following manner:

[0163] Determine a dynamic noise threshold that matches the use environment of the text processing model; perform denoising on the first training sample set according to the dynamic noise threshold to form a second training sample set that matches the dynamic noise threshold. Wherein, due to different use environments of text processing models, the dynamic noise thresholds that match the use environments of corresponding text processing models are also different. For example, in the use environment of single text processing (academic paper display or news information text), the dynamic noise threshold that matches the use environment of the text processing model needs to be smaller than the dynamic noise threshold in the text advertising environment. Since the training samples come from different data sources, the data sources include data of various types of application scenarios as the data source of the corresponding training books. For example, the text processing model provided by the present invention can be packaged in vehicle-mounted electronic devices as a software module, or can be packaged in different smart homes (including but not limited to: speakers, televisions, refrigerators, air conditioners, washing machines, stoves), and of course can also be solidified in the hardware devices of intelligent robots. For different use scenarios of these text processing models, the corresponding training samples can be used to conduct targeted training on the text processing models.

[0164] In some embodiments of the present invention, denoising the first training sample set to form a corresponding second training sample set may be implemented in the following manner:

[0165] Determine a fixed noise threshold corresponding to the use environment of the text processing model; perform denoising on the first training sample set according to the fixed noise threshold to form a second training sample set that matches the fixed noise threshold. When the text processing model is fixed in the corresponding hardware mechanism, such as when reading information text in a vehicle environment, since the noise is relatively simple, by fixing the fixed noise threshold corresponding to the text processing model, the training speed of the text processing model can be effectively improved, and the waiting time of the user can be reduced.

[0166] Step 403: The intelligent text processing device processes the second training sample set through a text processing model to determine initial parameters of the first neural network and initial parameters of the second neural network in the text processing model.

[0167] Among them, the text processing model provided in this application includes: an initial first neural network and a second neural network, wherein the first neural network can be a structured RNN network (hierarchical RNN), and the second neural network can be a bidirectional attention neural network model (BERT Bidirectional Encoder Representations from Transformers).

[0168] Continue to refer Figure 5, Figure 5 This is an optional structural diagram of the second neural network in an embodiment of the present invention, wherein the Encoder includes: N = 6 identical layers, each layer contains two sub-layers. The first sub-layer is a multi-head attention layer and then a simple fully connected layer. Each sub-layer has a residual connection and normalization.

[0169] The decoder consists of N=6 identical layers, where the layers are different from the encoder. The layers here contain three sub-layers, including a self-attention layer, an encoder-decoder attention layer, and finally a fully connected layer. The first two sub-layers are based on a multi-head attention layer.

[0170] Continue to refer Figure 6 , Figure 6 This is an optional word-level machine reading diagram of the second neural network in an embodiment of the present invention, wherein the encoder and decoder parts both include 6 encoders and decoders. The inputs entering the first encoder are combined with embedding and positional embedding. After passing through 6 encoders, they are output to each decoder in the decoder part; the input target is the text at the chapter level "Don't you see the water of the Yellow River coming from the sky... Call my son to go out and exchange it for fine wine so that we can share our eternal sorrows" After being processed by the second neural network, the output machine reading result is at the vector level: "Don't you see the water of the Yellow River coming from the sky... Call my son to go out and exchange it for fine wine so that we can share our eternal sorrows".

[0171] Continue to refer Figure 7 , Figure 7 This is an optional structural diagram of an encoder in the second neural network in an embodiment of the present invention, wherein its input consists of a query (Q) and a key (K) of dimension d and a value (V) of dimension d, all keys calculate the dot product of the query, and apply the softmax function to obtain the weight of the value.

[0172] Continue to refer Figure 7 , Figure 7The vector diagram of the encoder in the second neural network in the embodiment of the present invention is shown in FIG, where Q, K and V are obtained by multiplying the vector x of the input encoder with W^Q, W^K, W^V. The dimensions of W^Q, W^K, W^V in the article are (512, 64), and then assume that the dimension of our inputs is (m, 512), where m represents the number of words. Therefore, the dimensions of Q, K and V obtained after multiplying the input vector with W^Q, W^K, W^V are (m, 64).

[0173] Continue to refer Figure 8 , Figure 8 This is a schematic diagram of the vector concatenation of the encoder in the second neural network in an embodiment of the present invention, where Z0 to Z7 are the corresponding 8 parallel heads (dimension is (m, 64)), and then after concat these 8 heads, the dimension is (m, 512). Finally, after multiplying with W^O, the output matrix with dimension (m, 512) is obtained, and the dimension of this matrix is ​​consistent with the dimension entering the next encoder.

[0174] Continue to refer Fig. 9 , Fig. 9 This is a schematic diagram of the encoding process of the encoder in the second neural network in an embodiment of the present invention, in which x1 is in the state of z1 after self-attention. The tensor that has passed the self-attetion needs to be processed by the residual network and the Later Norm, and then enters the fully connected feedforward network. The feedforward network needs to perform the same operation, residual processing and normalization. Finally, the output tensor can enter the next encoder, and then this operation is iterated 6 times, and the result of the iterative processing enters the decoder.

[0175] Continue to refer Fig.10 , Fig.10 Schematic diagram of the decoding process of the decoder in the second neural network in an embodiment of the present invention, wherein the input, output and decoding process of the decoder are:

[0176] Output: probability distribution of the output word corresponding to position i;

[0177] Input: encoder output & corresponding i-1 position decoder output. So the middle attention is not self-attention, its K, V come from the encoder, and Q comes from the output of the previous position decoder.

[0178] Continue to refer Fig.11 and Fig.12 , Fig.11Schematic diagram of the decoding process of the decoder in the second neural network in an embodiment of the present invention, wherein the vector output by the last decoder of the decoder network passes through the Linear layer and the softmax layer. Fig.12 This is a schematic diagram of the decoding process of the decoder in the second neural network in an embodiment of the present invention. The function of the Linear layer is to map the vector from the decoder part into a logits vector, and then the softmax layer converts it into a probability value based on the logits vector, and finally finds the position of the maximum probability, thus completing the output of the decoder.

[0179] In some embodiments of the present invention, the second neural network may be a bidirectional attention neural network model (BERTBidirectional Encoder Representations from Transformers). Figure 5 , Figure 5 This is an optional structural diagram of the second neural network in an embodiment of the present invention, wherein the Encoder comprises: N = 6 identical layers, each layer contains two sub-layers. The first sub-layer is a multi-head attention layer followed by a simple fully connected layer. Each sub-layer has a residual connection and normalization.

[0180] The decoder consists of N=6 identical layers, where the layers are different from the encoder. The layers here contain three sub-layers, including a self-attention layer, an encoder-decoder attention layer, and finally a fully connected layer. The first two sub-layers are based on a multi-head attention layer.

[0181] Continue to refer Fig.13 , Fig.13This is an optional sentence-level machine reading diagram of the second neural network in an embodiment of the present invention, wherein the encoder and decoder parts both include 6 encoders and decoders. The inputs entering the first encoder are combined with embedding and positional embedding. After passing through the 6 encoders, the output is sent to each decoder in the decoder part; the input target is English "When you are old and grey and full of sleep And nodding by the fire take down this book" After being processed by the second neural network, the output machine reading result is: "When / you / are / old / and / grey / and / full of sleep / And / nodding / by the fire / take down / this book".

[0182] Of course, the BERT model in the present invention is also replaced by a feedforward neural network model (Bi-LSTM Bi-directionalLong Short-TermMemory), a gated recurrent unit network model (GRU Gated Recurrent Unit), a deep contextualized word representation network model (ELMo embedding from language model), a GPT model, and a GPT2 model, which will not be described in detail in the present invention.

[0183] Step 404: The intelligent text processing device processes the second training sample set through the text processing model in response to the initial parameters of the first neural network and the initial parameters of the second neural network, and determines the update parameters corresponding to different neural networks of the text processing model.

[0184] In some embodiments of the present invention, in response to the initial parameters of the first neural network and the initial parameters of the second neural network, the second training sample set is processed by the text processing model to determine the update parameters corresponding to different neural networks of the text processing model, which can be achieved in the following manner:

[0185] Substitute different sentence samples in the second training sample set into the loss function corresponding to the autoencoder network composed of the encoder and decoder of the first neural network of the text processing model; determine the parameters of the encoder and the corresponding decoder parameters of the first neural network when the loss function meets the first convergence condition as the update parameters of the first neural network; substitute different sentence samples in the second training sample set into the loss function corresponding to the autoencoder network composed of the encoder and decoder of the second neural network of the text processing model; determine the parameters of the encoder and the corresponding decoder parameters of the second neural network when the loss function meets the second convergence condition as the update parameters of the second neural network.

[0186] Thus, the text content at the corresponding chapter level in the touch screen can be processed by the text processing model.

[0187] Step 405: The intelligent text processing device iteratively updates the parameters of the first neural network and the parameters of the second neural network of the text processing model according to the update parameters of the text processing model corresponding to different neural networks of the text processing model through the second training sample set.

[0188] In some embodiments of the present invention, the updating parameters of the text processing model corresponding to different neural networks of the text processing model and the iterative updating of the parameters of the first neural network and the parameters of the second neural network of the text processing model respectively through the second training sample set can be implemented in the following manner:

[0189] Determine a second noise parameter that matches the second training sample set, wherein the second noise parameter is used to characterize the noise value of the parallel sentence samples in the second training sample set; iteratively update the encoder parameters and decoder parameters of the first neural network according to the noise value of the second noise parameter until the loss function corresponding to the autoencoder network formed by the encoder and decoder of the first neural network meets the corresponding convergence condition; iteratively update the encoder parameters and decoder parameters of the second neural network according to the noise value of the second noise parameter until the loss function corresponding to the autoencoder network formed by the encoder and decoder of the second neural network meets the corresponding convergence condition.

[0190] In some embodiments of the invention, wherein, the loss function of the encoder network is expressed as:

[0191] loss_A=∑(decoder_A(encoder(warp(x1)))-x1)2; where decoder_A is decoder A, warp is the function of the sentence to be recognized, x1 is the sentence to be recognized, and encoder is the encoder.

[0192] In the process of iterative training, the sentence to be recognized is substituted into the loss function of the encoder network, and the parameters of the encoder A and the decoder A are solved when the loss function decreases according to the gradient (such as the maximum gradient). When the loss function converges (that is, when it is determined that a word-level latent variable corresponding to the sentence to be recognized can be formed), the training is terminated.

[0193] During the training process of the encoder network, the loss function of the encoder network is expressed as: loss_B = ∑(decoder_B(encoder(warp(x2)))-x2)2; where decoder_B is decoder B, warp is the function of the sentence to be recognized, x2 is the sentence to be recognized, and encoder is the encoder.

[0194] During the iterative training process, the parameters of encoder B and decoder B are solved when the loss function decreases according to the gradient (such as the maximum gradient) by substituting the sentence to be recognized into the loss function of the encoder network; when the loss function converges (that is, when the decoding obtains the probability of selecting the text processing result corresponding to the sentence to be recognized), the adjustment and training are ended.

[0195] In some embodiments of the present invention, the intelligent text processing method provided by the present application further includes:

[0196] In response to the training sample dictionary set of the text processing model, an attention parameter set of the second training sample set is determined; and according to the training sample dictionary set and the attention parameter set of the second training sample set, the second training sample set is weighted to achieve the adaptation of the second training sample set to the training sample dictionary set of the text processing model.

[0197] In some embodiments of the present invention, the method further comprises:

[0198] The first training sample set is subjected to negative example processing to form a negative example sample set corresponding to the first training sample set, wherein the negative example sample set is used to adjust the encoder parameters and the decoder parameters of the first neural network, or to adjust the encoder parameters and the decoder parameters of the second neural network; a corresponding evaluation research value is determined according to the negative example sample set, wherein the evaluation research value is used as a supervision parameter to evaluate the text processing result of the text processing model.

[0199] In some embodiments of the present invention, negative example processing of the first training sample set may be implemented in the following manner:

[0200] Randomly combining the sentences to be output generated by the text processing model to form a negative sample set corresponding to the first training sample set; or,

[0201] The sentences to be output generated by the text processing model are randomly deleted or replaced to form a negative sample set corresponding to the first training sample set.

[0202] Continue to refer Fig.14 , Fig.14 An optional flow chart of the text processing model training method provided in an embodiment of the present invention is provided. It can be understood that: Fig.14 The steps shown can be performed by various electronic devices running the intelligent text processing device, such as a dedicated terminal with a text processing model training function, a server with a text processing model training function, or a server cluster. Fig.14 The steps shown are explained.

[0203] Step 1401: The intelligent text processing device obtains the text content at the chapter level corresponding to the operation selected on the touch screen;

[0204] Step 1402: Extracting a feature vector matching the text content at the chapter level through the first neural network of the text processing model.

[0205] Step 1403: Determine a sentence vector corresponding to the text content according to the feature vector through the first neural network of the text processing model.

[0206] Step 1404: Determine at least one word-level latent variable corresponding to the text content according to the feature vector through the second neural network of the text processing model.

[0207] Step 1405: Generate candidate words corresponding to the word-level latent variable and the probability of selection of the candidate words according to the at least one word-level latent variable through the second neural network of the text processing model;

[0208] Step 1406: selecting at least one candidate word to form a target text corresponding to the text content at the chapter level according to the probability of the candidate word being selected and the sentence vector corresponding to the text content;

[0209] Step 1407: Display the target text on the touch screen in a display manner corresponding to the selection operation.

[0210] In some embodiments of the present invention, extracting a feature vector matching the text content at the chapter level through the first neural network of the text processing model can be achieved in the following manner:

[0211] According to the text parameter information carried by the chapter-level text content displayed on the touch screen, the corresponding word segmentation library is triggered; the chapter-level text content displayed on the touch screen is segmented by the word dictionary of the triggered word segmentation library to form different word-level feature vectors; the different word-level feature vectors are denoised to form a word-level feature vector set matching the chapter-level text content. Among them, the so-called word segmentation has both verbal meaning and noun meaning; each word segmentation is a word or phrase, that is, a minimum semantic unit with a certain meaning; for different users or different text processing models received, the minimum semantic units contained therein need to be divided are also different, and adjustments need to be made in a timely manner. This process is called word segmentation, that is, word segmentation can refer to the above-mentioned process of dividing the minimum semantic unit; on the other hand, the minimum semantic unit obtained after the division is often also called word segmentation, that is, the word obtained after the word segmentation operation is performed; sometimes in order to distinguish the two meanings from each other, the minimum semantic unit referred to by the latter meaning is called a word segmentation object (Term); in this application, the word segmentation object is used; the word segmentation object corresponds to the keyword used as the index basis in the inverted list. For Chinese, since words, as the smallest semantic units, are often composed of different numbers of characters, and there are no natural distinguishing marks in phonetic characters such as blank spaces between words, for Chinese, accurately segmenting words to obtain reasonable segmentation objects is an important step.

[0212] In some embodiments of the present invention, the different word-level feature vectors are subjected to denoising to form a word-level feature vector set that matches the text content at the chapter level, which can be achieved in the following manner:

[0213] Determine a dynamic noise threshold that matches the use environment of the text processing model; perform denoising on the different word-level feature vectors according to the dynamic noise threshold, and trigger a dynamic word segmentation strategy that matches the dynamic noise threshold; perform word segmentation on the text content at the chapter level displayed on the touch screen according to the dynamic word segmentation strategy that matches the dynamic noise threshold, and form a corresponding set of dynamic word-level feature vectors. For example, in the use environment of academic translation, the text information displayed by the terminal only includes the text information of academic papers. The dynamic noise threshold that matches the use environment of the text processing model needs to be smaller than the dynamic noise threshold in the reading environment of entertainment information text.

[0214] In some embodiments of the present invention, the different word-level feature vectors are subjected to denoising to form a word-level feature vector set that matches the text content at the chapter level, which can be achieved in the following manner:

[0215] Determine a fixed noise threshold corresponding to the use environment of the text processing model; perform denoising on the different word-level feature vectors according to the fixed noise threshold, and trigger a fixed word segmentation strategy matching the fixed noise threshold; perform word segmentation on the target text at the chapter level displayed on the touch screen according to the fixed word segmentation strategy matching the fixed noise threshold, and form a corresponding set of fixed word-level feature vectors. Among them, when the text processing model is solidified in the corresponding hardware mechanism, such as a multimodal terminal or a smart medical system, when the use environment is professional terminology text information (or text information in a certain field), due to the relatively simple noise, the fixed noise threshold corresponding to the fixed text processing model can effectively improve the processing speed of the text processing model, reduce the user's waiting time, and improve the user's experience.

[0216] In some embodiments of the present invention, the text content at the chapter level displayed on the touch screen can also be segmented to form a segmentation result; in response to the segmentation result, the text content is processed to remove stop words to form text keywords matching the text content; according to the text keywords matching the text content, the part-of-speech tagging results matching the text content are determined, and a part-of-speech feature vector set corresponding to the text content is formed. Among them, since the text processed by the text processing model includes not only text information in a single language but also complex text information in multiple languages ​​(for example, a Chinese-English mixed academic paper as text information), unlike English, which directly uses spaces as intervals between words, for Chinese text, it is necessary to segment the Chinese text accordingly, because words in Chinese can contain complete information. The Chinese segmentation tool Jieba can be used to segment the Chinese text accordingly. In addition, it is necessary to remove stop words from the keyword set after segmentation, because words like "yes" and "can" have no information help for the corresponding category annotation task. For example, for the text "Yes, I like the restaurant", we can segment the words and remove the stop words to get a set of two keywords "like / the / restaurant" (use / as a separator, the same below). This can effectively improve the processing speed of the text processing model.

[0217] In some embodiments of the present invention, selecting at least one candidate word to form a target text corresponding to the text content according to the probability of selection of the candidate word and the sentence vector corresponding to the text content can be achieved in the following manner:

[0218] The sentence vector corresponding to the text content is matched with the text content displayed on the touch screen; based on the matching result of the sentence vector corresponding to the text content and the text content at the chapter level displayed on the touch screen, the probability of selection of the candidate words is fused; based on the fusion processing result of the selection probability of the candidate words, at least one candidate word is selected to form a target text corresponding to the text content at the chapter level.

[0219] The text processing model training method provided by the embodiment of the present invention is described below by taking text information processing in medical hardware equipment as an example, wherein: Fig.15 FIG. 1 is a schematic diagram of an application environment of text selection by a related technology in an embodiment of the present invention, wherein the related technology can be as follows: Fig.15 As shown, text is selected only by touch screen sensing. Specifically, during the use of this solution, the terminal receives the signal of finger touch through the touch screen, locates the cursor according to the touch position, and the user can use the cursor to select the boundary of the corresponding text. However, in this process, text can only be selected according to the position of the finger touch sensed by the touch screen. It is inconvenient to select the target text when the text font is small. At the same time, due to the user's one-handed operation, it is often easy to select the wrong text or miss the text. The user often repeats it many times to select the target text, which wastes the user's operation time.

[0220] Further, Fig.16 FIG. 1 is a schematic diagram of an application environment of text selection by a related technology in an embodiment of the present invention, wherein the related technology can be as follows: Fig.16 As shown, the text is selected by touch screen sensing, and punctuation marks are considered. Specifically, in the preceding sequence Fig.15 Based on the scheme shown, when determining the text information of the text to be selected, ordinary text and punctuation marks can be distinguished. Since punctuation marks are the boundaries of sentences or half sentences, when the user's cursor moves near punctuation marks, the system will use punctuation marks as the boundaries of the target text with a greater probability. However, in this process, although punctuation marks are considered when selecting text, this process can only use punctuation marks for auxiliary selection. For example, when the user wants to select text within a sentence, Fig.16 As shown, the words in the sentence cannot be assisted in selection. Also, personalized recommendations cannot be made based on the user's historical habits (for example, some users need to select texts with punctuation marks, while some users do not need to select texts with punctuation marks), which is not conducive to the use of different users.

[0221] Further, Fig.17 FIG. 1 is a schematic diagram of an application environment of text selection by a related technology in an embodiment of the present invention. The related technology can be as follows: Fig.17As shown, the corresponding target text is selected by touch screen sensing, and the target text is segmented by considering the word segmentation information. However, in this process, only the word information can be used for auxiliary selection, and a longer phrase or short sentence cannot be selected. At the same time, this process cannot make personalized recommendations based on the user's historical habits (the word segmentation processing methods are different for different users and different fields).

[0222] Fig.18 A schematic diagram of the training process of the text processing model provided in an embodiment of the present invention, Fig.19 A data structure diagram of a text processing model provided in an embodiment of the present invention, combined with Fig.18 , specifically including the following steps:

[0223] Step 1801: Obtain a first training sample set from a medical data source.

[0224] The first training sample set includes at least one group of sentence samples at the chapter level input through the corresponding touch screen. Specifically, the usage data of all users (for different text contents) can be recorded. First, the user may touch the screen once or more to select the text, and then perform further operations (for example, copy, send, etc.) after selecting the target text. The text selected by the user before the next operation can be regarded as the user's real target text. At the same time, the position of the user's finger when touching the screen is recorded. Of course, in order to distinguish different users, an ID (non-repetitive) will be configured for the user when recording the training data, and each sample will be marked with the user ID.

[0225] Step 1802: performing denoising processing on the first training sample set to form a corresponding second training sample set;

[0226] Step 1803: Processing the second training sample set through the text processing model to determine initial parameters of the structured RNN network and initial parameters of the bidirectional attention neural network in the text processing model;

[0227] Step 1804: In response to the initial parameters of the structured RNN network and the initial parameters of the bidirectional attention neural network, the second training sample set is processed by the text processing model to determine the update parameters corresponding to different neural networks of the text processing model;

[0228] Step 1805: According to the update parameters of the text processing model corresponding to different neural networks of the text processing model, the parameters of the structured RNN network and the parameters of the bidirectional attention neural network of the text processing model are iteratively updated through the second training sample set.

[0229] Combination Fig.19 , Fig. 20A A schematic diagram of text selection of a text processing model provided in an embodiment of the present invention, Fig. 20B The schematic diagram of the use process of the text processing model provided in the embodiment of the present invention specifically includes the following steps:

[0230] Step 2001: Acquire the text content at the chapter level corresponding to the operation selected on the touch screen;

[0231] The acquired long text sentence may correspond to the position touched by the finger on the touch screen.

[0232] Step 2002: extracting a feature vector matching the text content through a structured RNN network, and determining a sentence vector corresponding to the text content based on the feature vector.

[0233] Step 2003: Generate candidate words corresponding to the at least one word-level latent variable and the probability of the candidate words being selected according to the at least one word-level latent variable through a bidirectional attention neural network.

[0234] Step 2004: Select at least one candidate word according to the probability of the candidate word being selected through a bidirectional attention neural network, and combine it with the sentence vector corresponding to the text content to form a target text corresponding to the text content.

[0235] Step 2005: Displaying the target text in the touch screen in a display mode corresponding to the selected operation. Thus, the text processing model can be used to process the corresponding chapter-level sentences in the touch screen, thereby predicting the user operation.

[0236] Beneficial technical effects:

[0237] Compared with traditional technologies for processing text on touch screens, the technical solution provided in this application detects the user's operation on the touch screen to trigger the text processing model, thereby realizing the prediction of the text to be selected by the user, improving the accuracy of user selection, and enabling the text processing model to produce high-quality text processing results, thereby improving the ability to process corresponding chapter-level sentences on the touch screen through the text processing model, improving the fluency of user use, and thus effectively improving the user experience.

[0238] The above descriptions are merely embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. An intelligent text processing method, characterized in that: The method comprises: Get the text content at the chapter level corresponding to the selected operation on the touch screen; Extracting a feature vector matching the text content at the chapter level through a first neural network of the text processing model; Determining, by means of a first neural network of the text processing model, a sentence vector corresponding to the text content according to the feature vector; Determining at least one word-level latent variable corresponding to the text content according to the feature vector through a second neural network of the text processing model; Generate, by means of a second neural network of the text processing model, candidate words corresponding to the latent variable at the word level and the probability of selection of the candidate words according to the latent variable at the word level; According to the matching result of the sentence vector corresponding to the text content and the text content at the chapter level displayed on the touch screen, the selection probability of the candidate words is fused; According to the fusion processing result of the selection probability of the candidate words, at least one candidate word is selected to form a target text corresponding to the text content at the chapter level; The target text is displayed on the touch screen in a display manner corresponding to the selection operation.

2. The method according to claim 1, characterized in that The extracting of a feature vector matching the text content at the chapter level through the first neural network of the text processing model includes: triggering a corresponding word segmentation library according to text parameter information carried by the text content at the chapter level displayed on the touch screen; Performing word segmentation processing on the text content at the chapter level displayed on the touch screen through the triggered word segmentation library word dictionary to form different word-level feature vectors; The different word-level feature vectors are subjected to denoising to form a word-level feature vector set that matches the text content at the chapter level.

3. The method according to claim 2, characterized in that The denoising process is performed on the different word-level feature vectors to form a word-level feature vector set that matches the text content at the chapter level, including: Determining a dynamic noise threshold that matches the usage environment of the text processing model; De-noising the different word-level feature vectors according to the dynamic noise threshold, and triggering a dynamic word segmentation strategy that matches the dynamic noise threshold; According to the dynamic word segmentation strategy that matches the dynamic noise threshold, the text content at the chapter level displayed on the touch screen is segmented to form a corresponding dynamic word level feature vector set.

4. The method according to claim 2, characterized in that: The denoising process is performed on the different word-level feature vectors to form a word-level feature vector set that matches the text content at the chapter level, including: Determining a fixed noise threshold corresponding to the usage environment of the text processing model; De-noising the different word-level feature vectors according to the fixed noise threshold, and triggering a fixed word segmentation strategy that matches the fixed noise threshold; According to the fixed word segmentation strategy that matches the fixed noise threshold, the target text at the chapter level displayed on the touch screen is segmented to form a corresponding fixed word-level feature vector set.

5. The method according to claim 1, characterized in that The method further comprises: Acquire a first training sample set, wherein the first training sample set includes at least one set of sentence samples at the chapter level input through a corresponding touch screen; Performing denoising processing on the first training sample set to form a corresponding second training sample set; Processing the second training sample set by a text processing model to determine initial parameters of a first neural network and initial parameters of a second neural network in the text processing model; In response to initial parameters of the first neural network and initial parameters of the second neural network, the second training sample set is processed by the text processing model to determine update parameters corresponding to different neural networks of the text processing model; According to the update parameters of the text processing model corresponding to different neural networks of the text processing model, the parameters of the first neural network and the parameters of the second neural network of the text processing model are iteratively updated respectively through the second training sample set to realize the processing of the corresponding chapter-level text content in the touch screen through the text processing model.

6. The method according to claim 5, characterized in that The step of processing the second training sample set by the text processing model in response to the initial parameters of the first neural network and the initial parameters of the second neural network to determine the update parameters corresponding to different neural networks of the text processing model includes: Substituting different sentence samples in the second training sample set into the loss function corresponding to the autoencoder network composed of the encoder and decoder of the first neural network of the text processing model; Determine parameters of an encoder and corresponding decoder parameters of the first neural network corresponding to the loss function satisfying a first convergence condition as update parameters of the first neural network; Substituting different sentence samples in the second training sample set into the loss function corresponding to the autoencoder network composed of the encoder and decoder of the second neural network of the text processing model; Determine the parameters of the encoder and the corresponding decoder parameters of the second neural network corresponding to the loss function satisfying the second convergence condition as update parameters of the second neural network.

7. An intelligent text processing device, characterized in that: The device comprises: An information transmission module, used to obtain the text content at the chapter level corresponding to the operation selected on the touch screen; An information processing module, configured to extract a feature vector matching the text content at the chapter level through a first neural network of a text processing model; The information processing module is used to determine a sentence vector corresponding to the text content according to the feature vector through the first neural network of the text processing model; The information processing module is used to determine at least one word-level latent variable corresponding to the text content according to the feature vector through the second neural network of the text processing model; The information processing module is used to generate candidate words corresponding to the word-level latent variable and the probability of selection of the candidate words according to the at least one word-level latent variable through the second neural network of the text processing model; The information processing module is used to perform a fusion process on the selection probability of the candidate words according to the matching result of the sentence vector corresponding to the text content and the text content at the chapter level displayed on the touch screen; According to the fusion processing result of the selection probability of the candidate words, at least one candidate word is selected to form a target text corresponding to the text content at the chapter level; The information transmission module is used to display the target text on the touch screen in a display mode corresponding to the selection operation.

8. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable instructions; A processor is used to implement the intelligent text processing method described in any one of claims 1 to 6 when running the executable instructions stored in the memory.

9. A computer-readable storage medium storing executable instructions, characterized in that: When the executable instructions are executed by the processor, the intelligent text processing method described in any one of claims 1 to 6 is implemented.