This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
26 changed files
with
3,166 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...ructured_api_tools/pipeline-test-project/pipeline-notebooks/pipeline-process-file-2.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"# File Processing Pipeline" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# pipeline-api\n", | ||
"def pipeline_api(\n", | ||
" file\n", | ||
"):\n", | ||
" return {\"silly_result\": ' : '.join([str(len(file.read()))])}" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"{'silly_result': '17'}\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import tempfile\n", | ||
"with tempfile.TemporaryFile() as fp:\n", | ||
" fp.write(b'This is some data')\n", | ||
" fp.seek(0)\n", | ||
" print(pipeline_api(fp))" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "python3", | ||
"language": "python", | ||
"name": "python3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |
56 changes: 56 additions & 0 deletions
56
...ructured_api_tools/pipeline-test-project/pipeline-notebooks/pipeline-process-file-3.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"# File Processing Pipeline" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# pipeline-api\n", | ||
"def pipeline_api(\n", | ||
" file, response_type=\"text/csv\", response_schema=\"isd\"\n", | ||
"):\n", | ||
" return {\"silly_result\": ' : '.join([str(len(file.read())), str(response_type), str(response_schema)])}" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"{'silly_result': '17 : text/csv : isd'}\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import tempfile\n", | ||
"with tempfile.TemporaryFile() as fp:\n", | ||
" fp.write(b'This is some data')\n", | ||
" fp.seek(0)\n", | ||
" print(pipeline_api(fp, \"text/csv\", \"isd\"))" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "python3", | ||
"language": "python", | ||
"name": "python3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |
74 changes: 74 additions & 0 deletions
74
...ructured_api_tools/pipeline-test-project/pipeline-notebooks/pipeline-process-file-4.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"# File Processing Pipeline" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# pipeline-api\n", | ||
"def pipeline_api(\n", | ||
" file,\n", | ||
" file_content_type=None,\n", | ||
" response_type=\"application/json\",\n", | ||
" response_schema=\"labelstudio\",\n", | ||
" m_input1=[]\n", | ||
"):\n", | ||
" return {\"silly_result\": ' : '.join([\n", | ||
" str(len(file.read())),\n", | ||
" str(file_content_type),\n", | ||
" str(response_type),\n", | ||
" str(response_schema),\n", | ||
" str(m_input1)\n", | ||
" ])}" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"{'silly_result': \"17 : None : application/json : isd : ['input1', 'input2']\"}\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import tempfile\n", | ||
"with tempfile.TemporaryFile() as fp:\n", | ||
" fp.write(b'This is some data')\n", | ||
" fp.seek(0)\n", | ||
" print(\n", | ||
" pipeline_api(\n", | ||
" fp,\n", | ||
" None,\n", | ||
" \"application/json\",\n", | ||
" \"isd\",\n", | ||
" [\"input1\", \"input2\"]\n", | ||
" )\n", | ||
" )" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "python3", | ||
"language": "python", | ||
"name": "python3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |
77 changes: 77 additions & 0 deletions
77
...ructured_api_tools/pipeline-test-project/pipeline-notebooks/pipeline-process-file-5.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"# File Processing Pipeline" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# pipeline-api\n", | ||
"def pipeline_api(\n", | ||
" file,\n", | ||
" file_content_type=None,\n", | ||
" response_type=\"application/json\",\n", | ||
" response_schema=\"labelstudio\",\n", | ||
" m_input1=[],\n", | ||
" m_input2=[],\n", | ||
"):\n", | ||
" return {\"silly_result\": ' : '.join([\n", | ||
" str(len(file.read())),\n", | ||
" str(file_content_type),\n", | ||
" str(response_type),\n", | ||
" str(response_schema),\n", | ||
" str(m_input1),\n", | ||
" str(m_input2),\n", | ||
" ])}" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"{'silly_result': \"17 : None : application/json : isd : ['input1', 'input2'] : ['m_input2']\"}\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import tempfile\n", | ||
"with tempfile.TemporaryFile() as fp:\n", | ||
" fp.write(b'This is some data')\n", | ||
" fp.seek(0)\n", | ||
" print(\n", | ||
" pipeline_api(\n", | ||
" fp,\n", | ||
" None,\n", | ||
" \"application/json\",\n", | ||
" \"isd\",\n", | ||
" [\"input1\", \"input2\"],\n", | ||
" [\"m_input2\"]\n", | ||
" )\n", | ||
" )" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "python3", | ||
"language": "python", | ||
"name": "python3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |
62 changes: 62 additions & 0 deletions
62
...ructured_api_tools/pipeline-test-project/pipeline-notebooks/pipeline-process-text-1.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Text Processing Pipeline" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# pipeline-api\n", | ||
"def pipeline_api(\n", | ||
" text,\n", | ||
"):\n", | ||
" return {\"silly_result\": ' : '.join([str(len(text)), text])}" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 10, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"{'silly_result': '9 : some text'}\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"print(pipeline_api(\"some text\"))" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.15" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 1 | ||
} |
Oops, something went wrong.