Information processing method and device and electronic equipment
By combining pre-trained small text vectorization models, the problem that different natural language processing tasks require different vector dimensions is solved, and the computing resource utilization and vector interpretability are improved.
Patent Information
- Application Number
- CN202411012533.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-12-31
AI Technical Summary
Different natural language processing tasks require different vector dimensions, resulting in waste of computing resources. The existing technology requires training of vectorized models of multiple different dimensions to meet the needs.
By pre-training multiple small text vectorized models and combining them according to the needs of natural language processing tasks, a vectorized model that meets the target feature dimensions is generated to reduce waste of computing resources.
It improves the computing resource utilization rate of natural language processing tasks, reduces computing power waste, and makes the generated vector more interpretable.
Smart Images

Figure CN119226729A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of natural language processing, and in particular to an information processing method, device and electronic device. Background Art
[0002] Natural language processing tasks such as speech recognition and text classification usually vectorize text to obtain vectorized text features. However, different natural language processing tasks usually require different vector dimensions. Therefore, in order to meet the needs of different natural language processing tasks, it is usually necessary to train multiple vectorization models of different dimensions, resulting in a waste of computing resources. How to improve the utilization of computing resources for natural language processing tasks has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] The present disclosure provides an information processing method, device, electronic device and storage medium.
[0004] According to a first aspect of the present disclosure, there is provided an information processing method, the method comprising:
[0005] Get the target feature dimension number corresponding to the target natural language processing task;
[0006] Determining, according to the output vector dimensions of each first vector model, a second vector model that meets the target feature dimension, wherein the second vector model is composed of at least one first vector model;
[0007] Determine feature information corresponding to the target natural language processing task based on the second vector model.
[0008] In an implementation of the present application, determining the second vector model that meets the target feature dimension according to the output vector dimension of each first vector model includes:
[0009] Combining the first vector models to obtain at least one combined model;
[0010] Any combination model whose output vector dimension number is equal to the target feature dimension number is determined as the second vector model.
[0011] In one implementation of the present application, each of the first vector models includes an initial first vector model, and the initial first vector model is used to train other first vector models.
[0012] In an implementation of the present application, the training method of the initial first vector model includes:
[0013] Inputting the sample training data into a first vector model to be trained to obtain an output vector of a first preset dimension;
[0014] Determine a loss function value of a first to-be-trained vector model according to the identification data corresponding to the sample training data and the output vector;
[0015] If the loss function value is less than a preset loss threshold, determining the first vector model to be trained as an initial first vector model, and the output feature dimension of the initial first vector model is a first preset dimension;
[0016] If the loss function value is not less than the preset loss threshold, new sample training data is obtained, and the process returns to execute the step of inputting the sample training data into the first vector model to be trained.
[0017] In an implementation of the present application, the training methods of other first vector models except the initial first vector model include:
[0018] Inputting the sample training data into a second vector model to be trained to obtain a first output vector of a second preset dimension, and inputting the sample training data into each of the trained first vector models to obtain a corresponding second output vector, wherein the dimension of the second output vector is the same as or different from the second preset dimension;
[0019] Determine a loss function value of a second vector model to be trained according to the identification data corresponding to the sample training data and a superposition vector, wherein the superposition vector is a vector obtained by fusing the first output vector and each second output vector;
[0020] If the loss function value is less than a preset loss threshold, determining the second vector model to be trained as the first vector model;
[0021] If the loss function value is not less than the preset loss threshold, new sample training data is obtained, and the process returns to execute the step of inputting the sample training data into the second vector model to be trained.
[0022] In an implementation of the present application, the model parameters of the second vector model to be trained are the same as the parameters of the initial first vector model.
[0023] According to a second aspect of the present disclosure, there is provided an information processing device, the device comprising:
[0024] An information acquisition module is used to obtain the target feature dimension number corresponding to the target natural language processing task;
[0025] A model determination module, used to determine a second vector model that meets the target feature dimension according to the output vector dimension of each first vector model, wherein the second vector model is composed of at least one first vector model;
[0026] An information processing module is used to determine feature information corresponding to the target natural language processing task based on the second vector model.
[0027] In one implementation of the present application, the model determination module is used to combine the first vector models to obtain at least one combined model; and determine any combined model whose output vector dimension number is equal to the target feature dimension number as the second vector model.
[0028] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0029] at least one processor; and
[0030] a memory communicatively coupled to the at least one processor;
[0031] An image acquisition device; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described in the present disclosure.
[0032] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:
[0034] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0035] Figure 1 A schematic diagram of an implementation flow of the information processing method provided in an embodiment of the present application is shown;
[0036] Figure 2 A schematic diagram of vector model training provided in an embodiment of the present application is shown;
[0037] Figure 3 Another vector model training schematic diagram provided in an embodiment of the present application is shown;
[0038] Figure 4 Another vector model training schematic diagram provided in an embodiment of the present application is shown;
[0039] Figure 5 A schematic diagram of the structure of an information processing device provided by an embodiment of the present application is shown;
[0040] Figure 6 A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0041] In order to make the purpose, features, and advantages of the present disclosure more obvious and easy to understand, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0042] Different natural language processing tasks require different vector dimensions. However, currently, it is necessary to train multiple vectorization models of different dimensions to meet the needs of different natural language processing tasks, which leads to a waste of computing resources. Therefore, in order to improve the computing resource utilization of natural language processing tasks, the present disclosure provides an information processing method, device and electronic device, which can pre-train multiple small text vectorization models, and then combine different numbers of text vectorization models according to the needs of natural language processing tasks to obtain a vectorization model with a vector dimension that can meet the needs. The information processing method provided by the present disclosure can be applied to electronic devices such as computers, mobile phones and tablets.
[0043] The technical solution of the embodiment of the present application will be described below in conjunction with the drawings in the embodiment of the present application.
[0044] Figure 1 A schematic diagram of an implementation flow of the information processing method provided in an embodiment of the present application is shown. Figure 1 As shown, the method includes:
[0045] S101, obtaining the target feature dimension number corresponding to the target natural language processing task.
[0046] In the present disclosure, natural language processing tasks refer to tasks that process voice and / or text information to obtain user intent and / or interact with users. Natural language processing tasks can include different types of tasks such as text classification tasks, text recognition tasks, text generation tasks, user intent analysis tasks, and interaction tasks. Among them, text classification tasks can be applied to scenarios such as spam filtering, product classification, and user emotion classification, text recognition tasks can be applied to scenarios such as license plate recognition and ticket recognition, text generation tasks can be applied to scenarios such as translation and text summarization, user intent analysis tasks can be applied to scenarios such as user sentiment analysis and text semantic parsing, and interaction tasks can be applied to scenarios such as human-computer text interaction and human-computer voice interaction.
[0047] The target natural language processing task can be any natural language processing task that needs to be processed.
[0048] The natural language processing task includes information such as text data to be processed and task type identification. The text data to be processed may include text related to the natural language processing task and / or text corresponding to the related voice information. For example, if the natural language processing task is an electronic product classification task, the text data to be processed included in the natural language processing task may include encyclopedia texts of various electronic products, electronic product manual texts, and electronic product service texts. In the present disclosure, corresponding task type identifications can be set in advance for different types of natural language processing tasks. The task type identification can be a string or a digital code, for example, if the task type identification of the text classification task is set to the string "wbfl", and the task type identification of the text recognition task is set to the string "wbsb", if the task type of the target natural language processing task is a text classification task, the string "wbfl" can be used as the task type identification corresponding to the target natural language processing task.
[0049] In the present disclosure, the number of feature dimensions corresponding to a natural language processing task refers to the number of dimensions of a feature vector used to characterize the text data features of the natural language processing task. The feature vector extraction method, the task type of the natural language processing task, and the feature vector requirement dimension will all affect the number of feature dimensions corresponding to the natural language processing task. Different feature vector extraction methods, different task types of natural language processing tasks, and / or different feature vector requirement dimensions will result in different number of feature dimensions corresponding to the natural language processing task. The number of feature dimensions corresponding to a natural language processing task is usually greater than or equal to the feature vector requirement dimension of the natural language processing task. For example, natural language processing task A is a text recognition task, natural language processing task B is an interactive task, natural language processing task A includes text data W1, natural language processing task B includes text data W2, the processing requirement of natural language processing task A is to extract a 32-dimensional feature vector of text data W1, and the processing requirement of natural language processing task B is to extract a 64-dimensional feature vector of text data W2. Then the number of feature dimensions corresponding to natural language processing task A is 32 dimensions, and the number of feature dimensions corresponding to natural language processing task B is 64 dimensions.
[0050] In the present disclosure, the target number of feature dimensions corresponding to the target natural language processing task can be determined by the feature vector extraction method, task type identifier and / or feature vector requirement dimension of the target natural language processing task. For example, if the task type of the target natural language processing task is a text recognition task, the feature vector requirement dimension of the target natural language processing task is 32 dimensions. The text recognition task generally requires complex processing such as semantic similarity of text data, so higher-dimensional vector features such as 32 dimensions or 64 dimensions are required to achieve complex processing such as semantic similarity. Therefore, based on the feature vector requirement dimension of the target natural language processing task being 32 dimensions and the task type of the target natural language processing task, the target number of feature dimensions corresponding to the target natural language processing task can be set to 32 dimensions or 64 dimensions.
[0051] S102: Determine a second vector model that meets the target feature dimension according to the output vector dimensions of each first vector model, where the second vector model is composed of at least one first vector model.
[0052] In the present disclosure, multiple second vector models can be pre-trained, the output vector dimensions of any two second vector models can be the same or different, and the model structures of any two second vector models can be the same or different.
[0053] In the present disclosure, the first vector models can be combined according to the output vector dimensions of the respective first vector models to obtain a combined model whose output vector dimension is the target feature dimension as the second vector model.
[0054] In a possible implementation, determining the second vector model that meets the target feature dimension according to the output vector dimension of each first vector model may include steps A1-A2:
[0055] Step A1: combine the first vector models to obtain at least one combined model.
[0056] In the present disclosure, the first vector models are combined in groups of N to obtain a combination model, and each combination model includes a different first vector model. Wherein, N = 1, 2, 3..., n, n is the total number of first vector models. For example, if three first vector models are pre-trained: the first vector model m1, the first vector model m2 and the first vector model m3, the first vector models can be combined to obtain 7 combination models: a combination model composed of the first vector model m1, a combination model composed of the first vector model m2, a combination model composed of the first vector model m3, a combination model composed of the first vector model m1 and the first vector model m2, a combination model composed of the first vector model m1 and the first vector model m3, a combination model composed of the first vector model m2 and the first vector model m3, and a combination model composed of the first vector model m1, the first vector model m2 and the first vector model m3.
[0057] Step A2: Determine any combination model whose output vector dimension is equal to the target feature dimension as the second vector model.
[0058] After obtaining each combined model, the number of dimensions of the output vector of each combined model can be determined. The number of dimensions of the output vector of the combined model can be determined based on the superposition method between the output vectors of each first vector model in the combined model. If the superposition method between the output vectors of each first vector model in the combined model is a splicing method, the dimension of the output vector of the combined model is the sum of the dimensions of the output vectors of each first vector model in the combined model. For example, if the combined model includes a first vector model m1 and a first vector model m2, wherein the output vector of the first vector model m1 is a vector of x1 dimension, and the output vector of the first vector model m2 is a vector of x2 dimension, if the superposition method between the output vectors of the first vector model m1 and the first vector model m2 is a splicing method, the dimension of the output vector of the combined model is x1 plus x2.
[0059] If the output vectors of the first vector models in the combined model are superimposed in a maximum pooling manner, the dimension of the output vector of the combined model is equal to the dimension of the output vector of the first vector model with the largest output vector dimension in the combined model. For example, if the combined model includes a first vector model m3 and a first vector model m4, wherein the output vector of the first vector model m3 is a vector of dimension x3, and the output vector of the first vector model m4 is a vector of dimension x4, and x3 is greater than x4, if the output vectors of the first vector model m3 and the first vector model m4 are superimposed in a maximum pooling manner, the dimension of the output vector of the combined model is x3.
[0060] After determining the output vector dimensions of each combination model, any combination model whose output vector dimensions are equal to the target feature dimensions can be determined as the second vector model. In the present disclosure, any combination model whose output vector dimensions are greater than the target feature dimensions can also be determined as the second vector model.
[0061] S103: Determine feature information corresponding to the target natural language processing task based on the second vector model.
[0062] In the present disclosure, the text data to be processed of the target natural language processing task can be input into the second vector model, and the vector features of the text data to be processed can be extracted through the second vector model. The feature vector of the extracted text data to be processed is the feature vector of the target feature dimension number, and the feature vector of the target feature dimension number is used as the feature information corresponding to the target natural language processing task. Furthermore, the user intention can be analyzed and / or the interaction with the user can be realized based on the feature information corresponding to the target natural language processing task.
[0063] The information processing method disclosed in the present invention is used to obtain the target feature dimension number corresponding to the target natural language processing task, and the second vector model that meets the target feature dimension number is determined according to the output vector dimension number of each first vector model. The second vector model is composed of at least one first vector model, and the feature information corresponding to the target natural language processing task is determined based on the second vector model. Instead of wasting computing resources to train the corresponding vector model for each natural language processing task, a second vector model that can meet the processing requirements of each natural language processing task can be generated by combining multiple pre-trained second vector models, thereby improving the computing resource utilization of natural language processing tasks.
[0064] In a possible implementation, each of the first vector models includes an initial first vector model, and the initial first vector model is used to train other first vector models. In an embodiment, the training method of the initial first vector model may include steps B1-B4:
[0065] Step B1: input sample training data into a first vector model to be trained to obtain an output vector of a first preset dimension.
[0066] In the present disclosure, the first model to be trained can adopt a basic text encoding model such as BERT (Bidirectional Encoder Representations from Transformers, a pre-trained language model), GPT (Generative Pre-trained Transformer, a pre-trained language model) or LLAMA (Language Model for Multilingual Pretraining, a multilingual pre-trained language model).
[0067] Sample training data may include training text data and text identifiers. For example, the training text data may be classified by identifying product brand information included in the training text data. The classification results may include different brands to which different training data belong. The text identifiers may be the brands corresponding to each training text data.
[0068] The dimension of the output vector of the first vector model to be trained is the first preset dimension. The first preset dimension can be set according to actual application requirements. In the present disclosure, the dimension of the output vector of the first vector model to be trained can be preset to the first preset dimension by adjusting the structure of the first vector model to be trained and the dimension of the output layer. The dimension of the feature vector of the sample training data determined by the first vector model to be trained is also the first preset dimension.
[0069] Step B2: determining the loss function value of the first vector model to be trained according to the identification data corresponding to the sample training data and the output vector.
[0070] The identification data corresponding to the sample training data is the text identification. In the present disclosure, the first vector model to be trained can extract the feature vector of the sample training data, and the loss function value of the first vector model to be trained can be calculated based on the extracted feature vector and the text identification of the sample training data. The loss function can adopt a similarity function, an exponential function, etc.
[0071] Step B3: If the loss function value is less than a preset loss threshold, the first vector model to be trained is determined as an initial first vector model, and the output feature dimension of the initial first vector model is a first preset dimension.
[0072] The preset loss threshold may be set according to the actual application scenario. For example, the preset loss threshold may be set to 0.2 or 0.25.
[0073] Step B4: if the loss function value is not less than the preset loss threshold, obtain new sample training data, and return to execute the step of inputting the sample training data into the first vector model to be trained.
[0074] The new sample training data may also include training text data and text identifiers.
[0075] Figure 2 A schematic diagram of vector model training provided in an embodiment of the present application is shown. Figure 2 As shown, the BaseEncoder Model is a basic encoder model, that is, the first model to be trained. The text data corresponding to the sample training data "Hello, I am from brand A" is identified as brand A. The sample training data "Hello, I am from brand A" is input into the BaseEncoder Model model, and the loss function value of the BaseEncoder Model model is determined by the classification result output by the BaseEncoder Model model and the text data identification "Brand A". If the loss function value is less than the preset loss threshold, the current BaseEncoder Model model can be determined as the initial first vector model M1. If the loss function value is not less than the preset loss threshold, new sample training data is obtained, such as the sample training data "I am from brand B", and the new sample training data "I am from brand B" is input into the BaseEncoder Model model to continue iterative training until the BaseEncoderModel model training is completed, and the initial first vector model M1 is obtained. The output feature dimension of the initial first vector model M1 is consistent with the output feature dimension of the BaseEncoder Model model.
[0076] In one embodiment, the training method of other first vector models except the initial first vector model may include steps C1-C4:
[0077] Step C1, input the sample training data into the second vector model to be trained to obtain a first output vector of a second preset dimension, and input the sample training data into each trained first vector model to obtain a corresponding second output vector, wherein the dimension of the second output vector is the same as or different from the second preset dimension.
[0078] The second preset dimension can be set according to actual application requirements. In the present disclosure, the dimension of the output vector of the second vector model to be trained can be preset to the second preset dimension by adjusting the structure of the second vector model to be trained and the dimension of the output layer. The dimension of the feature vector of the sample training data determined by the first vector model to be trained is also the second preset dimension.
[0079] In the present disclosure, the model parameters of the second vector model to be trained are the same as the parameters of the initial first vector model. For example, the BERT model, the GPT model or the LLAMA model can be initialized to obtain a model with the same model structure as the initial first vector model as the second vector model to be trained. Figure 3 Another vector model training schematic diagram provided in an embodiment of the present application is shown. Figure 3 As shown, the Base Encoder Model model is a second vector model to be trained that is consistent with the model structure of the initial first vector model M1. The trained first vector model includes the initial first vector model. The sample training data "Hello, I am from brand A" is input into the second vector model to be trained to obtain the first output vector 301 of the second preset dimension. The sample training data is input into the trained initial first vector model M1 to obtain the corresponding second output vector 302. The first output vector 301 and the first output vector 302 can be fused to obtain a superimposed vector. In a possible implementation, the first output vector 301 and the first output vector 302 can be superimposed by vector concatenation, vector summation, vector averaging or maximum pooling. Figure 3 As shown, the loss function value of the second vector model to be trained can be calculated based on the identification data and the superimposed vector corresponding to the sample training data. If the loss function value is less than the preset loss threshold, the second vector model to be trained can be determined as the first vector model M2. If the loss function value is not less than the preset loss threshold, the new sample training data can be input into the second vector model to be trained to continue iterative training until the training is completed to obtain the first vector model M2.
[0080] In the present disclosure, if the model parameters of the second vector model to be trained are the same as the parameters of the initial first vector model, the dimension of the second output vector is the same as the second preset dimension.
[0081] Step C2, determining the loss function value of the second vector model to be trained according to the identification data corresponding to the sample training data and the superposition vector, wherein the superposition vector is a vector obtained by fusing the first output vector and each second output vector.
[0082] In the present disclosure, the first output vector and each second output vector may be fused by vector concatenation, vector summation, vector averaging or maximum pooling to obtain a fused vector as a superposition vector.
[0083] Step C3: if the loss function value is less than a preset loss threshold, the second vector model to be trained is determined as the first vector model.
[0084] In the present disclosure, the preset loss threshold can be set according to the actual application scenario.
[0085] Step C4: if the loss function value is not less than the preset loss threshold, new sample training data is obtained, and the process returns to the step of inputting the sample training data into the second vector model to be trained.
[0086] Figure 4 Another vector model training schematic diagram provided in an embodiment of the present application is shown. Figure 4 As shown, the BaseEncoder Model model is a second vector model to be trained that has the same model structure as the initial first vector model M1, and the trained first vector model includes the initial first vector model M1 and the first vector model M2. The sample training data "Hello, I am from brand A" is input into the second vector model to be trained to obtain a first output vector 403 of a second preset dimension, the sample training data is input into the trained initial first vector model M1 to obtain a corresponding second output vector 401, and the sample training data is input into the trained first vector model M2 to obtain a corresponding second output vector 402. The first output vector 403, the second output vector 402 and the second output vector 403 can be fused to obtain a superposition vector, and the loss function value of the second vector model to be trained can be calculated according to the identification data corresponding to the sample training data and the superposition vector. If the loss function value is less than the preset loss threshold, the second vector model to be trained can be determined as the first vector model M3. If the loss function value is not less than the preset loss threshold, new sample training data can be input into the second vector model to be trained to continue iterative training until the training is completed to obtain the first vector model M3.
[0087] In the present disclosure, when training other first vector models except the initial first vector model, the trained first vector models at least include the initial first vector model.
[0088] In the present disclosure, the model parameters of the second vector model to be trained may be different from the parameters of the initial first vector model. For example, the second model to be trained may adopt a BERT model, a GPT model or a LLAMA model with different parameters from those of the initial first vector model.
[0089] By adopting the information processing method disclosed in the present invention, multiple small text vectorization models can be obtained through incremental training. Then, different text vectorization models can be combined according to the requirements of natural language processing tasks to obtain a combined model that can meet the dimensional requirements of different scenarios. This not only reduces the waste of computing power but also makes the obtained output vectors of different dimensions more interpretable.
[0090] Based on the same inventive concept, according to the information processing method provided by the above embodiment of the present disclosure, correspondingly, another embodiment of the present disclosure further provides an information processing device, whose structural schematic diagram is shown in FIG. Figure 5 As shown, it may include:
[0091] An information acquisition module 501 is used to acquire the target feature dimension number corresponding to the target natural language processing task;
[0092] A model determination module 502 is used to determine a second vector model that meets the target feature dimension according to the output vector dimension of each first vector model, wherein the second vector model is composed of at least one first vector model;
[0093] The information processing module 503 is used to determine feature information corresponding to the target natural language processing task based on the second vector model.
[0094] The information processing device disclosed in the present invention is used to obtain the target feature dimension number corresponding to the target natural language processing task, and the second vector model that meets the target feature dimension number is determined according to the output vector dimension number of each first vector model. The second vector model is composed of at least one first vector model, and the feature information corresponding to the target natural language processing task is determined based on the second vector model. Instead of wasting computing resources to train the corresponding vector model for each natural language processing task, a second vector model that can meet the processing requirements of each natural language processing task can be generated by combining multiple pre-trained second vector models, thereby improving the computing resource utilization rate of the natural language processing task.
[0095] In one possible implementation, the model determination module 502 can be used to combine the first vector models to obtain at least one combined model; and determine any combined model whose output vector dimension number is equal to the target feature dimension number as the second vector model.
[0096] In one possible implementation, each of the first vector models includes an initial first vector model, and the initial first vector model is used to train other first vector models.
[0097] In one embodiment, the device further comprises:
[0098] The first model training module (not shown in the figure) is used to input sample training data into the first vector model to be trained to obtain an output vector of a first preset dimension; determine the loss function value of the first vector model to be trained based on the identification data corresponding to the sample training data and the output vector; if the loss function value is less than a preset loss threshold, determine the first vector model to be trained as an initial first vector model, and the output feature dimension of the initial first vector model is a first preset dimension; if the loss function value is not less than the preset loss threshold, obtain new sample training data, and return to execute the step of inputting the sample training data into the first vector model to be trained.
[0099] In one embodiment, the device further comprises:
[0100] The second model training module (not shown in the figure) is used to input the sample training data into the second vector model to be trained to obtain the first output vector of the second preset dimension, and to input the sample training data into each trained first vector model to obtain the corresponding second output vector, wherein the dimension of the second output vector is the same as or different from the second preset dimension; determine the loss function value of the second vector model to be trained according to the identification data and the superposition vector corresponding to the sample training data, wherein the superposition vector is a vector obtained by fusing the first output vector and each second output vector; if the loss function value is less than a preset loss threshold, determine the second vector model to be trained as the first vector model; if the loss function value is not less than the preset loss threshold, obtain new sample training data, and return to execute the step of inputting the sample training data into the second vector model to be trained.
[0101] In one possible implementation manner, the model parameters of the second vector model to be trained are the same as the parameters of the initial first vector model.
[0102] By using the information processing device disclosed in the present invention, multiple small text vectorization models can be obtained through incremental training. Then, different text vectorization models can be combined according to the requirements of natural language processing tasks to obtain a combined model that can meet the dimensional requirements of different scenarios. This not only reduces the waste of computing power but also makes the obtained output vectors of different dimensions more interpretable.
[0103] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
[0104] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0105] like Figure 6As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0106] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0107] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as information processing methods. For example, in some embodiments, the information processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the information processing method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the information processing method in any other appropriate manner (e.g., by means of firmware).
[0108] The electronic device 600 may further include an image acquisition device.
[0109] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), integrated systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0110] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0111] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0112] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0113] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0114] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0115] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0116] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0117] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. An information processing method, the method comprising: Get the target feature dimension number corresponding to the target natural language processing task; Determining, according to the output vector dimensions of each first vector model, a second vector model that meets the target feature dimension, wherein the second vector model is composed of at least one first vector model; Determine feature information corresponding to the target natural language processing task based on the second vector model.
2. The method according to claim 1, wherein determining the second vector model that meets the target feature dimension according to the output vector dimension of each first vector model comprises: Combining the first vector models to obtain at least one combined model; Any combination model whose output vector dimension number is equal to the target feature dimension number is determined as the second vector model.
3. According to the method of claim 1, each of the first vector models includes an initial first vector model, and the initial first vector model is used to train other first vector models.
4. According to the method of claim 3, the training method of the initial first vector model comprises: Inputting the sample training data into a first vector model to be trained to obtain an output vector of a first preset dimension; Determine a loss function value of a first to-be-trained vector model according to the identification data corresponding to the sample training data and the output vector; If the loss function value is less than a preset loss threshold, determining the first vector model to be trained as an initial first vector model, and the output feature dimension of the initial first vector model is a first preset dimension; If the loss function value is not less than the preset loss threshold, new sample training data is obtained, and the process returns to execute the step of inputting the sample training data into the first vector model to be trained.
5. According to the method of claim 3, the training method of other first vector models except the initial first vector model comprises: Inputting the sample training data into a second vector model to be trained to obtain a first output vector of a second preset dimension, and inputting the sample training data into each of the trained first vector models to obtain a corresponding second output vector, wherein the dimension of the second output vector is the same as or different from the second preset dimension; Determine a loss function value of a second vector model to be trained according to the identification data corresponding to the sample training data and a superposition vector, wherein the superposition vector is a vector obtained by fusing the first output vector and each second output vector; If the loss function value is less than a preset loss threshold, determining the second vector model to be trained as the first vector model; If the loss function value is not less than the preset loss threshold, new sample training data is obtained, and the process returns to execute the step of inputting the sample training data into the second vector model to be trained.
6. According to the method of claim 5, the model parameters of the second vector model to be trained are the same as the parameters of the initial first vector model.
7. An information processing device, comprising: An information acquisition module is used to obtain the target feature dimension number corresponding to the target natural language processing task; A model determination module, used to determine a second vector model that meets the target feature dimension according to the output vector dimension of each first vector model, wherein the second vector model is composed of at least one first vector model; An information processing module is used to determine feature information corresponding to the target natural language processing task based on the second vector model.
8. According to the device of claim 7, the model determination module is used to combine the various first vector models to obtain at least one combined model; and determine any combined model whose output vector dimension number is equal to the target feature dimension number as the second vector model.
9. The device according to claim 7, wherein each of the first vector models comprises an initial first vector model, and the initial first vector model is used to train other first vector models.
10. An electronic device, comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the information processing method.
