The invention discloses a
text retrieval enhancement generation method and device, a medium and equipment, and relates to the technical field of retrieval enhancement generation. Comprising the following steps: establishing a
database through vectorized corpora, and screening and labeling key information to generate a golden section vector
library; extracting an adversarial sample from an
external database by using a training problem, and fusing the adversarial sample with related corpora in a golden section vector
library to obtain a
training set; and adding a
noise classification layer to improve the language
large model, and training the improved language
large model by using the fusion
training set. When a user question is processed, relevant corpora are recalled,
noise is recognized through the classification layer, context representation is generated through the attention fusion layer, and the output layer dynamically adjusts a decoding strategy and generates an answer. According to the method, a large
language model added with a
noise classification task is trained through the fusion
training set, so that the model can identify and distinguish different types of noise, the adaptability of the model to different types of noise is enhanced, the model is helped to learn how to distinguish related and unrelated information, and thus the method is more robust when an actual problem is processed.