Shitao Xiao
Shitao Xiao
抱歉,没用过NPU,没有这方面的经验。
对NPU这块毫无经验,抱歉
目前没有,欢迎提交PR。
Currently, we only implement cross-entropy in this repo. If you want to use more loss functions, you need to add the code in modeling.py.
You should build a mapping between embedding and text, so you can find the text after retrieval the top-k embedding. You can refer to https://github.com/FlagOpen/FlagEmbedding/blob/master/FlagEmbedding/baai_general_embedding/finetune/eval_msmarco.py#L254
可以参考https://github.com/FlagOpen/FlagEmbedding/tree/master/FlagEmbedding/llm_reranker#evaluate-script
Bge-M3模型没有使用指令
可以查询正样本是否排在负样本前面。训练使用交叉熵损失,优化的是正样本和负样本的分数差,不保证正样本分数>0,
https://github.com/FlagOpen/FlagEmbedding/blob/master/FlagEmbedding/BGE_M3/modeling.py#L302 交叉熵损失,对pos和neg计算分数,将正样本作为正确分类计算损失