Shitao Xiao
Shitao Xiao
CLS 和MEAN_POOLING都是常用的做法。实际上,在经过训练后,各种方式差距并不大,选择一种简单的方式即可。不过要注意训练和测试使用同样的pooling方法。
Hi, I updated the readme to make it more clear: https://github.com/FlagOpen/FlagEmbedding/tree/master/examples/finetune#hard-negatives You can set `negative_number` to change the number of sampled negatives. `range_for_sampling` is used to create the corpus for...
不是一直都是0,看起来是正常的。 但是,loss很小,说明这个任务过于简单了,模型可能无法学到太多东西。建议增加batch size,以及挖掘难样本,提高任务难度。
> > 不是一直都是0,看起来是正常的。 但是,loss很小,说明这个任务过于简单了,模型可能无法学到太多东西。建议增加batch size,以及挖掘难样本,提高任务难度。 > > 我算力不是太够,batchsize没法提高了,请问项目支持梯度累计吗? 支持,但是梯度累积无法增加neg负样本数量,意义不大。可以增加负样本难度。
可以这样计算长度: ``` item = tokenizer.encode_plus( query, pos, truncation=True ) l = len(item['input_ids']) ``` 不过,我理解你这样计算长度是没有问题的,出现这种情况应该是没有过滤neg,query+neg超过了512。
> 不是的哦,我对query+pos和query+neg都分别计算了 抱歉,理解错了,你这样算会少一些token,程序会在两个文本之间加入一个sep 特殊token。
Yes, llm-embedder and bge share the same model architecture.
请问使用的是哪个程序?
您好,使用双语语料微调reranekr是可以的。