Text processing method, device, storage medium and electronic device
By integrating Nezha, Bert, and Roformer models for text processing, combined with negative sampling and adversarial learning technology, the problem of low recognition accuracy and efficiency in text processing in different industries has been solved, and higher semantic feature extraction accuracy and downstream task quality have been achieved.
Patent Information
- Application Number
- CN202211072526.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-02
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-09-02
AI Technical Summary
When processing business texts from different industries, the existing technology cannot effectively distinguish each business type and mine hidden information, resulting in low recognition accuracy and processing efficiency, and poor model performance due to insufficient training text data.
A fusion language model based on the Nezha model, Bert model and Roformer model is used for text preprocessing and word segmentation, and target word vectors are obtained through semantic feature extraction. Negative sampling and teacher-student models are combined for text enhancement, and contrastive learning and adversarial learning are used. Carry out model training.
It improves the accuracy of semantic feature extraction and word vectors, enhances the completion quality of downstream tasks, reduces annotation costs, and improves the generalization ability and effectiveness of the model.
Smart Images

Figure CN115374782B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a text processing method, a text processing system, a computer storage medium and an electronic device. Background Art
[0002] With the development of various industries and artificial intelligence, many different business types have emerged in each industry. In order to extract information from texts of various business types and reduce manpower expenditures, people have begun to use various language models to process business texts.
[0003] At present, when processing business texts, it is usually impossible to distinguish the texts corresponding to various business types in a specific industry and fully explore the hidden information therein, and thus it is impossible to meet the corresponding business needs of users. In addition, when training models, a large amount of annotated training texts are usually required, but annotation requires a lot of manpower and material resources, resulting in too little text data in the corresponding industry field, and the performance of the trained model is poor.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of this application. Summary of the invention
[0005] The purpose of this application is to provide a text processing method, a text processing system, a computer storage medium and an electronic device, thereby improving the recognition accuracy and processing efficiency of texts in various fields at least to a certain extent.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0007] According to a first aspect of the present application, a text processing method is provided, comprising:
[0008] Obtaining a text to be processed, and performing preprocessing and word segmentation processing on the text to be processed to obtain a word segmentation vector sequence corresponding to the text to be processed;
[0009] Inputting the word segmentation vector sequence into a fusion language model, and performing semantic feature extraction on the word segmentation vector sequence through the fusion language model to obtain a target word vector corresponding to the text to be processed;
[0010] The fusion language model is constructed based on the Nezha model, the Bert model and the Roformer model.
[0011] According to a second aspect of the present application, there is provided a text processing device, comprising:
[0012] A text processing module is used to obtain a text to be processed, and perform preprocessing and word segmentation processing on the text to be processed to obtain a word segmentation vector sequence corresponding to the text to be processed;
[0013] A model processing module, used for inputting the word segmentation vector sequence into a fusion language model, and performing semantic feature extraction on the word segmentation vector sequence through the fusion language model to obtain a target word vector corresponding to the text to be processed;
[0014] The fusion language model is constructed based on the Nezha model, the Bert model and the Roformer model.
[0015] According to a third aspect of the present application, there is provided a computer storage medium on which a computer program is stored, characterized in that the computer program implements the above-mentioned text processing method when executed by a processor.
[0016] According to a fourth aspect of the present application, there is provided an electronic device, characterized in that it includes:
[0017] Processor; and
[0018] A memory, configured to store executable instructions of the processor;
[0019] Wherein, the processor is configured to perform the above-mentioned text processing method by executing the executable instructions.
[0020] It can be seen from the above technical solutions that the text processing method, text processing device, computer storage medium and electronic device in the exemplary embodiments of the present application have at least the following advantages and positive effects:
[0021] The text processing method in the present application, after preprocessing and word segmentation processing of the text to be processed to obtain the word segmentation vector sequence corresponding to the text to be processed, can perform semantic feature extraction on the word segmentation vector sequence through a fusion language model to obtain the target word vector corresponding to the text to be processed, and the fusion language model is constructed based on the Nezha model, the Bert model and the Roformer model. In the embodiment of the present application, by combining the Nezha model, the Bert model and the Roformer model, the fusion language model can fully mine the hidden information in the text to be processed, improve the accuracy of semantic feature extraction, and also improve the accuracy of the determined word vector corresponding to the text, and then perform downstream tasks based on the word vector to improve the completion quality of downstream tasks.
[0022] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 The structural diagram of the system architecture of the text processing method in the embodiment of the present application is schematically shown.
[0025] Figure 2 The flowchart of the text processing method in the embodiment of the present application is schematically shown.
[0026] Figure 3 The structural diagram of the fusion language model in the embodiment of the present application is schematically shown.
[0027] Figure 4 The structural diagram of the fusion language model in the embodiment of the present application is schematically shown.
[0028] Figure 5 A schematic diagram of a process for classifying text according to business type in an embodiment of the present application is shown schematically.
[0029] Figure 6 The flowchart of training the fusion language model to be trained in the embodiment of the present application is schematically shown.
[0030] Figure 7 The structural block diagram of the text processing device in the present application is schematically shown.
[0031] Figure 8 The structure block diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0032] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0033] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0034] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first" and "second" etc. are used only as labels and are not intended to limit the quantity of their objects.
[0035] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0036] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0037] In the related art of the present application, for industry fields with multiple different business types, it is necessary to identify the business type corresponding to each text from a large amount of text, and to mine hidden information from the texts of different business types to guide downstream tasks. For example, text data in the telecommunications field has different business types, such as major customer business orders, international interconnection protocol IP virtual private networks, information and communication technology ICT business, Internet data center IDC orders, 95 dedicated lines, etc. When texts of different business types are mixed together, it is necessary to distinguish the business types corresponding to each text, and analyze the text of each business type, extract the hidden information therein, and guide downstream tasks based on the extracted information. However, when semantic features are currently extracted from texts, a single language model is usually used for semantic feature extraction, resulting in the output word vector corresponding to the text being not accurate enough, and then the business type cannot be accurately determined and downstream tasks cannot be performed based on the output word vector. In addition, due to the small amount of training text data in some industry fields, the trained language model is not stable enough and has weak generalization, which leads to poor accuracy of the output word vector.
[0038] In view of the problems existing in the related art, the present application proposes a text processing method. Before the technical solution in the embodiment of the present application is described in detail, the technical terms that may be involved in the embodiment of the present application are first explained and described.
[0039] (1) BERT model: Bidirectional Encoder Representations from Transformers, is a bidirectional encoder of Transformer, which aims to pre-train deep bidirectional representations from unlabeled text through conditional computations shared in left and right contexts.
[0040] (2) NEZHA model: an improved model based on the pre-trained language model BERT.
[0041] (3) Roformer model, Rotary Transformer, mainly designs a new rotational position encoding (RoPE) for the Transformer structure.
[0042] (4) Contrastive Learning: Contrastive Learning is a type of self-supervised learning. Self-supervised learning belongs to the unsupervised learning paradigm. Most common machine learning is supervised learning, which is characterized by labeled training data, while unsupervised learning solves the problem of unlabeled data.
[0043] (5) Adversarial Learning: Adversarial Learning is mainly used in sample generation or adversarial attack fields. The main method is to generate new samples by adding a discriminator or based on gradient backpropagation. It is mainly to improve the ability or robustness of the current backbone model to generate samples.
[0044] After introducing the technical terms that may be involved in the embodiments of the present application, the text processing method in the present application is described in detail.
[0045] Figure 1 The following schematically shows an exemplary system architecture block diagram applying the technical solution of the present application.
[0046] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a server 102, and a network 103. The terminal device 101 may include various electronic devices with display screens, such as smart phones, tablet computers, laptop computers, desktop computers, smart TVs, and smart car terminals. The server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. The network 103 may be a communication medium of various connection types that can provide a communication link between the terminal device 101 and the server 102, such as a wired communication link or a wireless communication link.
[0047] According to the implementation requirements, the system architecture in the embodiment of the present application can have any number of terminal devices, networks and servers. For example, the server can be a server group composed of multiple server devices.
[0048] The technical solution provided in the embodiment of the present application can be applied to the terminal device 101 or the server 102. When the text processing method in the present application is executed by the server 102, the server can be a cloud server that provides cloud computing services.
[0049] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, allowing various application systems to obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". From the user's perspective, the resources in the "cloud" are infinitely scalable and can be obtained at any time, used on demand, expanded at any time, and paid for by use.
[0050] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.
[0051] According to the logical function division, the PaaS (Platform as a Service) layer can be deployed on the IaaS (Infrastructure as a Service) layer, and the SaaS (Software as a Service) layer can be deployed on the PaaS layer. SaaS can also be deployed directly on IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is a variety of business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.
[0052] The following is a detailed description of the technical solutions such as the text processing method, text processing device, computer-readable medium, and electronic device provided by the present application in conjunction with specific implementation methods.
[0053] Figure 2 A flowchart of a text processing method is shown, such as Figure 2 As shown, the text processing method includes:
[0054] Step S210: obtaining a text to be processed, performing preprocessing and word segmentation processing on the text to be processed, so as to obtain a word segmentation vector sequence corresponding to the text to be processed;
[0055] Step S220: inputting the word segmentation vector sequence into a fusion language model, and performing semantic feature extraction on the word segmentation vector sequence through the fusion language model to obtain a target word vector corresponding to the text to be processed;
[0056] The fusion language model is constructed based on the Nezha model, the Bert model and the Roformer model.
[0057] The text processing method of the present application, after preprocessing and word segmentation processing of the text to be processed to obtain the word segmentation vector sequence corresponding to the text to be processed, can perform semantic feature extraction on the word segmentation vector sequence through a fusion language model to obtain the target word vector corresponding to the text to be processed, and the fusion language model is constructed based on the Nezha model, the Bert model and the Roformer model. In the embodiment of the present application, by combining the Nezha model, the Bert model and the Roformer model, the fusion language model can fully mine the hidden information in the text to be processed, improve the accuracy of semantic feature extraction, and also improve the accuracy of the determined word vector corresponding to the text, and then perform downstream tasks based on the word vector to improve the completion quality of downstream tasks.
[0058] Below Figure 2 Each step of the text processing method shown is described in detail.
[0059] In step S210, a text to be processed is obtained, and preprocessing and word segmentation processing are performed on the text to be processed to obtain a word segmentation vector sequence corresponding to the text to be processed.
[0060] In an exemplary embodiment of the present application, in order to ensure that the word vector corresponding to the text to be processed and integrating the contextual semantics can be accurately obtained, after obtaining the text to be processed, the text to be processed must first be preprocessed to remove factors that interfere with the extraction of semantic features in the text to be processed. The preprocessing may specifically include text standardization, text cleaning, word cleaning, spelling correction, etc., wherein text standardization may be converting full-width characters to half-width characters, converting uppercase letters to lowercase letters, etc., text cleaning may be removing non-text content and filtering punctuation marks, etc., word cleaning may be removing stop words, low-frequency words, etc., spelling correction may be correcting spelling, grammar, etc., and of course, other preprocessing contents may also be included, such as deleting duplicate data in the text to be processed, and so on.
[0061] In an exemplary embodiment of the present application, after completing the preprocessing of the text to be processed, the preprocessed text to be processed can be subjected to word segmentation processing to obtain a word segmentation vector sequence corresponding to the text to be processed. In an embodiment of the present application, the preprocessed text to be processed can be input into a word segmentation model, and the preprocessed text to be processed can be subjected to word segmentation and vectorization processing by the word segmentation model to obtain a word segmentation vector corresponding to each word in the preprocessed text to be processed. Furthermore, a word segmentation vector sequence can be constructed according to the order of each word segmentation and the word segmentation vector corresponding to the word segmentation. Among them, the word segmentation model can perform word segmentation on the preprocessed text to be processed that is input therein, and divide the text to be processed into vocabulary units such as characters, words or phrases, and then perform vectorization processing on the word segments corresponding to each vocabulary unit to generate word segmentation vectors corresponding to each word segmentation. For example, the preprocessed text to be processed is "Today's weather is cloudy", and through word segmentation processing, "Today's weather is cloudy" is obtained, and then through vectorization processing, the word segmentation vector sequence "Token1 Token2Token3 Token4 Token5" can be obtained, where Token1, Token2, Token3, Token4, and Token5 are the word segmentation vectors corresponding to the word segmentations "today", "of", "weather", "is", and "cloudy", respectively.
[0062] In step S220, the word segmentation vector sequence is input into a fusion language model, and semantic features are extracted from the word segmentation vector sequence through the fusion language model to obtain a target word vector corresponding to the text to be processed; wherein the fusion language model is constructed based on the Nezha model, the Bert model and the Roformer model.
[0063] In an exemplary embodiment of the present application, since the word segmentation vector sequence is obtained based only on the vector determined by the individual word segmentation, the contextual semantics of the text to be processed are not integrated, and thus the hidden information in the text to be processed cannot be obtained according to the word segmentation vector sequence. In view of this, it is necessary to use a language model to process the word segmentation vector sequence to obtain the word vector corresponding to the text to be processed and integrated with the contextual semantics. The language model used in the embodiment of the present application is a fusion language model, specifically a language model constructed based on the Nezha model, the Bert model and the Roformer model, which are all pre-trained language models, and the Nezha model and the Roformer model are all using the structure and training method of the Bert pre-trained language model, and the pre-trained language model can be used for transfer learning for other tasks, and can be used as an extractor of semantic features after further pre-training or fine-tuning.
[0064] Figure 3 The structural diagram of the fusion language model is schematically shown as follows: Figure 3 As shown, the fusion language model 300 includes an input layer 301, a first semantic parsing unit 302, a second semantic parsing unit 303, a model fusion layer 304, a word vector conversion layer 305 and an output layer 306, wherein the first semantic parsing unit 302 and the second semantic parsing unit 303 are arranged in parallel and are connected to the input layer 301 and the model fusion layer 304 at the same time.
[0065] The first semantic parsing unit 302 includes a Roformer model layer 302-1 and a first Bert model layer 302-2 connected in sequence, the second semantic parsing unit 303 includes a second Bert model layer 303-1 and a Nezha model layer 303-2 connected in sequence, and the word vector conversion layer 305 includes an attention layer 305-1 and a conversion layer 305-2. Figure 4 shown.
[0066] based on Figure 3 and Figure 4 The structural diagram of the fusion language model shown in the figure shows that the process of obtaining the target word vector corresponding to the text to be processed and integrating the contextual semantic information is as follows: the word segmentation vector sequence is respectively input to the first semantic parsing unit 302 and the second semantic parsing unit 303 through the input layer 301, and the semantic features of the word segmentation vector sequence are respectively extracted by the first semantic parsing unit 302 and the second semantic parsing unit 303 to obtain the first word vector and the second word vector; then the first semantic parsing unit 302 outputs the first word vector to the model fusion layer 304, and the second semantic parsing unit 303 outputs the second word vector to the model fusion layer 304, and the first word vector and the second word vector are fused by the model fusion layer 304 to obtain the fused word vector; finally, the model fusion layer 304 outputs the fused word vector to the word vector conversion layer 305, and the fused word vector is processed by the word vector conversion layer 305 based on the attention mechanism to obtain the target word vector.
[0067] Specifically, when the word segmentation vector sequence is input into the input layer, a flag is added to the word segmentation vector sequence, for example, [CLS] is added at the starting position, [SEP] is added between the word segmentation vectors corresponding to each word segmentation, and [SEP] is added at the end position, such as Figure 4 As shown in “[CLS]Token1[SEP]Token2[SEP]…Token N[SEP]”, where N is a positive integer.
[0068] After the word segmentation vector sequence is input into the input layer 301, the input layer 301 transmits the word segmentation vector sequence to the Roformer model layer 302-1 in the first semantic parsing unit 302 and the second Bert model layer 303-1 in the second semantic parsing unit 303 respectively. The Roformer model layer 302-1 can construct the corresponding rotation position code according to the position of each word segmentation vector in the word segmentation vector sequence. Then the word segmentation vector sequence and the rotation position code are input into the first Bert model layer. The first Bert model layer extracts semantic features from the word segmentation vector sequence according to the rotation position code to obtain a first word vector. The quantity includes the word vectors corresponding to each word segment in the preprocessed text to be processed determined based on the rotation position coding; at the same time, after the second Bert model layer receives the word segment vector sequence, it can extract semantic features from the word segment vector sequence to obtain an initial word vector, and then the initial word vector is input into the Nezha model layer 303-2, and the initial word vector is processed by the Nezha model layer 303-2 to obtain the relative position coding, and the initial word vector is extracted based on the relative position coding to obtain a second word vector, which includes the word vectors corresponding to each word segment in the preprocessed text to be processed determined based on the relative position coding. In an embodiment of the present application, the structure of the first Bert model layer and the second Bert model layer is the same, both of which are Bert backbone networks composed of multiple bidirectional Transformer units.
[0069] After receiving the first word vector and the second word vector, the model fusion layer 304 can fuse the word vectors corresponding to the same word in the first word vector and the second word vector to obtain a fused word vector. The fusion process can be addition or concatenation, or other processing methods. The embodiment of the present application does not specifically limit this. The fused word vector includes the embedded word vectors corresponding to each word in the preprocessed text to be processed, such as Figure 4 Embed1, Embed2, Embed3, ..., Embed N shown in .
[0070] After the fused word vector is outputted from the model fusion layer 304 to the word vector conversion layer 305, the attention weights α1, α2, α3, ..., αN corresponding to each embedded word vector in the fused word vector are first determined by the attention layer 305-1 based on the attention mechanism, and then the weighted average is performed according to each embedded word vector and the corresponding attention weight through the conversion layer 305-2 to obtain the target word vector. Among them, the reason why the attention weights corresponding to each embedded word vector are determined based on the attention mechanism is that the contributions of different word segments to the target word vector are different, so it is necessary to calculate the attention weight corresponding to each word segment.
[0071] When performing semantic feature extraction, the fusion language model in the embodiment of the present application comprehensively considers the relative position encoding generated by the Nezha model and the rotational position encoding generated by the Roformer model. Compared with semantic feature extraction based only on absolute position encoding, the present application extracts features from the word segmentation vector sequence from two dimensions: relative position encoding and rotational position encoding, and realizes more sufficient information interaction between the models through fusion, thereby making the quality of the generated word vectors higher.
[0072] In the exemplary embodiment of the present application, although the fusion language model is constructed based on the Nezha model, the Roformer model and the Bert model, and the Nezha model, the Roformer model and the Bert model are all pre-trained language models and can be directly used for transfer learning, in order to improve the analysis accuracy of the fusion language model for texts in different fields, before the word segmentation vector sequence corresponding to the pre-processed text to be processed is input into the fusion language model, it is also necessary to train the fusion language model to be trained according to the text in the related field to obtain a fusion language model that can be directly used in the field.
[0073] In an exemplary embodiment of the present application, when training a fusion language model to be trained, a text sample is first obtained, and the text sample is preprocessed and segmented to obtain a word segmentation vector sample sequence corresponding to the text sample. Then, the fusion language model to be trained is subjected to comparative training and adversarial training according to the word segmentation vector sample sequence to obtain a fusion language model.
[0074] For some industries or fields, the amount of text data is small, and the ratio of positive samples to negative samples is unbalanced, so the training effect of the model is relatively poor, and there may be problems of overfitting or underfitting. Therefore, when the amount of text data is small, how to achieve text enhancement is a problem that needs to be solved urgently.
[0075] In an exemplary embodiment of the present application, negative sampling technology and a teacher-student model are used to achieve text enhancement. In a large amount of text, each text needs to be classified, and then positive text samples and negative text samples are constructed according to each type of text. When classifying text, it can be classified according to business type, industry, etc. For example, in the telecommunications industry, there will be a variety of businesses, such as major customer business orders, IP virtual private networks, IDC orders, etc., then the text can be classified and enhanced according to these business types.
[0076] In an exemplary embodiment of the present application, when a large amount of text is classified, the classification can be performed based on only annotated text and a large amount of unannotated text. Figure 5 A schematic diagram of the process of classifying text according to business type is shown, such as Figure 5As shown, in step S501, annotated text, classification information corresponding to the annotated text and unannotated text are obtained, and a text classification model to be trained is trained according to the annotated text and the classification information to obtain a text classification model, wherein the text classification model to be trained is constructed based on the fusion language model to be trained; in step S502, unannotated text is input into the text classification model, and feature extraction is performed on the unannotated text through the text classification model to obtain classification information corresponding to the unannotated text; in step S503, the annotated text and the unannotated text are divided into multiple text sets according to the classification information, and the text samples are determined according to the multiple text sets.
[0077] For example, the classification information corresponding to the annotated text includes five categories: key customer business orders, IP virtual private networks, ICT services, IDC orders and 95 dedicated lines. A text classification model can be trained based on the annotated text and the classification information corresponding to each annotated text. The text classification model can identify the business type corresponding to the unannotated text to achieve automatic annotation of the unannotated text, so that a large amount of annotated text can be obtained. At the same time, the obtained annotated text can be used to retrain the text classification model to improve the stability and clustering effect of the text classification model.
[0078] In an exemplary embodiment of the present application, after a large amount of unlabeled text is automatically labeled by the teacher-student automatic labeling technology and a large amount of labeled text is obtained, all texts can be divided into multiple text sets according to the labeling information corresponding to each text, such as a text set with a business type of "large customer business order", a text set with a business type of "IDC order", etc. Further, text samples can be determined for the text set of the target business type. Specifically, the text in the text set corresponding to the target business type can be obtained as a positive text sample, and the text in the text set not corresponding to the target business type can be obtained as a negative text sample. Then, according to the determined positive text samples and negative text samples, a text sample can be constructed to train the fusion language model to be trained.
[0079] In an exemplary embodiment of the present application, the text classification model to be trained is constructed based on the fusion language model to be trained. Specifically, a classification layer can be set between the word vector conversion layer and the output layer of the fusion language model to be trained. After obtaining the word vector corresponding to the input text, the business type corresponding to the word vector is classified and the classification information is output.
[0080] In an exemplary embodiment of the present application, when training the fusion language model to be trained, an unsupervised training method combining contrastive learning and adversarial learning is adopted, and contrastive learning and adversarial learning are performed simultaneously during training. Figure 6The schematic diagram of the process of training the fusion language model to be trained is shown as follows: Figure 6 As shown, in step S601, a first word segmentation vector sequence corresponding to a target text sample is obtained, and a positive sample pair is generated according to the first word segmentation vector sequence; in step S602, a second word segmentation vector sequence corresponding to a non-target text sample is obtained, and a negative sample is generated according to the second word segmentation vector sequence; in step S603, the fusion language model to be trained is subjected to comparative training according to the target text sample, the positive sample pair and the negative sample, and while performing the comparative training, a fast gradient ascent process is performed on the parameters in the fusion language model to be trained, so as to perform adversarial training on the fusion language model to be trained.
[0081] Among them, in step S601, contrastive learning uses the Dropout layer in the pre-trained language model as an enhancement means to obtain different sentence representations. In an embodiment of the present application, the target text sample can be input into the fusion language model to be trained twice. Since the neurons randomly deleted by the Dropout layer are different each time the input is made, two different groups of word vectors will be obtained. Since the two groups of word vectors correspond to the target text sample, a positive sample pair corresponding to the target text sample can be constructed based on the two groups of word vectors. At the same time, the non-target text sample can be input into the fusion language model to be trained to obtain a word vector corresponding to the non-target text sample, and the word vector can be used as a negative sample. After obtaining the positive sample pair and the negative sample, a positive and negative sample pair can be constructed based on any group of word vectors and negative samples in the positive sample pair. In this way, adversarial training can be performed on the fusion language model to be trained based on the positive sample pair and the positive and negative sample pair. The loss function corresponding to contrastive learning is infoNCE loss, and the specific expression is shown in formula (1):
[0082]
[0083] Among them, q and q' are two sets of word vectors in the positive sample pair, k i is a negative sample, N is the total number of negative samples, and τ is the temperature coefficient.
[0084] From formula (1), we can see that only the distance of the positive sample pair is calculated in the numerator, and the negative sample only appears in the denominator of the contrast loss. When the distance of the positive sample pair is smaller and the distance of the negative sample pair is larger, the loss is smaller. Contrastive learning only requires mislabeled text data and does not require any annotation information. Therefore, when the number of annotated texts is insufficient, it greatly improves the effect of the fusion language model.
[0085] While conducting contrastive learning, adversarial learning is also conducted. Adversarial learning is to add perturbations to the parameters in the fusion language model in the gradient direction, thereby regularizing the model. This can alleviate the problem of poor robustness, reduce the probability of model overfitting, and further improve the generalization ability of the model. The addition of perturbations can be implemented based on fast gradient ascent, and the specific process of fast gradient ascent will not be described here.
[0086] The text processing method in this application can be applied to any industry, such as the construction industry, medical industry, education industry, telecommunication industry, etc. In order to make the text processing method in this application clearer, the text processing method in this application is specifically described below using the telecommunication industry as an example.
[0087] After obtaining a large amount of telecommunications industry texts, annotated texts can be extracted from them. If annotated texts do not exist, a small amount of texts can be manually annotated, and then the annotated texts can be used to train the text classification model to be trained that is built based on the fusion language model to be trained. The trained text classification model can be used to predict the business type corresponding to the unannotated text, so as to divide the large amount of telecommunications industry texts into multiple text sets corresponding to different business types.
[0088] Next, determine the target business type from multiple business types, such as ICT business, and obtain a text set corresponding to the target business type from multiple text sets corresponding to different business types, and use the text in the text set as a positive text sample, and use the text in the text set corresponding to other business types as a negative text sample, and construct a text sample based on the positive text sample and the negative text sample for training the fusion language model to be trained.
[0089] Then, the fusion language model to be trained is trained according to the text samples. During the training, contrastive learning and adversarial learning methods are used to train the model to obtain a fusion language model with stable performance.
[0090] Finally, after acquiring new texts for the telecommunications industry, the trained text classification model can be used to predict the business types corresponding to these texts to obtain the texts corresponding to the ICT business, and the trained fusion language model can be used to extract semantic features from the texts for the ICT business to obtain the corresponding word vectors. Furthermore, downstream tasks can be performed based on the obtained word vectors, such as building knowledge graphs, text intent analysis, etc., to optimize user services and improve user service experience.
[0091] The text processing method in the embodiment of the present application, after pre-processing and word segmentation processing of the text to be processed to obtain the word segmentation vector sequence corresponding to the text to be processed, can perform semantic feature extraction on the word segmentation vector sequence through a fusion language model to obtain the target word vector corresponding to the text to be processed, and the fusion language model is constructed based on the Nezha model, the Bert model and the Roformer model. In the embodiment of the present application, by combining the Nezha model, the Bert model and the Roformer model, the Bert model is used as the parameter sharing layer to achieve parameter sharing and model fusion, and improve the information exchange between models, so that the fusion language model can fully mine the hidden information in the text to be processed, improve the accuracy of semantic feature extraction, and also improve the accuracy of the determined word vector corresponding to the text, and then perform downstream tasks based on the word vector to improve the completion quality of downstream tasks. In addition, the text processing method in this application uses negative sampling and teacher-student models for text enhancement, and uses adversarial learning and contrastive learning to train the fusion language model, which reduces the annotation cost and increases the amount of text. It also uses parameter sharing and model fusion to achieve information exchange between models, thereby improving the effectiveness and generalization of the fusion language model, thereby effectively solving the coding problems in the field of data mining and analysis in various industries.
[0092] The present application also provides a text processing device, Figure 7 A structural diagram of a text processing device is shown. Figure 7 As shown, the text processing device 700 may include a text processing module 701 and a model processing module 702. Among them:
[0093] The text processing module 701 is used to obtain a text to be processed, and perform preprocessing and word segmentation processing on the text to be processed to obtain a word segmentation vector sequence corresponding to the text to be processed;
[0094] A model processing module 702 is used to input the word segmentation vector sequence into a fusion language model, and perform semantic feature extraction on the word segmentation vector sequence through the fusion language model to obtain a target word vector corresponding to the text to be processed;
[0095] The fusion language model is constructed based on the Nezha model, the Bert model and the Roformer model.
[0096] In one embodiment of the present application, the text processing module 701 is configured as follows:
[0097] Inputting the preprocessed text to be processed into a word segmentation model, performing word segmentation and vectorization processing on the preprocessed text to be processed through the word segmentation model to obtain a word segmentation vector corresponding to each word in the preprocessed text to be processed;
[0098] The word segmentation vector sequence is constructed according to the order of each word segmentation and the word segmentation vector corresponding to each word segmentation.
[0099] In one embodiment of the present application, the fusion language model includes an input layer, a first semantic parsing unit, a second semantic parsing unit, a model fusion layer, a word vector conversion layer and an output layer; the model processing module 702 includes:
[0100] A first processing unit is used to input the word segmentation vector sequence into the first semantic parsing unit and the second semantic parsing unit respectively through the input layer, and perform semantic feature extraction on the word segmentation vector sequence through the first semantic parsing unit and the second semantic parsing unit respectively to obtain a first word vector and a second word vector;
[0101] A second processing unit, configured to fuse the first word vector and the second word vector through the model fusion layer to obtain a fused word vector;
[0102] The third processing unit is used to process the fused word vector based on the attention mechanism through the word vector conversion layer to obtain the target word vector.
[0103] In one embodiment of the present application, the first semantic parsing unit includes a Roformer model layer and a first Bert model layer connected in sequence; the first processing unit is configured as follows:
[0104] Constructing a rotational position encoding according to the position corresponding to each word segmentation vector in the word segmentation vector sequence through the Roformer model layer;
[0105] The word segmentation vector sequence and the rotational position code are input into the first Bert model layer, and the first Bert model layer performs semantic feature extraction on the word segmentation vector sequence according to the rotational position code to obtain the first word vector.
[0106] In one embodiment of the present application, the second semantic parsing unit includes a second Bert model layer and a Nezha model layer connected in sequence; and the first processing unit is configured as follows:
[0107] Inputting the word segmentation vector sequence into the second Bert model layer, and performing semantic feature extraction on the word segmentation vector sequence through the second Bert model layer to obtain an initial word vector;
[0108] The initial word vector is input into the Nezha model layer, the initial word vector is processed by the Nezha model layer to obtain a relative position code, and semantic features are extracted from the initial word vector based on the relative position code to obtain the second word vector.
[0109] In an exemplary embodiment of the present application, the second processing unit is configured as:
[0110] The word vectors corresponding to the same word segment in the first word vector and the second word vector are added or concatenated to obtain the fused word vector.
[0111] In an exemplary embodiment of the present application, the fused word vector includes an embedded word vector corresponding to each of the word segments, the word vector conversion layer includes an attention layer and a conversion layer; and the third processing unit is configured as follows:
[0112] Determine, by the attention layer, an attention weight corresponding to each of the embedded word vectors based on an attention mechanism;
[0113] The target word vector is obtained by performing weighted averaging on each of the embedded word vectors and the attention weights corresponding to each of the embedded word vectors through the conversion layer.
[0114] In an exemplary embodiment of the present application, the text processing device 700 further includes:
[0115] A sample acquisition module, used for acquiring a text sample before inputting the word segmentation vector sequence into the fusion language model, and performing the preprocessing and word segmentation processing on the text sample to acquire a word segmentation vector sample sequence corresponding to the text sample;
[0116] The model training module is used to perform comparative training and adversarial training on the fusion language model to be trained according to the word segmentation vector sample sequence to obtain the fusion language model.
[0117] In an exemplary embodiment of the present application, the sample acquisition module is configured as follows:
[0118] Acquire annotated text, classification information corresponding to the annotated text, and unannotated text, and train a text classification model to be trained according to the annotated text and the classification information to obtain a text classification model, wherein the text classification model to be trained is constructed based on the fusion language model to be trained;
[0119] Inputting the unlabeled text into the text classification model, and performing feature extraction on the unlabeled text through the text classification model to obtain classification information corresponding to the unlabeled text;
[0120] The annotated text and the unannotated text are divided into a plurality of text sets according to the classification information, and the text samples are determined according to the plurality of text sets.
[0121] In an exemplary embodiment of the present application, the classification information is a business type; and the determining the text sample according to the multiple text sets is configured as follows:
[0122] Acquire text in a text set corresponding to a target business type as a positive text sample, and acquire text in a text set not corresponding to the target business type as a negative text sample;
[0123] The text sample is constructed according to the positive text sample and the negative text sample.
[0124] In an exemplary embodiment of the present application, the model training module includes:
[0125] A positive sample generating unit, used to obtain a first word segmentation vector sequence corresponding to a target text sample, and generate a positive sample pair according to the first word segmentation vector sequence;
[0126] A negative sample generating unit, used to obtain a second word segmentation vector sequence corresponding to a non-target text sample, and generate a negative sample according to the second word segmentation vector sequence;
[0127] A training unit is used to perform comparative training on the fusion language model to be trained according to the target text sample, the positive sample pair and the negative sample, and while performing the comparative training, perform fast gradient ascent processing on the parameters in the fusion language model to be trained to perform adversarial training on the fusion language model to be trained.
[0128] In an exemplary embodiment of the present application, the positive sample generation unit is configured as follows:
[0129] The first word segmentation vector sequence is input into the to-be-trained fusion language model twice to obtain two groups of word vectors corresponding to the target text samples, and the positive sample pair is constructed according to the two groups of word vectors obtained.
[0130] In an exemplary embodiment of the present application, the training unit is configured as follows:
[0131] Constructing a positive-negative sample pair according to a positive sample in the positive sample pair and the negative sample;
[0132] The fusion language model to be trained is subjected to comparative training according to the target text sample, the positive and negative sample pairs and the positive sample pairs.
[0133] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0134] In addition, although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0135] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0136] Figure 8 A computer system structure block diagram of an electronic device for implementing an embodiment of the present application is schematically shown, and the electronic device may be arranged in a terminal device or a server.
[0137] It should be noted that Figure 8 The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0138] like Figure 8As shown, the computer system 800 includes a central processing unit 801 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 802 (ROM) or the program loaded from the storage part 808 to the random access memory 803 (RAM). Various programs and data required for system operation are also stored in the random access memory 803. The central processing unit 801, the read-only memory 802 and the random access memory 803 are connected to each other through a bus 804. The input / output interface 805 (Input / Output interface, i.e., I / O interface) is also connected to the bus 804.
[0139] In some embodiments, the following components are connected to the input / output interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a local area network card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.
[0140] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processor 801, various functions defined in the system of the present application are executed.
[0141] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable medium or any combination of the above two. Computer-readable media can be, for example, - but not limited to - electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable media can include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (Erasable Programmable Read Only Memory, EPROM), flash memory, optical fibers, portable compact disk read-only memories (Compact Disc Read-Only Memory, CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present application, a computer-readable medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0142] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0143] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0144] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable an electronic device to execute the method according to the implementation methods of the present application.
[0145] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A text processing method, characterized in that: include: Obtaining a text to be processed, and performing preprocessing and word segmentation processing on the text to be processed to obtain a word segmentation vector sequence corresponding to the text to be processed; Inputting the word segmentation vector sequence into a fusion language model, and performing semantic feature extraction on the word segmentation vector sequence through the fusion language model to obtain a target word vector corresponding to the text to be processed; The fusion language model is constructed based on the Nezha model, the Bert model and the Roformer model; The fusion language model includes an input layer, a first semantic parsing unit, a second semantic parsing unit, a model fusion layer, a word vector conversion layer and an output layer, wherein the first semantic parsing unit and the second semantic parsing unit are arranged in parallel and are simultaneously connected to the input layer and the model fusion layer; the first semantic parsing unit includes a Roformer model layer and a first Bert model layer connected in sequence, the second semantic parsing unit includes a second Bert model layer and a Nezha model layer connected in sequence, and the word vector conversion layer includes an attention layer and a conversion layer.
2. The method according to claim 1, characterized in that The preprocessing and word segmentation processing of the to-be-processed text to obtain a word segmentation vector sequence includes: Inputting the preprocessed text to be processed into a word segmentation model, performing word segmentation and vectorization processing on the preprocessed text to be processed through the word segmentation model to obtain a word segmentation vector corresponding to each word in the preprocessed text to be processed; The word segmentation vector sequence is constructed according to the order of each word segmentation and the word segmentation vector corresponding to each word segmentation.
3. The method according to claim 1, characterized in that The step of inputting the word segmentation vector sequence into a fusion language model and extracting semantic features of the word segmentation vector sequence through the fusion language model to obtain a target word vector corresponding to the text to be processed includes: Inputting the word segmentation vector sequence into the first semantic parsing unit and the second semantic parsing unit respectively through the input layer, and performing semantic feature extraction on the word segmentation vector sequence respectively through the first semantic parsing unit and the second semantic parsing unit to obtain a first word vector and a second word vector; Fusing the first word vector and the second word vector through the model fusion layer to obtain a fused word vector; The fused word vector is processed by the word vector conversion layer based on the attention mechanism to obtain the target word vector.
4. The method according to claim 3, characterized in that The step of extracting semantic features from the word segmentation vector sequence by the first semantic parsing unit to obtain a first word vector includes: Constructing a rotational position encoding according to the position corresponding to each word segmentation vector in the word segmentation vector sequence through the Roformer model layer; The word segmentation vector sequence and the rotational position code are input into the first Bert model layer, and the first Bert model layer performs semantic feature extraction on the word segmentation vector sequence according to the rotational position code to obtain the first word vector.
5. The method according to claim 3, characterized in that The step of extracting semantic features from the word segmentation vector sequence by the second semantic parsing unit to obtain a second word vector includes: Inputting the word segmentation vector sequence into the second Bert model layer, and performing semantic feature extraction on the word segmentation vector sequence through the second Bert model layer to obtain an initial word vector; The initial word vector is input into the Nezha model layer, the initial word vector is processed by the Nezha model layer to obtain a relative position code, and semantic features are extracted from the initial word vector based on the relative position code to obtain the second word vector.
6. The method according to claim 3, characterized in that The fusing the first word vector and the second word vector through the model fusion layer to obtain a fused word vector includes: The word vectors corresponding to the same word segment in the first word vector and the second word vector are added or concatenated to obtain the fused word vector.
7. The method according to claim 3, characterized in that The fused word vector includes an embedded word vector corresponding to each of the word segments; The step of processing the fused word vector based on the attention mechanism through the word vector conversion layer to obtain the target word vector includes: Determine, by the attention layer, an attention weight corresponding to each of the embedded word vectors based on an attention mechanism; The target word vector is obtained by performing weighted averaging on each of the embedded word vectors and the attention weights corresponding to each of the embedded word vectors through the conversion layer.
8. The method according to claim 1, characterized in that Before inputting the word segmentation vector sequence into the fusion language model, the method further includes: Acquire a text sample, and perform the preprocessing and the word segmentation processing on the text sample to obtain a word segmentation vector sample sequence corresponding to the text sample; The fusion language model to be trained is subjected to comparative training and adversarial training according to the word segmentation vector sample sequence to obtain the fusion language model.
9. The method according to claim 8, characterized in that The obtaining of the text sample comprises: Acquire annotated text, classification information corresponding to the annotated text, and unannotated text, and train a text classification model to be trained according to the annotated text and the classification information to obtain a text classification model, wherein the text classification model to be trained is constructed based on the fusion language model to be trained; Inputting the unlabeled text into the text classification model, and performing feature extraction on the unlabeled text through the text classification model to obtain classification information corresponding to the unlabeled text; The annotated text and the unannotated text are divided into a plurality of text sets according to the classification information, and the text samples are determined according to the plurality of text sets.
10. The method according to claim 9, characterized in that The classification information is the business type; The determining the text sample according to the multiple text sets includes: Acquire text in a text set corresponding to a target business type as a positive text sample, and acquire text in a text set not corresponding to the target business type as a negative text sample; The text sample is constructed according to the positive text sample and the negative text sample.
11. The method according to claim 8, characterized in that The performing comparative training and adversarial training on the fusion language model to be trained according to the word segmentation vector sample sequence to obtain the fusion language model includes: Obtain a first word segmentation vector sequence corresponding to the target text sample, and generate a positive sample pair according to the first word segmentation vector sequence; Obtain a second word segmentation vector sequence corresponding to the non-target text sample, and generate a negative sample according to the second word segmentation vector sequence; The fusion language model to be trained is subjected to comparative training according to the target text sample, the positive sample pair and the negative sample, and while performing the comparative training, a fast gradient ascent process is performed on the parameters in the fusion language model to be trained, so as to perform adversarial training on the fusion language model to be trained.
12. The method according to claim 11, characterized in that The generating positive sample pairs according to the first word segmentation vector sequence includes: The first word segmentation vector sequence is input into the to-be-trained fusion language model twice to obtain two groups of word vectors corresponding to the target text samples, and the positive sample pair is constructed according to the two groups of word vectors obtained.
13. The method according to claim 11, characterized in that The comparative training of the fusion language model to be trained according to the target text sample, the positive sample pair and the negative sample includes: Constructing a positive-negative sample pair according to a positive sample in the positive sample pair and the negative sample; The fusion language model to be trained is subjected to comparative training according to the target text sample, the positive and negative sample pairs and the positive sample pairs.
14. A text processing device, characterized in that: include: A text processing module is used to obtain a text to be processed, and perform preprocessing and word segmentation processing on the text to be processed to obtain a word segmentation vector sequence corresponding to the text to be processed; A model processing module, used for inputting the word segmentation vector sequence into a fusion language model, and performing semantic feature extraction on the word segmentation vector sequence through the fusion language model to obtain a target word vector corresponding to the text to be processed; The fusion language model is constructed based on the Nezha model, the Bert model and the Roformer model; The fusion language model includes an input layer, a first semantic parsing unit, a second semantic parsing unit, a model fusion layer, a word vector conversion layer and an output layer, wherein the first semantic parsing unit and the second semantic parsing unit are arranged in parallel and are simultaneously connected to the input layer and the model fusion layer; the first semantic parsing unit includes a Roformer model layer and a first Bert model layer connected in sequence, the second semantic parsing unit includes a second Bert model layer and a Nezha model layer connected in sequence, and the word vector conversion layer includes an attention layer and a conversion layer.
15. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the text processing method according to any one of claims 1 to 13 is implemented.
16. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the text processing method according to any one of claims 1 to 13 by executing the executable instructions.
