[docs]def add_bulk_tasks(body):
"""
Add bulk tasks to a project.
:table:Input parameters summary:
+--------------+----------+-------+------------------------------------------------------+
| Field | Input | Type | Description |
+==============+==========+=======+======================================================+
| project_id | body | str |The Id of the project to add the item to |
+--------------+----------+-------+------------------------------------------------------+
| note | body | str |A note about the bulk tasks |
+--------------+----------+-------+------------------------------------------------------+
| dataset_items| body | str |A list of dataset item Ids to add to project |
+--------------+----------+-------+------------------------------------------------------+
Sample Request Body
.. code-block:: python
from pprint import pprint
from tensoract.client import Tensoract
# Initialize Tensoract client
task_client = Tensoract(api_url="YOUR_API_URL",api_key="YOUR_API_KEY")
body= {
"project_id": "a28aedc450e845523d4bfa10",
"note": "test note",
"dataset_items": [
"15542b60229da3f94f82d1a2",
"09f5dd6f24b057615f9c583c",
"e8cbb47f599c99b28a5d3466"
]
}
pprint(task_client.add_bulk_tasks(body))
:table:Response summary:
+---------+---------------------------------+
| Field | Description |
+=========+=================================+
| status | The status of the operation |
+---------+---------------------------------+
| value | Count of task added to project |
+---------+---------------------------------+
| task_ids| An array of task_ids |
+---------+---------------------------------+
Sample Response
.. code-block:: python
{
"status": "success",
"value": "2 item(s) added to project",
"task_ids": [
"aa7b5455f31a2910e9e41e12",
"6dae0d4817c9b9b1985e2a0a"
]
}
"""
[docs]def add_task(body):
"""
Add a single task item to a project.
:table:Input parameters summary:
+--------------+----------+-------+------------------------------------------------------+
| Field | Input | Type | Description |
+==============+==========+=======+======================================================+
| project_id | body | str |The Id of the project to add the item to. |
+--------------+----------+-------+------------------------------------------------------+
| item_id | body | str | The Id dataset item to add in project |
+--------------+----------+-------+------------------------------------------------------+
Sample Request Body
.. code-block:: python
from pprint import pprint
from tensoract.client import Tensoract
# Initialize Tensoract client
task_client = Tensoract(api_url="YOUR_API_URL",api_key="YOUR_API_KEY")
body= {
"project_id": "179cd15e334f9a63e2a9632a",
"item_id": "5835e22985bb0ca47a9fa96e"
}
pprint(task_client.add_task(body))
:table:Response summary:
+---------+---------------------------------+
| Field | Description |
+=========+=================================+
| status | The status of the operation |
+---------+---------------------------------+
| value | Count of task added to project |
+---------+---------------------------------+
| task_ids| An array of task_ids |
+---------+---------------------------------+
Sample Response
.. code-block:: python
{
"status": "success",
"value": "1 item(s) added to project",
"task_ids": [
"c1b160d50814fdf190eb12fc"
]
}
"""
[docs]def add_labels_to_task(task_id,body):
"""
Add labels to a task.
:table:Input parameters summary:
+------------------+------+-------+-------------------------------------------------------------------+
| Field |Input | Type | Description |
+==================+======+=======+===================================================================+
| task_id | body | str |The Id of the task to add labels |
+------------------+------+-------+-------------------------------------------------------------------+
| annotations | body | list | A list of dictionaries representing the annotations. Each |
| | | | dictionary contains the content of the annotation, such as |
| | | | tags, metadata, attributes, and pageAttributes. |
+------------------+------+-------+-------------------------------------------------------------------+
| Content | body | dict | A dict of containing pdf_fingerprint and metadata |
+------------------+------+-------+-------------------------------------------------------------------+
| tags | body | list | A list of dictionaries containing the tags to be added to task |
+------------------+------+-------+-------------------------------------------------------------------+
| pageOffsets | body | list | A list of page offsets |
+------------------+------+-------+-------------------------------------------------------------------+
| attributes | body | dict | A dictionary containing properties for each document attribute |
+------------------+------+-------+-------------------------------------------------------------------+
| pageAttributes | body | list | A list of dictionaries containing the attributes for each page |
+------------------+------+-------+-------------------------------------------------------------------+
Sample Request Body
.. code-block:: python
from pprint import pprint
from tensoract.client import Tensoract
# Initialize Tensoract client
task_client = Tensoract(api_url="YOUR_API_URL",api_key="YOUR_API_KEY")
task_id = "4d572fef4ec4bc9d86bd7b2f"
body = {
"annotations": [
{
"content": {
"pdf_fingerprint": "4ea5f2833097c04cc8d46bfffc7e4965",
"metadata": {
"File": "AVVISO DI GARA - TAG.PDF",
"TaskId": "3d57d3bd96d6f64bf6892828"
},
"tags": [
{
"page": 1,
"range": [
0,
17
],
"text": "REGIONE SICILIANA",
"id": 1,
"type": "aaaa",
"box": [
0.3741068447412354,
0.08150904704463213,
0.658875859766277,
0.09719059107358263
]
}
],
"pageOffsets": [
0,
1061
],
"attributes": {
"Doc Ok?": "Yes"
},
"pageAttributes": [
{
"Page OK?": "Yes"
}
]
}
}
]}
pprint(task_client.add_labels_to_task(task_id=task_id,body=body))
:table:Response summary:
+----------------+-----------------+-----------------------------------------------------------------+
| Field | Type | Description |
+================+=================+=================================================================+
| Task | str | Id of the task in which labels are added |
+----------------+-----------------+-----------------------------------------------------------------+
Sample Response
.. code-block:: python
{'task_id': '4d572fef4ec4bc9d86bd7b2f'}
"""
[docs]def get_task(task_id,trail):
"""
Get task by task_id and trail.
:table:Input parameters summary:
+------------------+------+-------+------------------------------------------------------------------+
| Field |Input | Type | Description |
+==================+======+=======+==================================================================+
| task_id | body | str |The Id of the task |
+------------------+------+-------+------------------------------------------------------------------+
| trail | body | bool |Whether to allow trail |
+------------------+------+-------+------------------------------------------------------------------+
Sample Request Body
.. code-block:: python
from pprint import pprint
from tensoract.client import Tensoract
# Initialize Tensoract client
task_client = Tensoract(api_url="YOUR_API_URL",api_key="YOUR_API_KEY")
data = task_client.get_task(task_id="449354de1168469a8229f605",trail= False)
pprint(data)
: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 project |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| dataset_id | str | The Id of the dataset |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| task_id | str | The Id of the task |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| item_id | str | The Id of the dataset item |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| file_name | str | The name of file |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| file_type | str | The type of file |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| source | str | Internal source file reference on local storage disk |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| metadata | dict | A dictionary containing metadat of task |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| annotations | list | A list of dictionaries representing the annotations. |
| | | Each dictionary contains the content of the annotation, |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| Content | dict | A dict of containing pdf_fingerprint and metadata |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| tags | list | A list of dictionaries containing the tags added in task |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| links | list | A list containing the relationships added in task |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| pageOffsets | list | A list of page offsets |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| attributes | dict | A dictionary containing properties for each document attribute |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| pageAttributes | list | A list of dictionaries containing the attributes for each page |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| tables | dict | A list of dictionaries containing the details of table |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| plain_text | dict | A dictionary containing key-value pairs of page numbers and the |
| | | corresponding plain text extracted from the file. |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| dimension | str |A list of dictionaries containing diemnsions of pages in task |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| annotator_id | str | The Id of Annotator |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| state | str | Status of task |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| comprehend_blocks_source | str | OCR blocks from Amazon Textract or pdf plumber depending |
| | | on the OCR settings |
+---------------------------------+-------+--------------------------------------------------------------------------------+
| labels | str | Count of labels and relationships added in task |
+---------------------------------+-------+--------------------------------------------------------------------------------+
**Tags:** Tags are atomic representations of labels in the context of data annotation. It is an array of Tag objects that contains the following:
.. code-block:: python
{
"page": number,
"text": "string",
"id": number,
"type": "string:KEY/VAL",
"words": [ "string" ],
"boxes": [
[
<Left float>,
<Top float>,
<Right float>,
<Bottom float>
]
],
"range": [
[
number,
number
]
]
} ,
{
"page": number,
"text": "string",
"id": number,
"type": "string:KEY/VAL",
"textAdjust": "string",
"words": [ "string" ],
"boxes": [
[
<Left float>,
<Top float>,
<Right float>,
<Bottom float>
]
],
"range": [
[
number,
number
]
]
},
{
"page": number,
"text": "string",
"id": number,
"type": "string:KEY/VAL",
"rawBox": boolean,
"words": [ "string" ],
"boxes": [
[
<Left float>,
<Top float>,
<Right float>,
<Bottom float>
]
],
"range": []
}
{
"page": number,
"text": "string",
"id": number,
"type": "string:KEY/VAL",
"rotate": number,
"rawBox": boolean,
"words": [ "string" ],
"boxes": [
[
<Left float>,
<Top float>,
<Right float>,
<Bottom float>
]
],
"range": []
},
{
"page": number,
"text": "string",
"id": number,
"type": "string:KEY/VAL",
"table": {
"id": number,
"x": number,
"y": number,
"cell": boolean
},
"words": [ "string" ],
"boxes": [
[
<Left float>,
<Top float>,
<Right float>,
<Bottom float>
]
],
"range": [
[
number,
number
]
]
}
:table:Tag Response summary:
+---------------------+-----------------------+----------------------------------------------------+
| Field | Type | Description |
+=====================+=======================+====================================================+
| tags | list | A list of dictionaries containing the annotated |
| | | tags |
+---------------------+-----------------------+----------------------------------------------------+
| pages | int | Page number of selected text |
+---------------------+-----------------------+----------------------------------------------------+
| text | str | The selected text for annotation |
+---------------------+-----------------------+----------------------------------------------------+
| id | int | The ID of selected text for annotation |
+---------------------+-----------------------+----------------------------------------------------+
| type | str | The type of the label to indicate whether tag |
| | | is key or value (KEY/VAL) |
+---------------------+-----------------------+----------------------------------------------------+
| words | list | The words in the selected text |
+---------------------+-----------------------+----------------------------------------------------+
| boxes | list | List of bounding box coordinates for OCRed words |
+---------------------+-----------------------+----------------------------------------------------+
| range | list | List of selected text box start offset and end |
| | | offset using plaintext |
+---------------------+-----------------------+----------------------------------------------------+
| textAdjust | str | Modified OCRed text |
+---------------------+-----------------------+----------------------------------------------------+
| rawbox | bool | Flag to indicate if bounding box is created |
| | | manually |
+---------------------+-----------------------+----------------------------------------------------+
| rotate | int | The rotation information of bounding box |
+---------------------+-----------------------+----------------------------------------------------+
| table | list | The table information |
+---------------------+-----------------------+----------------------------------------------------+
| id | int | The ID of the table |
+---------------------+-----------------------+----------------------------------------------------+
| x | number | The vertical grid coordinates |
+---------------------+-----------------------+----------------------------------------------------+
| y | number | The horiziontal grid coordinates |
+---------------------+-----------------------+----------------------------------------------------+
| cell | bool | Flag to indicate if the current object is a cell |
| | | of the table |
+---------------------+-----------------------+----------------------------------------------------+
**Links:** represent the relationship between the Keys and the Values.
.. code-block:: python
[
{
"page": number
"id1": number,
"id2": number,
"relationship": "key-pair"
},
{
"page": number
"id1": number,
"id2": number,
"relationship": "key-pair"
}
]
:table:Link Response summary:
+---------------------+-----------------------+-----------------------------------------------------+
| Field | Type | Description |
+=====================+=======================+=====================================================+
| link | list | A list containing the relationships added in |
| | | the task |
+---------------------+-----------------------+-----------------------------------------------------+
| id1 | int | The Id of the key field |
+---------------------+-----------------------+-----------------------------------------------------+
| id2 | int | The Id of the value field |
+---------------------+-----------------------+-----------------------------------------------------+
| relationship | string | The name of the relationship |
+---------------------+-----------------------+-----------------------------------------------------+
**Table** : contains the details of annotated tables.
.. code-block:: python
"tables": [
{
"x": [
float,
float,
float,
float,
float
],
"y": [
float,
float,
float
],
"rows": number,
"cols": number,
"box": [
float,
float,
float,
float
],
"id": number,
"page": number,
"description": "string"
}
]
:table:Table Response summary:
+----------------------+-----------------------+----------------------------------------------------+
| Field | Type | Description |
+======================+=======================+====================================================+
| tables | list | A list of dictionaries containing table |
| | | information |
+----------------------+-----------------------+----------------------------------------------------+
| x | list | The vertical grid coordinates |
+----------------------+-----------------------+----------------------------------------------------+
| y | list | The horiziontal grid coordinates |
+----------------------+-----------------------+----------------------------------------------------+
| rows | int | The number of rows in the table |
+----------------------+-----------------------+----------------------------------------------------+
| cols | int | The number of columns in the table |
+----------------------+-----------------------+----------------------------------------------------+
| box | list | list of bounding box coordinates for OCRed words |
+----------------------+-----------------------+----------------------------------------------------+
| id | int | The Id of the table |
+----------------------+-----------------------+----------------------------------------------------+
| page | int | The page number of the table |
+----------------------+-----------------------+----------------------------------------------------+
| description | str | The title of the table |
+----------------------+-----------------------+----------------------------------------------------+
Sample Response
.. code-block:: python
{
"project_id": "1787c02ac74eb6ff1a0b431e",
"project_name": "OCR-API",
"project_type": "OCR",
"dataset_id": "ad92df459162419c7eebb887",
"task_id": "2c60e79b7c630b4a3e516e04",
"item_id": "2978a028d548ef12dc45d4d0",
"file_name": "ABSTRACT - Axia.tiff",
"file_type": "application/pdf",
"source": "file:ad92df459162419c7eebb887/2978a028d548ef12dc45d4d0",
"metadata": {
"pages": "1",
"use-textract-only": "true",
"source_ref": "/uploads/ad92df459162419c7eebb887/2978a028d548ef12dc45d4d0",
"document_id": "2978a028d548ef12dc45d4d0"
},
"annotations": [
{
"email": "q1@qc.com",
"messages": [],
"role": "nlp_qc",
"elapsedTime": 23,
"date": "2023-07-12T11:46:44.644Z",
"content": {
"pdf_fingerprint": "069382dd9119a8b66b6b5cab5209f3ba",
"metadata": {
"File": "ABSTRACT - Axia.tiff",
"TaskId": "2c60e79b7c630b4a3e516e04",
"pages": "1",
"use-textract-only": "true",
"source_ref": "/uploads/ad92df459162419c7eebb887/2978a028d548ef12dc45d4d0",
"document_id": "2978a028d548ef12dc45d4d0"
},
"tags": [
{
"page": 1,
"text": "N A M E",
"id": 1,
"type": "Name:KEY",
"words": [
"N",
"A",
"M",
"E"
],
"boxes": [
[
0.06499018520116806,
0.11739349365234375,
0.07347860559821129,
0.12546881940215826
],
[
0.06458062678575516,
0.13079734146595,
0.0742951761931181,
0.1387380100786686
],
[
0.06520503759384155,
0.14403623342514038,
0.07536023296415806,
0.15211013052612543
],
[
0.06526166200637817,
0.15757058560848236,
0.07337938901036978,
0.16564789321273565
]
],
"range": [
[
71,
72
],
[
126,
127
],
[
165,
166
],
[
194,
195
]
]
},
{
"page": 1,
"text": "Axia Women's Health",
"id": 2,
"type": "Name:VAL",
"textAdjust": "Axia Women's",
"words": [
"Axia",
"Women's",
"Health"
],
"boxes": [
[
0.0935770571231842,
0.11707708239555359,
0.11941905505955219,
0.1253887191414833
],
[
0.12276646494865417,
0.11710146069526672,
0.17684946581721306,
0.1254600789397955
],
[
0.18119750916957855,
0.11732043325901031,
0.21823260188102722,
0.12542327493429184
]
],
"range": [
[
73,
77
],
[
78,
85
],
[
86,
92
]
]
},
{
"page": 1,
"text": "BILL TO",
"id": 3,
"type": "Address:KEY",
"rawBox": true,
"words": [
"BILL TO"
],
"boxes": [
[
0.4990138067061144,
0.11043412033511044,
0.5374753451676528,
0.16831683168316833
]
],
"range": []
},
{
"page": 1,
"text": "Regional Womens Health Managem",
"id": 4,
"type": "Address:VAL",
"rotate": 16,
"rawBox": true,
"words": [
"Regional Womens Health Managem"
],
"boxes": [
[
0.5443786982248521,
0.11119573495811119,
0.7682445759368837,
0.12642802741812642
]
],
"range": []
},
{
"page": 1,
"text": "Legal Name:",
"id": 5,
"type": "Name:KEY",
"table": {
"id": 2,
"x": 0,
"y": 0,
"cell": true
},
"words": [
"Legal",
"Name:"
],
"boxes": [
[
0.06351424008607864,
0.184540256857872,
0.09514468163251877,
0.19438805989921093
],
[
0.09904056787490845,
0.1844678372144699,
0.13720117509365082,
0.19286169949918985
]
],
"range": [
[
235,
240
],
[
241,
246
]
]
},
{
"page": 1,
"text": "Legal Name:",
"id": 6,
"type": "TABLEHEADER",
"table": {
"id": 2,
"x": 0,
"y": 0,
"cell": true
},
"words": [
"Legal",
"Name:"
],
"boxes": [
[
0.06351424008607864,
0.184540256857872,
0.09514468163251877,
0.19438805989921093
],
[
0.09904056787490845,
0.1844678372144699,
0.13720117509365082,
0.19286169949918985
]
],
"range": [
[
235,
240
],
[
241,
246
]
]
},
{
"page": 1,
"text": "Regional Womens",
"id": 7,
"type": "Name:KEY",
"table": {
"id": 2,
"x": 1,
"y": 0,
"cell": true
},
"words": [
"Regional",
"Womens"
],
"boxes": [
[
0.16795571148395538,
0.18427634239196777,
0.2189941145479679,
0.194447860121727
],
[
0.2225150763988495,
0.1843532919883728,
0.27455709502100945,
0.19275824166834354
]
],
"range": [
[
247,
255
],
[
256,
262
]
]
},
{
"page": 1,
"text": "Regional Womens",
"id": 8,
"type": "TABLEHEADER",
"table": {
"id": 2,
"x": 1,
"y": 0,
"cell": true
},
"words": [
"Regional",
"Womens"
],
"boxes": [
[
0.16795571148395538,
0.18427634239196777,
0.2189941145479679,
0.194447860121727
],
[
0.2225150763988495,
0.1843532919883728,
0.27455709502100945,
0.19275824166834354
]
],
"range": [
[
247,
255
],
[
256,
262
]
]
},
{
"page": 1,
"text": "Contact Name:",
"id": 9,
"type": "TABLECELL",
"table": {
"id": 2,
"x": 0,
"y": 1,
"cell": true
},
"words": [
"Contact",
"Name:"
],
"boxes": [
[
0.06349576264619827,
0.19775527715682983,
0.10882172361016273,
0.20638418663293123
],
[
0.11245942860841751,
0.19788290560245514,
0.15022221207618713,
0.20623660366982222
]
],
"range": [
[
292,
299
],
[
300,
305
]
]
},
{
"page": 1,
"text": "Health",
"id": 10,
"type": "Name:KEY",
"table": {
"id": 2,
"x": 2,
"y": 0,
"cell": true
},
"words": [
"Health"
],
"boxes": [
[
0.27853289246559143,
0.18437792360782623,
0.3156858831644058,
0.19261918030679226
]
],
"range": [
[
263,
269
]
]
},
{
"page": 1,
"text": "Health",
"id": 11,
"type": "TABLEHEADER",
"table": {
"id": 2,
"x": 2,
"y": 0,
"cell": true
},
"words": [
"Health"
],
"boxes": [
[
0.27853289246559143,
0.18437792360782623,
0.3156858831644058,
0.19261918030679226
]
],
"range": [
[
263,
269
]
]
},
{
"page": 1,
"text": "Jenni Witters",
"id": 12,
"type": "TABLECELL",
"table": {
"id": 2,
"x": 1,
"y": 1,
"cell": true
},
"words": [
"Jenni",
"Witters"
],
"boxes": [
[
0.16744308173656464,
0.1978190839290619,
0.19874349609017372,
0.20620528981089592
],
[
0.20581868290901184,
0.1977566033601761,
0.24662380293011665,
0.20619665179401636
]
],
"range": [
[
306,
311
],
[
312,
319
]
]
},
{
"page": 1,
"text": "Management",
"id": 13,
"type": "Name:KEY",
"table": {
"id": 2,
"x": 3,
"y": 0,
"cell": true
},
"words": [
"Management"
],
"boxes": [
[
0.3196510076522827,
0.18447376787662506,
0.3966050520539284,
0.19447442702949047
]
],
"range": [
[
270,
280
]
]
},
{
"page": 1,
"text": "Management",
"id": 14,
"type": "TABLEHEADER",
"table": {
"id": 2,
"x": 3,
"y": 0,
"cell": true
},
"words": [
"Management"
],
"boxes": [
[
0.3196510076522827,
0.18447376787662506,
0.3966050520539284,
0.19447442702949047
]
],
"range": [
[
270,
280
]
]
}
],
"pageOffsets": [
0,
3355,
5983
],
"links": [
{
"page": 1,
"id1": 1,
"id2": 2,
"relationship": "key-pair"
},
{
"page": 1,
"id1": 3,
"id2": 4,
"relationship": "key-pair"
}
],
"attributes": {
"Is Document Ok?": "ok"
},
"pageAttributes": [
{
"Is Page Ok?": "ok"
},
{
"Is Page Ok?": "ok"
}
],
"tables": [
{
"x": [
0.06349576264619827,
0.15883264690637589,
0.27654499374330044,
0.31766844540834427,
0.3966050520539284
],
"y": [
0.18427634239196777,
0.19611485209316015,
0.20638418663293123
],
"rows": 2,
"cols": 4,
"box": [
0.06349576264619827,
0.18427634239196777,
0.3966050520539284,
0.20638418663293123
],
"id": 2,
"page": 1,
"description": "Table No 1"
}
],
"plainText": {
"1": "Lease Id: PR0001 - 000222 Lease Profile Master Occupant Id: 00000162-1 N Axia Women's Health B Regional Womens Health Managem A HP Main Line LLC I T 227 Laurel Road M L o Echelon One, Suite 300 E Bryn Mawr PA 19010 L Voorhees NJ 08043 Legal Name: Regional Womens Health Management Tenant Id: Contact Name: Jenni Witters Tenant Type Id: Phone No: SIC Group: Fax No: NAICS Code Lease Stop: No Suite Information Current Recurring Charges Building Id: PR0001 Execution: 3/15/2021 Effective Monthly Annual Amount Suite Id: 401 Beginning: 6/15/2021 Cat. Description Sqft. Date Amount Amount PSF Lease Id: 000222 Occupancy: 9/1/2021 ABA Rent Abatements/Cor 4,850 6/15/2021 -12,125.00 -145,500.00 -30.00 Leased Sqft: 4,850 Rent Start: 6/15/2021 ABA Rent Abatements/Cor 4,850 12/1/2021 0.00 0.00 0.00 Pro-Rata Share: 0.17 Expiration: 9/30/2028 ROF Base Rent Office 4,850 6/15/2021 12,125.00 145,500.00 30.00 Ann. Mkt. Rent PSF: 0.00 Vacate: TIC Tenant Improvement 4,850 11/1/2021 3,059.54 36,714.48 7.57 UTI Utility Reimbursement 4,850 6/15/2021 808.33 9,699.96 2.00 Occupancy Status: Current Rate Change Schedule Effective Monthly Annual Amount Cat. Description Sqft. Date Amount Amount PSF ABA Rent Abatements/Con 4,850 11/1/2021 -2,575.00 -30,900.00 -6.37 ROF Base Rent Office 4,850 7/1/2022 12,367.50 148,410.00 30.60 ROF Base Rent Office 4,850 7/1/2023 12,614.04 151,368.48 31.21 ROF Base Rent Office 4,850 7/1/2024 12,868.67 154,424.04 31.84 ROF Base Rent Office 4,850 7/1/2025 13,123.29 157,479.48 32.47 ROF Base Rent Office 4,850 7/1/2026 13,386.00 160,632.00 33.12 ROF Base Rent Office 4,850 7/1/2027 13,652.75 163,833.00 33.78 ROF Base Rent - Office 4,850 7/1/2028 13,927.58 167,130.96 34.46 Lease Notes Effective Date Ref 1 Ref 2 Note 3/15/2021 ALTERTN Article 8 of Lease Landlord's consent required for any alterations, other than cosmetic Alterations which do not cost more than $1,000 per alteration and which do not affect (i) the structural portions or roof of the Premises or the 3/15/2021 ASGNSUB Article 9 Landlord consent required for any assignment/sublease. Landlord has 30 days after receipt of notice from Tenant to either approve assignment/sublease, not approve assignment/sublease, recapture the Premises 3/15/2021 DEFAULT Article 18 of Lease 1. If Tenant does not make payment within 5 days after date due, provided that, Landlord shall not more than 1 time per 12 full calendar month period of the term, deliver written notice to Tenant with respect to 3/15/2021 ESTOPEL Article 17 of Lease Estoppel required to be provided within 10 days after request. In the form set forth in Exhibit D 3/15/2021 HOLDOVR Section 19 (b) of Lease Landlord may either (i) increase Rent to 200% of the highest monthly aggregate Fixed Rent and additional 3/15/2021 INS Article 11 - Landlord responsible for repairs to all plumbing and other fixtures, equipment and systems (including replacement, if necessary) in or serving the Premises. Landlord to provide janitorial services (Exhibit E) and pest control as needed. 3/15/2021 LATECHG Article 3 of Lease Tenant shall pay Landlord a service and handling charge equal to five percent (5%) of any Rent not paid within five (5) days after the date first due, which shall apply cumulatively each month with respect to Report Id WEBX_PROFILE Database HAVERFORD Reported by Joe Staugaard 1/7/2022 11:50 Page 1"
},
"dimensions": [
{
"width": 1275,
"height": 1650
},
{
"width": 1275,
"height": 1650
}
],
"review": {
"rate": "Ok",
"note": "",
"reviewerId": "62de356a2f027ab62a00bef1"
},
"jobStart": 1689162378,
"sessionTime": 23,
"elapsedTime": 23,
"updateTime": 1689162401,
"selectBoundingBox": true,
"lastUpdate": 1689162404637
}
}
],
"annotator_id": [
"1@an.com"
],
"state": 4,
"state_description": "Approved",
"comprehend_blocks_source": "/uploads/ad92df459162419c7eebb887/intermediate/blocks/ed8c9f78-f425-4c14-91e1-744896720914_blocks.json",
"labels": {
"Name:KEY": 5,
"Name:VAL": 1,
"Address:KEY": 1,
"Address:VAL": 1
}
}
"""
[docs]def delete_task(task_id):
"""
Delete Task.
:table:Input parameters summary:
+--------------+----------+-------+--------------------------------------------------+
| Field | Input | Type | Description |
+==============+==========+=======+==================================================+
| task_id | body | str | The Id of the task to delete |
+--------------+----------+-------+--------------------------------------------------+
Sample Request Body
.. code-block:: python
from pprint import pprint
from tensoract.client import Tensoract
# Initialize Tensoract client
task_client = Tensoract(api_url="YOUR_API_URL",api_key="YOUR_API_KEY")
data = task_client.delete_task(task_id="449354de1168469a8229f605")
pprint(data)
:table:Response summary:
+------------+------------------+---------------------------------------------------------------+
| Field | Type | Description |
+============+==================+===============================================================+
| status | str |The status of the operation |
+------------+------------------+---------------------------------------------------------------+
| message | str |A message associated with the operation result |
+------------+------------------+---------------------------------------------------------------+
Sample Response
.. code-block:: python
{
"status": "success",
"message": "Task deleted sucessfully"
}
"""
[docs]def get_tasks(project_id,task_id,file_name,file_type):
"""
Get tasks.
:table:Input parameters summary:
+--------------+----------+-------+--------------------------------------------------+
| Field | Input | Type | Description |
+==============+==========+=======+==================================================+
| project_id | body | str | The Id of the Project |
+--------------+----------+-------+--------------------------------------------------+
| task_id | body | str | The Id of the task |
+--------------+----------+-------+--------------------------------------------------+
| file_name | body | str | The name of file |
+--------------+----------+-------+--------------------------------------------------+
| file-type | body | str | The type of file |
+--------------+----------+-------+--------------------------------------------------+
Sample Request Body
.. code-block:: python
from pprint import pprint
from tensoract.client import Tensoract
# Initialize Tensoract client
task_client = Tensoract(api_url="YOUR_API_URL",api_key="YOUR_API_KEY")
tasks = task_client.get_tasks(project_id="557b89e25a0588898fae91f0",task_id=None,file_name=None,file_type=None,trail = False)
pprint(tasks)
:table:Response summary:
+--------------------------+-------+-----------------------------------------------------------------------+
| Field | Type | Description |
+==========================+=======+=======================================================================+
| project_id | str |The Id of the project |
+--------------------------+-------+-----------------------------------------------------------------------+
| dataset_id | str |The Id of the dataset |
+--------------------------+-------+-----------------------------------------------------------------------+
| task_id | str |The Id of the task |
+--------------------------+-------+-----------------------------------------------------------------------+
| file_name | str |The name of file |
+--------------------------+-------+-----------------------------------------------------------------------+
| file_type | str |The type of file |
+--------------------------+-------+-----------------------------------------------------------------------+
| source | str |Internal source file reference on local storage disk |
+--------------------------+-------+-----------------------------------------------------------------------+
| company | str |The Id of the company associated with the item. |
+--------------------------+-------+-----------------------------------------------------------------------+
| state | int | State of task in numerical form |
+--------------------------+-------+-----------------------------------------------------------------------+
| state_description | str | State of task |
+--------------------------+-------+-----------------------------------------------------------------------+
Sample Response
.. code-block:: python
[
{
"project_id": "46c165230e44e4ba3954b407",
"task_id": "08698951b8d33f236db0f9c6",
"file_name": "Invoice-Template.pdf",
"file_type": "application/pdf",
"source": "file:781555718520b47b0b96bb0f/287b33efe398121be781e046",
"company": "60f38299446de8dabe9207e5",
"state": 0,
"state_description": "Unassigned"
},
{
"project_id": "46c165230e44e4ba3954b407",
"task_id": "f43faa1a5168f5fa5204c16e",
"file_name": "ABSTRACT - Axia (3).pdf",
"file_type": "application/pdf",
"source": "file:781555718520b47b0b96bb0f/4dc320a225eec89248d36222",
"company": "60f38299446de8dabe9207e5",
"annotator_id": [
"1@an.com"
],
"state": 4,
"state_description": "Approved",
"labels": {
"Name:KEY": 2,
"Name:VAL": 2,
"key-pair": 2
}
},
{
"project_id": "46c165230e44e4ba3954b407",
"task_id": "ce5863666d0b85ccfd0b06e1",
"file_name": "AVVISO DI GARA - TAG.pdf",
"file_type": "application/pdf",
"source": "file:781555718520b47b0b96bb0f/600e148e6bf778f852a61b27",
"company": "60f38299446de8dabe9207e5",
"state": 0,
"state_description": "Unassigned"
},
{
"project_id": "46c165230e44e4ba3954b407",
"task_id": "1bf678f3fca031245a482e96",
"file_name": "InvoiceSimple-PDF-Template.pdf",
"file_type": "application/pdf",
"source": "file:781555718520b47b0b96bb0f/bed472a61777cc506008e145",
"company": "60f38299446de8dabe9207e5",
"state": 0,
"state_description": "Unassigned"
}
]
"""
[docs]def get_word_boxes(task_id,page):
"""
Get Bounding Box coordinates of all pages in a document. Optionally pass "page" number to restrict by the page.
:table:Input parameters summary:
+--------------+----------+-------+--------------------------------------------------+
| Field | Input | Type | Description |
+==============+==========+=======+==================================================+
| task_id | body | str | The Id of the task to get word boxes |
+--------------+----------+-------+--------------------------------------------------+
| page | body | str | Page number of the document |
+--------------+----------+-------+--------------------------------------------------+
Sample Request Body
.. code-block:: python
from pprint import pprint
from tensoract.client import Tensoract
# Initialize Tensoract client
task_client = Tensoract(api_url="YOUR_API_URL",api_key="YOUR_API_KEY")
response = task_client.get_word_boxes(task_id="449354de1168469a8229f605", page = 1)
pprint(response)
:table:Response summary:
+-----------+-------+-----------------------------------------------------------------+
| Field | Type | Description |
+===========+=======+=================================================================+
| box | list | List of Bounding_box coordinates |
+-----------+-------+-----------------------------------------------------------------+
| range | str | List of offsets |
+-----------+-------+-----------------------------------------------------------------+
| text | str | Text |
+-----------+-------+-----------------------------------------------------------------+
Sample Response
.. code-block:: python
[
[
{
'box': [0.04322405692755147,
0.020058986644677534,
0.11036431902612907,
0.030159995920771787],
'range': [0, 9],
'text': '2/27/2021'
},
{
'box': [0.3196231438320821,
0.020058986644677534,
0.4089945621543309,
0.030159995920771787],
'range': [10, 21],
'text': 'Amazon.com:'},
{
'box': [0.2981259968948721,
0.9708164847570528,
0.4446869530303018,
0.9809174940331471],
'range': [114, 134],
'text': '-reviews/B00014353Y/'
}
]
]
"""
[docs]def get_task_deep_link(task_id):
"""
Get deeplink information from a task.
:table:Input parameters summary:
+--------------+----------+-------+--------------------------------------------------+
| Field | Input | Type | Description |
+==============+==========+=======+==================================================+
| task_id | body | str | The Id of the task to get deep link for the task |
+--------------+----------+-------+--------------------------------------------------+
Sample Request Body
.. code-block:: python
response = task_client.get_task_deep_link(task_id="8aa09e5e78cb8ff883002a32")
pprint(response)
:table:Response summary:
+--------------+----------+---+--------------------------------------------------------------------+
| Field | Input | Type | Description |
+==============+==========+=======+================================================================+
| task_id | body | str | The Id of the task |
+--------------+----------+-------+----------------------------------------------------------------+
| project | body | str | The Id of the Project |
+--------------+----------+-------+----------------------------------------------------------------+
| project_type | body | str | The type of project |
+--------------+----------+-------+----------------------------------------------------------------+
| company | body | str | The Id of company |
+--------------+----------+-------+----------------------------------------------------------------+
| processing | body | str | The status code of the processing |
+--------------+----------+-------+----------------------------------------------------------------+
| role | body | str | The role of user |
+--------------+----------+-------+----------------------------------------------------------------+
| priv | body | str | The privilage of user |
+--------------+----------+-------+----------------------------------------------------------------+
| returnURL | body | str | Redirects to this URL |
+--------------+----------+-------+----------------------------------------------------------------+
| name | body | str | The name of user |
+--------------+----------+-------+----------------------------------------------------------------+
| email | body | str | The email of User |
+--------------+----------+-------+----------------------------------------------------------------+
| expireLink | body | str | Timestamp for expiration |
+--------------+----------+-------+----------------------------------------------------------------+
| url | body | str | Created Deeplink |
+--------------+----------+-------+----------------------------------------------------------------+
| status | body | str | The status of the operation |
+--------------+----------+-------+----------------------------------------------------------------+
Sample Response
.. code-block:: python
{
"taskId": "8aa09e5e78cb8ff883002a32",
"project": "866ad732042bde9b94929cc3",
"projectType": "NER",
"company": "60f38299446de8dabe9207e5",
"processing": 0,
"role": "nlp_an",
"priv": "nlp_an",
"returnURL": "https://google.com",
"name": "johndoe",
"email": "johndoe@acme.com",
"expireLink": 1690703045137,
"url": "https://sandbox.tensoract.com/?dlkey=64b8e5c5d5c5bdd02295e2ad",
"status": "success"
}
"""
[docs]def create_task_deep_link(body):
"""
Set a task deeplink.
:table:Input parameters summary:
+--------------+-------+----------------------------------------------------------------------+
| Field | Type | Description |
+==============+=======+======================================================================+
| task_id | str | The Id of the task |
+--------------+-------+----------------------------------------------------------------------+
| user_name | str | The name of user |
+--------------+-------+----------------------------------------------------------------------+
| user_email | str | The Email of user |
+--------------+-------+----------------------------------------------------------------------+
| role | str | The role of User |
+--------------+-------+----------------------------------------------------------------------+
| expire_in | int | Timestamp for expiration |
+--------------+-------+----------------------------------------------------------------------+
| returnURL | str | Redirects to this URL |
+--------------+-------+----------------------------------------------------------------------+
Sample Request Body
.. code-block:: python
response = task_client.create_task_deep_link(
task_id="8aa09e5e78cb8ff883002a32",
user_name="johndoe",
user_email="john.doe@acme.com",
role="Annotator",
expire_in=1,
return_url=https://yourdomain.com
)
:table:Response summary:
+--------------+-------+----------------------------------------------------------------+
| Field | Type | Description |
+==============+=======+================================================================+
| task_id | str | The Id of the task |
+--------------+-------+----------------------------------------------------------------+
| project | str | The Id of the Project |
+--------------+-------+----------------------------------------------------------------+
| project_type | str | The type of project |
+--------------+-------+----------------------------------------------------------------+
| company | str | The Id of company |
+--------------+-------+----------------------------------------------------------------+
| processing | str | The status code of the processing |
+--------------+-------+----------------------------------------------------------------+
| role | str | The role of User |
+--------------+-------+----------------------------------------------------------------+
| priv | str | The privilage of User |
+--------------+-------+----------------------------------------------------------------+
| returnURL | str | Redirects to this URL |
+--------------+-------+----------------------------------------------------------------+
| name | str | The name of user |
+--------------+-------+----------------------------------------------------------------+
| email | str | The email of user |
+--------------+-------+----------------------------------------------------------------+
| expireLink | str | Timestamp for expiration |
+--------------+-------+----------------------------------------------------------------+
| url | str | Created Deeplink |
+--------------+-------+----------------------------------------------------------------+
| status | str | The status of the operation |
+--------------+-------+----------------------------------------------------------------+
Sample Response
.. code-block:: python
{
"taskId": "8aa09e5e78cb8ff883002a32",
"project": "866ad732042bde9b94929cc3",
"projectType": "NER",
"company": "60f38299446de8dabe9207e5",
"processing": 0,
"role": "nlp_an",
"returnURL": "https://google.com",
"name": "johndoe",
"email": "johndoe@acme.com",
"expireLink": 1690703045137,
"url": "https://sandbox.tensoract.com/?dlkey=64b8e5c5d5c5bdd02295e2ad",
"status": "success"
}
"""
[docs]def get_task_url(task_id,role):
"""
Get url for task.
:table:Input parameters summary:
+--------------+----------+---+--------------------------------------------------------------------+
| Field | Input | Type | Description |
+==============+==========+=======+================================================================+
| task_id | body | str | The Id of the task |
+--------------+----------+-------+----------------------------------------------------------------+
| role | body | str | The role of user |
+--------------+----------+-------+----------------------------------------------------------------+
Sample Request Body
.. code-block:: python
response = task_client.get_task_url(task_id="8aa09e5e78cb8ff883002a32", role="annotator"|"reviewer")
pprint(response)
:table:Response summary:
+--------------+-------+---------------------------------------------------------------+
| Field | Type | Description |
+==============+=======+=======+=======================================================+
| status | str | The status of the operation |
+--------------+-------+-------+-------------------------------------------------------+
| url | str | URL for task |
+--------------+-------+-------+-------------------------------------------------------+
Sample Response
.. code-block:: python
{
"status": "success",
"url": "https://sandbox.tensoract.com/?params=eyJwdHlwZSI6InByb2oiLCJpZCI6Ijg2NmFkNzMyMDQyYmRlOWI5NDkyOWNjMyIsInR5cGUiOiJORVIiLCJuYW1lIjoiTkVSLVByb2plY3QtREIiLCJjb21wYW55IjoiNjBmMzgyOTk0NDZkZThkYWJlOTIwN2U1Iiwicm9sZSI6ImFubm90YXRvciIsImFjdGl2ZSI6dHJ1ZSwiZmlsZUlkIjoiOGFhMDllNWU3OGNiOGZmODgzMDAyYTMyIn0=#NERView"
}
"""