Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text field missing / Costum Rest Api for Auto-Labelling #1248

Closed
lrwagner opened this issue Mar 12, 2021 · 4 comments · Fixed by #1997
Closed

Text field missing / Costum Rest Api for Auto-Labelling #1248

lrwagner opened this issue Mar 12, 2021 · 4 comments · Fixed by #1997
Labels
bug Something isn't working
Projects

Comments

@lrwagner
Copy link

How to reproduce the behaviour

When sending (Testing) the Post request inside the creation of a costum rest api service for auto-labelling the request payload (which goes to doccano/django) looks like this:

{
  "id": 99999,
  "model_name": "CustomRESTRequestModel",
  "model_attrs": {
    "url": "http://0.0.0.0:5001/process-single/",
    "method": "POST",
    "params": {},
    "headers": {},
    "body": { "model": "models/model-best" }
  },
  "template": "",
  "label_mapping": {},
  "text": "Example Text"
}

My Problem/Question

I suppose this is the request which is being send to Django to create a model instance which is used to communicate with my costum rest api.
Somehow, when calling my api using doccano, the received json does only inlcude { "model": "models/model-best" }. Shouldn't "text": "Example Text" also be in there? What am I missing?

  • Operating System: Ubuntu
  • Python Version Used: 3.8
  • How did you install doccano (Heroku button etc): Docker
@lrwagner lrwagner changed the title Text field for Costum Rest Api for Auto-Labelling Text field missing / Costum Rest Api for Auto-Labelling Mar 12, 2021
@jreypy
Copy link

jreypy commented Apr 9, 2021

I am doing my first steps with doccano, I would like to use auto-labeling too, but when I create a record.

My curl body is like this

{"id":99999,"model_name":"Custom REST Request","model_attrs":{"url":"http://0.0.0.0:5001/process-
single/","method":"POST","params":{},"headers":{},"body":{"model":"models/model- best"}},"template":"","label_mapping":{},"text":"Example Test"}

I compare my json body and my model_name is REST Request and your json body is CustomRESTRequestModel, I have this error in my server

raise NameError(f'{model_name} is not found.')
NameError: Custom REST Request is not found.

what is wrong with my auto labeling register ?

I move to the previous version and still I have the same error, I dont know if I forget a step.

@pranavpawar3
Copy link

@jreypy Hi, I am facing the same issue, i.e. NameError. Have you found any solution to this?

Thanks

@jreypy
Copy link

jreypy commented Apr 13, 2021

Hi @pranavpawar3 , I really need my document auto labeled after the import and when the document has been checked... then My solution is create a Proxy (NINGX) and catch 2 requests (import and approve-labels) and overwrite services (another application) to import with labels and get all labels from the documents. Maybe I can add another proxy interceptor to override the auto-labeling and avoid the doccano service.

This is an example of my nginx :

    location ~ ^/v1/projects/[0-9]+/docs/upload$ {
        proxy_pass http://localhost:8080;
        proxy_set_header Host $host;
        proxy_read_timeout  1000;
    }
    location ~ ^/v1/projects/[0-9]+/docs/[0-9]+/approve-labels$ {
        proxy_pass http://localhost:8080;
        proxy_set_header Host $host;
        proxy_read_timeout  1000;
    }

    location / {
        proxy_pass http://localhost:8000;
        proxy_set_header Host $host;
        proxy_read_timeout  300;
    }

Let me know If I can help you with this.

@gika815
Copy link

gika815 commented Apr 22, 2021

solution #1307 (comment)

@Hironsan Hironsan added the bug Something isn't working label Oct 21, 2021
@Hironsan Hironsan added this to To do in v1.8.1 Sep 6, 2022
v1.8.1 automation moved this from To do to Done Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

5 participants