so I have a recipe to stream image to the prodigy and a text input area where annotators will input the text that is in the image. so if you see the example below, we have an image of a page and since a page has more than one line of text. When the first line of the text is typed and when pressed enter to jump the cursor to the next line to type the second line of text from the image, it doesn't work or go to the next line. How do I make changes to the recipe so that it does or to add multiple text lines in the text input ?
below is my recipe
@prodigy.recipe("image-to-text-recipe")
def image_to_text_recipe(dataset, jsonl_file):
logging.info(f"dataset:{dataset}, jsonl_file_path:{jsonl_file}")
blocks = [
{"view_id": "image"},
{"view_id": "text_input"}
]
return {
"dataset": dataset,
"stream": stream_from_jsonl(jsonl_file),
"view_id": "blocks",
"config": {
"blocks": blocks,
"editable": True
}
}
def stream_from_jsonl(jsonl_file):
with jsonlines.open(jsonl_file) as reader:
for line in reader:
image_id = line["id"]
obj_key = line["image_url"]
text = line["user_input"]
image_url = get_new_url(obj_key)
eg = {"id": image_id, "image": image_url, "user_input": text}
yield set_hashes(eg, input_keys=("id"))```