deepseek-ai / DeepSeek-LLM

DeepSeek LLM: Let there be answers
https://chat.deepseek.com/
MIT License
1.33k stars 87 forks source link

TriviaQA结果复现求助 #33

Open HYZ17 opened 5 months ago

HYZ17 commented 5 months ago

你好,我尝试着复现base模型(7B和67B)在TriviaQA上的结果。发现使用tech report 中的prompt格式,结果还是相差了7个点左右。请问可以提供复现的代码吗?感谢你的帮助。

luofuli commented 5 months ago

@hwxu20 @DeepSeekPH

hwxu20 commented 5 months ago

TriviaQA我们测试的是web的子集,实际评测时每个样本选择的few-shot example是随机从train里面挑选的,tech report中只是给出了其中的一个示例。 另外评估结果差7个点可能是对答案的后处理不一致,我们使用的后处理脚本供参考:

def normalize_answer(s):
    """Lower text and remove punctuation, articles and extra whitespace."""

    def remove_articles(text):
        return re.sub(r"\b(a|an|the)\b", " ", text)

    def white_space_fix(text):
        return " ".join(text.split())

    def handle_punc(text):
        exclude = set(string.punctuation + "".join(["‘", "’", "´", "`"]))
        return "".join(ch if ch not in exclude else " " for ch in text)

    def lower(text):
        return text.lower()

    def replace_underscore(text):
        return text.replace("_", " ")

    return white_space_fix(remove_articles(handle_punc(lower(replace_underscore(s))))).strip()
RoacherM commented 3 months ago

哪里可以看到你们的测评脚本?想复线一波?

hwxu20 commented 3 months ago

现在还没有开源评测的脚本