Font Size: a A A

Research On Online Semi-Supervised Few-Shot Text Classification Method Based On Contrastive Learning

Posted on:2024-08-08Degree:MasterType:Thesis
Country:ChinaCandidate:M KangFull Text:PDF
GTID:2568307109981259Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
At present,in the case of sufficient labeled data,text classification methods based on deep learning have achieved remarkable performance in various natural language processing tasks.However,the cost of annotating text data is very high,and it requires annotators to undergo professional training.The scarcity of labeled data seriously affects the performance of text classification.In order to address this problem,researchers have proposed semi-supervised fewshot text classification methods.These methods are able to efficiently train text classification models using a small number of labeled examples and a large number of unlabeled examples.The existing semi-supervised few-shot text classification methods use static text data to offline train the model.However,all kinds of text data on the Internet are growing exponentially and explosively,and new text data occurs every day.In order to adapt the model to the new data generated,it is unreasonable to retrain it from scratch,which is very time-consuming and very inefficient.Therefore,it is very meaningful to study how to enable the text classification model to learn online as the text data stream changes.To this end,this thesis studies the online semisupervised few-shot text classification,The contributions of my thesis are summarized as follows:(1)An online semi-supervised few-shot text classification model(OSSFSTC)is proposed to solve the online classification problem of few-shot text data streams.The model adopts a classic encoder-classifier architecture.In the encoding stage,a bidirectional long short-term memory network(BiLSTM)is used to encode the words in the text to obtain the embedding representation of each word.Then the attention mechanism is utilized to learn the weights of the words in the text,and the text embedding representation is obtained by weighting and summing the corresponding word embeddings.In this thesis,the prototype memory network is used to learn the prototype representation of each class.At the classification stage,the text class is determined by calculating the distance between the text and the class prototype.During the online learning process,we employ the recurrent neural networks(RNN)to dynamically learn and accumulate historical knowledge,and use this knowledge to classify currently encountered text.In addition,a threshold is used in the prototype network to determine whether the current text class is a known class.(2)An online semi-supervised few-shot text classification based on contrastive learning(OSSFSTC-CL)model is proposed.In OSSFSTC,the performance of the encoder not only affects the encoding result of the text,but also affects the representation of the class prototype,thus affecting the classification effect of the text.As one of the important methods of selfsupervised learning,contrastive learning can use unmarked data to learn the underlying representation of text,and has achieved good performance in many areas of machine learning.To further improve the performance of the encoder,this thesis introduces a contrastive learning into text representation learning.Specifically,after the texts are encoded,a text is randomly selected as the anchor,and the texts with the same label are taken as positive examples and the remaining texts are taken as negative examples.Then,the similarity between anchors and positive samples,and anchors and negative samples are calculated.Finally,by defining a contrastive learning loss to restrict that the similarity between anchors and positive examples is greater than that between anchors and negative examples,thereby improving the performance of the encoder.(3)In order to verify the performance of the model proposed,we have conducted extensive experiments on the Amazon and Yelp datasets,and the experimental results show that our model can outperform other state-of-the-art baselines.
Keywords/Search Tags:Few-Shot Text Classification, Online Learning, Semi-Supervised Learning, Prototype Network, Contrastive Learning
PDF Full Text Request
Related items