SimCSE-Pytorch icon indicating copy to clipboard operation
SimCSE-Pytorch copied to clipboard

中文数据集下SimCSE+ESimCSE的实现

Results 12 SimCSE-Pytorch issues
Sort by recently updated
recently updated
newest added

阅读了一下这里的代码,对MoCo的实现是在dataloader里面维护了一个队列存储了历史样本(而不是样本的embedding),但是Momentum encoder的思想,如果我理解的无误,应该是缓存momentum encoder的输出embedding,并通过动量更新的方法使embedding空间的波动不至于太大(同时不用占用额外显存)。是否是实现有误呢?

---> 12 sim = F.cosine_similarity(y_pred.unsqueeze(1), y_pred.unsqueeze(0), dim=-1) 13 14 # 将相似度矩阵对角线置为很小的值, 消除自身的影响 RuntimeError: cosine_similarity requires both inputs to have the same sizes, but x1 has [64, 1, 768] and x2...

你好博主,感谢你的分享,我在运行过程中发现单独运行ESimCSE_train.py和单独运行ESimCSE_dataloader.py过程中negative_samples实际表现不一致,代码编辑如下: def negative_samples(self, batch_src_text): batch_size = len(batch_src_text) print('*' * 10) print('len(self.q):', len(self.q)) print('batch_size:', batch_size) negative_samples = None if len(self.q) > 0: negative_samples = self.q[:self.q_size] # print("size of negative_samples", len(negative_samples)) if...

运行时,模型报错。不知道这个路径里面是什么。 报错:requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://huggingface.co//data/Learn_Project/Backup_Data/bert_chinese/resolve/main/config.json

SimCSE有监督版有用到 1,2,3,4,5 的标签吗, 可用于 预测 两个句子相似度吗?

i runed two model both of simcse and esimcse using the data under your provide path,but the spearman both under 0.2,why?

ESimCSE 真的有效果吗?

看代码是用stsb的dev来测试数据的,spearman也是dev的结果,不应该是用test来跑最后的分数么

我看别人计算相似度之前都是需要归一化的,你这里是不是缺个归一化的操作?

simcse_unsup_loss 只有一个loss函数,有监督跟无监督用的loss函数是一样的吗。?