yangkevin2 / doc-story-generation

MIT License
145 stars 19 forks source link

The baseline experiment of re3 could not be successfully executed according to the README #7

Closed pumfish closed 7 months ago

pumfish commented 7 months ago

Hello I am trying to use DOC's plan to generate RE3 results. However, when I use the

python scripts/data/save_re3_plan.py -i output/plan.pkl -o output/re3_plan.pkl

I found the re3_plan.pkl actually is a json, and can't be used in the RE3 because of format incompatibility I tried to wirte a new one:

    with open(args.output, 'wb') as wf:
        save_info = {'premise': plan['premise'],
                    'setting': plan['setting'],
                    'character_strings': plan['character_strings'],
                    'outline': '\n\n'.join([f'{i+1}. {section}' for i, section in enumerate([node.text for node in plan['outline'].children])]),
                    'outline_sections': [node.text for node in plan['outline'].children],
                    'infer_attributes_string': plan['infer_attributes_string']
        }
        pickle.dump(save_info, wf)

I only got an Error:

Traceback (most recent call last):
  File "/workspace/volume/doc-story-gen/emnlp22-re3-story-generation/scripts/main.py", line 106, in <module>
    save_info = load_plan_info(args.load_outline_file)
  File "/workspace/volume/doc-story-gen/emnlp22-re3-story-generation/scripts/../story_generation/plan_module/plan.py", line 173, in load_plan_info
    save_info = pickle.load(f)
ModuleNotFoundError: No module named 'story_generation.plan_module.outline'

The links of RE3 I use is https://github.com/yangkevin2/emnlp22-re3-story-generation How can I solve it?

pumfish commented 7 months ago

Find it,just need change re3_plan.pkl to re3_plan.json