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

Async Version of annotate_note #118

Open
boyleconnor opened this issue Feb 26, 2021 · 3 comments · May be fixed by #129
Open

Async Version of annotate_note #118

boyleconnor opened this issue Feb 26, 2021 · 3 comments · May be fixed by #129
Assignees

Comments

@boyleconnor
Copy link

def annotate_note(host: str, note: dict, annotator_type: str) -> dict:

It would be very useful to have an asynchronous version of annotate_note (as well as a few of the other methods in this module).

E.g. I call something like this:

requests = []
for annotation_type in ('person', 'date', 'address'):
    requests.append(annotate_note(note=my_note, annotator_type=annotation_type, host=HOST_URL))

responses = []
for request in requests:
    responses.append(request.response())
@thomasyu888 thomasyu888 self-assigned this Feb 27, 2021
@thomasyu888
Copy link
Member

thomasyu888 commented Feb 28, 2021

@cascadianblue

When using the auto-generated client, there is a way to set async_req=True:

configuration = annotator.Configuration(host=host)
with annotator.ApiClient(configuration) as api_client:
    api_instance = text_date_annotation_api.TextDateAnnotationApi(api_client)
    annotations = api_instance.create_text_date_annotations(
        text_date_annotation_request=text_date_request,
        async_req=True
    )

The object returned annotations has 4 functions:

  • annotations.get()
  • annotations.ready()
  • annotations.successful()
  • annotations.wait()

If I create a parameter async, should I only return the annotations async object?

@thomasyu888 thomasyu888 linked a pull request Feb 28, 2021 that will close this issue
@tschaffter
Copy link
Member

@thomasyu888 Is there an update regarding this ticket? Is this a low hanging fruit? Is it a must-have for the launch on June 8th?

@tschaffter tschaffter added the question Further information is requested label May 29, 2021
@thomasyu888
Copy link
Member

thomasyu888 commented May 29, 2021

@tschaffter not a must have for launch, and there hasn't been much development on this front for awhile.

@tschaffter tschaffter removed the question Further information is requested label Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants