Pre-filled text_input interface to capture edit operations

Hi,

I'm working on human evaluation/annotation of text generation models and am wondering if there's a way to use a text_input field that is pre-filled with the text to be annotated.

The idea is similar to the image captioning demo example, but instead of asking the annotator to type the caption from scratch, we want to provide an editable text. This should allow the annotator to quickly edit words in place with the cursor rather than having to re-type or manually copy/paste the parts of the text that are ok.

The gaol here would be to capture edit operations between a model's output and a human-edited version.

Thanks in advance!

Hi! I hope I understand your question correctly, but I think I'm actually doing the same thing in my image captioning tutorial to manually correct the captions suggested by the model. Prodigy's input and output format is identical, so you can pre-populate the field you're storing the free-form text in (configurable by the field_id), and the pre-populated text will show up in the UI.

In the example recipe, I've used the field ID caption for the editable caption, and added another key orig_caption to preserve the original caption text. After annotation, you can then compare the caption and orig_caption to see if and how the text was edited. See here for the recipe code:

Hi Ines,

Thanks so much for the quick response and the clarification. It's much clearer now and the recipe is working as expected :raised_hands:. The problem was that I had misunderstood exactly what the field_id key was for :roll_eyes:

Love your work!