Medical question summarization generation method and device based on multi-angle reorderer

By constructing a multi-angle reordering model to evaluate the quality of candidate summaries, the problem of inconsistency between the objective function and evaluation index of sequence-to-sequence models in existing technologies is solved, resulting in higher quality medical question summaries and improving the efficiency and accuracy of automatic question answering systems.

CN118133180BActive Publication Date: 2026-07-21QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES) +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
Filing Date
2024-03-15
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing methods for generating medical question summaries fail to adequately consider the inconsistencies between the objective function and evaluation metrics of sequence-to-sequence models, leading to inaccurate evaluation of candidate summary quality and impacting the performance of automated medical question answering systems.

Method used

A medical problem summary generation method based on a multi-angle reorderer is adopted. By constructing a medical problem summary generation model and a multi-angle reorderer model, the decoding search space is expanded, and the quality of candidate summaries is evaluated from multiple perspectives, including similarity scores from external and internal perspectives. The optimal summary is selected using multi-level reasoning.

Benefits of technology

The performance of the medical question summary generation model has been improved, resulting in higher quality candidate summaries and enhancing the efficiency and accuracy of the medical automated question answering system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118133180B_ABST
    Figure CN118133180B_ABST
Patent Text Reader

Abstract

The application discloses a medical question summary generation method and device based on a multi-angle reorderer, a storage medium and an electronic device, and belongs to the fields of artificial intelligence and natural language processing.The technical problem to be solved by the application is to automatically generate a short summary for a long patient health question and evaluate the quality of the summary using a multi-angle reorderer.The technical scheme adopted is as follows: ① a medical question summary generation method based on a multi-angle reorderer, which comprises the following steps: S1, constructing a medical question summary generation dataset;S2, constructing and training a medical question summary generation model;S3, constructing and training a multi-angle reorderer model;S4, joint inference.② a medical question summary generation device based on a multi-angle reorderer, which comprises a medical question summary generation dataset construction unit, a medical question summary generation model construction and training unit, a multi-angle reorderer model construction and training unit and a joint inference unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and natural language processing, specifically to a method and apparatus for generating medical problem summaries based on a multi-angle reordering device. Background Technology

[0002] With the rapid development of the internet, the healthcare industry is actively integrating into this transformation, launching numerous online applications designed to benefit patients and reduce the burden on doctors. In particular, the rise of online medical Q&A communities allows patients to ask medical questions on online platforms and receive answers when doctors are available. This approach greatly simplifies the consultation process, avoiding traditional procedures such as going to the hospital, registering, and queuing, lowering the barrier to consultation, and improving doctors' work efficiency. However, with the surge in the number of online users, the number of patients asking questions has quickly exceeded the number of doctors who can provide answers, resulting in the response time not keeping pace with the growth in questions, thus impacting the user experience.

[0003] To address this issue, many researchers have begun developing automated medical question-answering systems based on natural language processing (NLP) technology. These systems quickly meet patient needs by finding answers that match their questions from existing question-answering databases, while also reducing the burden on doctors. However, patient questions often contain a large amount of non-technical vocabulary and irrelevant information, making it difficult for text matching techniques to accurately find matching answers and limiting the effectiveness of automated question-answering systems. Therefore, there is an urgent need for a technology that can simplify complex patient questions into concise, refined, and easily matched common question formats—namely, medical question summarization generation technology—to advance the development of automated medical question-answering systems. In recent years, various sequence-to-sequence pre-trained language models have been applied to the field of medical question summarization generation with some success. One trend in the development of these models is the adoption of various specific strategies to enhance their performance, including methods such as leveraging external knowledge, transfer learning, multi-task learning, reinforcement learning, and contrastive learning. These strategies have shown significant effectiveness in the task of generating medical question summaries. However, these methods often do not fully consider the inconsistency between the objective function and evaluation metrics of sequence-to-sequence models. To address this issue, researchers have proposed expanding the decoding search space to generate more candidate summaries and employing appropriate evaluation methods to assess their quality. Based on this assessment, the candidate summaries are then reordered to select the optimal one. However, existing evaluation methods often assess candidate summaries from a single perspective, which limits the overall performance of the model to some extent. Therefore, to further improve the performance of medical problem summary generation models, there is an urgent need to develop quality assessment methods that can evaluate and reorder candidate summaries from multiple perspectives. Summary of the Invention

[0004] To address the shortcomings of current methods for generating medical problem summaries, this invention aims to provide a method and apparatus for generating medical problem summaries based on a multi-angle reordering algorithm. The technical problem this invention addresses is automatically generating concise summaries of lengthy patient health questions and evaluating the quality of these summaries using a multi-angle reordering algorithm. This method and apparatus propose a medical problem summary generation model architecture based on a multi-angle reordering algorithm, which mainly consists of a medical problem summary generation model and a multi-angle reordering algorithm model. The medical problem summary generation model is responsible for generating candidate summaries for the input medical problem; the multi-angle reordering algorithm model is responsible for performing multi-level quality evaluation and reordering of the candidate summaries.

[0005] The technical objective of this invention is achieved as follows: a method for generating medical problem summaries based on a multi-angle reordering algorithm, comprising the following steps:

[0006] S1. Constructing a Medical Question Summary Generation Dataset: First, it is necessary to obtain medical questions raised by users in the medical Q&A community and reference summaries written by humans to form a medical question summary generation dataset. Then, it is divided into a training dataset, a validation dataset, and a test dataset.

[0007] S2. Construct and train a medical problem summary generation model. The main operations include: constructing a sequence-to-sequence model, constructing a cross-entropy loss function, optimizing the training of the sequence-to-sequence model, and generating candidate summaries for medical problems.

[0008] S3. Construct and train the multi-angle reorderer model. The main operations include: constructing the multi-angle reorderer model, constructing the multi-angle contrastive learning loss function, and optimizing the training of the multi-angle reorderer model.

[0009] S4, Joint Reasoning, mainly includes the following operations: generating candidate summaries for medical questions, encoding medical questions and their candidate summaries, calculating external perspective similarity scores, and calculating internal perspective similarity scores.

[0010] Preferably, the construction and training of the medical problem summary generation model is as follows:

[0011] The main operations for building and training a medical problem summary generation model include: building a sequence-to-sequence model, building a cross-entropy loss function, optimizing the training of the sequence-to-sequence model, and generating candidate summaries for medical problems.

[0012] The construction of the sequence-to-sequence model specifically involves: first, constructing the structure of the sequence-to-sequence model, and then loading the pre-trained sequence-to-sequence model weights and parameter configuration file.

