doccano-client
doccano-client copied to clipboard
Is it possible to add annotations for a document directly to postgres?
I'm trying to add annotations to my sequence labelling and classifications project using post_doc_upload but this doesn't seem to be working as the data never appears in doccano? I have also tried to do this using the create_document method but this only creates documents and doesn't add any annotations.
I think it would be easier to upload the documents and then update the annotations in postgres. Which tables do i need to update?
How to reproduce the behaviour
instantiate a client and log in to a Doccano instance
doccano_client = DoccanoClient(
"https://doccano.test.com/", "admin", "password"
)
doccano_client.post_doc_upload(37, file_name='ner_file.jsonl', file_path=f'{local_base_path}outfile', format='json', column_data = "text", column_label = "labels",)
Test data looks like:
{"text": "ok test volume", "labels": [[3, 10, "search"]]}
{"text": "ok testing toggle only mode", "labels": [[3, 10, "screen"], [18, 27, "screen"]]}
Your Environment
- Operating System: MacOS Monterey 12.1
- Python Version: 3.8
- Package Version: 1.0.3