# Field report: Noisy translation data annotation and nginx-proxy deployment

**URL:** <https://support.prodi.gy/t/field-report-noisy-translation-data-annotation-and-nginx-proxy-deployment/5189>\
**Category:** Uncategorized\
**Tags:** usage, custom, server\
**Created:** [January 14, 2022, 11:19am UTC](https://support.prodi.gy/t/field-report-noisy-translation-data-annotation-and-nginx-proxy-deployment/5189 "2022-01-14T11:19:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![baeumer](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/baeumer/32/260_2.png) [@baeumer](https://support.prodi.gy/u/baeumer)\
**Post date:** [January 14, 2022, 11:19am UTC](https://support.prodi.gy/t/field-report-noisy-translation-data-annotation-and-nginx-proxy-deployment/5189/1 "2022-01-14T11:19:07Z")

</div>

Hello all,

I have been using prodigy for a very long time and I think I have seen many configurations. But I don't know all the tricks and have some ugly habits to achieve my goals in prodigy. So I thought I'd report on a use case and possibly a discussion will come up about how I could have implemented this better. I would be very happy to hear that!

**Below I would like to present a use case and show my NGINX integration.**

We are training a translation solution for a research project. In this project, both the SOURCE and TARGET language sentences are of poor quality. It is therefore necessary that users can edit both the source and target sentences. Furthermore, it is necessary that comments can be given.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/prodigy/original/2X/e/eafa69a95c11e04e92dd3f95a70997ec588d4ee8.png)

Comments can be realized very easily by the text field of Prodigy.

However, editing sentences and comparing them at the same time is not so easy with the user input variant in the prodigy block. Especially not, because you can't define a text for the user inputs (only a placeholder). For this reason, it is necessary to work with HTML.

```python
    blocks = [
        {"view_id": "html", "html_template": "<div class='c0185'><label class='c0186' for='w2'>Source</label><textarea rows='4' id='w2' class='prodigy-text-input c0187 c0188' onchange=\"setsource(document.getElementById('w2').value)\">{{source}}</textarea></div>"},
        {"view_id": "html", "html_template": "<div class='c0185'><label class='c0186' for='w3'>Target</label><textarea rows='4' id='w3' class='prodigy-text-input c0187 c0188' onchange=\"settarget(document.getElementById('w3').value)\">{{target}}</textarea></div>"},
        {"view_id": "text_input", "field_rows": 3, "field_label": "Comment"}
    ]

```

In order for the changed texts to find their way into the database, the change must be noted in the Prodigy object. For this we can use JavaScript.

```python
"config": {
            "blocks": blocks, # add the blocks to the config
            "javascript": "function setsource(text) {window.prodigy.content.source = text; window.prodigy.content.text = text;} function settarget(text) {window.prodigy.content.target = text;}"
        }

```

This works very well. But is it also the easiest way? And why can't I use the user input blocks for this?

Let's move on to nginx. If a reverse proxy is to be used with nginx and the paths cannot be "/" because, for example, something else is already running on the path, as far as I know you have no way in Prodigy to define an alternative route here.

```python
        location /awesome-prodigy/ {
                proxy_pass http://127.0.0.1:8080/;
        }

```

This first leads to a 404 at Prodigy, because the paths are not correct. I adjust the routes in the app.py in prodigy. Then it works great. But is there a nicer way here?

Best,  
Frederik

---

<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 17, 2022, 10:48am UTC](https://support.prodi.gy/t/field-report-noisy-translation-data-annotation-and-nginx-proxy-deployment/5189/2 "2022-01-17T10:48:32Z")

</div>

Thank for sharing 🙂

> [@baeumer](#):
>
> Especially not, because you can't define a text for the user inputs (only a placeholder). For this reason, it is necessary to work with HTML.

I hope I understand the question correctly but you can also pre-populate the text in the text field in the incoming JSON. By default, that'd be `user_input`, but you can also customise the ID via the `field_id` setting on the block. So if you feed in data with `"user_inpit": "Some text here"`, the field will get pre-populated.

> [@baeumer](#):
>
> If a reverse proxy is to be used with nginx and the paths cannot be "/" because, for example, something else is already running on the path, as far as I know you have no way in Prodigy to define an alternative route here.

Couldn't you do something like this and define alternative routes for all the endpoints?

> [@Using Prodigy with a ProxyPass](https://support.prodi.gy/t/using-prodigy-with-a-proxypass/1159/8):
>
> @elly Thanks Ellen, that worked for me too! In case someone else stumbles upon this thread looking for a solution for Nginx, it’s straight forward based on Ellen’s post: location /annotate/ { proxy\_pass http://localhost:8080/; } location /project { proxy\_pass http://localhost:8080/project; } location /get\_questions { proxy\_pass http://localhost:8080/get\_questions; } location /give\_answers { proxy\_pass http://localhost:8080/give\_answers; } location /fonts { proxy\_pass http:/…

In general, Prodigy should support custom path-based routing because all requests are made using the releative paths.
