SmartLi8 / stella

text embedding

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to add instruction to augment retrieval result?

hwang824 opened this issue · comments

commented

在示例代码中提到:

如果是短对长数据集,推荐添加instruction,来帮助模型更好地进行检索。

注意instruction里的是英文的冒号

请问这里的instruction应该怎么添加,以增加在问答段落召回时的效果?

是否类似这样:

q_embeddings = model.encode(["查询:" + q for q in queries], normalize_embeddings=True)
p_embeddings = model.encode(["结果:" + p for p in passages], normalize_embeddings=True)

在示例代码中提到:

如果是短对长数据集,推荐添加instruction,来帮助模型更好地进行检索。

注意instruction里的是英文的冒号

请问这里的instruction应该怎么添加,以增加在问答段落召回时的效果?

是否类似这样:

q_embeddings = model.encode(["查询:" + q for q in queries], normalize_embeddings=True) p_embeddings = model.encode(["结果:" + p for p in passages], normalize_embeddings=True)

你好,是的

你好现已更新v2,不再需要instruction: https://huggingface.co/infgrad/stella-base-zh-v2