interactive-cookbook / recipe-generation

Apache License 2.0
0 stars 0 forks source link

Repetition of instructions #17

Closed kastein closed 1 year ago

kastein commented 1 year ago

Many recipes generated using the generate.py script include repetitions of complete instructions or instructions following each other start with the same tokens.

For example for cauliflower_mash_5.conllu (not part of the training set of the model):

Separate cauliflower from poppy. Separate cauliflower into florets. Chop up the core finely. Bring about 1 cup of water to a simmer in a pot, then add the cauliflower. Then add the cauliflower. Then add the cauliflower. Then add the cauliflower. Then add the cauliflower. Cook the cauliflower for 12 - 15 minutes or until very tender. Drain all the water, and the cauliflower will be more dry and better. Drain all the water and discard all the water. The cauliflower will be more dry and better.

In contrast to this, the recipe generated from the same model for the same amr graphs using the scripts in the recipe-generation-model repository looks much better:

Separate cauliflower from poppy. Chop the cauliflower up to a fine chopping up the core. Bring about 1 cup water to a simmer in pot. Then add the cauliflower. Cover. Turn the heat to medium. Cook cauliflower for 12 - 15 minutes or until very tender. Drain all the water ; the cauliflower will be more dry and better. Drain and discard all of the water. The more dry and better the cauliflower.

TODO: figure out where this difference comes from

kastein commented 1 year ago

Mistakes when creating the input string for the model in generate.py.

  1. context is added as a list instead of a string
  2. metadata is not excluded beforehand

about 1. context is first a list but should be joined then into a string -> see the read_document function in dataset_reader.py but this function is not called in the generate_recipe.py script

about 2. In the recipe-generation-model inference code, the AMRs are read using the read_data_set function from dataset_reader.py. In the current repository, the AMRs are read using the read_aligned_amr_file function from action_amr_graph_mappings and get then transformed to strings