# Bert-Similarity **Repository Path**: StevenRogers/bert-similarity ## Basic Information - **Project Name**: Bert-Similarity - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-07-03 - **Last Updated**: 2021-07-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Bert计算文本相似度 ## 1.原理 对于单个Bert模型计算文本相似度,其输入格式为:\ [CLS] text_a [SEP] text_b [SEP] \ 然后[CLS]输出的向量进行分类 ## 2.模型结构 模型结构如图所示: ![模型结构](wiki/pictures/bert-sim-model.png) ## 训练: 1. 加载bert预训练模型 ```shell cd data/ git lfs install git clone https://huggingface.co/bert-base-chinese ``` 2. 开始训练模型 ```shell python main.py train --use_cuda=True --batch_size=64