[0013] The construction of the cross-entropy loss function is specifically as follows: For the constructed sequence-to-sequence model, its standard training framework is maximum likelihood estimation; for a specific training sample {CHQ,FAQ} in the loaded training dataset, where CHQ represents a medical question, denoted as Q, and FAQ represents a reference summary, denoted as S; maximum likelihood estimation is equivalent to minimizing l tokens {s1,…,s1} in the reference summary S. j ,...,s l The sum of the negative log-likelihoods of} is used to optimize the following cross-entropy loss function:

[0014]

[0015] Among them, s * This refers to the tokens currently generated by the model; S <j This refers to a predefined starting word s0 and a current word s j The lexical table formed by the previous lexical units, namely {s0,s1,…,s j-1};p true This represents a one-hot encoded distribution within the standard maximum likelihood estimation framework; θ refers to the parameters of f. The probability distribution is caused by the parameters of f; f is a model function. Given a medical problem Q, the goal of the medical problem summarization task is to learn a function f to generate a summary S of the medical problem Q. * .

[0016] The optimized sequence-to-sequence model training specifically involves using Adam as the optimization algorithm, setting the learning rate of the Adam optimizer to 1e-5, and using the constructed cross-entropy loss function on the loaded training dataset to optimize and train the constructed sequence-to-sequence model.

[0017] The process of generating candidate summaries for medical questions involves the following steps: The trained sequence is fed into a sequence model, denoted as g(·); for a specific sample {CHQ,FAQ} in the loaded training dataset, where CHQ represents the medical question (Q) and FAQ represents the reference summary (S); g(·) is used to generate a probability distribution D for Q, using the following formula:

[0018] D = g(Q)

[0019] Use a beam search decoding algorithm to generate a set of candidate summaries for a given medical problem Q.

[0020]

[0021] Where BeamSearch(·) refers to the beam search algorithm, and n represents the number of candidate summaries; the ROUGE-L F1 score from the ROUGE scoring method is used to calculate the candidate summary set. Candidate summary C i The score between the candidate abstract and the reference abstract S, and the scored candidate abstract set are represented as follows:

[0022]

[0023] in, They are sorted in descending order based on their scores; samples with scores are used as supervision signals for optimizing the constructed multi-angle reorderer model; it is important to note that these scores are only used in the training process and not in the inference process, because the labels, i.e., the reference summary S, cannot be used during inference.

[0024] More preferably, the construction and training of the multi-angle reorderer model is specifically as follows:

[0025] The main operations for building and training a multi-angle reorderer model include: building the multi-angle reorderer model, constructing a multi-angle contrastive learning loss function, and optimizing the training of the multi-angle reorderer model.

[0026] The construction of the multi-angle reorderer model specifically involves: for a specific training sample {CHQ,FAQ} in the loaded training dataset, where CHQ represents a medical question (Q) and FAQ represents a reference summary (S); generating a candidate summary set for the medical question Q and scoring each candidate summary to obtain a scored candidate summary set. Using the pre-trained language model RoBERTa as the encoder for a multi-angle reorderer, the Q, S, and Encode them to obtain their embedding representation E Q E S and

[0027] E Q =embedding(Q)

[0028] E S =embedding(S)

[0029]

[0030] Where i = 1, 2, ..., n, n is the number of candidate summaries generated; embedding(·) is a function of the encoder that uses a multi-angle reorderer model to obtain the text embedding representation.

[0031] The construction of the multi-angle contrastive learning loss function specifically involves: constructing an external perspective contrastive learning loss function, constructing an internal perspective contrastive learning loss function, and constructing a total loss function. The specific steps are as follows:

[0032] An external perspective contrastive learning loss function is constructed for the constructed multi-angle reorderer model to enhance its effectiveness in evaluating the quality of external perspective similarity scores. For a specific training sample {CHQ,FAQ} in the loaded training dataset, where CHQ represents the medical question (Q) and FAQ represents the reference summary (S), a candidate summary set is generated for the medical question Q, and each candidate summary is scored to obtain the scored candidate summary set. The encoder, using the constructed multi-angle reorderer model, performs operations on Q, S, and... Encode the corresponding embedding representation E. Q E S and External perspective comparative learning considers medical issues Q and Candidate Abstract Relationship between medical question Q and candidate abstract The higher the cosine similarity between them, the better the candidate abstract. The higher the quality, the better; the specific external perspective contrastive learning loss function is as follows:

[0033]

[0034] Where i = 1, 2, ..., n, and n is the number of candidate summaries, i.e., the set Size; λ ij = (ji)*λ is the sorting interval, where λ is a hyperparameter that controls the size of the interval; max(x,y) means returning the maximum value between x and y; It is to calculate Q and The external perspective similarity score is calculated using the following formula:

[0035]

[0036] Among them, E Q and They are Q and Embedded representation; and The calculation method is similar and will not be repeated here;

[0037] An internal perspective contrastive learning loss function is constructed for the constructed multi-angle reorderer model to enhance its effectiveness in evaluating the quality of internal perspective similarity scores. For a specific training sample {CHQ,FAQ} in the loaded training dataset, where CHQ represents the medical question (Q) and FAQ represents the reference summary (S), a candidate summary set is generated for the medical question Q, and each candidate summary is scored to obtain the scored candidate summary set. The encoder uses the constructed multi-angle reorderer model to... Encode to obtain the corresponding embedding representation. Internal perspective comparative learning considers The relationship between different candidate abstracts: High-quality candidate abstracts should be compared with... The remaining candidate summaries share more semantic features; the constructed internal perspective contrastive learning loss function is as follows:

[0038]

[0039] Where i = 1, 2, ..., n, and n is the number of candidate summaries, i.e., the set Size; μ ij = (ji)*μ is the sorting interval, where μ is a hyperparameter that controls the size of the interval; max(x,y) means returning the maximum value between x and y; It is a calculation and candidate summary set The set of the remaining candidate abstracts The internal perspective similarity score between them is calculated using the following formula:

[0040]

[0041] Where n is the number of candidate summaries, i.e., the set Size; It is a calculation and The cosine similarity between them is calculated using the following formula:

[0042]

[0043] in, and They are and Embedded representation; The calculation method and Similarly, I will not repeat the details here;

[0044] The overall loss function is constructed, which consists of two parts: the external perspective contrastive learning loss function and the internal perspective contrastive learning loss function. The specific formula is as follows:

[0045]

[0046] in, It is an external perspective contrastive learning loss function. It is an internal perspective contrastive learning loss function; It is a hyperparameter that balances the weights between the two loss functions.

[0047] The optimized multi-angle reorderer model training is specifically as follows: Adam is used as the optimization algorithm, the initial learning rate of the Adam optimizer is set to 2e-7, the maximum learning rate is set to 2e-3, and the constructed multi-angle reorderer model is optimized and trained on the loaded training dataset using the constructed total loss function.

[0048] More preferably, the joint reasoning is specifically as follows:

