Query window modeling-based reply relationship discovery method and device
Through the method of query window modeling, the query window and sample weights are dynamically adjusted, which solves the problem of missing semantic clues in the existing reply relationship discovery model and the prediction bias towards negative samples, which significantly improves the model's reply relationship discovery effect.
Patent Information
- Application Number
- CN202411409785.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-03-07
AI Technical Summary
The existing reply relationship discovery model has problems with missing short text semantic cues and prediction bias towards negative samples in multiple rounds of multi-party conversations, resulting in poor results in the model's reply relationship discovery process.
Using a method based on query window modeling, the model's adaptability to short text environments and learning ability of positive samples is enhanced by dynamically adjusting the message sequence and sample weights in the query window. Specific steps include building a reply relationship discovery task dataset, preprocessing messages, modeling query window, coding model input, calculating loss function and discriminant model output.
Through the optimization method, the model's accuracy and recall rate on the public data set have been significantly improved, which can more effectively discover the reply relationship, alleviating the problems of short text semantic cues and prediction bias towards negative samples.
Smart Images

Figure CN119578536A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of natural language processing, and in particular relates to a reply relationship discovery method and device based on query window modeling. Background Art
[0002] The development of social networks has greatly improved the efficiency of communication between people and generated a large number of group chat history records, which are regarded as multi-round multi-party conversation data. The reply relationship discovery task aims to discover the reply relationship between messages from multi-round multi-party conversation data. Specifically, the input of this task is a conversation sequence, and the output is the sequence number of all message pairs with reply relationships in the sequence. In the process of model learning, message pairs with reply relationships are regarded as positive samples, and vice versa. Discovering reply relationships in multi-round multi-party conversations helps to understand the content of group chats and explore the social relationships between users, which can then be used in fields such as social network analysis.
[0003] The present invention mainly focuses on two problems in the reply relationship discovery task: First, since the proportion of short texts is large, and short messages contain fewer semantic clues, the model has the problem of missing semantic clues in the reply relationship discovery process. Second, since the number of message pairs with reply relationships in all message pairs is much smaller than the number of message pairs without reply relationships, the number of positive samples is much smaller than the number of negative samples, and the unbalanced sample categories will cause the model to learn the bias of different categories, which leads to the problem of excessive bias towards negative in the process of predicting labels. The existing reply relationship discovery model aims to learn rich message text representations to achieve message matching to discover reply relationships. For example: "Pre-Trained and Attention-Based Neural Networks for Building Noetic Task-Oriented Dialogue Systems" learns message text semantic representations based on pre-trained language models, and makes binary classification discrimination of reply relationships for each pair of messages. "Who did they Respond To? Conversation Structure Modeling Using Masked Hierarchical Transformer" (abbreviated as MHTM) proposes a model based on masked self-attention mechanism to better learn context-related semantic representations. However, existing methods have ignored the problem of missing semantic clues in short texts mentioned at the beginning of the paragraph and the problem of prediction bias towards negative samples. Therefore, the optimization method proposed in the present invention based on the above problems is an innovative improvement. Summary of the invention
[0004] The purpose of this invention is to alleviate the problem of missing semantic clues in short texts and prediction bias towards negative samples, enhance the model's adaptability to short text environments, enhance the model's learning ability for positive samples, and improve the model's comparative experimental results on public data sets.
[0005] The technical solution adopted by the present invention to achieve the above-mentioned purpose is as follows:
[0006] A reply relationship discovery method based on query window modeling includes the following steps:
[0007] Step 1: Based on the real group chat data collected on social platforms, a reply relationship discovery task dataset is constructed;
[0008] Step 2: Preprocess each message in the reply relationship discovery task dataset;
[0009] Step 3: Take each pre-processed message as the current query message in turn, and model the query window corresponding to the current query message. The query window contains candidate messages that have the possibility of replying to the current query message.
[0010] Step 4: Encode model input. Each input of the model contains the current query message and its corresponding query window.
[0011] Step 5: Calculate the loss function during model training and optimize the model parameters by adjusting the sample weights;
[0012] Step 6: Determine the model output. The model output value is the degree of reply relationship between the candidate message and the current query message.
[0013] Preferably, the step of constructing the reply relationship discovery task dataset in Step 1 includes:
[0014] Step 1.1: Use the ChatGPT large model to semi-automatically pre-label the collected real group chat data;
[0015] Step 1.2: Manually review and re-annotate the pre-annotated results to obtain the reply relationship discovery task dataset.
[0016] Preferably, the step of preprocessing the message in Step 2 includes:
[0017] Step 2.1: Add special tags [REPLY] and [USER] to concatenate the content of each message in the data set with its corresponding user name and special tags. [REPLY] is used to identify the reply relation discriminant value output bit, and [USER] is used to separate the message content and the user information.
[0018] Step 2.2: Use the WordPiece algorithm to split each message content and its corresponding speaking user name into word units.
[0019] Preferably, in Step 3, during the training phase, the step of modeling the query window includes:
[0020] Step 3.1: Specify a discrete value set for the query window size;
[0021] Step 3.2: Calculate the proportion of local short texts in the current query message, and count the proportion of short texts whose text length is less than a fixed value based on the largest query window;
[0022] Step 3.3: Determine the probability density function according to the proportion of short texts. When the proportion of short texts is higher than the threshold, a nonlinear increasing concave function is taken as the probability density function. In addition, when the proportion of short texts is lower than the threshold, a nonlinear decreasing convex function is taken as the probability density function.
[0023] Step 3.4: Sample and output the length L of the previous content of the current query message according to the current probability density function in the query window size set q and the context length L of the reply tag message r ;
[0024] Step 3.5: Determine the context of the current query message and the reply tag message respectively and enter them into the query window in order. The context of the reply tag message takes the maximum query window as the boundary and takes the context length L. r The following uses the maximum query window and L r The remaining values are taken for the boundaries, and there are no duplicates within the query window.
[0025] Preferably, in Step 3, during the testing phase, the step of modeling the query window includes:
[0026] Step 3.6: Set the query window size to a fixed value. The query window is a continuous sequence starting from the current query message.
[0027] Preferably, the step of encoding the model input in Step 4 includes:
[0028] Step 4.1: Use the [SEP] identifier of the BERT model to concatenate the current query message with the query window, and perform word-unit-based supplementation or truncation operations on the concatenated result based on the input length limit of the BERT model;
[0029] Step 4.2: Convert the word units and tokens into word vectors through pre-trained word embedding as the initialization representation of the model input.
[0030] Preferably, the step of calculating the loss function in Step 5 includes:
[0031] Step 5.1: The reply relation discovery task is regarded as a multi-label classification task. Based on the multi-label cross entropy loss function, the loss representation of each negative sample is converted into the loss representation of all samples minus the positive samples.
[0032] Step 5.2: Use the Gaussian distribution function to calculate the distance weight of the sample. The Gaussian distribution function conforms to the correlation between the positive sample distribution and the distance between the current query message. By increasing the weight of samples with a smaller distance, the optimization of positive samples is improved.
[0033] Step 5.3: Multiply the loss representation by the distance weight to assign corresponding weights to each part of the loss representation, and finally calculate the weighted loss function, where the weight is related to the distance between the current sample and the current query message.
[0034] Preferably, in Step 6, during the training phase, the step of discriminating the model output includes:
[0035] Step 6.1: The encoding model outputs the corresponding output bits of all [REPLY] identifiers in the current query window, with a value range of 0 to 1. The closer to 1, the higher the degree of reply relationship between the candidate message and the current query message.
[0036] Preferably, in Step 6, during the formal use phase, the step of discriminating the model output includes:
[0037] Step 6.2: Determine the candidate message number with the highest probability of replying to the current query message by comparing the highest value of each output bit in the query window.
[0038] A reply relationship discovery device based on query window modeling comprises a memory and a processor. A computer program is stored in the memory. When the processor executes the program, the steps of the above method are implemented.
[0039] Compared with the prior art, the beneficial effects of the present invention include:
[0040] 1) To address the problem of missing semantic clues in short texts, the present invention dynamically and randomly adjusts the message sequence in the query window, dynamically increases the context length of the short text, and increases the semantic clues of the model input by adjusting the query window in the training phase to enhance the model's adaptability to the short text environment. Ablation experiments have shown that the optimization method has an improvement effect on the model, and the model that introduces the optimization method has improvements in evaluation indicators compared with the baseline model.
[0041] 2) To address the problem of prediction bias towards negative samples, the present invention optimizes model parameters by reasonably adjusting the learning focus of positive and negative samples and adjusting sample weights to enhance the model's learning ability for positive samples. Ablation experiments show that the optimization method has an improvement effect on the model. The model that introduces the optimization method has improvements in evaluation indicators compared to the baseline model. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 Schematic diagram of a model of an embodiment of the present invention.
[0043] Figure 2 The query window modeling flow chart of the embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the various technical features and advantages or technical effects in the above technical scheme of the present invention more obvious and easy to understand, the following is a detailed description with reference to the accompanying drawings.
[0045] This embodiment specifically provides a reply relationship discovery method based on query window modeling, including the following steps:
[0046] 1) Constructing a dataset for reply relationship discovery tasks
[0047] Based on the real group chat data collected on the social platform, a reply relationship discovery task dataset was constructed. The steps include: using the ChatGPT large model to semi-automatically pre-label the group chat data, manually reviewing the pre-labeling results to achieve secondary labeling, labeling the reply message sequence number, that is, labeling the corresponding relationship between the reply and the replied message, and dividing the dataset based on the secondary labeled data for model training and testing. The final training set size is 4000, and the test set size is 1000.
[0048] During the pre-labeling process, due to the context length limit of ChatGPT, the original data is cut and batched, and each request contains a fixed task description and examples, as well as the batched original data. During the pre-labeling process, the prompt is repeatedly adjusted many times, including the wording of the task description, the quality and quantity of the examples, the format of the incoming data, etc., to enhance the quality of the pre-labeled data generated by ChatGPT replies.
[0049] During the secondary annotation process, the first 10 messages in each batch of data are reviewed to avoid missing annotations due to cropping. Since the annotation data format generated by ChatGPT is not guaranteed, and due to length restrictions, incomplete data may be generated, etc., manual review is required for secondary annotation.
[0050] The data annotation is organized in JSON format. Each message data contains a key-value pair of message number, message content, and the user name of the speaker. The annotation results are presented in the form of a newly added key-value pair, where the key is the reply message number and the value is taken from the message number above.
[0051] 2) Preprocessing message representation
[0052] The model structure designed by the present invention is as follows Figure 1 As shown in the figure, the model is improved based on the pre-trained language model BERT. The input of the model is divided into two parts: query message and candidate message. The query window determines the reply relationship between the current query message and its previous candidate message. The query message is the last message in the current query window. The candidate message includes a message sequence composed of each candidate message in the current window, which also includes the query message.
[0053] The reply relation discovery task dataset is represented as a message sequence S = [S1, S2, ..., S N ], now take the i-th message S i Take the message representation preprocessing process as an example:
[0054] First, add a special tag to the vocabulary and use the special tag to expand the i-th message S i Information that can be included. In order to introduce user information U i and with the message content T i To distinguish between the two, the present invention adds a [USER] special identifier to clarify the partition position. In order to distinguish from the pre-trained [SEP] identifier information, the present invention adds a [REPLY] special identifier to output the reply relationship discrimination value of the corresponding candidate message. i and the message text content T i , confirm the message S i The initial representation of .
[0055] Secondly, for the message S i The user name and message text content of the speaker are tokenized, and the WordPiece word segmentation method is used to segment the corresponding text into tokens.
[0056] 3) Modeling query window
[0057] The present invention proposes an improved sample sampling method based on query window modeling. In the training stage, the size of the query window is a random value, and the query window contains a random length context of the current query message and a random length context of the reply tag message. The random value is generated by weighted random sampling, and the weight is related to the proportion of short text. When the proportion of short text is large, it is more likely to sample and generate a larger window length, thereby increasing the number of messages in the window and increasing the semantic clues in the model input, thereby alleviating the problem of missing semantic clues. In the testing stage, the size of the query window is a fixed value, and the query window is a continuous sequence starting from the current query message. By increasing the scale of semantic clues input by the model in the training stage, the prediction performance of the model in the testing stage can be further enhanced.
[0058] Specifically, the weighted random sampling process for each sample in the training phase includes the following steps: Figure 2 As shown:
[0059] ① The discrete value set R of the query window size is specified as {r1, r2, ..., r δ |1≤r1<r2<…<r δ}, where r δ Represents the maximum size of the query window.
[0060] ②Calculate the current sample S i The approximate value of the local short text ratio τ i : Based on the maximum size r δ The query window Count the percentage of short texts whose length is less than a fixed value. Represents the current maximum size query window The sequence number set of each candidate message in the unit step function u(·) is used to count the number of short texts whose text length is less than the fixed value len0. As shown in the following formula:
[0061]
[0062] ③ Determine the probability density function according to the proportion of short text: When the proportion of short text is τ i When the query window length r is large enough, the probability of a larger query window length r is higher, and the probability density function is a monotonically increasing function ln(r+1); when the short text proportion τ i When the query window length r is small enough, the probability of a smaller query window length r is higher, and the probability density function is a monotonically decreasing function e -r . As shown in the following formula:
[0063]
[0064] ④ Output two query window lengths based on the probability density function: In the query window size set R, two sampling weights are P according to the current probability density function. sample (r) is independently sampled, as shown in the following formula, P sample (r) represents the sampling probability of each size value of the query window. The output results of the two samplings are respectively the length L of the previous text of the current query message q and the context length L of the reply tag message r .
[0065]
[0066] ⑤ Determine the context of the current query message and the reply tag message respectively and enter them into the query window in order: the context of the reply tag message takes the maximum query window as the boundary and takes the context length L r half of the maximum query window and L r Take the remaining values for the boundaries and, in addition, ensure that there are no duplicates within the query window.
[0067] 4) Encoding model input
[0068] First, the current query message and the query window determined by the above operation are concatenated through the [SEP] identifier of the BERT model.
[0069] Secondly, due to the uniform restriction of the BERT encoder on the input length, the message S is i When the input length is too long, in order to maximize the retention of each candidate message in the query window, the current query window W is iteratively i =[…,S i-1 , S i ] is used to perform truncation operations on the longest candidate message. The iterative approach ensures a more fair truncation operation between longer candidate messages. Otherwise, the [PAD] flag is used for padding operations.
[0070] Finally, after the above steps, we can get the message representation S with uniform length i , it is encoded and represented through pre-trained word embedding to determine the final model input.
[0071] 5) Calculate the loss function
[0072] The present invention proposes a model parameter optimization method for adjusting the weight of positive samples based on position information. It is known that in the multi-label cross entropy loss function y = [y1, y2, ..., y c ] represents the current sample reply relation label, which takes a value of 0 or 1, and points to which candidate message in the query window the current sample annotation result belongs to. represents the predicted value of the response relationship of the current sample, which is a real number between 0 and 1, as shown in the following formula:
[0073]
[0074] Each negative sample The loss is converted into all samples minus the positive samples The loss representation is expressed as , and the weight ω(x) of the distance between the candidate message sequence number x and the current sequence number i is assigned to each part of the loss representation based on the Gaussian distribution function, as shown in the following formula:
[0075]
[0076] Model parameter optimization is an improved method proposed to solve the problem of prediction bias towards negative samples. The reply relationship discovery task can be regarded as a multi-label classification task, and the commonly used loss function for classification tasks is the cross entropy function. Based on the multi-label cross entropy loss function, a corresponding weight is assigned to each part of the loss representation, which is related to the distance between the current sample and the current query message.
[0077] Specifically, the distance weight is calculated using the Gaussian distribution function. Since the distribution of positive samples of the reply relationship is correlated with the distance between the current query message, positive samples are more likely to be distributed in a range closer to the current query message, so the Gaussian distribution function is physically consistent with the improvement requirements here. From the perspective of demand, since the number of positive samples is small and the distance between the positive samples and the current query message is usually small, the optimization of positive samples is enhanced by increasing the weight of samples with a smaller distance. From the perspective of the Gaussian distribution function formula, the smaller the relative distance between the candidate message and the current query message, the larger the corresponding distance weight value, the greater the fluctuation of the loss function, and the model can more fully learn samples with a smaller distance, including most of the positive samples. Therefore, this method can intuitively alleviate the problem of prediction biased towards negative samples.
[0078] 5) Discriminant model output
[0079] For each input, the model outputs the corresponding output bits of all [REPLY] special identifiers in the current query window, with a value range of 0 to 1. The closer to 1, the more likely the candidate message is to have a reply relationship with the current query message, and vice versa. In the test phase, the output bit threshold for judging whether each candidate message has a reply relationship is 0.5. If it is higher than 0.5, it means there is a reply relationship, and if it is lower than 0.5, it means there is no reply relationship. Therefore, in the test phase, multiple positive samples may be output in the same query window, and their corresponding precision and recall rates are usually not equal. In the production phase, by comparing the highest value of each output bit in the query window, the candidate message number that is most likely to reply to the current query message can be determined. Therefore, in the production phase, only one positive sample is output in the same query window, and its corresponding precision and recall rates are equal.
[0080] Here is an example:
[0081] (1) Construct a reply relation discovery task dataset. Some fragments of the dataset in this example are shown in Table 1.
[0082] Table 1. Examples of reply relation discovery task datasets
[0083] Message sequence number Speaker Username Message content Reply message sequence number 7134 Tony20201 How to subscribe to V3 7134 7135 Tiankongjiasu v3 not subscribed 7134 7136 Tony20201 Does V3 have any nodes? 7135 7137 Yanghuazei How to solve the problem that the computer cannot be used 7137 7138 cxkkkdf Change sstap 7137 7139 Tiankongjiasu No 7136
[0084] (2) Encoding model input. In this example, <speaking user name: tiankongjiasu, message content: none> is used as the query message, <speaking user name: Tony20201, message content: how to subscribe to V3>, <speaking user name: tiankongjiasu, message content: v3 not subscribed>, etc. <speaking user name: tiankongjiasu, message content: none> are candidate messages. The message representation after splicing with special identifiers [REPLY][USER] is shown in the following example:
[0085] [REPLY] How to subscribe to V3 [USER] cxkkkdf;
[0086] [REPLY] How to solve the problem that the computer cannot be used [USER]yanghuazei.
[0087] (3) Modeling query windows. The largest query window in this example is the fragment shown in (1) (the actual maximum window size is 10, and the maximum size is limited to 6 here for ease of display). The corresponding short text accounts for a large proportion. The probability density function is determined to be an increasing logarithmic function. According to the probability density function, random sampling is performed in the discrete value set of the query window size. The sampling results show that the context length of the current query message is 2 and the context length of the reply tag message is 3 (the reply tag message is placed in the center as much as possible, which is subject to the boundary of the maximum query window). The current query window is composed of the following input representations:
[0088] [REPLY]v3 did not subscribe to [USER]tiankongjiasu;
[0089] [REPLY]Does V3 have any nodes? [USER]Tony20201;
[0090] [REPLY] How to solve the problem that the computer cannot be used [USER]yanghuazei;
[0091] [REPLY]Change sstap[USER]cxkkkdf;
[0092] [REPLY]No [USER]tiankongjiasu.
[0093] The input of the model consists of two parts: the current query message and the current query window. Its complete representation is:
[0094] [CLS] current query message semantic representation [SEP] current query window semantic representation [SEP];
[0095] Among them, the [CLS] and [SEP] identifiers are special identifiers that already contain pre-trained semantics in the pre-trained model. [CLS] is used to identify the sentence-level representation of the entire input sequence, and [SEP] is used to segment different sentences or text fragments. In the present invention, [SEP] is used to segment the current query message and the current query window.
[0096] (4) Calculate the loss function. The loss function of this instance is modified based on the multi-label cross entropy loss function. The loss representation of the negative sample in this batch of data is equivalent to the loss representation of all samples in the batch of data minus the positive sample. Based on the Gaussian function (the mathematical expectation is the current query message number, the random variable is the candidate message number, and the variance is 0.5), the weight of the distance between each part of the loss representation and the current query message is assigned. The average loss function value of this instance in the first round (epoch) of the training stage is: 9.1864.
[0097] (5) Discriminant model output. The model takes the vectorized semantic representation of each [REPLY] special mark and obtains a prediction value between 0 and 1 through the sigmoid activation function. The closer the value is to 1, the more likely it is that there is a reply relationship between the candidate message corresponding to [REPLY] and the current query message. The corresponding prediction values of each candidate message in the test phase of this instance are: 0.4872, 0.7991, 0.2331, 0.1043, and 0.2999. In the test phase, there are 7136 candidate messages with a prediction value greater than 0.5, that is, 7136 candidate messages are predicted to have a reply relationship with the current query message, which is consistent with the actual label information and the prediction is correct.
[0098] Experimental data:
[0099] The improved model proposed in the present invention can achieve a precision of 56.8% and a recall of 62.2% on the public dataset Ubuntu IRC. Compared with the existing previous work MHTM, the improved model proposed in the present invention improves the precision by 2.9% and the recall by 10.5%. In addition, the improved model proposed in the present invention can achieve a precision of 72.5% and a recall of 71.9% on the self-constructed dataset.
[0100] The above embodiments are only for the purpose of describing the present invention, and are not intended to limit the scope of the present invention. The scope of the present invention is defined by the appended claims, and various equivalent substitutions and modifications made without departing from the spirit and principle of the present invention should be included in the scope of the present invention.
Claims
1. A reply relationship discovery method based on query window modeling, characterized in that: The following steps are involved: 1) Based on real group chat data collected on social platforms, a reply relationship discovery task dataset is constructed; 2) Preprocess each message in the reply relationship discovery task dataset; 3) Taking each pre-processed message as the current query message in turn, modeling the query window corresponding to the current query message, the query window contains each candidate message that has the possibility of replying to the current query message; 4) Encoding model input, each input of the model includes the current query message and its corresponding query window; 5) Calculate the loss function during model training and optimize the model parameters by adjusting the sample weights; 6) Discriminant model output, the model output value is the degree of reply relationship between the candidate message and the current query message.
2. The method according to claim 1, characterized in that The steps of constructing the reply relation discovery task dataset in step 1) include: Use the ChatGPT large model to semi-automatically pre-label the collected real group chat data; The pre-annotated results are manually reviewed and re-annotated to obtain the reply relationship discovery task dataset.
3. The method according to claim 1, characterized in that The steps of preprocessing the message in step 2) include: Add special tags [REPLY] and [USER] to concatenate the content of each message in the data set with its corresponding user name and special tags. [REPLY] is used to identify the reply relation discriminant value output bit, and [USER] is used to separate the message content and the user information. The WordPiece algorithm is used to segment each message content and its corresponding speaking user name into word units.
4. The method according to claim 1, characterized in that In step 3), during the training phase, the steps of modeling the query window include: A set of discrete values that specifies the query window size; Calculate the proportion of local short texts in the current query message, and count the proportion of short texts whose text length is less than a fixed value based on the largest query window; Determine the probability density function according to the proportion of short texts. When the proportion of short texts is higher than the threshold, take a nonlinear increasing concave function as the probability density function. In addition, when the proportion of short texts is lower than the threshold, take a nonlinear decreasing convex function as the probability density function. In the query window size set, the length L of the previous content of the current query message is output according to the current probability density function sampling. q and the context length L of the reply tag message r ; Determine the context of the current query message and the reply tag message respectively and enter them into the query window in order, where the context of the reply tag message takes the maximum query window as the boundary and takes the context length L r The following uses the maximum query window and L r The remaining values are taken for the boundaries, and there are no duplicates within the query window.
5. The method according to claim 1, characterized in that In step 3), during the testing phase, the step of modeling a query window includes: setting the query window size to a fixed value, the query window being a continuous sequence starting from the current query message.
6. The method according to claim 1, characterized in that The steps of encoding the model input in step 4) include: The [SEP] identifier of the BERT model is used to concatenate the current query message with the query window, and the concatenation result is supplemented or truncated in units of tokens based on the input length limit of the BERT model; The tokens and logos are converted into word vectors through pre-trained word embedding as the initialization representation of the model input.
7. The method according to claim 1, characterized in that The steps of calculating the loss function in step 5) include: The reply relation discovery task is regarded as a multi-label classification task. Based on the multi-label cross entropy loss function, the loss representation of each negative sample is converted into the loss representation of all samples minus the positive samples. The distance weight of the sample is calculated using the Gaussian distribution function. The Gaussian distribution function conforms to the correlation between the positive sample distribution and the distance between the current query message. The optimization of positive samples is improved by increasing the weight of samples with smaller distances. The loss representation is multiplied by the distance weight to assign corresponding weights to each part of the loss representation, and finally the weighted loss function is calculated, where the weight is related to the distance between the current sample and the current query message.
8. The method according to claim 1, characterized in that In step 6), during the training phase, the step of discriminating the model output includes: the encoding model outputs the corresponding output bits of all [REPLY] identifiers in the current query window, with a value range of 0 to 1. The closer to 1, the higher the degree of reply relationship between the candidate message and the current query message.
9. The method according to claim 1, characterized in that In step 6), during the formal use phase, the step of discriminating the model output includes: determining the candidate message sequence number with the highest probability of replying to the current query message by comparing the highest value of each output bit in the query window.
10. A reply relationship discovery device based on query window modeling, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Cited By
Multi-modal dialogue sequence discovery method and system in complex message flow
CN122491301A