Font Size: a A A

Research And System Implementation Of Text Matching Algorithm Based On Contrastive Learning

Posted on:2024-06-26Degree:MasterType:Thesis
Country:ChinaCandidate:G Q WuFull Text:PDF
GTID:2568307076992899Subject:Software engineering
Abstract/Summary:PDF Full Text Request
The text matching algorithm aims to judge the relationship between two texts by comparing the similarity between them,which is an important part of the question answering system.Traditional text matching algorithms are mainly based on word vector representation,which is not effective when dealing with texts with high semantic similarity.The text matching algorithm based on contrastive learning uses the difference between positive sample pairs and negative sample pairs to improve the accuracy and robustness of text matching.However,existing models mainly focus on the construction of positive and negative sample pairs in the current batch,ignoring the semantic information of other samples,resulting in model underfitting.In addition,the existing models lack effective discrimination of negative samples,resulting in putting wrong samples into negative samples when constructing negative sample pairs,reducing the quality of text representation.In response to the above problems,this paper designs a text matching model that integrates the error negative sample solution algorithm and the momentum comparison mechanism,which improves the text matching accuracy.The research work of this paper is as follows:(1)In order to solve the lack of samples during model training,inspired by the field of computer vision,this paper adopts the momentum comparison mechanism,uses the queue to reuse the samples of the previous batch to expand the number of negative samples,and uses the momentum update method to optimize the queue encoder.Experimental results on public datasets show that the momentum contrast mechanism improves the model’s sentence representation ability.(2)In order to solve the error propagation caused by wrong negative samples during model training,this paper proposes a wrong negative sample solution algorithm,designs a multi-view feature aggregation algorithm to find out wrong negative samples within a batch,and adopts two strategies of shielding and expansion to solve the problem.The semantic loss problem of the model.Experimental results on public datasets show that error negative sample resolution algorithms can improve model accuracy.In addition,the error negative sample resolution algorithm can be jointly trained with the momentum comparison mechanism to further improve the model accuracy.(3)Design and implement a knowledge graph-based question answering system for famous characters.The text matching model is applied to the system to realize functions including character relationship query,character information question and answer,map display,system analysis,etc.,which solves the problem of complex character relationships and difficult for readers to understand in literary works in actual educational scenarios,and helps readers better understanding and analysis of literary works.
Keywords/Search Tags:Text matching, contrastive learning, automatic question answering, knowledge graph, character relationship
PDF Full Text Request
Related items