[0049] Joint reasoning mainly involves the following operations: generating candidate summaries for medical questions, encoding medical questions and their candidate summaries, calculating external perspective similarity scores, and calculating internal perspective similarity scores.

[0050] The process of generating candidate summaries for medical questions involves the following steps: The trained sequence is fed into a sequence model, denoted as g(·); for a specific sample {CHQ,FAQ} in the loaded validation or test dataset, where CHQ represents the medical question (Q) and FAQ represents the reference summary (S); g(·) is used to generate a probability distribution D for Q, using the following formula:

[0051] D = g(Q)

[0052] Use a beam search decoding algorithm to generate a set of candidate summaries for a given medical problem Q.

[0053]

[0054] Where BeamSearch(·) is the beam search algorithm, and n represents the number of candidate summaries, which is set to 16.

[0055] The encoding of the medical question and its candidate summaries specifically involves: for a specific sample {CHQ,FAQ} in the loaded validation or test dataset, where CHQ represents the medical question, denoted as Q; and for the resulting set of candidate summaries for Q, denoted as... The encoder of the trained multi-angle reorderer model is used to evaluate Q and The candidate summaries in the dataset are encoded to obtain the medical question and its candidate summary embedding representation E. Q and

[0056] E Q =embedding(Q)

[0057]

[0058] Where i = 1, 2, ..., n, n is the number of candidate summaries generated; embedding(·) is a function of the encoder that uses a multi-angle reorderer model to obtain the text embedding representation.

[0059] The calculation of the external perspective similarity score is specifically as follows: For a specific sample {CHQ,FAQ} in the loaded validation or test dataset, where CHQ represents a medical question, denoted as Q; the resulting candidate summary set for Q is denoted as... Calculate Q and Each candidate summary C i The external perspective similarity score between them is calculated using the following formula:

[0060]

[0061] Among them, E Q and The obtained Q and C are respectively i The embedding representation; after calculation, the set of external perspective similarity scores is obtained. Then, based on the external perspective similarity score, they are sorted from high to low to obtain the sorted set. Then filter out M outer′ The candidate summaries with the lowest scores (nm) are used to obtain the set of the top m candidate summaries based on their external perspective similarity scores. And from the obtained embedding representation Select C′1,…,C′ from the middle m Corresponding embedding representation

[0062] The calculation of the internal perspective similarity score specifically involves: for the set of m candidate summaries with the highest obtained external perspective similarity scores... Calculate C i and candidate summary set The set of the remaining candidate abstracts The internal perspective similarity score between them is calculated using the following formula:

[0063]

[0064] Where m is a set Size; sim(C k ′,C i ′) is the calculation of C k ′ and C i The cosine similarity between '' is calculated using the following formula:

[0065]

[0066] in, and The C obtained are respectively k ′ and C i The embedding representation of ′; after calculation, the set of internal viewpoint similarity scores is obtained. Then, the internal perspective similarity scores are sorted from highest to lowest to obtain the sorted set. Finally, the candidate summary C1″ with the highest internal perspective similarity score is output as the final summary.

[0067] More preferably, the specific steps for constructing the medical problem summary to generate the dataset are as follows:

[0068] First, we need to obtain medical questions raised by users in the medical Q&A community and reference summaries written by experts to form a medical question summary generation dataset. Then, we need to split it into training dataset, validation dataset and test dataset.

[0069] A medical problem summary generation device based on a multi-angle reordering algorithm, the device comprising:

[0070] The medical problem summary generation dataset building unit is responsible for preprocessing the original dataset and splitting it into training dataset, validation dataset, and test dataset.

[0071] The medical problem summary generation model building and training unit is responsible for building a sequence-to-sequence model, training the model's summary generation capability using the cross-entropy loss function, and generating candidate summaries for the multi-angle reorderer model.

[0072] The multi-angle reorderer model building and training unit is responsible for building the multi-angle reorderer model and training its ability to evaluate candidate summary quality using the multi-angle contrastive learning loss function.

[0073] The joint reasoning unit is responsible for performing multi-level reasoning by combining the medical problem summary generation model and the multi-angle reorderer model, and constructing a complete reasoning process for the medical problem summary generation method based on the multi-angle reorderer.

[0074] An electronic device includes a storage medium and a processor; the storage medium stores multiple instructions, which are loaded by the processor to execute the steps of the above-described medical problem summary generation method based on a multi-angle reorderer; the processor is used to execute the instructions in the storage medium.

[0075] The medical problem summary generation method and apparatus based on a multi-angle reordering unit of the present invention have the following advantages:

[0076] (i) This invention uses a high-performance sequence-to-sequence model as the basic model and applies it to the generation of medical problem summaries, providing a basic guarantee for the generation of medical problem summaries;

[0077] (ii) This invention expands the decoding search space of sequence-to-sequence models, generates more candidate summaries for medical problems, and increases the probability of high-quality summaries appearing;

[0078] (III) This invention designs a multi-angle reorderer model, which can evaluate the quality of candidate abstracts from multiple angles;

[0079] (iv) This invention designs an external perspective contrastive learning loss function for the multi-angle reorderer model. This loss function enables the model to focus on the external semantic features between medical questions and candidate summaries, thereby improving the multi-angle reorderer model's ability to evaluate the quality of candidate summaries.

[0080] (v) This invention designs an internal perspective contrast learning loss function for the multi-angle reorderer model. This loss function enables the model to focus on the internal semantic features between each candidate summary, thereby improving the multi-angle reorderer model's ability to evaluate the quality of candidate summaries.

[0081] (vi) The present invention designs a joint reasoning method that combines a sequence-to-sequence model and a multi-angle reorderer model, and uses multi-level reasoning to evaluate the quality of candidate summaries. Attached Figure Description

[0082] The invention will be further described below with reference to the accompanying drawings.

[0083] Figure 1 This is a schematic diagram of a medical problem summary generation device based on a multi-angle reordering algorithm.

[0084] Figure 2 This is a schematic diagram of the framework for a medical problem summary generation model based on a multi-angle reorderer. Detailed Implementation

[0085] The medical problem summary generation method and apparatus based on a multi-angle reordering device of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0086] Example 1:

