The application discloses a kind of based on knowledge
contrast enhancement prompt
small sample text classification method, belong to
natural language processing technical field, including the following steps: S1: initialization continuous prompt;S2: knowledge template generation;S3: joint training optimization;S4:
mask prediction.The application first utilizes BiLSTM to initialize a continuous prompt vector that can be learned and has relevance, then pre-training
language model is used as
knowledge base, automatically generates a set of positive and negative prompt templates, on this basis, combined with contrast learning and
mask language model are jointly trained, finally obtain effective continuous prompt embedding for accurate
mask prediction, and provide an
effective method that can automatically construct continuous prompt template, and extensive experiments are carried out on 14 data sets, the results show that the accuracy of the method is improved by more than 3.5% than the optimal contrast model, solve the two major problems that continuous prompt is sensitive to initial parameters and easy to overfit in
small sample environment.