# Pre-filled text\_input interface to capture edit operations

**URL:** https://support.prodi.gy/t/pre-filled-text-input-interface-to-capture-edit-operations/3806
**Category:** Uncategorized
**Tags:** front-end, usage, custom
**Created:** [January 19, 2021, 4:47pm UTC](https://support.prodi.gy/t/pre-filled-text-input-interface-to-capture-edit-operations/3806 "2021-01-19T16:47:40Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tannonk](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/tannonk/32/1867_2.png) [@tannonk](https://support.prodi.gy/u/tannonk)
#### Post date: [January 19, 2021, 4:47pm UTC](https://support.prodi.gy/t/pre-filled-text-input-interface-to-capture-edit-operations/3806/1 "2021-01-19T16:47:40Z")

</div>

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](https://youtu.be/zlyq9z7hdUA), 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!

---

<div class="post-metadata">

### Author: ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)
#### Post date: [January 20, 2021, 4:59am UTC](https://support.prodi.gy/t/pre-filled-text-input-interface-to-capture-edit-operations/3806/2 "2021-01-20T04:59:39Z")

</div>

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:

> <https://github.com/explosion/prodigy-recipes/blob/master/image/image_caption/image_caption.py#L27>

---

<div class="post-metadata">

### Author: ![tannonk](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/tannonk/32/1867_2.png) [@tannonk](https://support.prodi.gy/u/tannonk)
#### Post date: [January 20, 2021, 9:32am UTC](https://support.prodi.gy/t/pre-filled-text-input-interface-to-capture-edit-operations/3806/3 "2021-01-20T09:32:08Z")

</div>

Hi Ines,

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

Love your work!