[0087] The overall model framework structure of this invention is as follows: Figure 2 As shown. By Figure 2 As can be seen, the main framework of this invention includes three stages: medical problem summary generation, training of a multi-angle reorderer, and joint inference. In the medical problem summary generation stage, the medical problem is first fed into a sequence model to generate a corresponding probability distribution. Then, a beam search decoding algorithm is used to decode the probability distribution, obtaining n candidate summaries of the medical problem. The medical problem and its candidate summaries are then fed into the multi-angle reorderer model encoder. In the multi-angle reorderer training stage, the multi-angle reorderer model encoder is first responsible for encoding the medical problem and its candidate summaries to obtain the embedding representations of the medical problem and its candidate summaries. Then, the embedding representations of the medical problem and its candidate summaries are used to calculate the external perspective similarity score, and the embedding representations of the candidate summaries are used to calculate the internal perspective similarity score. Finally, the external perspective similarity score and the internal perspective similarity score are fed into the external perspective contrastive learning loss function and the internal perspective contrastive learning loss function, respectively, to calculate the corresponding loss values ​​and optimize the training of the multi-angle reorderer model. In the joint inference phase, an external perspective similarity score is calculated using the embedding representation of the medical question and the embedding representation of the candidate summary. Then, the candidate summaries are sorted from high to low according to the external perspective similarity score and sent to the filter. The filter is responsible for receiving the candidate summaries sorted from high to low according to the external perspective similarity score, filtering out the bottom n candidate summaries with the lowest external perspective similarity scores, and obtaining the top m candidate summaries and their corresponding embedding representations. Next, the internal perspective similarity score is calculated using the embedding representations of the top m candidate summaries, and the top m candidate summaries are sorted from high to low according to the internal perspective similarity score. Finally, the candidate summary with the highest internal perspective similarity score is used as the output, i.e., the final summary.

[0088] Example 2:

[0089] The medical problem summary generation method based on a multi-angle reorderer of the present invention comprises the following steps:

[0090] S1. Constructing a Medical Question Summary Generation Dataset: First, it is necessary to obtain medical questions raised by users in the medical Q&A community and reference summaries written by humans to form a medical question summary generation dataset. Then, it is divided into a training dataset, a validation dataset, and a test dataset.

[0091] S101. Download publicly available medical problem summaries from the internet to generate a dataset;

[0092] For example, there are many publicly available datasets online for generating summaries of medical questions, such as the iCliniq dataset. The data items in the iCliniq dataset are shown below:

[0093]

[0094] Here, CHQ represents the patient's medical problem description, and FAQ is a manually written reference summary; note that in the following description, CHQ will be abbreviated as medical problem, and FAQ will be abbreviated as reference summary of medical problem or reference summary.

[0095] S102. Preprocess the dataset obtained in S101 and split it into training dataset, validation dataset and test dataset;

[0096] For example, the data in the iCliniq dataset is collected from online healthcare websites. Therefore, the original dataset file must first be downloaded. Then, data items for the medical question summary generation task are extracted from the original dataset file and constructed into a JSON file. The format of the processed JSON file is shown below:

