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

Uploading curation from tsv #37

Open
ofersabo opened this issue Feb 5, 2021 · 5 comments
Open

Uploading curation from tsv #37

ofersabo opened this issue Feb 5, 2021 · 5 comments

Comments

@ofersabo
Copy link

ofersabo commented Feb 5, 2021

Hi,

Trying to upload an annotated TSV file as a curation document to a project.

I possess the curator file id as well as the document id.
The following code returns an error:

        with open(os.path.join(path_to_curation_dir, _name_document, "CURATION_USER.tsv")) as annotation:
            try:
                client.api.create_curation(project_id, document_id, curation_format=InceptionFormat.TSV, content=annotation)
            except InceptionBadResponse as e:
                print(e.bad_response.content)
                raise e

error:
b'{"messages":[{"level":"ERROR","message":"Internal server error: The document appears to be empty. Unable to detect any tokens or sentences. Empty documents cannot be imported."}]}'

Both the annotated TSV file on my file system contains annotations, as well as the curation file in the tool.

Any idea why this error occurs?

@ofersabo
Copy link
Author

ofersabo commented Feb 6, 2021

When trying to load the same TSV file from the swagger API, I get a different type of error.
error:

"message": "Internal server error: upload11954770680320360405.bin This is not a valid TSV File"

See the image with information about the request and the response.
image

@FrogFeather
Copy link

FrogFeather commented Feb 16, 2021

Following up on this, I'm experiencing the same problem even just for uploading regular annotations for a document.

    try:
        client.api.create_annotation(project_id, document_id, annotation_format=InceptionFormat.TSV, content=annotation)
    except InceptionBadResponse as e:
        print(e.bad_response.content)
        raise e

Yet I still receive the following error:
b'{"messages":[{"level":"ERROR","message":"Internal server error: The document appears to be empty. Unable to detect any tokens or sentences. Empty documents cannot be imported."}]}'

I've tried uploading annotations in various different formats (CONLL, XMI, TCF, NIF, etc.) but nothing works.

@ofersabo
Copy link
Author

Hi @JavierLuna

Comment here so you'd see this issue.

@JavierLuna
Copy link
Contributor

Thank you for the valuable feedback, I'm working on it in inception-project/pycaprio#1

@reckart
Copy link

reckart commented Apr 18, 2021

I have tried reproducing this by exporting a document as WebAnno TSV 3.2 from (format identifier ctsv3) from the curation page and then using the Swagger API again to upload the curation document (again using format identifier ctsv3). It worked for me.

I'll comment on inception-project/pycaprio#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants