Model training method and device, data alignment method and device and electronic equipment
By constructing a data alignment model of timing feature extractor and text feature vector alignment, the problem of span modal alignment in multimodal large models is solved, and effective alignment between timing data and text data is realized and deep-level mode mining is realized.
Patent Information
- Application Number
- CN202411790376.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-18
AI Technical Summary
In practical applications, multimodal large models rely on high-quality alignment labeling data, and the expression methods and feature structures of different modalities are significantly different, resulting in difficult semantic alignment and difficult to explain the decision mechanism of the model in cross-modal alignment.
A model training method is proposed. By obtaining the time series data set with text data labels, a data alignment model including a time series feature extractor is constructed, and the timing features of the time series data are extracted using the time series feature extractor, and aligned with the text feature vector, a loss function is constructed to adjust the model parameters and realize the alignment of the time series data and text data.
It realizes effective alignment of time series data and text data, explores deeper data relationships and patterns, improves the fusion ability of multimodal data, and the model alignment mechanism is more transparent.
Smart Images

Figure CN119646745A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to data processing technology, and in particular to a model training method, a data alignment method, a device and an electronic device. Background Art
[0002] Multimodal big model technology has been a hot topic in artificial intelligence research in recent years. Multimodal big models usually refer to models that can simultaneously process and understand multiple types of data (such as text, images, audio, time series, etc.). By fusing data of different modalities, they can provide more comprehensive and accurate analysis results.
[0003] However, many large multimodal models currently rely on high-quality aligned and annotated data in practical applications, which is often difficult to obtain. The expression methods and feature structures of different modalities vary significantly, and alignment between semantics is more difficult. For example, the pixel features of an image are fundamentally different from the semantic structure of a text, and direct alignment can easily lead to information loss. Furthermore, multimodal models are usually black box structures, making it difficult to understand their alignment and decision-making mechanisms, and to explain which features the model prioritizes in cross-modal alignment. Summary of the invention
[0004] In view of this, the present invention aims to propose a model training method, a data alignment method, a device and an electronic device, innovatively propose the alignment of time series data and text data, and mine deeper data relationships and patterns.
[0005] In a first aspect, the present invention provides a model training method, wherein a model trained by the method is used for multi-source data alignment, comprising:
[0006] Get a time series dataset with text data labels;
[0007] Build a data alignment model including a time series feature extractor, and train the time series feature extractor using the time series dataset;
[0008] Input the time series data set into the trained time series feature extractor to obtain a time series feature vector mapping, and use the text data label of the time series data set to obtain a text feature vector mapping corresponding to the time series data set;
[0009] The first loss function is constructed using time series feature vector mapping and text feature vector mapping, and the model parameters are adjusted with the goal of minimizing the first loss function to obtain a trained data alignment model.
[0010] Furthermore, the temporal feature extractor includes an encoding module and a decoding module, wherein the encoding module includes an LSTM network and the decoding module includes an attention mechanism.
[0011] Furthermore, using the time series dataset to train the time series feature extractor includes:
[0012] Determine the splitting time point of the time series data according to the set splitting conditions, and use the splitting time point to split the time series data in the time series data set to obtain several subsequences;
[0013] Each subsequence is divided into a front data segment and a back data segment, the back data segment in the current subsequence is used as the input of the time series feature extractor, the prediction result of the front data segment in the next subsequence adjacent to the current subsequence in chronological order is output, and a second loss function is constructed according to the prediction result of the front data segment in the next subsequence and the real data. The model parameters of the time series feature extractor are adjusted with the goal of minimizing the second loss function to obtain a trained time series feature extractor.
[0014] Furthermore, using the time series data set to train the time series feature extractor also includes:
[0015] Calculate the statistical features of the time series data set, and concatenate the statistical features and encoding modules.
[0016] Furthermore, the second loss function is
[0017]
[0018] in, represents the weight of the categorical variable, represents the weight of the regression variable, Represents the classification label, represents the regression label, K represents the number of label categories, and N represents the total number of data set samples.
[0019] Furthermore, inputting the time series data set into the trained time series feature extractor to obtain a time series feature vector mapping, and using the text data label of the time series data set to obtain the text feature vector mapping corresponding to the time series data set includes:
[0020] Input the time series data set into the trained time series feature extractor to obtain the time series feature vector , perform the following linear mapping on the time series feature vector , get the time series feature vector mapping;
[0021] The text embedding model is used to convert the text data labels of the time series dataset into word vectors, and the word vectors are linearly mapped as follows: , and obtain the text feature vector mapping corresponding to the time series dataset.
[0022] Further, constructing a first loss function using the time series feature vector mapping and the text feature vector mapping includes:
[0023] The similar inner product of the time series feature vector mapping and the text feature vector mapping is calculated as follows:
[0024] ;
[0025] The first loss function is constructed using similar inner products as follows:
[0026] ,
[0027] in, represents the marginal parameter, Represents the time series feature vector mapping Mapping with text feature vector The similar inner product of Represents the time series feature vector mapping Mapping with text feature vector Similar inner product of .
[0028] In a second aspect, the present invention provides a data alignment method, comprising:
[0029] Obtain the time series data and text data to be aligned;
[0030] The time series data and text data to be aligned are input into the data alignment model trained in the first aspect to obtain the alignment result.
[0031] In a third aspect, the present invention provides a model training device, comprising:
[0032] A training data acquisition module is used to obtain a time series data set with text data labels;
[0033] A model building module, used to build a data alignment model including a time series feature extractor, and train the time series feature extractor using a time series data set;
[0034] A feature mapping module is used to input the time series data set into the trained time series feature extractor to obtain a time series feature vector mapping, and use the text data label of the time series data set to obtain a text feature vector mapping corresponding to the time series data set;
[0035] The loss updating module is used to construct a first loss function using the time series feature vector mapping and the text feature vector mapping, adjust the model parameters with the goal of minimizing the first loss function, and obtain a trained data alignment model.
[0036] In a fourth aspect, the present invention provides a data alignment device, comprising:
[0037] A module for acquiring data to be aligned, used for acquiring time series data and text data to be aligned;
[0038] The data alignment module is used to input the time series data and text data to be aligned into the data alignment model trained by the model training device of the third aspect to perform data alignment and obtain an alignment result.
[0039] In a fifth aspect, the present invention provides an electronic device, comprising: a memory and a processor;
[0040] The memory is used to store programs;
[0041] The processor is used to call the program stored in the memory to execute the model training method provided by the above-mentioned first aspect embodiment and / or any possible implementation method combined with the first aspect embodiment, or to execute the data alignment method provided by the above-mentioned second aspect embodiment.
[0042] In a sixth aspect, the present invention further provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements the model training method provided in the above-mentioned first aspect embodiment and / or any possible implementation method in combination with the first aspect embodiment, or executes the data alignment method provided in the above-mentioned second aspect embodiment.
[0043] Compared with the prior art, the present invention has the following beneficial effects:
[0044] The present invention provides a model training method and a data alignment method, constructing a data alignment model including a time series feature extractor, using the time series feature extractor to extract the time series features of time series data, so that the data alignment model can realize the alignment of time series data and text data, and effectively fuse data of different sources and types; a further embodiment uses an LSTM network as an encoding module of the time series feature extractor, learns the long-term dependency of time series data, and better extracts the time series features of time series data; further, the time series feature extractor can also be combined with other extractors to obtain a multimodal embedding large model, and process multimodal data in practical applications, for example, an image feature extractor can be combined to realize the alignment of image and text data at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0046] Figure 1 A flowchart for implementing a data alignment model training method provided in an embodiment of the present application;
[0047] Figure 2 A comparison chart of time series data segmentation according to set segmentation conditions and traditional equidistant segmentation provided in an embodiment of the present application;
[0048] Figure 3 A schematic diagram of a training time series feature extractor provided in an embodiment of the present application;
[0049] Figure 4 A temporal feature extractor network architecture provided in an embodiment of the present application;
[0050] Figure 5 A schematic diagram of splicing a linear mapping of statistical indicators with an encoding module of a temporal feature extractor provided in an embodiment of the present application;
[0051] Figure 6 Based on Figure 5 The schematic splicing diagram shows the resulting coding module network architecture;
[0052] Figure 7 A schematic diagram of a data alignment model architecture provided in an embodiment of the present application;
[0053] Figure 8 A schematic diagram of another data alignment model architecture provided in an embodiment of the present application;
[0054] Fig. 9 A flowchart of a data alignment method provided in an embodiment of the present application;
[0055] Fig.10 A structural diagram of a model training device provided in an embodiment of the present application;
[0056] Fig.11 A structural diagram of a data alignment device provided in an embodiment of the present application;
[0057] Fig.12 This is a diagram of the electronic device architecture provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] See also Figure 1 An embodiment of the present invention provides a model training method, wherein the model trained by the method is used for multi-source data alignment, comprising the following steps:
[0060] Step S110: Obtain a time series data set with text data labels.
[0061] In this step, the acquired time series data set refers to continuous data recorded in chronological order. There is a strong temporal correlation between data points. The current state is closely related to historical data, which manifests as short-term dependency (such as instantaneous reaction) or long-term dependency (such as trend and periodicity). Time series data may contain multiple dimensions or modalities, such as sensor data, video frame sequences, etc. Each time series data has a text label associated with it (such as descriptive text or classification annotation).
[0062] Step S120. Construct a data alignment model including a time series feature extractor, and train the time series feature extractor using the time series dataset.
[0063] Specifically, a time series feature extractor is used to capture the time series features and dependencies of time series data. A neural network architecture suitable for time series data modeling, such as convolutional networks (CNNs), recurrent neural networks, and Transformer models, can be used to input time series data into the extractor for training and output feature vectors of fixed dimensions.
[0064] Step S130. Input the time series data set into the trained time series feature extractor to obtain a time series feature vector mapping, and use the text data label of the time series data set to obtain a text feature vector mapping corresponding to the time series data set.
[0065] In this step, the trained time series feature extractor is used to extract the time series features of the time series data and linearly map the time series features. The mapping process is defined in the form of , where W represents the linear mapping matrix, which determines the mapping weight. The extracted time series feature vector is input into the linear mapping module to generate a new feature representation. For text feature vector mapping, since the time series data itself carries the real ID text data label, the pre-trained text embedding model can be used to extract the text feature vector and perform a similar linear mapping on the feature vector.
[0066] Step S140. Construct a first loss function using the time series feature vector mapping and the text feature vector mapping, adjust the model parameters with the goal of minimizing the first loss function, and obtain a trained data alignment model.
[0067] In this step, the loss function is used to minimize the difference between the time series feature vector and the text feature vector, combining the modules of the time series feature extractor and the data alignment part into an overall data alignment model.
[0068] In a further implementation, the temporal feature extractor trained in step S120 includes an encoding module and a decoding module, wherein the encoding module includes an LSTM network and the decoding module includes an attention mechanism.
[0069] Specifically, the LSTM network and attention mechanism are used in combination to capture dynamic patterns and specific features in time series data. The encoding module receives the input time series data, compresses the input time series data into a hidden state representation, captures the time series features and outputs the hidden state. The decoding module extracts features related to the current task from the hidden state of the encoder through the attention mechanism.
[0070] In a further embodiment, the training process of the temporal feature extractor in step S120 includes:
[0071] Step S121. Determine the segmentation time point of the time series data according to the set segmentation condition, and use the segmentation time point to segment the time series data in the time series data set to obtain a plurality of subsequences.
[0072] In this step, the time series data can be divided into blocks to help extract local features and improve computing efficiency. Common block strategies include fixed-length block, overlapping block, dynamic block, etc. The embodiment of the present invention proposes to determine the segmentation time point of the time series data according to the set segmentation conditions, rather than the traditional equidistant segmentation.
[0073] Specifically, the parameter change points of the device or system reflected by the time series data can be used as the basis for segmenting the time series data. If the model is ultimately used to control a specific device or system, the change points of the device state or device parameters or system parameters can be used as the segmentation time points. The specific operation can be to make a difference between the data corresponding to adjacent time points on the time series data, and select the point that is not 0 as the segmentation time point. Examples include the moment when the device state changes, or the moment when parameters such as temperature and pressure change. After determining the segmentation time points, the time series data between adjacent segmentation time points are divided into the same subsequence.
[0074] Figure 2 The comparison between the time series data segmentation according to the set segmentation conditions proposed in the embodiment of the present invention and the traditional equidistant division is illustrated. The time points of parameter change of the device or system are regarded as control points, and the time series data are segmented by control points, which can better reflect the local characteristics of each subsequence.
[0075] Step S122. Divide each subsequence into a front data segment and a rear data segment, use the rear data segment in the current subsequence as the input of the time series feature extractor, output the prediction result of the front data segment in the next subsequence adjacent to the current subsequence in chronological order, construct a second loss function based on the prediction result of the front data segment in the next subsequence and the real data, adjust the model parameters of the time series feature extractor with the goal of minimizing the second loss function, and obtain a trained time series feature extractor.
[0076] Specifically, the subsequence is divided into two segments according to the time length, and can be divided into the front data segment and the back data segment according to the time order. For two adjacent subsequences, the back data segment of the previous subsequence is used to predict the front data segment of the back subsequence. For example, Figure 3 As shown in the figure, the model learns the impact of parameter changes on the system or device as a whole. The attention mechanism of the decoding module combines the context vector it generates with the output of the encoding module for prediction, so that the model can better focus on important information when processing time series data and improve prediction performance.
[0077] Examples include Figure 4 As shown, the schematic encoding module (Encoder LSTMs) includes two layers of LSTM networks, one forward layer (LSTM1) and one reverse layer (LSTM2). The decoding module is completely composed of the attention mechanism (Attention Decoder). Labels of different lengths (y1, y2, y3) are obtained by calculating the intermediate vectors (c1, c2, c3) at different times. Among them, the (t1, t2, ..., tn) input to the LSTM network represents the latter data segment in the former subsequence of the two adjacent subsequences, and y represents the former data segment in the latter subsequence of the two adjacent subsequences. When y includes categorical variables and regression variables, the second loss function for optimizing the time series feature extractor can be designed as follows:
[0078]
[0079] in, represents the weight of the categorical variable, represents the weight of the regression variable, Represents the classification label, represents the regression label, K represents the number of label categories, and N represents the total number of data set samples.
[0080] A further implementation method takes into account that in addition to the need to characterize the subsequent impact of the segmentation time point on the time series data, the overall indicators of the time series data also need to be described in detail for subsequent alignment with the text data input. Therefore, it is also necessary to statistically calculate the overall indicators of the time series, such as the mean, variance, and rate of change of the time series data, perform linear mapping on these indicators, and splice them with the prediction network of the encoding module to form the final encoding module.
[0081] Example aspects, such as Figure 5 and Figure 6 As shown in the figure, taking the LSTM network as an example, the statistical indicators of the time series data are calculated, linearly mapped, and then concat-joined with the LSTM network as the final encoding module.
[0082] In a further embodiment, step S130 includes the following steps:
[0083] Input the time series data set into the trained time series feature extractor to obtain the time series feature vector , perform the following linear mapping on the time series feature vector , get the time series feature vector mapping;
[0084] The text embedding model is used to convert the text data labels of the time series dataset into word vectors, and the word vectors are linearly mapped as follows: , and obtain the text feature vector mapping corresponding to the time series dataset.
[0085] In a more preferred implementation, the time series feature vector mapping and its text feature vector mapping may be normalized onto a unit hypersphere.
[0086] In a further embodiment, the construction of the first loss function includes:
[0087] The similar inner product of the time series feature vector mapping and the text feature vector mapping is calculated as follows:
[0088] ;
[0089] The first loss function is constructed using similar inner products as follows:
[0090]
[0091] in, represents the marginal parameter, Represents the time series feature vector mapping Mapping with text feature vector The similar inner product of Represents the time series feature vector mapping Mapping with text feature vector Similar inner product of .
[0092] Marginal parameters Ensure that there is a certain distance between correctly classified samples and incorrectly classified samples by setting the margin parameter Set to a positive value to enhance the robustness of the model and improve the generalization ability of the model. or ,and The difference is The model performs best when No score is given to avoid the impact of large errors in a single sample on the overall situation.
[0093] In a more preferred implementation, the first loss function may use the Max Hinge Loss function.
[0094] For example, Figure 7The data alignment model trained in the above embodiments of the present invention is illustrated, time series features (series tokens) are extracted from time series data and paired with text feature vectors (text tokens), and model training is completed by optimizing model parameters based on the established loss function.
[0095] In a specific implementation, text embedding can use a word segmentation model to segment and byte-encode text data, convert the byte encoding into word vectors, and use the word vectors and time series feature vectors for comparative learning. The model is trained by maximizing the similarity of matching pairs and minimizing the similarity of unmatched pairs.
[0096] In a more preferred embodiment, the temporal feature extractor can also be combined with other extractors to obtain a multimodal embedding large model, for example: Figure 8 As shown, for example, an image feature extractor can be implemented using a residual network. The image feature vectors (image tokens) are also compared and learned with the text feature vectors (text tokens) to obtain an image-text data alignment model, which is merged with the aforementioned time series-text data alignment model.
[0097] Through the above model training method, a more accurate data alignment model can be obtained. Fig. 9 A method for performing data alignment using the model according to an embodiment of the present invention is described.
[0098] like Fig. 9 As shown, an embodiment of the present invention provides a data alignment method, comprising the following steps:
[0099] Step S910: Obtain the time series data and text data to be aligned.
[0100] Step S920. Input the time series data and text data to be aligned into the data alignment model trained in the above-mentioned embodiment to obtain the alignment result.
[0101] The above disclosed embodiments describe in detail a model training method and a data alignment method. The above disclosed methods can be implemented using various forms of equipment. Therefore, the present invention also discloses a device corresponding to the above method. Specific embodiments are given below for detailed description.
[0102] like Fig.10 As shown, one embodiment of the present invention provides a model training device, comprising:
[0103] The training data acquisition module 1002 is used to acquire a time series data set with text data labels;
[0104] A model building module 1004 is used to build a data alignment model including a time series feature extractor, and train the time series feature extractor using a time series data set;
[0105] The feature mapping module 1006 is used to input the time series data set into the trained time series feature extractor to obtain a time series feature vector mapping, and use the text data label of the time series data set to obtain a text feature vector mapping corresponding to the time series data set;
[0106] The loss updating module 1008 is used to construct a first loss function using the time series feature vector mapping and the text feature vector mapping, and adjust the model parameters with the goal of minimizing the first loss function to obtain a trained data alignment model.
[0107] like Fig.11 As shown, an embodiment of the present invention provides a data alignment device, comprising:
[0108] The to-be-aligned data acquisition module 1102 is used to acquire the time series data and text data to be aligned;
[0109] The data alignment module 1104 is used to input the time series data and text data to be aligned into the data alignment model trained by the model training device to perform data alignment and obtain an alignment result.
[0110] The implementation principle and technical effects of the device provided in the above embodiments of the present application are the same as those of the above method embodiments. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the above method embodiments.
[0111] The following embodiments are described by taking the method applied to a computer device as an example. It can be understood that the computer device can be any device with computing and processing functions, and can be but not limited to a server or a personal laptop computer, etc. In one embodiment, the computer device can be an application server, and the application server can be a server for running an application to be tested.
[0112] See also Fig.12 , which shows a hardware block diagram of an electronic device, 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 application described and / or required herein.
[0113] like Fig.12As shown, the electronic device includes: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;
[0114] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;
[0115] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;
[0116] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory;
[0117] Among them, the memory stores a program, and the processor can call the program stored in the memory, and the program is used to: implement each processing flow of the aforementioned model training method, or implement each processing flow of the aforementioned data alignment method.
[0118] An embodiment of the present invention also provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program implements the various processing flows of the aforementioned model training method, or implements the various processing flows of the aforementioned data alignment method.
[0119] The above-mentioned embodiments have described the present invention in particular detail with respect to possible scenarios, and those skilled in the art will recognize that the present invention can be practiced through other embodiments. The specific naming of components, the capitalization of terms, attributes, data structures, or any other programming or structural aspects are not mandatory or important, and the mechanisms or features of the present invention may have different names, forms, or procedures. The system may be implemented by a combination of hardware and software (as described), entirely by hardware elements, or entirely by software elements. The specific division of functions between the various system components described herein is exemplary only and not mandatory; on the contrary, the functions performed by a single system component may be performed by multiple components, or the functions performed by multiple components may be performed by a single component.
[0120] Those skilled in the art should understand that the various steps of the above disclosed method can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented with program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the embodiments of the present invention are not limited to any specific combination of hardware and software.
[0121] These computing device executable programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors, and these computing programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0122] Certain aspects of the present invention include process steps and instructions described herein in the form of algorithms. It should be noted that the process steps and instructions of the present invention can be implemented in software, firmware and / or hardware, and when implemented by software, it can be downloaded, stored on different platforms used by various operating systems and operated from the platforms.
[0123] Those skilled in the art will understand that the structures shown in the accompanying drawings are merely block diagrams of partial structures related to the scheme of the present application, and do not constitute a limitation on the terminal device to which the scheme of the present application is applied. The specific terminal device may include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
[0124] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "possible design" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0125] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0126] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A model training method, characterized in that: The model trained by the method is used for multi-source data alignment, including: Get a time series dataset with text data labels; Constructing a data alignment model including a time series feature extractor, and training the time series feature extractor using the time series data set; Inputting the time series data set into a trained time series feature extractor to obtain a time series feature vector mapping, and using the text data label of the time series data set to obtain a text feature vector mapping corresponding to the time series data set; A first loss function is constructed using the time series feature vector mapping and the text feature vector mapping, and model parameters are adjusted with the goal of minimizing the first loss function to obtain a trained data alignment model.
2. The method according to claim 1, characterized in that The temporal feature extractor includes an encoding module and a decoding module, wherein the encoding module includes an LSTM network and the decoding module includes an attention mechanism.
3. The method according to claim 1, characterized in that The using the time series data set to train the time series feature extractor comprises: Determine the splitting time point of the time series data according to the set splitting conditions, and use the splitting time point to split the time series data in the time series data set to obtain several subsequences; Each subsequence is divided into a front data segment and a back data segment, the back data segment in the current subsequence is used as the input of the time series feature extractor, the prediction result of the front data segment in the next subsequence adjacent to the current subsequence in chronological order is output, and a second loss function is constructed according to the prediction result of the front data segment in the next subsequence and the real data. The model parameters of the time series feature extractor are adjusted with the goal of minimizing the second loss function to obtain a trained time series feature extractor.
4. The method according to claim 2, characterized in that: The using the time series data set to train the time series feature extractor further comprises: Calculate the statistical features of the time series data set, and concatenate the statistical features and the encoding module.
5. The method according to claim 1, characterized in that The step of inputting the time series data set into a trained time series feature extractor to obtain a time series feature vector mapping, and using the text data label of the time series data set to obtain a text feature vector mapping corresponding to the time series data set includes: Input the time series data set into the trained time series feature extractor to obtain the time series feature vector , perform the following linear mapping on the time series feature vector , get the time series feature vector mapping; The text embedding model is used to convert the text data labels of the time series dataset into word vectors, and the word vectors are linearly mapped as follows: , obtain the text feature vector mapping corresponding to the time series data set.
6. The method according to claim 5, characterized in that The constructing a first loss function using the time series feature vector mapping and the text feature vector mapping comprises: The similar inner product of the time series feature vector mapping and the text feature vector mapping is calculated as follows: ; The first loss function is constructed using the similar inner product as follows: , in, represents the marginal parameter, Represents the time series feature vector mapping Mapping with text feature vector The similar inner product of Represents the time series feature vector mapping Mapping with text feature vector Similar inner product of .
7. A data alignment method, characterized in that: include: Obtain the time series data and text data to be aligned; The time series data and text data to be aligned are input into the data alignment model trained by the methods described in claims 1 to 6 to obtain an alignment result.
8. A model training device, characterized in that: include: A training data acquisition module is used to obtain a time series data set with text data labels; A model building module, used to build a data alignment model including a time series feature extractor, and train the time series feature extractor using the time series data set; A feature mapping module, used to input the time series data set into a trained time series feature extractor to obtain a time series feature vector mapping, and use the text data label of the time series data set to obtain a text feature vector mapping corresponding to the time series data set; The loss updating module is used to construct a first loss function using the time series feature vector mapping and the text feature vector mapping, adjust the model parameters with the goal of minimizing the first loss function, and obtain a trained data alignment model.
9. A data alignment device, characterized in that: include: A module for acquiring data to be aligned, used for acquiring time series data and text data to be aligned; The data alignment module is used to input the time series data and text data to be aligned into the data alignment model trained by the model training device as described in claim 8 to perform data alignment and obtain an alignment result.
10. An electronic device, characterized in that: include: Memory and processor; The memory is used to store programs; The processor is used to call the program stored in the memory to execute the model training method as described in claims 1 to 6, or to execute the data alignment method as described in claim 7.
Citation Information
Patent Citations
Video natural language text retrieval method based on space time sequence characteristics
CN113704546A
Cross-modal text-video retrieval method based on space-time relationship enhancement
CN114048351A
Video text retrieval method based on pre-training model
CN116109960A
Video text retrieval method based on differential multi-scale multi-granularity feature fusion
CN116226449A
Joint heterogeneous language-vision embeddings for video tagging and search
US20170357720A1
Cited By
Data alignment method, electronic equipment and storage medium
CN121834143A
Data alignment method, electronic device, and storage medium
CN121834143B