[docs]def create_project(body):
"""
Create a new project.
:table:Input parameters summary:
+-------------------------------------+----------+-------+--------------------------------------------------------+
| Field | Input | Type | Description |
+=====================================+==========+=======+========================================================+
| project_name | body | str | The name of the project |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| project_type | body | str | The type of the project |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| metadata | body | dict | The metadata of the project |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| company | body | str | The Id of the company |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| company_name | body | str | The name of the company |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| enable_text_mode_option | body | bool | Whether to enable the text mode option. |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| allow_new_label_input | body | bool | Whether to add new label in label list in task |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| annotator_full_list_mode | body | bool | Whether to display all tasks to annotation/review team |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| maximum_annotators_per_task | body | str | The maximum number of annotators per task |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| models | body | dict | Dictionary containing boolean values for each model |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| disable_auto_key_pairs | body | bool | Whether to disable auto key pairs |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| disable_reviewer_flow | body | bool | Whether to disable the reviewer flow |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| reviewer_may_request_adjustment | body | bool | Whether the reviewer may request adjustment |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| allow_table_mode | body | bool | Whether to allow table mode |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| use_keypair_dictionary | body | bool | Whether to use a keypair dictionary |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| dictionary_match_only_keys | body | bool | Whether to match only the keys in the |
| | | | dictionary |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| ignore_generic_key_pairs | body | bool | Whether to ignore generic key pairs |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| labels | body | dict | A dictionary containing a dictionary of label |
| | | | properties for each label |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| document_attributes | body | list | A list of dictionaries containing properties |
| | | | for each document attribute |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| has_attributes | body | list | Whether to display document attributes in task |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| page_attributes | body | list | A list of dictionaries containing properties for |
| | | | each page attribute |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| has_page_attributes | body | list | Whether to display page attributes in task |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| webhooks | body | dict | A dictionary containing webhooks for task and project |
| | | | updates. |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| checkboxes_set | body | list | A list of default checkboxes that are enabled |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| extract_tables_using_textract | body | bool | Whether to extract tables using Aws default |
+----------------------------+--------+----------+-------+--------------------------------------------------------+
|extract_key_pairs_using_textract | body | bool | Whether to extract key pairs using Aws default |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| allow_box_rotation | body | bool | Whether to allow to rotate bounding box in task |
+-------------------------------------+----------+-------+--------------------------------------------------------+
Sample Request Body
.. code-block:: python
from pprint import pprint
from tensoract.client import Tensoract
# Initialize Tensoract client
project_client = Tensoract(api_url="YOUR_API_URL",api_key="YOUR_API_KEY")
body={
"project_name": "Demo-OCR-Project",
"project_type": "NER"|"Comprehend NER"|"OCR"|"Classification"|"Media Transcription"|
"Bulk Image Classification"|"Object Detection"|,
"metadata": {
"Type of Project": "OCR"
},
"company": "60f38299446de8dabe9207e5",
"company_name": "Objectways",
"enable_text_mode_option": true,
"allow_new_label_input": true,
"annotator_full_list_mode": true,
"maximum_annotators_per_task": "1",
"models": {
"OCR TEST": false,
"OCR TEST2": false,
"MCR OCR Labeling": false,
"OCR-TEST-MODEL-2": false
},
"disable_auto_key_pairs": false,
"disable_reviewer_flow": false,
"reviewer_may_request_adjustment": true,
"allow_table_mode": true,
"use_keypair_dictionary": true,
"dictionary_match_only_keys": false,
"ignore_generic_key_pairs": false,
"labels": {
"PERSON ENTITY": {
"color": "#ff0000",
"keyset": true,
"alias": "",
"name": "PERSON ENTITY",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Person Entity",
"dictionary": ""
},
"ORGANIZATION ENTITY": {
"color": "#1900e5",
"keyset": true,
"alias": "",
"name": "ORGANIZATION ENTITY",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Organization Entity",
"dictionary": ""
},
"LOCATION ENITITY": {
"color": "#00cb33",
"keyset": true,
"alias": "",
"name": "LOCATION ENITITY",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Location Entity",
"dictionary": ""
},
"MISCELLANEOUS": {
"color": "#b24c00",
"keyset": true,
"alias": "",
"name": "MISCELLANEOUS",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Miscellaneous Entity",
"dictionary": ""
},
"OUTSIDE OF A NAMED ENTITY": {
"color": "#ff0000",
"keyset": false,
"alias": "",
"7d92a5d068c2e6800bd930c6": "Outside of a named entity",
"name": "OUTSIDE OF A NAMED ENTITY",
"dictionary": ""
}
},
"document_attributes": [
{
"optional": false,
"allowNew": false,
"options": [
"Yes",
"No"
],
"label": "Is Document damaged?"
}
],
"has_attributes": true,
"page_attributes": [
{
"optional": true,
"allowNew": false,
"options": [
"Yes ",
"No"
],
"label": "Is page damaged?"
}
],
"has_page_attributes": true,
"webhooks": {
"taskUpdate": "aaa",
"projectUpdate": "aaa"
},
"checkboxes_set": [
"texts",
"labels"
],
"extract_tables_using_textract": "awsdefault",
"extract_key_pairs_using_textract": "awsdefault",
"allow_box_rotation": true
}
pprint(project_client.create_project(body))
:table:Response summary:
+-------------------------------------+---------+----------------------------------------------------------------+
| Field | Type | Description |
+=====================================+=========+================================================================+
| project_id | str | The Id of the project |
+-------------------------------------+---------+----------------------------------------------------------------+
| project_name | str | The name of the project |
+-------------------------------------+---------+----------------------------------------------------------------+
| project_type | str | The type of the project |
+-------------------------------------+---------+----------------------------------------------------------------+
| metadata | dict | The metadata of the project |
+-------------------------------------+---------+----------------------------------------------------------------+
| company | str | The Id of the company |
+-------------------------------------+---------+----------------------------------------------------------------+
| company_name | str | The name of the company |
+-------------------------------------+---------+----------------------------------------------------------------+
| enable_text_mode_option | bool | Whether to enable the text mode option |
+-------------------------------------+---------+----------------------------------------------------------------+
| allow_new_label_input | bool | Whether to allow add new label in label list in task |
+-------------------------------------+---------+----------------------------------------------------------------+
| annotator_full_list_mode | bool | Whether to display all task to annotation/review team |
+-------------------------------------+---------+----------------------------------------------------------------+
| maximum_annotators_per_task | str | The maximum number of annotators per task |
+-------------------------------------+---------+----------------------------------------------------------------+
| models | dict | Dictionary containing boolean values for each model |
+-------------------------------------+---------+----------------------------------------------------------------+
| disable_auto_key_pairs | bool | Whether to disable auto key pairs |
+-------------------------------------+---------+----------------------------------------------------------------+
| disable_reviewer_flow | bool | Whether to disable the reviewer flow |
+-------------------------------------+---------+----------------------------------------------------------------+
| reviewer_may_request_adjustment | bool | Whether the reviewer may request adjustment |
+-------------------------------------+---------+----------------------------------------------------------------+
| allow_table_mode | bool | Whether to allow table mode |
+-------------------------------------+---------+----------------------------------------------------------------+
| use_keypair_dictionary | bool | Whether to use a keypair dictionary |
+-------------------------------------+---------+----------------------------------------------------------------+
| dictionary_match_only_keys | bool | Whether to match only the keys in the |
| | | dictionary |
+-------------------------------------+---------+----------------------------------------------------------------+
| ignore_generic_key_pairs | bool | Whether to ignore generic key pairs |
+-------------------------------------+---------+----------------------------------------------------------------+
| labels | dict | A dictionary containing a dictionary of label |
| | | properties for each label |
+-------------------------------------+---------+----------------------------------------------------------------+
| document_attributes | list | A list of dictionaries containing properties |
| | | for each document attribute |
+-------------------------------------+---------+----------------------------------------------------------------+
| has_attributes | bool | Whether to display document attributes in task |
+-------------------------------------+---------+----------------------------------------------------------------+
| page_attributes | list | A list of dictionaries containing properties for |
| | | each page attribute |
+-------------------------------------+---------+----------------------------------------------------------------+
| has_page_attributes | bool | Whether to display page attributes in task |
+-------------------------------------+---------+----------------------------------------------------------------+
| webhooks | dict | A dictionary containing webhooks for task and project |
| | | updates. |
+-------------------------------------+---------+----------------------------------------------------------------+
| checkboxes_set | list | A list of default checkboxes that are enabled |
+-------------------------------------+---------+----------------------------------------------------------------+
| status | str | The status of the operation |
+-------------------------------------+---------+----------------------------------------------------------------+
| extract_tables_using_textract | bool | Whether to extract tables using Aws default |
+-------------------------------------+---------+----------------------------------------------------------------+
| extract_key_pairs_using_textract | bool | Whether to extract key pairs using Aws default |
+-------------------------------------+---------+----------------------------------------------------------------+
| allow_box_rotation | bool | Whether to allow to rotate bounding box in task |
+-------------------------------------+---------+----------------------------------------------------------------+
Sample Response
.. code-block:: python
{
"project_id": "4681c74ed5b88f0461b79ba4",
"project_name": "Demo-OCR-Project",
"project_type": "OCR",
"metadata": {
"Type of Project": "OCR"
},
"company": "60f38299446de8dabe9207e5",
"enable_text_mode_option": true,
"allow_new_label_input": true,
"annotator_full_list_mode": true,
"maximum_annotators_per_task": 1,
"models": {
"OCR TEST": false,
"OCR TEST2": false,
"MCR OCR Labeling": false,
"OCR-TEST-MODEL-2": false
},
"disable_auto_key_pairs": false,
"disable_reviewer_flow": false,
"reviewer_may_request_adjustment": true,
"allow_table_mode": true,
"use_keypair_dictionary": true,
"dictionary_match_only_keys": false,
"ignore_generic_key_pairs": false,
"labels": {
"PERSON ENTITY": {
"color": "#ff0000",
"keyset": true,
"alias": "",
"name": "PERSON ENTITY",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Person Entity",
"dictionary": ""
},
"ORGANIZATION ENTITY": {
"color": "#1900e5",
"keyset": true,
"alias": "",
"name": "ORGANIZATION ENTITY",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Organization Entity",
"dictionary": ""
},
"LOCATION ENITITY": {
"color": "#00cb33",
"keyset": true,
"alias": "",
"name": "LOCATION ENITITY",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Location Entity",
"dictionary": ""
},
"MISCELLANEOUS": {
"color": "#b24c00",
"keyset": true,
"alias": "",
"name": "MISCELLANEOUS",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Miscellaneous Entity",
"dictionary": ""
},
"OUTSIDE OF A NAMED ENTITY": {
"color": "#ff0000",
"keyset": false,
"alias": "",
"7d92a5d068c2e6800bd930c6": "Outside of a named entity",
"name": "OUTSIDE OF A NAMED ENTITY",
"dictionary": ""
}
},
"document_attributes": [
{
"optional": false,
"allowNew": false,
"options": [
"Yes",
"No"
],
"label": "Is Document damaged?"
}
],
"has_attributes": true,
"page_attributes": [
{
"optional": true,
"allowNew": false,
"options": [
"Yes ",
"No"
],
"label": "Is page damaged?"
}
],
"has_page_attributes": true,
"webhooks": {
"taskUpdate": "aaa",
"projectUpdate": "aaa"
},
"checkboxes_set": [
"texts",
"labels"
],
"status": "success",
"extract_tables_using_textract": "awsdefault",
"extract_key_pairs_using_textract": "awsdefault",
"allow_box_rotation": true
}
"""
[docs]def get_project(project_id):
"""
Get project by project_id.
:table:Input parameters summary:
+--------------+----------+-------+--------------------------------------------------+
| Field | Input | Type | Description |
+==============+==========+=======+==================================================+
| project_id | body | str | The Id of the project |
+--------------+----------+-------+--------------------------------------------------+
Sample Request Body
.. code-block:: python
from pprint import pprint
from tensoract.client import Tensoract
# Initialize Tensoract client
project_client = Tensoract(api_url="YOUR_API_URL",api_key="YOUR_API_KEY")
body= {
from pprint import pprint
from tensoract.client import Tensoract
# Initialize Tensoract client
project_client = Tensoract(api_url="YOUR_API_URL",api_key="YOUR_API_KEY")
# Invoke get_project method
response = project_client.get_project(project_id="e991e58460c0769015cb4a0f")
}
pprint(response)
:table:Response summary:
+-------------------------------------+---------+----------------------------------------------------------------+
| Field | Type | Description |
+=====================================+=========+================================================================+
| project_id | str | The Id of the project |
+-------------------------------------+---------+----------------------------------------------------------------+
| project_name | str | The name of the project |
+-------------------------------------+---------+----------------------------------------------------------------+
| project_type | str | The type of the project |
+-------------------------------------+---------+----------------------------------------------------------------+
| metadata | dict | The metadata of the project |
+-------------------------------------+---------+----------------------------------------------------------------+
| company | str | The Id of the company |
+-------------------------------------+---------+----------------------------------------------------------------+
| company_name | str | The name of the company |
+-------------------------------------+---------+----------------------------------------------------------------+
| enable_text_mode_option | bool | Whether to enable the text mode option |
+-------------------------------------+---------+----------------------------------------------------------------+
| allow_new_label_input | bool | Whether to allow add new label in label list in task |
+-------------------------------------+---------+----------------------------------------------------------------+
| annotator_full_list_mode | bool | Whether to display all task to annotation/review team |
+-------------------------------------+---------+----------------------------------------------------------------+
| maximum_annotators_per_task | str | The maximum number of annotators per task |
+-------------------------------------+---------+----------------------------------------------------------------+
| models | dict | Dictionary containing boolean values for each model |
+-------------------------------------+---------+----------------------------------------------------------------+
| disable_auto_key_pairs | bool | Whether to disable auto key pairs |
+-------------------------------------+---------+----------------------------------------------------------------+
| disable_reviewer_flow | bool | Whether to disable the reviewer flow |
+-------------------------------------+---------+----------------------------------------------------------------+
| reviewer_may_request_adjustment | bool | Whether the reviewer may request adjustment |
+-------------------------------------+---------+----------------------------------------------------------------+
| allow_table_mode | bool | Whether to allow table mode |
+-------------------------------------+---------+----------------------------------------------------------------+
| use_keypair_dictionary | bool | Whether to use a keypair dictionary |
+-------------------------------------+---------+----------------------------------------------------------------+
| dictionary_match_only_keys | bool | Whether to match only the keys in the |
| | | dictionary |
+-------------------------------------+---------+----------------------------------------------------------------+
| ignore_generic_key_pairs | bool | Whether to ignore generic key pairs |
+-------------------------------------+---------+----------------------------------------------------------------+
| labels | dict | A dictionary containing a dictionary of label |
| | | properties for each label |
+-------------------------------------+---------+----------------------------------------------------------------+
| document_attributes | list | A list of dictionaries containing properties |
| | | for each document attribute |
+-------------------------------------+---------+----------------------------------------------------------------+
| has_attributes | bool | Whether to display document attributes in task |
+-------------------------------------+---------+----------------------------------------------------------------+
| page_attributes | list | A list of dictionaries containing properties for |
| | | each page attribute |
+-------------------------------------+---------+----------------------------------------------------------------+
| has_page_attributes | bool | Whether to display page attributes in task |
+-------------------------------------+---------+----------------------------------------------------------------+
| webhooks | dict | A dictionary containing webhooks for task and project |
| | | updates. |
+-------------------------------------+---------+----------------------------------------------------------------+
| checkboxes_set | list | A list of default checkboxes that are enabled |
+-------------------------------------+---------+----------------------------------------------------------------+
| extract_tables_using_textract | bool | Whether to extract tables using Aws default |
+----------------------------+--------+---------+----------------------------------------------------------------+
| extract_key_pairs_using_textract | bool | Whether to extract key pairs using Aws default |
+-------------------------------------+---------+----------------------------------------------------------------+
| allow_box_rotation | bool | Whether to allow to rotate bounding box in task |
+-------------------------------------+---------+----------------------------------------------------------------+
Sample Response
.. code-block:: python
{
"project_id": "e991e58460c0769015cb4a0f",
"project_name": "Demo-OCR-Project",
"project_type": "OCR",
"metadata": {
"Type of Project": "OCR"
},
"company": "60f38299446de8dabe9207e5",
"company_name": "Objectways",
"enable_text_mode_option": false,
"allow_new_label_input": true,
"annotator_full_list_mode": true,
"maximum_annotators_per_task": 1,
"models": {
"OCR TEST": false,
"OCR TEST2": false,
"MCR OCR Labeling": false,
"OCR-TEST-MODEL-2": false
},
"disable_auto_key_pairs": false,
"disable_reviewer_flow": false,
"reviewer_may_request_adjustment": true,
"allow_table_mode": true,
"use_keypair_dictionary": true,
"dictionary_match_only_keys": false,
"ignore_generic_key_pairs": false,
"labels": {
"PERSON ENTITY": {
"color": "#ff0000",
"keyset": true,
"alias": "",
"name": "PERSON ENTITY",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Person Entity",
"dictionary": ""
},
"ORGANIZATION ENTITY": {
"color": "#1900e5",
"keyset": true,
"alias": "",
"name": "ORGANIZATION ENTITY",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Organization Entity",
"dictionary": ""
},
"LOCATION ENITITY": {
"color": "#00cb33",
"keyset": true,
"alias": "",
"name": "LOCATION ENITITY",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Location Entity",
"dictionary": ""
},
"MISCELLANEOUS": {
"color": "#b24c00",
"keyset": true,
"alias": "",
"name": "MISCELLANEOUS",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Miscellaneous Entity",
"dictionary": ""
},
"OUTSIDE OF A NAMED ENTITY": {
"color": "#ff0000",
"keyset": false,
"alias": "",
"7d92a5d068c2e6800bd930c6": "Outside of a named entity",
"name": "OUTSIDE OF A NAMED ENTITY",
"dictionary": ""
}
},
"document_attributes": [
{
"optional": false,
"allowNew": false,
"options": [
"Yes",
"No"
],
"label": "Is Document damaged?"
}
],
"has_attributes": true,
"page_attributes": [
{
"optional": true,
"allowNew": false,
"options": [
"Yes ",
"No"
],
"label": "Is page damaged?"
}
],
"has_page_attributes": true,
"webhooks": {
"taskUpdate": "aaa",
"projectUpdate": "aaa"
},
"checkboxes_set": [
"texts",
"labels"
],
"extract_tables_using_textract": "awsdefault",
"extract_key_pairs_using_textract": "awsdefault",
"allow_box_rotation": true
}
"""
[docs]def update_project(project_id,body):
"""
Update Project.
:table:Input parameters summary:
+-------------------------------------+----------+-------+--------------------------------------------------------+
| Field | Input | Type | Description |
+=====================================+==========+=======+========================================================+
| project_id | body | str | The Id of the project |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| project_name | body | str | The name of the project |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| project_type | body | str | The type of the project |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| metadata | body | dict | The metadata of the project |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| company | body | str | The Id of the company |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| company_name | body | str | The name of the company |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| enable_text_mode_option | body | bool | Whether to enable the text mode option. |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| allow_new_label_input | body | bool | Whether to allow add new label in label list in task |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| annotator_full_list_mode | body | bool | Whether to display all tasks to annotation/review team |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| maximum_annotators_per_task | body | str | The maximum number of annotators per task |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| models | body | dict | dictionary containing boolean values for each model |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| disable_auto_key_pairs | body | bool | Whether to disable auto key pairs |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| disable_reviewer_flow | body | bool Whether to disable the reviewer flow |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| reviewer_may_request_adjustment | body | bool | Whether the reviewer may request adjustment |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| allow_table_mode | body | bool | Whether to allow table mode |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| use_keypair_dictionary | body | bool | Whether to use a keypair dictionary |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| dictionary_match_only_keys | body | bool | Whether to match only the keys in the |
| | | | dictionary |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| ignore_generic_key_pairs | body | bool | Whether to ignore generic key pairs |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| labels | body | dict | A dictionary containing a dictionary of label |
| | | | properties for each label |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| document_attributes | body | list | A list of dictionaries containing properties |
| | | | for each document attribute |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| has_attributes | body | list | Whether to display document attributes in task |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| page_attributes | body | list | A list of dictionaries containing properties for |
| | | | each page attribute |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| has_page_attributes | body | list | Whether to display page attributes in task |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| webhooks | body | dict | A dictionary containing webhooks for task and project |
| | | | updates. |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| checkboxes_set | body | list | A list of default checkboxes that are enabled |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| extract_tables_using_textract | body | bool | Whether to extract tables using Aws default |
+-------------------------------------+----------+-------+--------------------------------------------------------+
|extract_key_pairs_using_textract | body | bool | Whether to extract key pairs using Aws default |
+-------------------------------------+----------+-------+--------------------------------------------------------+
| allow_box_rotation | body | bool | Whether to allow to rotate bounding box in task |
+-------------------------------------+----------+-------+--------------------------------------------------------+
Sample Request Body
.. code-block:: python
from pprint import pprint
from tensoract.client import Tensoract
# Initialize Tensoract client
project_client = Tensoract(api_url="YOUR_API_URL",api_key="YOUR_API_KEY")
# Set the JSON config in body
body ={
"project_id": "4681c74ed5b88f0461b79ba4",
"project_name": "Demo-OCR-Project",
"project_type": "OCR",
"metadata": {
"Type of Project": "OCR"
},
"company": "60f38299446de8dabe9207e5",
"enable_text_mode_option": false,
"allow_new_label_input": true,
"annotator_full_list_mode": true,
"maximum_annotators_per_task": 1,
"models": {
"OCR TEST": false,
"OCR TEST2": false,
"MCR OCR Labeling": false,
"OCR-TEST-MODEL-2": false
},
"disable_auto_key_pairs": false,
"disable_reviewer_flow": false,
"reviewer_may_request_adjustment": true,
"allow_table_mode": true,
"use_keypair_dictionary": true,
"dictionary_match_only_keys": false,
"ignore_generic_key_pairs": false,
"labels": {
"PERSON ENTITY": {
"color": "#ff0000",
"keyset": true,
"alias": "",
"name": "PERSON ENTITY",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Person Entity",
"dictionary": ""
},
"ORGANIZATION ENTITY": {
"color": "#1900e5",
"keyset": true,
"alias": "",
"name": "ORGANIZATION ENTITY",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Organization Entity",
"dictionary": ""
},
"LOCATION ENITITY": {
"color": "#00cb33",
"keyset": true,
"alias": "",
"name": "LOCATION ENITITY",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Location Entity",
"dictionary": ""
},
"MISCELLANEOUS": {
"color": "#b24c00",
"keyset": true,
"alias": "",
"name": "MISCELLANEOUS",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Miscellaneous Entity",
"dictionary": ""
},
"OUTSIDE OF A NAMED ENTITY": {
"color": "#ff0000",
"keyset": false,
"alias": "",
"7d92a5d068c2e6800bd930c6": "Outside of a named entity",
"name": "OUTSIDE OF A NAMED ENTITY",
"dictionary": ""
}
},
"document_attributes": [
{
"optional": false,
"allowNew": false,
"options": [
"Yes",
"No"
],
"label": "Is Document damaged?"
}
],
"has_attributes": true,
"page_attributes": [
{
"optional": true,
"allowNew": false,
"options": [
"Yes ",
"No"
],
"label": "Is page damaged?"
}
],
"has_page_attributes": true,
"webhooks": {
"taskUpdate": "aaa",
"projectUpdate": "aaa"
},
"checkboxes_set": [
"texts",
"labels"
],
"extract_tables_using_textract": "awsdefault",
"extract_key_pairs_using_textract": "awsdefault",
"allow_box_rotation": true
}
# Invoke update_project method
response = project_client.update_project(project_id="e991e58460c0769015cb4a0f",body=body)
pprint(response)
:table:Response summary:
+-------------------------------------+---------+----------------------------------------------------------------+
| Field | Type | Description |
+=====================================+=========+================================================================+
| project_id | str | The Id of the project |
+-------------------------------------+---------+----------------------------------------------------------------+
| project_name | str | The name of the project |
+-------------------------------------+---------+----------------------------------------------------------------+
| project_type | str | The type of the project |
+-------------------------------------+---------+----------------------------------------------------------------+
| metadata | dict | The metadata of the project |
+-------------------------------------+---------+----------------------------------------------------------------+
| company | str | The Id of the company |
+-------------------------------------+---------+----------------------------------------------------------------+
| company_name | str | The name of the company |
+-------------------------------------+---------+----------------------------------------------------------------+
| enable_text_mode_option | bool | Whether to enable the text mode option |
+-------------------------------------+---------+----------------------------------------------------------------+
| allow_new_label_input | bool | Whether to allow add new label in label list in task |
+-------------------------------------+---------+----------------------------------------------------------------+
| annotator_full_list_mode | bool | Whether to display all task to annotation/review team |
+-------------------------------------+---------+----------------------------------------------------------------+
| maximum_annotators_per_task | str | The maximum number of annotators per task |
+-------------------------------------+---------+----------------------------------------------------------------+
| models | dict | Dictionary containing boolean values for each model |
+-------------------------------------+---------+----------------------------------------------------------------+
| disable_auto_key_pairs | bool | Whether to disable auto key pairs |
+-------------------------------------+---------+----------------------------------------------------------------+
| disable_reviewer_flow | bool | Whether to disable the reviewer flow |
+-------------------------------------+---------+----------------------------------------------------------------+
| reviewer_may_request_adjustment | bool | Whether the reviewer may request adjustment |
+-------------------------------------+---------+----------------------------------------------------------------+
| allow_table_mode | bool | Whether to allow table mode |
+-------------------------------------+---------+----------------------------------------------------------------+
| use_keypair_dictionary | bool | Whether to use a keypair dictionary |
+-------------------------------------+---------+----------------------------------------------------------------+
| dictionary_match_only_keys | bool | Whether to match only the keys in the |
| | | dictionary |
+-------------------------------------+---------+----------------------------------------------------------------+
| ignore_generic_key_pairs | bool | Whether to ignore generic key pairs |
+-------------------------------------+---------+----------------------------------------------------------------+
| labels | dict | A dictionary containing a dictionary of label |
| | | properties for each label |
+-------------------------------------+---------+----------------------------------------------------------------+
| document_attributes | list | A list of dictionaries containing properties |
| | | for each document attribute |
+-------------------------------------+---------+----------------------------------------------------------------+
| has_attributes | bool | Whether to display document attributes in task |
+-------------------------------------+---------+----------------------------------------------------------------+
| page_attributes | list | A list of dictionaries containing properties for |
| | | each page attribute |
+-------------------------------------+---------+----------------------------------------------------------------+
| has_page_attributes | bool | Whether to display page attributes in task |
+-------------------------------------+---------+----------------------------------------------------------------+
| webhooks | dict | A dictionary containing webhooks for task and project |
| | | updates. |
+-------------------------------------+---------+----------------------------------------------------------------+
| checkboxes_set | list | A list of default checkboxes that are enabled |
+-------------------------------------+---------+----------------------------------------------------------------+
| extract_tables_using_textract | bool | Whether to extract tables using Aws default |
+----------------------------+--------+---------+----------------------------------------------------------------+
| extract_key_pairs_using_textract | bool | Whether to extract key pairs using Aws default |
+-------------------------------------+---------+----------------------------------------------------------------+
| allow_box_rotation | bool | Whether to allow to rotate bounding box in task |
+-------------------------------------+---------+----------------------------------------------------------------+
Sample Response
.. code-block:: python
{
"project_id": "e991e58460c0769015cb4a0f",
"project_name": "Demo-OCR-Project",
"project_type": "OCR",
"metadata": {
"Type of Project": "OCR"
},
"company": "60f38299446de8dabe9207e5",
"enable_text_mode_option": false,
"allow_new_label_input": true,
"annotator_full_list_mode": true,
"maximum_annotators_per_task": 1,
"models": {
"OCR TEST": false,
"OCR TEST2": false,
"MCR OCR Labeling": false,
"OCR-TEST-MODEL-2": false
},
"disable_auto_key_pairs": false,
"disable_reviewer_flow": false,
"reviewer_may_request_adjustment": true,
"allow_table_mode": true,
"use_keypair_dictionary": true,
"dictionary_match_only_keys": false,
"ignore_generic_key_pairs": false,
"labels": {
"PERSON ENTITY": {
"color": "#ff0000",
"keyset": true,
"alias": "",
"name": "PERSON ENTITY",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Person Entity",
"dictionary": ""
},
"ORGANIZATION ENTITY": {
"color": "#1900e5",
"keyset": true,
"alias": "",
"name": "ORGANIZATION ENTITY",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Organization Entity",
"dictionary": ""
},
"LOCATION ENITITY": {
"color": "#00cb33",
"keyset": true,
"alias": "",
"name": "LOCATION ENITITY",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Location Entity",
"dictionary": ""
},
"MISCELLANEOUS": {
"color": "#b24c00",
"keyset": true,
"alias": "",
"name": "MISCELLANEOUS",
"cec9093b59a112014ce1f561": "",
"7d92a5d068c2e6800bd930c6": "Miscellaneous Entity",
"dictionary": ""
},
"OUTSIDE OF A NAMED ENTITY": {
"color": "#ff0000",
"keyset": false,
"alias": "",
"7d92a5d068c2e6800bd930c6": "Outside of a named entity",
"name": "OUTSIDE OF A NAMED ENTITY",
"dictionary": ""
}
},
"document_attributes": [
{
"optional": false,
"allowNew": false,
"options": [
"Yes",
"No"
],
"label": "Is Document damaged?"
}
],
"has_attributes": true,
"page_attributes": [
{
"optional": true,
"allowNew": false,
"options": [
"Yes ",
"No"
],
"label": "Is page damaged?"
}
],
"has_page_attributes": true,
"webhooks": {
"taskUpdate": "aaa",
"projectUpdate": "aaa"
},
"checkboxes_set": [
"texts",
"labels"
],
"extract_tables_using_textract": "awsdefault",
"extract_key_pairs_using_textract": "awsdefault",
"allow_box_rotation": true
}
"""
[docs]def delete_project(project_id):
"""
Delete Project.
:table:Input parameters summary:
+--------------+----------+-------+--------------------------------------------------+
| Field | Input | Type | Description |
+==============+==========+=======+==================================================+
| Project_id | body | str | The Id of the project |
+--------------+----------+-------+--------------------------------------------------+
Sample Request Body
.. code-block:: python
from pprint import pprint
from tensoract.client import Tensoract
# Initialize Tensoract client
project_client = Tensoract(api_url="YOUR_API_URL",api_key="YOUR_API_KEY")
# Invoke delete_project method
response = project_client.delete_project(project_id="8bc05ec26ab161e218a0e842")
pprint(response)
:table:Response summary:
+------------+------------------+---------------------------------------------------------------+
| Field | Type | Description |
+============+==================+===============================================================+
| status | str | The status of the operation |
+------------+------------------+---------------------------------------------------------------+
| message | str | A message about the delete status of item |
+------------+------------------+---------------------------------------------------------------+
Sample Response
.. code-block:: python
{
"status": "success",
"message": "project deleted"
}
"""
[docs]def get_projects(project_id,project_name,active):
"""
Get Projects.
:table:Input parameters summary:
+----------------+-------+-------+-----------------------------------------------+
| Field | Input | Type | Description |
+================+=======+=======+=======+=======================================+
| project_id | body | str |The Id of the project |
+----------------+-------+-------+-------+---------------------------------------+
| project_name | body | str |The name of the project |
+----------------+-------+-------+-----------------------------------------------+
| active | body | bool | Whether to filter project by active status |
+----------------+-------+-------+-----------------------------------------------+
Sample Request Body
.. code-block:: python
from pprint import pprint
from tensoract.client import Tensoract
# Initialize Tensoract client
project_client = Tensoract(api_url="YOUR_API_URL",api_key="YOUR_API_KEY")
# Invoke get_projects method
response = project_client.get_projects(project_id=None,project_name="OCR-API",active=True)
pprint(response)
:table:Response summary:
+------------------------+-------+-------------------------------------------------------------------------------+
| Field | Type | Description |
+========================+=======+=======+=======================================================================+
| project_id | str | The Id of the project |
+------------------------+-------+-------------------------------------------------------------------------------+
| project_name | str | The name of the project |
+------------------------+-------+-------------------------------------------------------------------------------+
| project_type | str | The type of the project |
+------------------------+-------+-------------------------------------------------------------------------------+
| company | str | The Id of the company |
+------------------------+-------+-------------------------------------------------------------------------------+
| company_name | str | The name of the company |
+------------------------+-------+-------------------------------------------------------------------------------+
Sample Response
.. code-block:: python
[
{
"project_id": "e991e58460c0769015cb4a0f",
"project_name": "Demo-OCR-Project",
"project_type": "OCR",
"company": "60f38299446de8dabe9207e5",
"company_name": "Objectways"
}
]
"""