[0097] [{“chq”:“Hi doctor,I have a kind of bump on the side where my bottomwisdom tooth was.Also,there appears to be a little hole in the area withwhite stuff on it.It is behind my last bottom tooth where the wisdom toothwas removed years ago.It is sore to touch.I have attached the photo.It is notthe where my finger is,but behind the back tooth.”,“faq”:“What is this bumpwhich I have on the place where the wisdom tooth was?”},{“chq”:“Hi doctor,mybaby boy has trigger thumb problem,and he is just 11months old.Our familydoctor has suggested surgery,as a treatment option.We are ready for surgery,but we are thinking about the baby's age.Is his age sufficient for thesurgery?We are thinking to get the surgery done after 18months.Should weproceed with surgery now?Or can we wait for another six months?Or is thereany chance to recover without surgery?Please help.”,“faq”:“Can trigger thumbrecover without surgery?”}]

[0098] After obtaining the dataset in JSON format, it is split into training dataset, validation dataset, and test dataset; the training dataset, validation dataset, and test dataset contain 16556, 2069, and 2071 data entries, respectively.

[0099] S103. Load the dataset. Create a function to load the JSON format dataset and use this function to load the training dataset, validation dataset, and test dataset obtained in S102.

[0100] For example, in Python, the code described above would be implemented as follows:

[0101]

[0102] The parameter dataset_dir is the storage path of the dataset on the computer; the train.json file contains the training dataset; the val.json file contains the validation dataset; and the test.json file contains the test dataset. After the data is loaded, each dataset list contains several pairs (CHQ, FAQ), where CHQ is the medical question and FAQ is the reference summary.

[0103] S2. Construct and train a medical question summary generation model. The main operations include: constructing a sequence-to-sequence model, constructing a cross-entropy loss function, optimizing the sequence-to-sequence model training, and generating candidate summaries for medical questions. Specific steps are as follows:

[0104] S201. Constructing a sequence-to-sequence model: First, construct the structure of the sequence-to-sequence model, and then load the pre-trained sequence-to-sequence model weights and parameter configuration file.

[0105] For example: In the Transformer of Huggingface, the code implementation of the above description is as follows:

[0106] config=BartConfig.from_pretrained(args.model)

[0107] model=BartForConditionalGeneration.from_pretrained(args.model)

[0108] Here, args.model is the model name, with a value of facebook / bart-large, indicating that the pre-trained sequence-to-sequence model used is the LARGE version of the BART model released by Facebook; config is the default parameter configuration table for the BART model; and model is the BART model itself, which loads the parameter weights of the pre-trained model.

[0109] S202. Construct the cross-entropy loss function. For the sequence-to-sequence model constructed in S201, its standard training framework is maximum likelihood estimation. For a specific training sample {CHQ,FAQ} in the training dataset loaded in S103, where CHQ represents the medical question, denoted as Q, and FAQ represents the reference summary, denoted as S; maximum likelihood estimation is equivalent to minimizing the l tokens {s1,…,s1} in the reference summary S. j ,...,s l The sum of the negative log-likelihoods of} is used to optimize the following cross-entropy loss function:

[0110]

[0111] Among them, s * This refers to the tokens currently generated by the model; S <j This refers to a predefined starting word s0 and a current word s j The lexical table formed by the previous lexical units, namely {s0,s1,…,s j-1};p true This represents a one-hot encoded distribution within the standard maximum likelihood estimation framework; θ refers to the parameters of f. The probability distribution is caused by the parameters of f; f is a model function. Given a medical problem Q, the goal of the medical problem summarization task is to learn a function f to generate a summary S of the medical problem Q. * ;

[0112] S203. Optimize the sequence-to-sequence model training by using Adam as the optimization algorithm. The learning rate of the Adam optimizer is set to 1e-5. The sequence-to-sequence model constructed in S201 is optimized and trained on the training dataset loaded in S103 using the cross-entropy loss function constructed in S202.

[0113] For example, the simplified code implementation of the optimizer and optimization training process described above in PyTorch is as follows:

[0114] optimizer=torch.optim.Adam(model.model.parameters(),lr=args.learning_rate)

[0115]

[0116] for e in range(args.epochs):

[0117]

[0118]

[0119] optimizer.zero_grad()

[0120] loss = model(...)

[0121] loss.backward()

[0122] optimizer.step()

[0123] Here, `model.model.parameters()` represents the model's parameters, `lr` is the learning rate, `args.epoch` is the number of epochs for model training, `optimizer.zero_grad()` means to zero out the gradients, `loss` is the loss calculated using the cross-entropy loss function formula in S202 after one epoch of training, `loss.backward()` is used to calculate the gradients of all learnable parameters in the model, and `optimizer.step()` instructs the optimizer to update the parameters based on the calculated gradients.

[0124] S204. Generate candidate summaries for the medical questions. The sequence trained in S203 is transferred to the sequence model, denoted as g(·). For a specific sample {CHQ,FAQ} in the training dataset loaded in S103, where CHQ represents the medical question (Q) and FAQ represents the reference summary (S), g(·) can be used to generate a probability distribution D for Q, as shown in the following formula:

[0125] D=g(Q) (2)

[0126] Use a beam search decoding algorithm to generate a set of candidate summaries for a given medical problem Q.

[0127]

[0128] Where BeamSearch(·) refers to the beam search algorithm, and n represents the number of candidate summaries; the ROUGE-L F1 score from the ROUGE scoring method is used to calculate the candidate summary set. Candidate summary C i The score between the candidate abstract and the reference abstract S, and the scored candidate abstract set are represented as follows:

[0129]

[0130] in, They are sorted in descending order based on their scores; samples with scores are used as supervision signals for optimization of the multi-angle reorderer model built in S301; it should be noted that these scores are only used in the training process and not in the inference process, because the labels, i.e., the reference summary S, cannot be used during inference.

[0131] For example, in Transformer, the code implementation of the functions for generating candidate summaries and the scoring function described above is shown below:

[0132]

[0133]

[0134] In this function, get_summaries() is the function that generates candidate summaries, and cal_score() is the function that scores the candidate summaries.

[0135] S3. Construct and train the multi-angle reorderer model. The main operations include: constructing the multi-angle reorderer model, constructing the multi-angle contrastive learning loss function, and optimizing the training of the multi-angle reorderer model. The specific steps are as follows:

[0136] S301. Construct a multi-angle reordering model. For a specific training sample {CHQ,FAQ} in the training dataset loaded in S103, where CHQ represents the medical question (Q) and FAQ represents the reference summary (S), use the method in S204 to generate a set of candidate summaries for the medical question Q and score each candidate summary to obtain a scored set of candidate summaries. Using the pre-trained language model RoBERTa as the encoder for a multi-angle reorderer, the Q, S, and Encode them to obtain their embedding representation E Q E S and

[0137]

[0138] Where i = 1, 2, ..., n, n is the number of candidate summaries generated; embedding(·) is a function of the encoder that uses the multi-angle reorderer model to obtain the text embedding representation;

[0139] For example, in Transformer, the code implementation described above would be as follows:

[0140] self.encoder=RobertaModel.from_pretrained(encoder)

[0141] self.pad_token_id=pad_token_id

[0142] input_mask=text_id! =self.pad_token_id

[0143] out=self.encoder(text_id, attention_mask=input_mask)[0]

[0144] doc_emb = out[:,0,:]

[0145] input_mask=summary_id! =self.pad_token_id

[0146] out=self.encoder(summary_id, attention_mask=input_mask)[0]

[0147] summary_emb = out[:,0,:]

[0148] input_mask=candidate_id! =self.pad_token_id

[0149] out=self.encoder(candidate_id, attention_mask=input_mask)[0]

[0150] candidate_emb=out[:,0,:].view(batch_size,candidate_num,-1)

[0151] Here, `encoder` is the encoder type, and its value is `roberta-base`, indicating that the base version of the pre-trained language model RoBERTa provided by HuggingFace is used; `doc_emb` represents the embedding representation of the medical question Q, `summary_emb` represents the embedding representation of the reference summary S, and `candidate_emb` represents the candidate summary. Embedded representation;

[0152] S302. Constructing the multi-view contrastive learning loss function. The main operations include: constructing the external view contrastive learning loss function, constructing the internal view contrastive learning loss function, and constructing the overall loss function. The specific steps are as follows:

[0153] S30201. Construct an external perspective contrastive learning loss function. For the multi-angle reorderer model constructed in S301, construct an external perspective contrastive learning loss function to enhance its effect on evaluating the quality of external perspective similarity scores. For a specific training sample {CHQ,FAQ} in the training dataset loaded in S103, where CHQ represents the medical question (Q) and FAQ represents the reference summary (S), use the method in S204 to generate a candidate summary set for the medical question Q and score each candidate summary to obtain a scored candidate summary set. The encoder uses the multi-angle reorderer model built in S301 to perform operations on Q, S, and... Encode the corresponding embedding representation E. Q E S and External perspective comparative learning considers medical issues Q and Candidate Abstract Relationship between medical question Q and candidate abstract The higher the cosine similarity between them, the better the candidate abstract. The higher the quality, the better; the specific external perspective contrastive learning loss function is as follows:

[0154]

[0155] Where i = 1, 2, ..., n, and n is the number of candidate summaries, i.e., the set Size; λ ij = (ji)*λ is the sorting interval, where λ is a hyperparameter that controls the size of the interval; max(x,y) means returning the maximum value between x and y; It is to calculate Q and The external perspective similarity score is calculated using the following formula:

[0156]

[0157] Among them, E Q and They are Q and Embedded representation; and The calculation method is similar and will not be repeated here;

[0158] S30202. Construct an internal perspective contrastive learning loss function. For the multi-angle reorderer model constructed in S301, construct an internal perspective contrastive learning loss function to enhance its effect on evaluating the quality of internal perspective similarity scores. For a specific training sample {CHQ,FAQ} in the training dataset loaded in S103, where CHQ represents the medical question (Q) and FAQ represents the reference summary (S), use the method in S204 to generate a candidate summary set for the medical question Q and score each candidate summary to obtain a scored candidate summary set. The encoder uses the multi-angle reorderer model built in S301 to... Encode to obtain the corresponding embedding representation. Internal perspective comparative learning considers The relationship between different candidate abstracts: High-quality candidate abstracts should be compared with... The remaining candidate summaries share more semantic features; the constructed internal perspective contrastive learning loss function is as follows:

[0159]

[0160] Where i = 1, 2, ..., n, and n is the number of candidate summaries, i.e., the set Size; μ ij = (ji)*μ is the sorting interval, where μ is a hyperparameter that controls the size of the interval; max(x,y) means returning the maximum value between x and y; It is a calculation and candidate summary set The set of the remaining candidate abstracts The internal perspective similarity score between them is calculated using the following formula:

[0161]

[0162] Where n is the number of candidate summaries, i.e., the set Size; It is a calculation and The cosine similarity between them is calculated using the following formula:

[0163]

[0164] in, and They are and Embedded representation; The calculation method and Similarly, I will not repeat the details here;

[0165] S30203. Construct the overall loss function, which consists of two parts: the external perspective contrastive learning loss function constructed in S30201 and the internal perspective contrastive learning loss function constructed in S30202. The specific formula is as follows:

[0166]

[0167] in, It is an external perspective contrastive learning loss function. It is an internal perspective contrastive learning loss function; It is a hyperparameter that balances the weights between the two loss functions;

[0168] S303. Optimize the training of the multi-angle reorderer model. Use Adam as the optimization algorithm. Set the initial learning rate of the Adam optimizer to 2e-7 and the maximum learning rate to 2e-3. Optimize the training of the multi-angle reorderer model built in S301 on the training dataset loaded in S103 using the total loss function built in S30203.

[0169] For example, the simplified PyTorch code implementation of the optimizer and the training process of the optimized multi-angle reorderer model described above is as follows:

[0170] optimizer=torch.optim.Adam(reranker.parameters(),lr=args.init_lr)

[0171]

[0172] for e in range(args.epochs):

[0173]

[0174]

[0175] optimizer.zero_grad()

[0176] loss = reranker(...)

[0177] loss.backward()

[0178] optimizer.step()

[0179] lr=args.max_lr*min(all_step_cnt**(-0.5),all_step_cnt*

[0180] (args.warmup_steps**(-1.5)))

[0181] for param_group in optimizer.param_groups:

[0182] param_group['lr'] = lr

[0183] In this context, `reranker.parameters()` represents the encoder parameters of the multi-angle reranker; `init_lr` is the initial learning rate, which gradually increases as the model trains until it reaches the maximum learning rate `max_lr`; `args.epoch` is the number of training epochs; `optimizer.zero_grad()` means to zero out the gradients; `loss` is the loss calculated after one training epoch based on the total loss function formula in S30203; `loss.backward()` is used to calculate the gradients of all learnable parameters in the model; and `optimizer.step()` instructs the optimizer to update the parameters based on the calculated gradients.

[0184] S4. Joint reasoning, the main operations include: generating candidate summaries for the medical problem, encoding the medical problem and its candidate summaries, calculating the external perspective similarity score, and calculating the internal perspective similarity score. The specific steps are as follows:

[0185] S401. Generate candidate summaries for medical questions. The sequence trained in S203 is transferred to the sequence model, denoted as g(·). For a specific sample {CHQ,FAQ} in the validation or test dataset loaded in S103, where CHQ represents the medical question (Q) and FAQ represents the reference summary (S), g(·) can be used to generate a probability distribution D for Q, as shown in the following formula:

[0186]

[0187] Use a beam search decoding algorithm to generate a set of candidate summaries for a given medical problem Q.

[0188]

[0189] Where BeamSearch(·) is the beam search algorithm, and n represents the number of candidate summaries, which is set to 16;

[0190] S402. Encode the medical problem and its candidate summaries. For a specific sample {CHQ,FAQ} in the validation or test dataset loaded in S103, where CHQ represents the medical problem, denoted as Q; for the set of candidate summaries of Q obtained in S401, denoted as... The encoder pair Q and Q are used in the multi-angle reorderer model trained in S303. The candidate summaries in the dataset are encoded to obtain the medical question and its candidate summary embedding representation E. Q and E Ci :

[0191]

[0192] Where i = 1, 2, ..., n, n is the number of candidate summaries generated; embedding(·) is a function of the encoder that uses the multi-angle reorderer model to obtain the text embedding representation;

[0193] S403. Calculate the external perspective similarity score. For a specific sample {CHQ,FAQ} in the validation or test dataset loaded in S103, where CHQ represents a medical question, denoted as Q; for the candidate summary set of Q obtained in S401, denoted as... Calculate Q and Each candidate summary C i The external perspective similarity score between them is calculated using the following formula:

[0194]

[0195] Among them, E Q and These are Q and C obtained from S402, respectively. i The embedding representation; after calculation, the set of external perspective similarity scores is obtained. Then, based on the external perspective similarity score, they are sorted from high to low to obtain the sorted set. Then filter out M outer′ The candidate summaries with the lowest scores (nm) are used to obtain the set of the top m candidate summaries based on their external perspective similarity scores. and the embedded representation obtained from S402 Selected from Corresponding embedding representation

[0196] S404. Calculate the internal perspective similarity score. For the set of candidate summaries with the top m external perspective similarity scores obtained in S403... Calculate C i and candidate summary set The set of the remaining candidate abstracts The internal perspective similarity score between them is calculated using the following formula:

[0197]

[0198] Where m is a set Size; sim(C′k ,C′ i ) is the calculation of C′ k and C′ i The cosine similarity between them is calculated using the following formula:

[0199]

[0200] in, and These are C′ obtained from S403. k and C′ i The embedding representation; after calculation, the set of internal viewpoint similarity scores is obtained. Then, the internal perspective similarity scores are sorted from highest to lowest to obtain the sorted set. Finally, the candidate summary C″1 with the highest internal perspective similarity score is output as the final summary.

[0201] The model proposed in this invention achieves better results than current state-of-the-art models on the iCliniq dataset. The experimental results are compared in the table below:

[0202] T5 39.25 20.84 34.92 PEGASUS 36.09 18.30- 31.45 ProphetNet 39.13 20.15 34.01 BART 40.66 21.87 35.83 SimCLS 41.85 22.18 36.97 Our Model 42.65 23.02 37.88

[0203] The model of this invention was compared with existing models. Among them, the first five rows are the experimental results of the existing technology model [Raffel C, Shazeer N, Roberts A, et al. Exploring the limits of transfer learning with a unified text-to-text transformer, The Journal of Machine Learning Research; Zhang J, Zhao Y, Saleh M, et al. Pegasus: Pre-training with extracted gap-sentences for abstractive summarization, International Conference on Machine Learning; Qi W, Yan Y, Gong Y,et al.ProphetNet:Predicting Future N-gram for Sequence-to-SequencePre-training,EMNLP 2020;Lewis M,Liu Y,Goyal N,etal.BART:Denoising Sequence-to-Sequence Pre-training for Natural LanguageGeneration,Translation,and Comprehension,ACL 2020;Liu Y,Liu P.SimCLS:A SimpleFramework for Contrastive Learning of Abstractive Summarization,ACL [2021.] The last line shows the experimental results of the model of this invention. R1, R2, and RL represent the F1 scores of ROUGE (Recall-Oriented Understudy for Gisting Evaluation) for ROUGE-1, ROUGE-2, and ROUGE-L, respectively. It can be seen that the present invention has made a significant improvement compared with the existing models.

[0204] Example 3:

[0205] As attached Figure 1As shown, the medical problem summary generation device based on the multi-angle reorderer in Embodiment 2 includes: a medical problem summary generation dataset construction unit, a medical problem summary generation model construction and training unit, a multi-angle reorderer model construction and training unit, and a joint inference unit. These units respectively implement the functions of steps S1, S2, S3, and S4 in the medical problem summary generation method based on the multi-angle reorderer. The specific functions of each unit are described below:

[0206] The medical problem summary generation dataset building unit is responsible for preprocessing the original dataset and splitting it into training dataset, validation dataset, and test dataset.

[0207] The medical problem summary generation model building and training unit is responsible for building a sequence-to-sequence model, training the model's summary generation capability using the cross-entropy loss function, and generating candidate summaries for the multi-angle reorderer model.

[0208] The multi-angle reorderer model building and training unit is responsible for building the multi-angle reorderer model and training its ability to evaluate candidate summary quality using the multi-angle contrastive learning loss function.

[0209] The joint reasoning unit is responsible for performing multi-level reasoning by combining the medical problem summary generation model and the multi-angle reorderer model, and constructing a complete reasoning process for the medical problem summary generation method based on the multi-angle reorderer.

[0210] Example 4:

[0211] An electronic device, characterized in that the electronic device includes a storage medium based on Embodiment 2 and a processor; the storage medium stores a plurality of instructions, which are loaded by the processor to execute the steps of the medical problem summary generation method based on a multi-angle reorderer of Embodiment 2; the processor is used to execute the instructions in the storage medium.

[0212] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating medical problem summaries based on a multi-angle reordering algorithm, characterized in that, The method includes the following steps: S1. Constructing a Medical Question Summary Generation Dataset: First, it is necessary to obtain medical questions raised by users in the medical Q&A community and reference summaries written by humans to form a medical question summary generation dataset. Then, it is divided into a training dataset, a validation dataset, and a test dataset. S2. Construct and train a medical problem summary generation model: Construct a sequence-to-sequence model, construct a cross-entropy loss function, optimize the training of the sequence-to-sequence model, and generate candidate summaries for medical problems; S3. Construct and train the multi-angle reorderer model: Construct the multi-angle reorderer model, construct the multi-angle contrastive learning loss function, and optimize the training of the multi-angle reorderer model. S4. Joint Reasoning: Generate candidate summaries for medical questions, encode medical questions and their candidate summaries, calculate external perspective similarity scores, and calculate internal perspective similarity scores. The steps S1, constructing a medical problem summary generation dataset, and S2, constructing and training a medical problem summary generation model, are as follows: Step S1: Construct a medical problem summary and generate a dataset: S101. Download publicly available medical problem summaries from the internet to generate a dataset; S102. Preprocess the dataset obtained in S101 and split it into training dataset, validation dataset and test dataset; S103. Load the dataset. Create a function to load the JSON format dataset and use this function to load the training dataset, validation dataset, and test dataset obtained in S102. Step S2: Construct and train a medical problem summary generation model: S201. Constructing a sequence-to-sequence model: First, construct the structure of the sequence-to-sequence model, and then load the pre-trained sequence-to-sequence model weights and parameter configuration file. S202. Construct the cross-entropy loss function. For the sequence-to-sequence model constructed in S201, its standard training framework is maximum likelihood estimation. For a specific training sample {CHQ, FAQ} in the training dataset loaded in S103, where CHQ represents a medical question, denoted as... FAQ stands for Reference Summary, denoted as Maximum likelihood estimation is equivalent to minimizing the reference summary. In each word element The sum of the negative log-likelihoods is used to optimize the following cross-entropy loss function: ; in, This refers to the lexical units currently generated by the model; It refers to a predefined starting word. and the current word unit The lexicon table formed by the previous lexicons, i.e. ; A one-hot encoded distribution in the standard maximum likelihood estimation framework; It refers to The parameters, It is by The probability distribution caused by the parameters; It is a model function, given a medical problem. The goal of the medical problem summarization task is to learn a function. To generate medical questions Abstract ; S203. Optimize sequence-to-sequence model training. Use Adam as the optimization algorithm. On the training dataset loaded in S103, use the cross-entropy loss function constructed in S202 to optimize and train the sequence-to-sequence model constructed in S201. S204. Generate candidate summaries for medical questions, and convert the sequences trained in S203 into a sequence model. For a specific sample {CHQ, FAQ} in the training dataset loaded by S103, where CHQ represents a medical question, denoted as... FAQ stands for Reference Summary, denoted as ;use It can be Generate a probability distribution The specific formula is as follows: ; Generate a given medical question using a beam search decoding algorithm. A set of candidate abstracts : ; in This refers to the beam search algorithm. The number of candidate abstracts is represented; the set of candidate abstracts is calculated using the ROUGE-L F1 index in the ROUGE score. Candidate abstracts and reference abstract The scores between the two groups, and the set of candidate summaries after scoring, are represented as follows: ; in, They are sorted in descending order based on their scores; samples with scores are used as supervision signals for optimizing the multi-angle reorderer model built in S301; it is important to note that these scores are only used in the training process, not in the inference process, because labels, i.e., reference summaries, cannot be used during inference. ; Step S3 involves constructing and training the multi-angle reorderer model, as detailed below: S301. Construct a multi-angle reordering model. For a specific training sample {CHQ, FAQ} in the training dataset loaded in S103, where CHQ represents a medical question, denoted as... FAQ stands for Reference Summary, denoted as Using the methods in S204 for medical problems Generate a set of candidate summaries and score each candidate summary to obtain a scored set of candidate summaries. The pre-trained language model RoBERTa was used as the encoder for the multi-angle reorderer. , and Encode them to obtain their embedding representations. , and : ; in, , It is the number of candidate summaries generated; It is a function that uses a multi-angle reorderer model to obtain the text embedding representation from the encoder; S302. Construct a multi-angle contrastive learning loss function, including: constructing an external perspective contrastive learning loss function, constructing an internal perspective contrastive learning loss function, and constructing a total loss function; S303. Optimize the training of the multi-angle reorderer model. Use Adam as the optimization algorithm. On the training dataset loaded in S103, use the total loss function constructed in S30203 to optimize the training of the multi-angle reorderer model constructed in S301.

2. The method for generating medical problem summaries based on a multi-angle reordering device according to claim 1, characterized in that, Step S302 involves constructing a multi-angle contrastive learning loss function, as follows: Step S302: Construct a multi-angle contrastive learning loss function: S30201. Construct an external perspective contrast learning loss function. For the multi-angle reorderer model constructed in S301, construct an external perspective contrast learning loss function to enhance its effect on evaluating the quality of external perspective similarity scores; for a specific training sample {CHQ, FAQ} in the training dataset loaded in S103, where CHQ represents medical questions, denoted as... FAQ stands for Reference Summary, denoted as ; Using the method in S204 for medical issues Generate a set of candidate summaries and score each candidate summary to obtain a scored set of candidate summaries. The encoder of the multi-angle reorderer model built in S301 is used for... , and Encode to obtain the corresponding embedding representation. , and External perspective comparative learning considers medical issues. and Candidate Abstract Relationship between: medical issues With candidate abstracts The higher the cosine similarity between them, the better the candidate abstract. The higher the quality, the better; the specific external perspective contrastive learning loss function is as follows: ; in, , It is the number of candidate summaries, i.e., the set. Size; It is the corresponding interval for sorting. It is a hyperparameter that controls the size of the corresponding interval; Indicates return and The maximum value in; It is a calculation and The external perspective similarity score is calculated using the following formula: ; in, and They are and Embedded representation; and The calculation method is similar and will not be repeated here; S30202. Construct an internal perspective contrast learning loss function. For the multi-angle reorderer model constructed in S301, construct an internal perspective contrast learning loss function to enhance its effect on evaluating the quality of internal perspective similarity scores; for a specific training sample {CHQ, FAQ} in the training dataset loaded in S103, where CHQ represents medical questions, denoted as... FAQ stands for Reference Summary, denoted as Using the methods in S204 for medical problems Generate a set of candidate summaries and score each candidate summary to obtain a scored set of candidate summaries. The encoder of the multi-angle reorderer model built in S301 is used for... Encode to obtain the corresponding embedding representation. Internal perspective comparative learning considers The relationship between different candidate abstracts: High-quality candidate abstracts should be compared with... The remaining candidate summaries share more semantic features; the constructed internal perspective contrastive learning loss function is as follows: ; in, , It is the number of candidate summaries, i.e., the set. Size; It is the corresponding interval for sorting. It is a hyperparameter that controls the size of the corresponding interval; Indicates return and The maximum value in; It is a calculation and candidate summary set The set of the remaining candidate abstracts The internal perspective similarity score between them is calculated using the following formula: ; in, It is the number of candidate summaries, i.e., the set. Size; It is a calculation and The cosine similarity between them is calculated using the following formula: ; in, and They are and Embedded representation; The calculation method and Similarly, I will not repeat the details here; S30203. Construct the overall loss function, which consists of two parts: the external perspective contrastive learning loss function constructed in S30201 and the internal perspective contrastive learning loss function constructed in S30202. The specific formula is as follows: ; in, It is an external perspective contrastive learning loss function. It is an internal perspective contrastive learning loss function; It is a hyperparameter that balances the weights between the two loss functions.

3. The method for generating medical problem summaries based on a multi-angle reordering device according to claim 1, characterized in that, The joint reasoning step S4 is as follows: S401. Generate candidate summaries for medical problems, and convert the sequences trained in S203 into a sequence model. For a specific sample {CHQ, FAQ} in the validation or test dataset loaded in S103, where CHQ represents a medical question, denoted as... FAQ stands for Reference Summary, denoted as ;use It can be Generate a probability distribution The specific formula is as follows: ; Generate a given medical question using a beam search decoding algorithm. A set of candidate extracts : ; in It is a beam search algorithm. The number of candidate summaries is set to 16. S402. Code the medical questions and their candidate abstracts; S403. Calculate the external perspective similarity score; S404. Calculate the internal viewpoint similarity score.

4. The method for generating medical problem summaries based on a multi-angle reordering device according to claim 3, characterized in that, Step S402 encodes the medical problem and its candidate abstracts, as follows: The medical questions and their candidate summaries are encoded. For a specific sample {CHQ, FAQ} in the validation or test dataset loaded in S103, where CHQ represents the medical question, denoted as... For the results obtained in S401 The set of candidate summaries, denoted as The encoder of the multi-angle reorderer model trained in S303 is used to... and The candidate summaries are encoded to obtain an embedding representation of the medical question and its candidate summaries. and : ; in, , It is the number of candidate summaries generated; It is a function that uses a multi-angle reorderer model to obtain the text embedding representation from the encoder.

5. The method for generating medical problem summaries based on a multi-angle reordering device according to claim 3, characterized in that, Step S403 calculates the external view similarity score, as follows: Calculate the external perspective similarity score for a specific sample {CHQ, FAQ} in the validation or test dataset loaded in S103, where CHQ represents a medical question, denoted as... For the results obtained in S401 The set of candidate summaries, denoted as ;calculate and Each candidate summary The external perspective similarity score between them is calculated using the following formula: ; in, and These are obtained from S402. and The embedding representation; after calculation, the set of external perspective similarity scores is obtained. Then, based on the external perspective similarity score, the results are sorted from high to low to obtain the sorted set. Then filter out Low score The candidate summaries corresponding to each score are used to obtain the external perspective similarity score. A set of candidate summaries for each bit and the embedded representation obtained from S402 Selected from Corresponding embedding representation .

6. The method for generating medical problem summaries based on a multi-angle reordering device according to claim 3, characterized in that, Step S404 calculates the internal viewpoint similarity score, as follows: Calculate the internal viewpoint similarity score, compared to the external viewpoint similarity score obtained in S403. A set of candidate summaries for each bit ,calculate and candidate summary set The set of the remaining candidate abstracts The internal perspective similarity score between them is calculated using the following formula: ; in, It is a set Size; It is a calculation and The cosine similarity between them is calculated using the following formula: ; in, and These are obtained from S403. and The embedding representation; after calculation, the set of internal viewpoint similarity scores is obtained. Then, based on the internal perspective similarity score, the results are sorted from highest to lowest to obtain the sorted set. Finally, the candidate summary with the highest internal perspective similarity score is selected. As output, this is the final summary.

7. A medical problem summary generation apparatus based on a multi-angle reordering device, implementing the medical problem summary generation method based on a multi-angle reordering device as described in any one of claims 1 to 6, characterized in that, The device includes: The medical problem summary generation dataset building unit is responsible for preprocessing the original dataset and splitting it into training dataset, validation dataset, and test dataset; The medical problem summary generation model building and training unit is responsible for building a sequence-to-sequence model, training the model's summary generation ability using the cross-entropy loss function, and generating candidate summaries for the multi-angle reorderer model. The multi-angle reorderer model building and training unit is responsible for building the multi-angle reorderer model and training the multi-angle reorderer model's ability to evaluate the quality of candidate summaries using the multi-angle contrastive learning loss function. The joint reasoning unit is responsible for performing multi-level reasoning by combining the medical problem summary generation model and the multi-angle reorderer model, and constructing a complete reasoning process for the medical problem summary generation method based on the multi-angle reorderer.

8. An electronic device, characterized in that, The electronic device includes a storage medium and a processor; the storage medium stores a plurality of instructions, which are loaded by the processor to execute the steps of the medical problem summary generation method based on a multi-angle reorderer as described in any one of claims 1 to 6; A processor is used to execute instructions stored in a storage medium.