Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alpaca_gpt4_data_zh.json那份数据,很多output部分是不完整的。 #29

Open
lale314 opened this issue Jun 27, 2023 · 2 comments

Comments

@lale314
Copy link

lale314 commented Jun 27, 2023

部分instruction如下:
写一篇《麦田里的守望者》的书摘。
写一个与技术进步相关的短故事。
在Instagram上为化妆品品牌创建一个有针对性的帖子。
写一段关于你选择的话题的说唱歌词。
用给定的主题创作一个原创故事。主题:老化。
创作一首关于你最喜欢的篮球队洛杉矶湖人的说唱歌曲。
创作一个故事,以这个句子为开头:天空是一片明亮的蓝色。
想出两个电视剧的点子。
比较Emma Lazarus的《新巨像》和William Shakespeare的《十九号十四行诗》中自由的主题。
写一段比较和对比《麦田里的守望者》和《杀死一只知更鸟》这两本书。
为一部关于大学生的电影创建提纲。电影标题为“大学生”。

@sz128
Copy link

sz128 commented Jun 30, 2023

image 中文结果有问题,不完整。

@sz128
Copy link

sz128 commented Jul 4, 2023

@lale314 可以用如下代码过滤出不完整的数据。

import sys
import json

with open(sys.argv[1]) as fin:
    for line in fin:
        line = line.strip()
        sample = json.loads(line)
        output = sample['output'].strip(" \n\"”")
        if output[-1] in set("?!.。?!})]`》)") or output.endswith("```") or '\n\n此致' in output[-20:]:
            print(line)
        else:
            if len(output) > 200:
                sample['id'] = sample['id'] + '__<|notstoptoken|>'
                print(json.dumps(sample, ensure_ascii=False))
            else:
                print(line)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants