Aspect-based sentiment analysis(ABSA)is an important research topic in the field of natural language processing.Although supervised solutions for this task have made significant progress in recent years,the fine-grained nature of the task makes it difficult to obtain the large amount of high-quality labeled data required for supervised solutions in practical applications.Therefore,this thesis focuses on exploring unsupervised and fewshot solutions for the ABSA task.The ABSA task can be divided into two major steps:the first step involves identifying the fine-grained aspect categories,also known as aspect category detection.The second step is to perform sentiment polarity classification on the identified aspect categories or aspect terms.For the aspect category detection task,this thesis proposes a prompt-based constraint clustering method,PCCT.The PCCT algorithm employs the language model(LM)combined with prompt techniques as a knowledge base to automatically generate constraints for clustering,as well as to provide a representation space for performing clustering.PCCT(1)extracts extensive keywords to expand our understanding of each aspect,(2)automatically generates instance-level and concept-level constraints for clustering,and(3)trains the clustering model with the above constraints.The experiments demonstrate that PCCT performs noticeably better than existing unsupervised approaches and considerably surpasses weakly supervised methods that require more human effort.For the aspect sentiment classification task,this thesis proposes a prompt-based contrastive sentiment classification algorithm,PCSC,that can be applied to few-shot scenarios.Firstly,by referencing the way humans write comments,the traditional classification task is converted to a natural language implication task for sentiment classification.The experiments demonstrate that this approach can effectively improve the performance of PCSC in the few-shot scenario.Secondly,to further alleviate the problem of the baseline model accurately identifying neutral sentiment polarity,PCSC introduces supervised contrastive loss to jointly train the model.The experiments show that PCSC can be applied to both the aspect term sentiment classification(ATSC)task and the aspect category classification(ACSC)task,and its performance is superior in few-shot scenarios.Furthermore,a simple aspect sentiment analysis system is implemented to demonstrate the practical value of the proposed algorithms for real-life applications. |