Datasaur
Search
⌃K

Custom API

We could also support custom API in case you want to use your own model, by telling us the API URL. All you need to do is making sure that the API complies to the request structure.
If you choose Custom, you can simply enter a custom API URL and load in any API of your own choice. You can see a Custom API sample preview by clicking the button beside the text field.

Set up your Custom API

  1. 1.
    Fill in custom API URL
  2. 2.
    You can find API request body and response sample beside API URL dialog
  3. 3.
    Click predict labels to apply labels to your document

Sample API Request Body

{
"id": "[project_id]",
"name": "[project_name]",
"documents": [
{
"id": "[document_id_1]",
"name": "[document_file_name_1]",
"sentences": [
{
"id": 0, // zero-based line number of the document
"text": "first message",
"metadata": []
},
{
"id": 1,
"text": "first message",
"metadata": []
},
]
}
]
}

Sample API Response

{
"id": "[project_id]",
"documents": [
{
"id": "[document_id_1]",
"labels": [
{
"id": 0,
"entities": [
{
"label": "LOCATION",
"start_char": 10,
"end_char": 18,
"layer": 0
},
{
"label": "PERSON",
"start_char": 20,
"end_char": 29,
"layer": 1
},
]
},
{
"id": 1,
"entities": []
}
]
}
]
}