Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Documentation improvements, closes #200

davidmezzettif8853f6af818
diff --git a/docs/api/cluster.md b/docs/api/cluster.md
index 696fe2df..4090b981 100644
--- a/docs/api/cluster.md
+++ b/docs/api/cluster.md
@@ -12,3 +12,9 @@ cluster:
This configuration aggregates the API instances above as index shards. Data is evenly split among each of the shards at index time. Queries are run in parallel against each shard and the results are joined together. This method allows horizontal scaling and supports very large index clusters.
This method is only recommended for data sets in the 1 billion+ records. The ANN libraries can easily support smaller data sizes and this method is not worth the additional complexity. At this time, new shards can not be added after building the initial index.
+
+See the link below for a detailed example covering distributed embeddings clusters.
+
+| Notebook | Description | |
+|:----------|:-------------|------:|
+| [Distributed embeddings cluster](https://github.com/neuml/txtai/blob/master/examples/15_Distributed_embeddings_cluster.ipynb) | Distribute an embeddings index across multiple data nodes | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/15_Distributed_embeddings_cluster.ipynb) |
diff --git a/docs/api/configuration.md b/docs/api/configuration.md
index bbe8194a..19e1bd60 100644
--- a/docs/api/configuration.md
+++ b/docs/api/configuration.md
@@ -39,7 +39,7 @@ Determines if the input embeddings index is writable (true) or read-only (false)
Pipelines are loaded as top level configuration parameters. Pipeline names are automatically detected in the YAML configuration and created upon startup. All [pipelines](../../pipeline) are supported.
-The following example defines a series of pipelines.
+The following example defines a series of pipelines. Note that entries below are the lower-case names of the pipeline class.
```yaml
caption:
diff --git a/docs/api/index.md b/docs/api/index.md
index f3457540..0c69444d 100644
--- a/docs/api/index.md
+++ b/docs/api/index.md
@@ -3,9 +3,11 @@
![api](../images/api.png#only-light)
![api](../images/api-dark.png#only-dark)
-txtai has a full-featured API that can optionally be enabled for any txtai process. All functionality found in txtai can be accessed via the API. The following is an example configuration and startup script for the API.
+txtai has a full-featured API, backed by [FastAPI](https://github.com/tiangolo/fastapi), that can optionally be enabled for any txtai process. All functionality found in txtai can be accessed via the API.
-Note that this configuration file enables all functionality. It is suggested that separate processes are used for each instance of a txtai component. Components can be joined together with workflows.
+The following is an example configuration and startup script for the API.
+
+Note: that this configuration file enables all functionality. It is suggested that separate processes are used for each instance of a txtai component.
```yaml
# Index file path
@@ -68,16 +70,24 @@ workflow:
Assuming this YAML content is stored in a file named index.yml, the following command starts the API process.
-```
+```bash
CONFIG=index.yml uvicorn "txtai.api:app"
```
uvicorn is a full-featured production ready server with support for SSL and more. See the [uvicorn deployment guide](https://www.uvicorn.org/deployment/) for details.
-## Differences between Python and API
+## Connect to API
+
+The default port for the API is 8000. See the uvicorn link above to change this.
-The txtai API provides all the major functionality found in this project. But there are differences due to the nature of JSON and differences across the supported programming languages. For example, any Python callable method is available at a named endpoint (i.e. instead of summary() the method call would be summary.summary()).
-Return types vary as tuples are returned as objects via the API.
+txtai has a number of language bindings which abstract the API (see links below). Alternatively, code can be written to connect directly to the API. Documentation for a live running instance can be found at the `/docs` url (i.e. http://localhost:8000/docs). The following example runs a workflow using cURL.
+
+```bash
+curl \
+ -X POST "http://localhost:8000/workflow" \
+ -H "Content-Type: application/json" \
+ -d '{"name":"sumfrench", "elements": ["https://github.com/neuml/txtai"]}'
+```
## Supported language bindings
@@ -88,4 +98,8 @@ The following programming languages have txtai bindings:
- [Rust](https://github.com/neuml/txtai.rs)
- [Go](https://github.com/neuml/txtai.go)
-See each of the projects above for details on how to install and use. Please add an issue to request additional language bindings!
+See the link below for a detailed example covering how to use the API.
+
+| Notebook | Description | |
+|:----------|:-------------|------:|
+| [API Gallery](https://github.com/neuml/txtai/blob/master/examples/08_API_Gallery.ipynb) | Using txtai in JavaScript, Java, Rust and Go | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/08_API_Gallery.ipynb) |
diff --git a/docs/embeddings/index.md b/docs/embeddings/index.md
index 4c048a41..02d712f4 100644
--- a/docs/embeddings/index.md
+++ b/docs/embeddings/index.md
@@ -83,3 +83,7 @@ The search method takes two parameters, the query and query limit. The results f
- List of `(id, score)` when content is disabled
- List of `{**query columns}` when content is enabled
+
+## More examples
+
+See [this link](../examples/#semantic-search) for a full list of embeddings examples.
\ No newline at end of file
diff --git a/docs/examples.md b/docs/examples.md
index a502de5d..1f00ac0f 100644
--- a/docs/examples.md
+++ b/docs/examples.md
@@ -15,7 +15,6 @@ Build semantic/similarity/vector/neural search applications.
| [Build an Embeddings index with Hugging Face Datasets](https://github.com/neuml/txtai/blob/master/examples/02_Build_an_Embeddings_index_with_Hugging_Face_Datasets.ipynb) | Index and search Hugging Face Datasets | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/02_Build_an_Embeddings_index_with_Hugging_Face_Datasets.ipynb) |
| [Build an Embeddings index from a data source](https://github.com/neuml/txtai/blob/master/examples/03_Build_an_Embeddings_index_from_a_data_source.ipynb) | Index and search a data source with word embeddings | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/03_Build_an_Embeddings_index_from_a_data_source.ipynb) |
| [Add semantic search to Elasticsearch](https://github.com/neuml/txtai/blob/master/examples/04_Add_semantic_search_to_Elasticsearch.ipynb) | Add semantic search to existing search systems | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/04_Add_semantic_search_to_Elasticsearch.ipynb) |
-| [API Gallery](https://github.com/neuml/txtai/blob/master/examples/08_API_Gallery.ipynb) | Using txtai in JavaScript, Java, Rust and Go | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/08_API_Gallery.ipynb) |
| [Similarity search with images](https://github.com/neuml/txtai/blob/master/examples/13_Similarity_search_with_images.ipynb) | Embed images and text into the same space for search | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/13_Similarity_search_with_images.ipynb) |
| [Distributed embeddings cluster](https://github.com/neuml/txtai/blob/master/examples/15_Distributed_embeddings_cluster.ipynb) | Distribute an embeddings index across multiple data nodes | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/15_Distributed_embeddings_cluster.ipynb) |
| [What's new in txtai 4.0](https://github.com/neuml/txtai/blob/master/examples/24_Whats_new_in_txtai_4_0.ipynb) | Content storage, SQL, object storage, reindex and compressed indexes | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/24_Whats_new_in_txtai_4_0.ipynb) |
@@ -30,6 +29,7 @@ Transform data with NLP-backed pipelines.
| [Extractive QA with Elasticsearch](https://github.com/neuml/txtai/blob/master/examples/06_Extractive_QA_with_Elasticsearch.ipynb) | Run extractive question-answering queries with Elasticsearch | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/06_Extractive_QA_with_Elasticsearch.ipynb) |
| [Extractive QA to build structured data](https://github.com/neuml/txtai/blob/master/examples/20_Extractive_QA_to_build_structured_data.ipynb) | Build structured datasets using extractive question-answering | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/20_Extractive_QA_to_build_structured_data.ipynb) |
| [Apply labels with zero shot classification](https://github.com/neuml/txtai/blob/master/examples/07_Apply_labels_with_zero_shot_classification.ipynb) | Use zero shot learning for labeling, classification and topic modeling | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/07_Apply_labels_with_zero_shot_classification.ipynb) |
+| [API Gallery](https://github.com/neuml/txtai/blob/master/examples/08_API_Gallery.ipynb) | Using txtai in JavaScript, Java, Rust and Go | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/08_API_Gallery.ipynb) |
| [Building abstractive text summaries](https://github.com/neuml/txtai/blob/master/examples/09_Building_abstractive_text_summaries.ipynb) | Run abstractive text summarization | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/09_Building_abstractive_text_summaries.ipynb) |
| [Extract text from documents](https://github.com/neuml/txtai/blob/master/examples/10_Extract_text_from_documents.ipynb) | Extract text from PDF, Office, HTML and more | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/10_Extract_text_from_documents.ipynb) |
| [Transcribe audio to text](https://github.com/neuml/txtai/blob/master/examples/11_Transcribe_audio_to_text.ipynb) | Convert audio files to text | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/11_Transcribe_audio_to_text.ipynb) |
diff --git a/docs/articles.md b/docs/further.md
similarity index 100%
rename from docs/articles.md
rename to docs/further.md
diff --git a/docs/images/task-dark.png b/docs/images/task-dark.png
new file mode 100644
index 00000000..59cce71c
Binary files /dev/null and b/docs/images/task-dark.png differ
diff --git a/docs/images/task.excalidraw b/docs/images/task.excalidraw
new file mode 100644
index 00000000..42869399
--- /dev/null
+++ b/docs/images/task.excalidraw
@@ -0,0 +1,1124 @@
+{
+ "type": "excalidraw",
+ "version": 2,
+ "source": "https://excalidraw.com",
+ "elements": [
+ {
+ "type": "rectangle",
+ "version": 4906,
+ "versionNonce": 976633260,
+ "isDeleted": false,
+ "id": "9itz4bqXi6IMeZhGhc42J",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 793.1319708150991,
+ "y": 84.01158837080237,
+ "strokeColor": "#03a9f4",
+ "backgroundColor": "#fff",
+ "width": 70.67858069123133,
+ "height": 107.25081879410921,
+ "seed": 2026142776,
+ "groupIds": [
+ "zRT55AcPrMo-vI2M6Q7JX"
+ ],
+ "strokeSharpness": "sharp",
+ "boundElements": [
+ {
+ "type": "arrow",
+ "id": "CFu0B4Mw_1wC1Hbgx8Fs0"
+ },
+ {
+ "type": "arrow",
+ "id": "XIl_NhaFtRO00pX5Pq6VU"
+ },
+ {
+ "type": "arrow",
+ "id": "EndiSTFlx1AT7vcBVjgve"
+ },
+ {
+ "id": "sbyEF_hTthhrIaA-47du2",
+ "type": "arrow"
+ },
+ {
+ "id": "3DJ_wB8Ty8UNX4KAZfwjT",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1642714818536
+ },
+ {
+ "type": "rectangle",
+ "version": 4954,
+ "versionNonce": 1503052564,
+ "isDeleted": false,
+ "id": "7HUYNqBGn8JbkXw6qt_jr",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 785.5845377793848,
+ "y": 76.99149908508815,
+ "strokeColor": "#03a9f4",
+ "backgroundColor": "#fff",
+ "width": 70.67858069123133,
+ "height": 107.25081879410921,
+ "seed": 1090159432,
+ "groupIds": [
+ "6R5o6OnVZ7fFC_87zCo7G",
+ "zRT55AcPrMo-vI2M6Q7JX"
+ ],
+ "strokeSharpness": "sharp",
+ "boundElements": [
+ {
+ "type": "arrow",
+ "id": "CFu0B4Mw_1wC1Hbgx8Fs0"
+ },
+ {
+ "type": "arrow",
+ "id": "XIl_NhaFtRO00pX5Pq6VU"
+ },
+ {
+ "type": "arrow",
+ "id": "EndiSTFlx1AT7vcBVjgve"
+ }
+ ],
+ "updated": 1642714818536
+ },
+ {
+ "type": "rectangle",
+ "version": 5050,
+ "versionNonce": 1115269164,
+ "isDeleted": false,
+ "id": "mI_Mfw3cNZf0AuQhK5KUO",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 776.1894484936695,
+ "y": 68.73759283508838,
+ "strokeColor": "#03a9f4",
+ "backgroundColor": "#fff",
+ "width": 70.67858069123133,
+ "height": 107.25081879410921,
+ "seed": 1146631480,
+ "groupIds": [
+ "zRT55AcPrMo-vI2M6Q7JX"
+ ],
+ "strokeSharpness": "sharp",
+ "boundElements": [
+ {
+ "type": "arrow",
+ "id": "CFu0B4Mw_1wC1Hbgx8Fs0"
+ },
+ {
+ "type": "arrow",
+ "id": "XIl_NhaFtRO00pX5Pq6VU"
+ },
+ {
+ "type": "arrow",
+ "id": "EndiSTFlx1AT7vcBVjgve"
+ }
+ ],
+ "updated": 1642714818536
+ },
+ {
+ "type": "line",
+ "version": 4173,
+ "versionNonce": 2037727380,
+ "isDeleted": false,
+ "id": "y3oKPiP36axXzEF0c7OiC",
+ "fillStyle": "solid",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 788.1758750805805,
+ "y": 117.48482988244103,
+ "strokeColor": "#03a9f4",
+ "backgroundColor": "#fff",
+ "width": 46.57983585730082,
+ "height": 3.249953844290203,
+ "seed": 1952111176,
+ "groupIds": [
+ "zRT55AcPrMo-vI2M6Q7JX"
+ ],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818536,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 40.42449133807562,
+ 0.1573930526684746
+ ],
+ [
+ 46.57983585730082,
+ -3.0925607916217284
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 4199,
+ "versionNonce": 1944830636,
+ "isDeleted": false,
+ "id": "-52Udo1sfovtw-gxgUT91",
+ "fillStyle": "solid",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 790.0311273185948,
+ "y": 86.01954258360246,
+ "strokeColor": "#03a9f4",
+ "backgroundColor": "#fff",
+ "width": 45.567415680676426,
+ "height": 2.8032978840147194,
+ "seed": 923586104,
+ "groupIds": [
+ "zRT55AcPrMo-vI2M6Q7JX"
+ ],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818536,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 16.832548902953302,
+ -2.8032978840147194
+ ],
+ [
+ 45.567415680676426,
+ -0.3275477042019195
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 4224,
+ "versionNonce": 1671958036,
+ "isDeleted": false,
+ "id": "7Tgba-Lgh4JYVwHG-MlYn",
+ "fillStyle": "solid",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 789.9545278022254,
+ "y": 153.41391685395956,
+ "strokeColor": "#03a9f4",
+ "backgroundColor": "#fff",
+ "width": 48.33668263438425,
+ "height": 4.280657518731036,
+ "seed": 664293704,
+ "groupIds": [
+ "zRT55AcPrMo-vI2M6Q7JX"
+ ],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818536,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 26.41225578429045,
+ -0.2552319773002338
+ ],
+ [
+ 37.62000339651456,
+ 2.3153712935189787
+ ],
+ [
+ 48.33668263438425,
+ -1.9652862252120569
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 4261,
+ "versionNonce": 355896620,
+ "isDeleted": false,
+ "id": "KsHbDZNNeZoS7zbhCYNon",
+ "fillStyle": "solid",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 786.770480620695,
+ "y": 164.65706526223835,
+ "strokeColor": "#03a9f4",
+ "backgroundColor": "#fff",
+ "width": 54.40694982784246,
+ "height": 2.9096445412231735,
+ "seed": 2043037496,
+ "groupIds": [
+ "zRT55AcPrMo-vI2M6Q7JX"
+ ],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818536,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 10.166093050596771,
+ -1.166642430373031
+ ],
+ [
+ 16.130660965377448,
+ -0.8422655250909383
+ ],
+ [
+ 46.26079588567538,
+ 0.6125567455206506
+ ],
+ [
+ 54.40694982784246,
+ -2.297087795702523
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 4226,
+ "versionNonce": 1764043668,
+ "isDeleted": false,
+ "id": "R5nE2rgdgOpe93Q8VvYhl",
+ "fillStyle": "solid",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 787.0553235162608,
+ "y": 101.08014413686368,
+ "strokeColor": "#03a9f4",
+ "backgroundColor": "#fff",
+ "width": 46.92865289294453,
+ "height": 2.4757501798128,
+ "seed": 571402312,
+ "groupIds": [
+ "zRT55AcPrMo-vI2M6Q7JX"
+ ],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818536,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 18.193786115221407,
+ -0.5912874140789839
+ ],
+ [
+ 46.92865289294453,
+ 1.884462765733816
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 4241,
+ "versionNonce": 130287532,
+ "isDeleted": false,
+ "id": "lfWLpL8lTqrf2GMoqJY8y",
+ "fillStyle": "solid",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 787.1628117124112,
+ "y": 135.5634731727032,
+ "strokeColor": "#03a9f4",
+ "backgroundColor": "#fff",
+ "width": 46.92865289294453,
+ "height": 2.4757501798128,
+ "seed": 2028511288,
+ "groupIds": [
+ "zRT55AcPrMo-vI2M6Q7JX"
+ ],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818536,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 8.093938105125233,
+ 1.4279702913643746
+ ],
+ [
+ 18.193786115221407,
+ -0.5912874140789839
+ ],
+ [
+ 46.92865289294453,
+ 1.884462765733816
+ ]
+ ]
+ },
+ {
+ "type": "text",
+ "version": 378,
+ "versionNonce": 1294951852,
+ "isDeleted": false,
+ "id": "uG1gxQCUX_W4xoK8WjzqS",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 0,
+ "opacity": 100,
+ "angle": 0,
+ "x": 762,
+ "y": 202,
+ "strokeColor": "#03a9f4",
+ "backgroundColor": "#03a9f4",
+ "width": 117,
+ "height": 26,
+ "seed": 657172488,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818537,
+ "fontSize": 20,
+ "fontFamily": 1,
+ "text": "Input Data",
+ "baseline": 18,
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "Input Data"
+ },
+ {
+ "type": "arrow",
+ "version": 657,
+ "versionNonce": 1814305556,
+ "isDeleted": false,
+ "id": "3DJ_wB8Ty8UNX4KAZfwjT",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 878.680938765565,
+ "y": 132.68136619602433,
+ "strokeColor": "#03a9f4",
+ "backgroundColor": "#ff7043",
+ "width": 104.88363252862348,
+ "height": 0.6395755770326446,
+ "seed": 1663624312,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818537,
+ "startBinding": {
+ "elementId": "9itz4bqXi6IMeZhGhc42J",
+ "focus": -0.09772881248040827,
+ "gap": 14.870387259234633
+ },
+ "endBinding": {
+ "elementId": "FEMcxzUOmwHX8lGW-KR6K",
+ "focus": 0.36409382861238426,
+ "gap": 13.827470007461386
+ },
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": "arrow",
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 104.88363252862348,
+ 0.6395755770326446
+ ]
+ ]
+ },
+ {
+ "type": "arrow",
+ "version": 778,
+ "versionNonce": 1812844588,
+ "isDeleted": false,
+ "id": "IEnqZv0JAf73xE5G5LY1s",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1132.8223412617328,
+ "y": 135.16943809537315,
+ "strokeColor": "#00e676",
+ "backgroundColor": "#ff7043",
+ "width": 116.4656944766266,
+ "height": 1.9037944501569655,
+ "seed": 2055241224,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818537,
+ "startBinding": {
+ "elementId": "SitnQfRbjMmvvsNhTxQRZ",
+ "focus": 0.4543845673944436,
+ "gap": 15.775328240798956
+ },
+ "endBinding": {
+ "elementId": "lIucERyh1MMe7Vzo8_q7d",
+ "focus": -0.22308504197782658,
+ "gap": 15.365988697358375
+ },
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": "arrow",
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 116.4656944766266,
+ -1.9037944501569655
+ ]
+ ]
+ },
+ {
+ "type": "text",
+ "version": 354,
+ "versionNonce": 9934996,
+ "isDeleted": false,
+ "id": "g9t3YfCk9S7S38pod_Itm",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "dashed",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1019.5,
+ "y": 70,
+ "strokeColor": "#ff7043",
+ "backgroundColor": "#7950f2",
+ "width": 84,
+ "height": 36,
+ "seed": 1032706680,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818537,
+ "fontSize": 28,
+ "fontFamily": 1,
+ "text": "Action",
+ "baseline": 25,
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "Action"
+ },
+ {
+ "type": "diamond",
+ "version": 775,
+ "versionNonce": 79652372,
+ "isDeleted": false,
+ "id": "jfnfQYlAh24YsuMMDHNx7",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1006.140893315531,
+ "y": 143.61217895662338,
+ "strokeColor": "#ff7043",
+ "backgroundColor": "#ff7043",
+ "width": 112.64736525303451,
+ "height": 36.77344700318558,
+ "seed": 2110406188,
+ "groupIds": [
+ "HaVHECspFkRC2Qpa0lGum"
+ ],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818537
+ },
+ {
+ "type": "diamond",
+ "version": 816,
+ "versionNonce": 903918892,
+ "isDeleted": false,
+ "id": "6xQj2yQQKSeIivJj9W1ju",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1006.140893315531,
+ "y": 134.74039902836483,
+ "strokeColor": "#ff7043",
+ "backgroundColor": "#ff7043",
+ "width": 112.64736525303451,
+ "height": 36.77344700318558,
+ "seed": 1235290772,
+ "groupIds": [
+ "HaVHECspFkRC2Qpa0lGum"
+ ],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818537
+ },
+ {
+ "type": "diamond",
+ "version": 898,
+ "versionNonce": 496075668,
+ "isDeleted": false,
+ "id": "FEMcxzUOmwHX8lGW-KR6K",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1006.140893315531,
+ "y": 122.10983943365278,
+ "strokeColor": "#ff7043",
+ "backgroundColor": "#ff7043",
+ "width": 112.64736525303451,
+ "height": 36.77344700318558,
+ "seed": 1689884844,
+ "groupIds": [
+ "HaVHECspFkRC2Qpa0lGum"
+ ],
+ "strokeSharpness": "round",
+ "boundElements": [
+ {
+ "id": "3DJ_wB8Ty8UNX4KAZfwjT",
+ "type": "arrow"
+ },
+ {
+ "id": "IEnqZv0JAf73xE5G5LY1s",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1642714818537
+ },
+ {
+ "type": "diamond",
+ "version": 940,
+ "versionNonce": 1625894828,
+ "isDeleted": false,
+ "id": "SitnQfRbjMmvvsNhTxQRZ",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1006.140893315531,
+ "y": 109.57816713635543,
+ "strokeColor": "#ff7043",
+ "backgroundColor": "#ff7043",
+ "width": 112.64736525303451,
+ "height": 36.77344700318558,
+ "seed": 264935444,
+ "groupIds": [
+ "HaVHECspFkRC2Qpa0lGum"
+ ],
+ "strokeSharpness": "round",
+ "boundElements": [
+ {
+ "id": "IEnqZv0JAf73xE5G5LY1s",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1642714818537
+ },
+ {
+ "type": "rectangle",
+ "version": 4955,
+ "versionNonce": 1631842580,
+ "isDeleted": false,
+ "id": "qfqvZwfY8g2maDsv8tzi-",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1281.5965467571473,
+ "y": 81.99348491888458,
+ "strokeColor": "#00e676",
+ "backgroundColor": "#fff",
+ "width": 70.67858069123133,
+ "height": 107.25081879410921,
+ "seed": 320002220,
+ "groupIds": [
+ "33LizGdDAL7lJNoiSiJZy"
+ ],
+ "strokeSharpness": "sharp",
+ "boundElements": [
+ {
+ "type": "arrow",
+ "id": "CFu0B4Mw_1wC1Hbgx8Fs0"
+ },
+ {
+ "type": "arrow",
+ "id": "XIl_NhaFtRO00pX5Pq6VU"
+ },
+ {
+ "type": "arrow",
+ "id": "EndiSTFlx1AT7vcBVjgve"
+ },
+ {
+ "id": "sbyEF_hTthhrIaA-47du2",
+ "type": "arrow"
+ },
+ {
+ "id": "3DJ_wB8Ty8UNX4KAZfwjT",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1642714818537
+ },
+ {
+ "type": "rectangle",
+ "version": 5003,
+ "versionNonce": 972970540,
+ "isDeleted": false,
+ "id": "Cydk-vrvGXEEAXU4XHWk7",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1274.049113721433,
+ "y": 74.97339563317036,
+ "strokeColor": "#00e676",
+ "backgroundColor": "#fff",
+ "width": 70.67858069123133,
+ "height": 107.25081879410921,
+ "seed": 2124765204,
+ "groupIds": [
+ "m2CJZBWcxZ3sXLBcib5Jt",
+ "33LizGdDAL7lJNoiSiJZy"
+ ],
+ "strokeSharpness": "sharp",
+ "boundElements": [
+ {
+ "type": "arrow",
+ "id": "CFu0B4Mw_1wC1Hbgx8Fs0"
+ },
+ {
+ "type": "arrow",
+ "id": "XIl_NhaFtRO00pX5Pq6VU"
+ },
+ {
+ "type": "arrow",
+ "id": "EndiSTFlx1AT7vcBVjgve"
+ }
+ ],
+ "updated": 1642714818537
+ },
+ {
+ "type": "rectangle",
+ "version": 5100,
+ "versionNonce": 793554580,
+ "isDeleted": false,
+ "id": "lIucERyh1MMe7Vzo8_q7d",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1264.6540244357177,
+ "y": 66.71948938317058,
+ "strokeColor": "#00e676",
+ "backgroundColor": "#fff",
+ "width": 70.67858069123133,
+ "height": 107.25081879410921,
+ "seed": 722133804,
+ "groupIds": [
+ "33LizGdDAL7lJNoiSiJZy"
+ ],
+ "strokeSharpness": "sharp",
+ "boundElements": [
+ {
+ "type": "arrow",
+ "id": "CFu0B4Mw_1wC1Hbgx8Fs0"
+ },
+ {
+ "type": "arrow",
+ "id": "XIl_NhaFtRO00pX5Pq6VU"
+ },
+ {
+ "type": "arrow",
+ "id": "EndiSTFlx1AT7vcBVjgve"
+ },
+ {
+ "id": "IEnqZv0JAf73xE5G5LY1s",
+ "type": "arrow"
+ }
+ ],
+ "updated": 1642714818537
+ },
+ {
+ "type": "line",
+ "version": 4221,
+ "versionNonce": 1007301804,
+ "isDeleted": false,
+ "id": "3UaWROnZ6NNaCTSa51ntD",
+ "fillStyle": "solid",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1276.6404510226287,
+ "y": 115.46672643052324,
+ "strokeColor": "#00e676",
+ "backgroundColor": "#fff",
+ "width": 46.57983585730082,
+ "height": 3.249953844290203,
+ "seed": 166278548,
+ "groupIds": [
+ "33LizGdDAL7lJNoiSiJZy"
+ ],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818537,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 40.42449133807562,
+ 0.1573930526684746
+ ],
+ [
+ 46.57983585730082,
+ -3.0925607916217284
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 4247,
+ "versionNonce": 140622868,
+ "isDeleted": false,
+ "id": "H3c0943V86dq4MeskNY-E",
+ "fillStyle": "solid",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1278.495703260643,
+ "y": 84.00143913168466,
+ "strokeColor": "#00e676",
+ "backgroundColor": "#fff",
+ "width": 45.567415680676426,
+ "height": 2.8032978840147194,
+ "seed": 1285397932,
+ "groupIds": [
+ "33LizGdDAL7lJNoiSiJZy"
+ ],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818537,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 16.832548902953302,
+ -2.8032978840147194
+ ],
+ [
+ 45.567415680676426,
+ -0.3275477042019195
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 4272,
+ "versionNonce": 1958133548,
+ "isDeleted": false,
+ "id": "g62fLo1BCU_TuN8OEk_ie",
+ "fillStyle": "solid",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1278.4191037442736,
+ "y": 151.39581340204182,
+ "strokeColor": "#00e676",
+ "backgroundColor": "#fff",
+ "width": 48.33668263438425,
+ "height": 4.280657518731036,
+ "seed": 198533908,
+ "groupIds": [
+ "33LizGdDAL7lJNoiSiJZy"
+ ],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818537,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 26.41225578429045,
+ -0.2552319773002338
+ ],
+ [
+ 37.62000339651456,
+ 2.3153712935189787
+ ],
+ [
+ 48.33668263438425,
+ -1.9652862252120569
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 4309,
+ "versionNonce": 1719212436,
+ "isDeleted": false,
+ "id": "jMbD-eUPMlCihQh7GK--c",
+ "fillStyle": "solid",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1275.2350565627432,
+ "y": 162.6389618103206,
+ "strokeColor": "#00e676",
+ "backgroundColor": "#fff",
+ "width": 54.40694982784246,
+ "height": 2.9096445412231735,
+ "seed": 1358235692,
+ "groupIds": [
+ "33LizGdDAL7lJNoiSiJZy"
+ ],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818537,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 10.166093050596771,
+ -1.166642430373031
+ ],
+ [
+ 16.130660965377448,
+ -0.8422655250909383
+ ],
+ [
+ 46.26079588567538,
+ 0.6125567455206506
+ ],
+ [
+ 54.40694982784246,
+ -2.297087795702523
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 4274,
+ "versionNonce": 745404844,
+ "isDeleted": false,
+ "id": "lmzq_v_7Zzb2T4WxQPEqG",
+ "fillStyle": "solid",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1275.519899458309,
+ "y": 99.06204068494588,
+ "strokeColor": "#00e676",
+ "backgroundColor": "#fff",
+ "width": 46.92865289294453,
+ "height": 2.4757501798128,
+ "seed": 719315092,
+ "groupIds": [
+ "33LizGdDAL7lJNoiSiJZy"
+ ],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818537,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 18.193786115221407,
+ -0.5912874140789839
+ ],
+ [
+ 46.92865289294453,
+ 1.884462765733816
+ ]
+ ]
+ },
+ {
+ "type": "line",
+ "version": 4289,
+ "versionNonce": 348702484,
+ "isDeleted": false,
+ "id": "YoZdONxrJotpnXjxFe748",
+ "fillStyle": "solid",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1275.6273876544594,
+ "y": 133.54536972078546,
+ "strokeColor": "#00e676",
+ "backgroundColor": "#fff",
+ "width": 46.92865289294453,
+ "height": 2.4757501798128,
+ "seed": 1543185068,
+ "groupIds": [
+ "33LizGdDAL7lJNoiSiJZy"
+ ],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818537,
+ "lastCommittedPoint": null,
+ "startArrowhead": null,
+ "endArrowhead": null,
+ "points": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 8.093938105125233,
+ 1.4279702913643746
+ ],
+ [
+ 18.193786115221407,
+ -0.5912874140789839
+ ],
+ [
+ 46.92865289294453,
+ 1.884462765733816
+ ]
+ ]
+ },
+ {
+ "type": "text",
+ "version": 450,
+ "versionNonce": 240772140,
+ "isDeleted": false,
+ "id": "fAIYPmdTgnjEqc8PGu-SI",
+ "fillStyle": "hachure",
+ "strokeWidth": 1,
+ "strokeStyle": "solid",
+ "roughness": 0,
+ "opacity": 100,
+ "angle": 0,
+ "x": 1255.9645759420482,
+ "y": 203.9818965480822,
+ "strokeColor": "#00e676",
+ "backgroundColor": "#03a9f4",
+ "width": 134,
+ "height": 26,
+ "seed": 1891202964,
+ "groupIds": [],
+ "strokeSharpness": "round",
+ "boundElements": [],
+ "updated": 1642714818537,
+ "fontSize": 20,
+ "fontFamily": 1,
+ "text": "Output Data",
+ "baseline": 18,
+ "textAlign": "left",
+ "verticalAlign": "top",
+ "containerId": null,
+ "originalText": "Output Data"
+ }
+ ],
+ "appState": {
+ "gridSize": null,
+ "viewBackgroundColor": "#ffffff"
+ },
+ "files": {}
+}
\ No newline at end of file
diff --git a/docs/images/task.png b/docs/images/task.png
new file mode 100644
index 00000000..f8fbf8ee
Binary files /dev/null and b/docs/images/task.png differ
diff --git a/docs/pipeline/audio/transcription.md b/docs/pipeline/audio/transcription.md
index 332cd93c..bda61d9d 100644
--- a/docs/pipeline/audio/transcription.md
+++ b/docs/pipeline/audio/transcription.md
@@ -1,13 +1,68 @@
# Transcription
-A Transcription pipeline converts speech in audio files to text.
+![pipeline](../../images/pipeline.png#only-light)
+![pipeline](../../images/pipeline-dark.png#only-dark)
-Transcription parameters are set as constructor arguments. Examples below.
+The Transcription pipeline converts speech in audio files to text.
+
+## Example
+
+The following shows a simple example using this pipeline.
```python
-Transcription()
-Transcription("facebook/wav2vec2-large-960h")
+from txtai.pipeline import Transcription
+
+# Create and run pipeline
+transcribe = Transcription()
+transcribe("path to wav file")
```
-::: txtai.pipeline.Transcription.__init__
-::: txtai.pipeline.Transcription.__call__
+See the link below for a more detailed example.
+
+| Notebook | Description | |
+|:----------|:-------------|------:|
+| [Transcribe audio to text](https://github.com/neuml/txtai/blob/master/examples/11_Transcribe_audio_to_text.ipynb) | Convert audio files to text | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/11_Transcribe_audio_to_text.ipynb) |
+
+## Configuration-driven example
+
+Pipelines are run with Python or configuration. Pipelines can be instantiated in [configuration](../../../api/configuration/#pipeline) using the lower case name of the pipeline. Configuration-driven pipelines are run with [workflows](../../../workflow/#configuration-driven-example) or the [API](../../../api).
+
+### config.yml
+```yaml
+# Create pipeline using lower case class name
+transcription:
+
+# Run pipeline with workflow
+workflow:
+ transcribe:
+ tasks:
+ - action: transcription
+```
+
+### Run with Workflows
+
+```python
+from txtai.api import API
+
+# Create and run pipeline with workflow
+app = API("config.yml")
+list(app.workflow("transcribe", ["path to wav file"]))
+```
+
+### Run with API
+
+```bash
+CONFIG=config.yml uvicorn "txtai.api:app" &
+
+curl \
+ -X POST "http://localhost:8000/workflow" \
+ -H "Content-Type: application/json" \
+ -d '{"name":"transcribe", "elements":["path to wav file"]}'
+```
+
+## Methods
+
+Python documentation for the pipeline.
+
+### ::: txtai.pipeline.Transcription.__init__
+### ::: txtai.pipeline.Transcription.__call__
diff --git a/docs/pipeline/data/segmentation.md b/docs/pipeline/data/segmentation.md
index d76bda7e..1caf6400 100644
--- a/docs/pipeline/data/segmentation.md
+++ b/docs/pipeline/data/segmentation.md
@@ -1,12 +1,63 @@
# Segmentation
-A Segmentation pipeline segments text into semantic units.
+![pipeline](../../images/pipeline.png#only-light)
+![pipeline](../../images/pipeline-dark.png#only-dark)
-Segmentation parameters are set as constructor arguments. Examples below.
+The Segmentation pipeline segments text into semantic units.
+
+## Example
+
+The following shows a simple example using this pipeline.
```python
-Segmentation()
+from txtai.pipeline import Segmentation
+
+# Create and run pipeline
+segment = Segmentation(sentences=True)
+segment("This is a test. And another test.")
+```
+
+## Configuration-driven example
+
+Pipelines are run with Python or configuration. Pipelines can be instantiated in [configuration](../../../api/configuration/#pipeline) using the lower case name of the pipeline. Configuration-driven pipelines are run with [workflows](../../../workflow/#configuration-driven-example) or the [API](../../../api).
+
+### config.yml
+```yaml
+# Create pipeline using lower case class name
+segmentation:
+ sentences: true
+
+# Run pipeline with workflow
+workflow:
+ segment:
+ tasks:
+ - action: segmentation
```
-::: txtai.pipeline.Segmentation.__init__
-::: txtai.pipeline.Segmentation.__call__
+### Run with Workflows
+
+```python
+from txtai.api import API
+
+# Create and run pipeline with workflow
+app = API("config.yml")
+list(app.workflow("segment", ["This is a test. And another test."]))
+```
+
+### Run with API
+
+```bash
+CONFIG=config.yml uvicorn "txtai.api:app" &
+
+curl \
+ -X POST "http://localhost:8000/workflow" \
+ -H "Content-Type: application/json" \
+ -d '{"name":"segment", "elements":["This is a test. And another test."]}'
+```
+
+## Methods
+
+Python documentation for the pipeline.
+
+### ::: txtai.pipeline.Segmentation.__init__
+### ::: txtai.pipeline.Segmentation.__call__
diff --git a/docs/pipeline/data/tabular.md b/docs/pipeline/data/tabular.md
index 68fa8952..852b08d3 100644
--- a/docs/pipeline/data/tabular.md
+++ b/docs/pipeline/data/tabular.md
@@ -1,10 +1,71 @@
# Tabular
-A Tabular pipeline splits tabular data into rows and columns.
+![pipeline](../../images/pipeline.png#only-light)
+![pipeline](../../images/pipeline-dark.png#only-dark)
+
+The Tabular pipeline splits tabular data into rows and columns. The tabular pipeline is most useful in creating (id, text, tag) tuples to load into Embedding indexes.
+
+## Example
+
+The following shows a simple example using this pipeline.
+
+```python
+from txtai.pipeline import Tabular
+
+# Create and run pipeline
+tabular = Tabular("id", ["text"])
+tabular("path to csv file")
+```
+
+See the link below for a more detailed example.
+
+| Notebook | Description | |
+|:----------|:-------------|------:|
+| [Transform tabular data with composable workflows](https://github.com/neuml/txtai/blob/master/examples/22_Transform_tabular_data_with_composable_workflows.ipynb) | Transform, index and search tabular data | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/22_Transform_tabular_data_with_composable_workflows.ipynb) |
+
+## Configuration-driven example
+
+Pipelines are run with Python or configuration. Pipelines can be instantiated in [configuration](../../../api/configuration/#pipeline) using the lower case name of the pipeline. Configuration-driven pipelines are run with [workflows](../../../workflow/#configuration-driven-example) or the [API](../../../api).
+
+### config.yml
+```yaml
+# Create pipeline using lower case class name
+tabular:
+ idcolumn: id
+ textcolumns:
+ - text
+
+# Run pipeline with workflow
+workflow:
+ tabular:
+ tasks:
+ - action: tabular
+```
+
+### Run with Workflows
```python
-Tabular(idcolumns, [textcolumns])
+from txtai.api import API
+
+# Create and run pipeline with workflow
+app = API("config.yml")
+list(app.workflow("tabular", ["path to csv file"]))
```
-::: txtai.pipeline.Tabular.__init__
-::: txtai.pipeline.Tabular.__call__
+### Run with API
+
+```bash
+CONFIG=config.yml uvicorn "txtai.api:app" &
+
+curl \
+ -X POST "http://localhost:8000/workflow" \
+ -H "Content-Type: application/json" \
+ -d '{"name":"tabular", "elements":["path to csv file"]}'
+```
+
+## Methods
+
+Python documentation for the pipeline.
+
+### ::: txtai.pipeline.Tabular.__init__
+### ::: txtai.pipeline.Tabular.__call__
diff --git a/docs/pipeline/data/textractor.md b/docs/pipeline/data/textractor.md
index a9248474..6f10ee6e 100644
--- a/docs/pipeline/data/textractor.md
+++ b/docs/pipeline/data/textractor.md
@@ -1,12 +1,68 @@
# Textractor
-A Textractor pipeline extracts and splits text from documents.
+![pipeline](../../images/pipeline.png#only-light)
+![pipeline](../../images/pipeline-dark.png#only-dark)
-Textractor parameters are set as constructor arguments. Examples below.
+The Textractor pipeline extracts and splits text from documents. This pipeline uses either an [Apache Tika](https://github.com/chrismattmann/tika-python) backend (if Java is available) or [BeautifulSoup4](https://pypi.org/project/beautifulsoup4/).
+
+## Example
+
+The following shows a simple example using this pipeline.
```python
-Textractor()
+from txtai.pipeline import Textractor
+
+# Create and run pipeline
+textract = Textractor()
+textract("https://github.com/neuml/txtai")
```
-::: txtai.pipeline.Textractor.__init__
-::: txtai.pipeline.Textractor.__call__
+See the link below for a more detailed example.
+
+| Notebook | Description | |
+|:----------|:-------------|------:|
+| [Extract text from documents](https://github.com/neuml/txtai/blob/master/examples/10_Extract_text_from_documents.ipynb) | Extract text from PDF, Office, HTML and more | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/10_Extract_text_from_documents.ipynb) |
+
+## Configuration-driven example
+
+Pipelines are run with Python or configuration. Pipelines can be instantiated in [configuration](../../../api/configuration/#pipeline) using the lower case name of the pipeline. Configuration-driven pipelines are run with [workflows](../../../workflow/#configuration-driven-example) or the [API](../../../api).
+
+### config.yml
+```yaml
+# Create pipeline using lower case class name
+textractor:
+
+# Run pipeline with workflow
+workflow:
+ textract:
+ tasks:
+ - action: textractor
+```
+
+### Run with Workflows
+
+```python
+from txtai.api import API
+
+# Create and run pipeline with workflow
+app = API("config.yml")
+list(app.workflow("textract", ["https://github.com/neuml/txtai"]))
+```
+
+### Run with API
+
+```bash
+CONFIG=config.yml uvicorn "txtai.api:app" &
+
+curl \
+ -X POST "http://localhost:8000/workflow" \
+ -H "Content-Type: application/json" \
+ -d '{"name":"textract", "elements":["https://github.com/neuml/txtai"]}'
+```
+
+## Methods
+
+Python documentation for the pipeline.
+
+### ::: txtai.pipeline.Textractor.__init__
+### ::: txtai.pipeline.Textractor.__call__
diff --git a/docs/pipeline/image/caption.md b/docs/pipeline/image/caption.md
index b9c905dc..ac228a1e 100644
--- a/docs/pipeline/image/caption.md
+++ b/docs/pipeline/image/caption.md
@@ -1,10 +1,62 @@
# Caption
-A caption pipeline reads a list of images and returns a list of captions for those images.
+![pipeline](../../images/pipeline.png#only-light)
+![pipeline](../../images/pipeline-dark.png#only-dark)
+
+The caption pipeline reads a list of images and returns a list of captions for those images.
+
+## Example
+
+The following shows a simple example using this pipeline.
+
+```python
+from txtai.pipeline import Caption
+
+# Create and run pipeline
+caption = Caption()
+caption("path to image file")
+```
+
+## Configuration-driven example
+
+Pipelines are run with Python or configuration. Pipelines can be instantiated in [configuration](../../../api/configuration/#pipeline) using the lower case name of the pipeline. Configuration-driven pipelines are run with [workflows](../../../workflow/#configuration-driven-example) or the [API](../../../api).
+
+### config.yml
+```yaml
+# Create pipeline using lower case class name
+caption:
+
+# Run pipeline with workflow
+workflow:
+ caption:
+ tasks:
+ - action: caption
+```
+
+### Run with Workflows
```python
-Caption()
+from txtai.api import API
+
+# Create and run pipeline with workflow
+app = API("config.yml")
+list(app.workflow("caption", ["path to image file"]))
+```
+
+### Run with API
+
+```bash
+CONFIG=config.yml uvicorn "txtai.api:app" &
+
+curl \
+ -X POST "http://localhost:8000/workflow" \
+ -H "Content-Type: application/json" \
+ -d '{"name":"caption", "elements":["path to image file"]}'
```
-::: txtai.pipeline.Caption.__init__
-::: txtai.pipeline.Caption.__call__
+## Methods
+
+Python documentation for the pipeline.
+
+### ::: txtai.pipeline.Caption.__init__
+### ::: txtai.pipeline.Caption.__call__
diff --git a/docs/pipeline/image/objects.md b/docs/pipeline/image/objects.md
index 6cfa3fc2..8fcbe0b1 100644
--- a/docs/pipeline/image/objects.md
+++ b/docs/pipeline/image/objects.md
@@ -1,14 +1,62 @@
# Objects
-A objects pipeline reads a list of images and returns a list of detected objects.
+![pipeline](../../images/pipeline.png#only-light)
+![pipeline](../../images/pipeline-dark.png#only-dark)
+
+The Objects pipeline reads a list of images and returns a list of detected objects.
+
+## Example
+
+The following shows a simple example using this pipeline.
```python
-# Default configuration
-Objects()
+from txtai.pipeline import Objects
+
+# Create and run pipeline
+objects = Objects()
+objects("path to image file")
+```
-# Detect objects with an image classificaton model
-Objects(classification=True, threshold=0.95)
+## Configuration-driven example
+
+Pipelines are run with Python or configuration. Pipelines can be instantiated in [configuration](../../../api/configuration/#pipeline) using the lower case name of the pipeline. Configuration-driven pipelines are run with [workflows](../../../workflow/#configuration-driven-example) or the [API](../../../api).
+
+### config.yml
+```yaml
+# Create pipeline using lower case class name
+objects:
+
+# Run pipeline with workflow
+workflow:
+ objects:
+ tasks:
+ - action: objects
```
-::: txtai.pipeline.Objects.__init__
-::: txtai.pipeline.Objects.__call__
+### Run with Workflows
+
+```python
+from txtai.api import API
+
+# Create and run pipeline with workflow
+app = API("config.yml")
+list(app.workflow("objects", ["path to image file"]))
+```
+
+### Run with API
+
+```bash
+CONFIG=config.yml uvicorn "txtai.api:app" &
+
+curl \
+ -X POST "http://localhost:8000/workflow" \
+ -H "Content-Type: application/json" \
+ -d '{"name":"objects", "elements":["path to image file"]}'
+```
+
+## Methods
+
+Python documentation for the pipeline.
+
+### ::: txtai.pipeline.Objects.__init__
+### ::: txtai.pipeline.Objects.__call__
diff --git a/docs/pipeline/index.md b/docs/pipeline/index.md
index 46999e7d..8ea38c06 100644
--- a/docs/pipeline/index.md
+++ b/docs/pipeline/index.md
@@ -3,10 +3,13 @@
![pipeline](../images/pipeline.png#only-light)
![pipeline](../images/pipeline-dark.png#only-dark)
-txtai provides a generic pipeline processing framework with the only interface requirement being a `__call__` method. Pipelines are flexible and can
-process various types of data. Pipelines can wrap machine learning models as well as other processes.
+txtai provides a generic pipeline processing framework with the only interface requirement being a `__call__` method. Pipelines are flexible and process various types of data. Pipelines can wrap machine learning models as well as other processes.
-The following pipeline types are currently supported.
+Pipelines are run with Python or configuration. Pipelines can be instantiated in [configuration](../api/configuration/#pipeline) using the lower case name of the pipeline. Configuration-driven pipelines are run with [workflows](../workflow/#configuration-driven-example) or the [API](../api).
+
+## List of pipelines
+
+The following is a list of the default pipelines available in txtai.
- Audio
- [Transcription](audio/transcription)
diff --git a/docs/pipeline/text/extractor.md b/docs/pipeline/text/extractor.md
index 306e6405..968b9510 100644
--- a/docs/pipeline/text/extractor.md
+++ b/docs/pipeline/text/extractor.md
@@ -1,12 +1,71 @@
# Extractor
-An Extractor pipeline is a combination of an embeddings query and an Extractive QA model. Filtering the context for a QA model helps maximize performance of the model.
+![pipeline](../../images/pipeline.png#only-light)
+![pipeline](../../images/pipeline-dark.png#only-dark)
-Extractor parameters are set as constructor arguments. Examples below.
+The Extractor pipeline is a combination of an embeddings query and an Extractive QA model. Filtering the context for a QA model helps maximize performance of the model.
+
+## Example
+
+The following shows a simple example using this pipeline.
```python
-Extractor(embeddings, path, quantize, gpu, model, tokenizer)
+from txtai.embeddings import Embeddings
+from txtai.pipeline import Extractor
+
+# Embeddings model ranks candidates before passing to QA pipeline
+embeddings = Embeddings({"path": "sentence-transformers/nli-mpnet-base-v2"})
+
+# Create and run pipeline
+extractor = Extractor(embeddings, "distilbert-base-cased-distilled-squad")
+extractor([["What was won"] * 3 + [False]],
+ ["Maine man wins $1M from $25 lottery ticket"])
```
-::: txtai.pipeline.Extractor.__init__
-::: txtai.pipeline.Extractor.__call__
+See the links below for more detailed examples.
+
+| Notebook | Description | |
+|:----------|:-------------|------:|
+| [Extractive QA with txtai](https://github.com/neuml/txtai/blob/master/examples/05_Extractive_QA_with_txtai.ipynb) | Introduction to extractive question-answering with txtai | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/05_Extractive_QA_with_txtai.ipynb) |
+| [Extractive QA with Elasticsearch](https://github.com/neuml/txtai/blob/master/examples/06_Extractive_QA_with_Elasticsearch.ipynb) | Run extractive question-answering queries with Elasticsearch | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/06_Extractive_QA_with_Elasticsearch.ipynb) |
+| [Extractive QA to build structured data](https://github.com/neuml/txtai/blob/master/examples/20_Extractive_QA_to_build_structured_data.ipynb) | Build structured datasets using extractive question-answering | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/20_Extractive_QA_to_build_structured_data.ipynb) |
+
+## Configuration-driven example
+
+Pipelines are run with Python or configuration. Pipelines can be instantiated in [configuration](../../../api/configuration/#pipeline) using the lower case name of the pipeline. Configuration-driven pipelines are run with [workflows](../../../workflow/#configuration-driven-example) or the [API](../../../api).
+
+### config.yml
+```yaml
+# Create pipeline using lower case class name
+extractor:
+```
+
+### Run with Workflows
+
+```python
+from txtai.api import API
+
+# Create and run pipeline with workflow
+app = API("config.yml")
+list(app.extract([{"name": "What was won", "query": "What was won",
+ "question", "What was won", "snippet": False}],
+ ["Maine man wins $1M from $25 lottery ticket"]))
+```
+
+### Run with API
+
+```bash
+CONFIG=config.yml uvicorn "txtai.api:app" &
+
+curl \
+ -X POST "http://localhost:8000/extract" \
+ -H "Content-Type: application/json" \
+ -d '{"queue": [{"name":"What was won", "query": "What was won", "question": "What was won", "snippet": false}], "texts": ["Maine man wins $1M from $25 lottery ticket"]}'
+```
+
+## Methods
+
+Python documentation for the pipeline.
+
+### ::: txtai.pipeline.Extractor.__init__
+### ::: txtai.pipeline.Extractor.__call__
diff --git a/docs/pipeline/text/labels.md b/docs/pipeline/text/labels.md
index 402d3fdd..c4449cac 100644
--- a/docs/pipeline/text/labels.md
+++ b/docs/pipeline/text/labels.md
@@ -1,19 +1,72 @@
# Labels
-A Labels pipeline uses a text classification model to apply labels to input text. This pipeline can classify text using either a zero shot model (dynamic labeling) or a standard text classification model (fixed labeling).
+![pipeline](../../images/pipeline.png#only-light)
+![pipeline](../../images/pipeline-dark.png#only-dark)
-Labels parameters are set as constructor arguments. Examples below.
+The Labels pipeline uses a text classification model to apply labels to input text. This pipeline can classify text using either a zero shot model (dynamic labeling) or a standard text classification model (fixed labeling).
+
+## Example
+
+The following shows a simple example using this pipeline.
```python
-# Default configuration
-Labels()
+from txtai.pipeline import Labels
+
+# Create and run pipeline
+labels = Labels()
+labels(
+ ["Great news", "That's rough"],
+ ["positive", "negative"]
+)
+```
+
+See the link below for a more detailed example.
-# Custom model with zero shot classification
-Labels("roberta-large-mnli")
+| Notebook | Description | |
+|:----------|:-------------|------:|
+| [Apply labels with zero shot classification](https://github.com/neuml/txtai/blob/master/examples/07_Apply_labels_with_zero_shot_classification.ipynb) | Use zero shot learning for labeling, classification and topic modeling | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/07_Apply_labels_with_zero_shot_classification.ipynb) |
-# Model with fixed labels
-Labels(dynamic=False)
+## Configuration-driven example
+
+Pipelines are run with Python or configuration. Pipelines can be instantiated in [configuration](../../../api/configuration/#pipeline) using the lower case name of the pipeline. Configuration-driven pipelines are run with [workflows](../../../workflow/#configuration-driven-example) or the [API](../../../api).
+
+### config.yml
+```yaml
+# Create pipeline using lower case class name
+labels:
+
+# Run pipeline with workflow
+workflow:
+ labels:
+ tasks:
+ - action: labels
+ args: [["positive", "negative"]]
```
-::: txtai.pipeline.Labels.__init__
-::: txtai.pipeline.Labels.__call__
+### Run with Workflows
+
+```python
+from txtai.api import API
+
+# Create and run pipeline with workflow
+app = API("config.yml")
+list(app.workflow("labels", ["Great news", "That's rough"]))
+```
+
+### Run with API
+
+```bash
+CONFIG=config.yml uvicorn "txtai.api:app" &
+
+curl \
+ -X POST "http://localhost:8000/workflow" \
+ -H "Content-Type: application/json" \
+ -d '{"name":"labels", "elements": ["Great news", "Thats rough"]}'
+```
+
+## Methods
+
+Python documentation for the pipeline.
+
+### ::: txtai.pipeline.Labels.__init__
+### ::: txtai.pipeline.Labels.__call__
diff --git a/docs/pipeline/text/similarity.md b/docs/pipeline/text/similarity.md
index 5657ba49..56d87df1 100644
--- a/docs/pipeline/text/similarity.md
+++ b/docs/pipeline/text/similarity.md
@@ -1,13 +1,70 @@
# Similarity
-A Similarity pipeline is also a zero shot classifier model where the labels are the queries. The results are transposed to get scores per query/label vs scores per input text.
+![pipeline](../../images/pipeline.png#only-light)
+![pipeline](../../images/pipeline-dark.png#only-dark)
-Similarity parameters are set as constructor arguments. Examples below.
+The Similarity pipeline computes similarity between queries and list of text using a text classifier.
+
+This pipeline supports both standard text classification models and zero-shot classification models. The pipeline uses the queries as labels for the input text. The results are transposed to get scores per query/label vs scores per input text.
+
+## Example
+
+The following shows a simple example using this pipeline.
```python
-Similarity()
-Similarity("roberta-large-mnli")
+from txtai.pipeline import Similarity
+
+# Create and run pipeline
+similarity = Similarity()
+similarity("feel good story", [
+ "Maine man wins $1M from $25 lottery ticket",
+ "Don't sacrifice slower friends in a bear attack"
+])
```
-::: txtai.pipeline.Similarity.__init__
-::: txtai.pipeline.Similarity.__call__
+See the link below for a more detailed example.
+
+| Notebook | Description | |
+|:----------|:-------------|------:|
+| [Add semantic search to Elasticsearch](https://github.com/neuml/txtai/blob/master/examples/04_Add_semantic_search_to_Elasticsearch.ipynb) | Add semantic search to existing search systems | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/04_Add_semantic_search_to_Elasticsearch.ipynb) |
+
+## Configuration-driven example
+
+Pipelines are run with Python or configuration. Pipelines can be instantiated in [configuration](../../../api/configuration/#pipeline) using the lower case name of the pipeline. Configuration-driven pipelines are run with [workflows](../../../workflow/#configuration-driven-example) or the [API](../../../api).
+
+### config.yml
+```yaml
+# Create pipeline using lower case class name
+similarity:
+```
+
+### Run with Workflows
+
+```python
+from txtai.api import API
+
+# Create and run pipeline with workflow
+app = API("config.yml")
+app.similarity("feel good story", [
+ "Maine man wins $1M from $25 lottery ticket",
+ "Don't sacrifice slower friends in a bear attack"
+])
+```
+
+### Run with API
+
+```bash
+CONFIG=config.yml uvicorn "txtai.api:app" &
+
+curl \
+ -X POST "http://localhost:8000/similarity" \
+ -H "Content-Type: application/json" \
+ -d '{"query": "feel good story", "texts": ["Maine man wins $1M from $25 lottery ticket", "Dont sacrifice slower friends in a bear attack"]}'
+```
+
+## Methods
+
+Python documentation for the pipeline.
+
+### ::: txtai.pipeline.Similarity.__init__
+### ::: txtai.pipeline.Similarity.__call__
diff --git a/docs/pipeline/text/summary.md b/docs/pipeline/text/summary.md
index 6b176832..b24916b1 100644
--- a/docs/pipeline/text/summary.md
+++ b/docs/pipeline/text/summary.md
@@ -1,13 +1,68 @@
# Summary
-A Summary pipeline summarizes text.
+![pipeline](../../images/pipeline.png#only-light)
+![pipeline](../../images/pipeline-dark.png#only-dark)
-Summary parameters are set as constructor arguments. Examples below.
+The Summary pipeline summarizes text. This pipeline runs a text2text model that abstractively creates a summary of the input text.
+
+## Example
+
+The following shows a simple example using this pipeline.
```python
-Summary()
-Summary("sshleifer/distilbart-cnn-12-3")
+from txtai.pipeline import Summary
+
+# Create and run pipeline
+summary = Summary()
+summary("Enter long, detailed text to summarize here")
```
-::: txtai.pipeline.Summary.__init__
-::: txtai.pipeline.Summary.__call__
+See the link below for a more detailed example.
+
+| Notebook | Description | |
+|:----------|:-------------|------:|
+| [Building abstractive text summaries](https://github.com/neuml/txtai/blob/master/examples/09_Building_abstractive_text_summaries.ipynb) | Run abstractive text summarization | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/09_Building_abstractive_text_summaries.ipynb) |
+
+## Configuration-driven example
+
+Pipelines are run with Python or configuration. Pipelines can be instantiated in [configuration](../../../api/configuration/#pipeline) using the lower case name of the pipeline. Configuration-driven pipelines are run with [workflows](../../../workflow/#configuration-driven-example) or the [API](../../../api).
+
+### config.yml
+```yaml
+# Create pipeline using lower case class name
+summary:
+
+# Run pipeline with workflow
+workflow:
+ summary:
+ tasks:
+ - action: summary
+```
+
+### Run with Workflows
+
+```python
+from txtai.api import API
+
+# Create and run pipeline with workflow
+app = API("config.yml")
+list(app.workflow("summary", ["Enter long, detailed text to summarize here"]))
+```
+
+### Run with API
+
+```bash
+CONFIG=config.yml uvicorn "txtai.api:app" &
+
+curl \
+ -X POST "http://localhost:8000/workflow" \
+ -H "Content-Type: application/json" \
+ -d '{"name":"summary", "elements":["Enter long, detailed text to summarize here"]}'
+```
+
+## Methods
+
+Python documentation for the pipeline.
+
+### ::: txtai.pipeline.Summary.__init__
+### ::: txtai.pipeline.Summary.__call__
diff --git a/docs/pipeline/text/translation.md b/docs/pipeline/text/translation.md
index 2ef2c7cf..e8597a43 100644
--- a/docs/pipeline/text/translation.md
+++ b/docs/pipeline/text/translation.md
@@ -1,12 +1,69 @@
# Translation
-A Translation pipeline translates text between languages
+![pipeline](../../images/pipeline.png#only-light)
+![pipeline](../../images/pipeline-dark.png#only-dark)
-Translation parameters are set as constructor arguments. Examples below.
+The Translation pipeline translates text between languages. It supports over 100+ languages. Automatic source language detection is built-in. This pipeline detects the language of each input text row, loads a model for the source-target combination and translates text to the target language.
+
+## Example
+
+The following shows a simple example using this pipeline.
```python
-Translation()
+from txtai.pipeline import Translation
+
+# Create and run pipeline
+translate = Translation()
+translate("This is a test translation into Spanish", "es")
```
-::: txtai.pipeline.Translation.__init__
-::: txtai.pipeline.Translation.__call__
+See the link below for a more detailed example.
+
+| Notebook | Description | |
+|:----------|:-------------|------:|
+| [Translate text between languages](https://github.com/neuml/txtai/blob/master/examples/12_Translate_text_between_languages.ipynb) | Streamline machine translation and language detection | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/12_Translate_text_between_languages.ipynb) |
+
+## Configuration-driven example
+
+Pipelines are run with Python or configuration. Pipelines can be instantiated in [configuration](../../../api/configuration/#pipeline) using the lower case name of the pipeline. Configuration-driven pipelines are run with [workflows](../../../workflow/#configuration-driven-example) or the [API](../../../api).
+
+### config.yml
+```yaml
+# Create pipeline using lower case class name
+translation:
+
+# Run pipeline with workflow
+workflow:
+ translate:
+ tasks:
+ - action: translation
+ args: ["es"]
+```
+
+### Run with Workflows
+
+```python
+from txtai.api import API
+
+# Create and run pipeline with workflow
+app = API("config.yml")
+list(app.workflow("translate", ["This is a test translation into Spanish"]))
+```
+
+### Run with API
+
+```bash
+CONFIG=config.yml uvicorn "txtai.api:app" &
+
+curl \
+ -X POST "http://localhost:8000/workflow" \
+ -H "Content-Type: application/json" \
+ -d '{"name":"translate", "elements":["This is a test translation into Spanish"]}'
+```
+
+## Methods
+
+Python documentation for the pipeline.
+
+### ::: txtai.pipeline.Translation.__init__
+### ::: txtai.pipeline.Translation.__call__
diff --git a/docs/pipeline/train/hfonnx.md b/docs/pipeline/train/hfonnx.md
index c0008c0f..18378c66 100644
--- a/docs/pipeline/train/hfonnx.md
+++ b/docs/pipeline/train/hfonnx.md
@@ -1,9 +1,14 @@
# HFOnnx
+![pipeline](../../images/pipeline.png#only-light)
+![pipeline](../../images/pipeline-dark.png#only-dark)
+
Exports a Hugging Face Transformer model to ONNX. Currently, this works best with classification/pooling/qa models. Work is ongoing for sequence to
sequence models (summarization, transcription, translation).
-Example on how to use the pipeline below.
+## Example
+
+The following shows a simple example using this pipeline.
```python
from txtai.pipeline import HFOnnx, Labels
@@ -20,5 +25,14 @@ labels = Labels((model, path), dynamic=False)
labels("I am happy")
```
-::: txtai.pipeline.HFOnnx.__init__
-::: txtai.pipeline.HFOnnx.__call__
+See the link below for a more detailed example.
+
+| Notebook | Description | |
+|:----------|:-------------|------:|
+| [Export and run models with ONNX](https://github.com/neuml/txtai/blob/master/examples/18_Export_and_run_models_with_ONNX.ipynb) | Export models with ONNX, run natively in JavaScript, Java and Rust | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/18_Export_and_run_models_with_ONNX.ipynb) |
+
+## Methods
+
+Python documentation for the pipeline.
+
+### ::: txtai.pipeline.HFOnnx.__call__
diff --git a/docs/pipeline/train/mlonnx.md b/docs/pipeline/train/mlonnx.md
index 20e1494b..b2de1f5f 100644
--- a/docs/pipeline/train/mlonnx.md
+++ b/docs/pipeline/train/mlonnx.md
@@ -1,6 +1,20 @@
# MLOnnx
+![pipeline](../../images/pipeline.png#only-light)
+![pipeline](../../images/pipeline-dark.png#only-dark)
+
Exports a traditional machine learning model (i.e. scikit-learn) to ONNX.
-::: txtai.pipeline.MLOnnx.__init__
-::: txtai.pipeline.MLOnnx.__call__
+## Example
+
+See the link below for a detailed example.
+
+| Notebook | Description | |
+|:----------|:-------------|------:|
+| [Export and run other machine learning models](https://github.com/neuml/txtai/blob/master/examples/21_Export_and_run_other_machine_learning_models.ipynb) | Export and run models from scikit-learn, PyTorch and more | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/21_Export_and_run_other_machine_learning_models.ipynb) |
+
+## Methods
+
+Python documentation for the pipeline.
+
+### ::: txtai.pipeline.MLOnnx.__call__
diff --git a/docs/pipeline/train/trainer.md b/docs/pipeline/train/trainer.md
index 6f8e635a..92509fdd 100644
--- a/docs/pipeline/train/trainer.md
+++ b/docs/pipeline/train/trainer.md
@@ -1,8 +1,13 @@
# HFTrainer
+![pipeline](../../images/pipeline.png#only-light)
+![pipeline](../../images/pipeline-dark.png#only-dark)
+
Trains a new Hugging Face Transformer model using the Trainer framework.
-Examples on how to use the trainer below.
+## Example
+
+The following shows a simple example using this pipeline.
```python
import pandas as pd
@@ -32,5 +37,16 @@ model, tokenizer = trainer("bert-base-uncased", dt,
All [TrainingArguments](https://huggingface.co/transformers/main_classes/trainer.html#transformers.TrainingArguments) are supported as function arguments to the trainer call.
-::: txtai.pipeline.HFTrainer.__init__
-::: txtai.pipeline.HFTrainer.__call__
+See the links below for more detailed examples.
+
+| Notebook | Description | |
+|:----------|:-------------|------:|
+| [Train a text labeler](https://github.com/neuml/txtai/blob/master/examples/16_Train_a_text_labeler.ipynb) | Build text sequence classification models | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/16_Train_a_text_labeler.ipynb) |
+| [Train without labels](https://github.com/neuml/txtai/blob/master/examples/17_Train_without_labels.ipynb) | Use zero-shot classifiers to train new models | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/17_Train_without_labels.ipynb) |
+| [Train a QA model](https://github.com/neuml/txtai/blob/master/examples/19_Train_a_QA_model.ipynb) | Build and fine-tune question-answering models | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtai/blob/master/examples/19_Train_a_QA_model.ipynb) |
+
+## Methods
+
+Python documentation for the pipeline.
+
+### ::: txtai.pipeline.HFTrainer.__call__
diff --git a/docs/workflow/file.md b/docs/workflow/file.md
index 77df270a..1f26ab28 100644
--- a/docs/workflow/file.md
+++ b/docs/workflow/file.md
@@ -1,10 +1,33 @@
# File Task
-Task that processes file urls.
+![task](../images/task.png#only-light)
+![task](../images/task-dark.png#only-dark)
+
+The File Task validates a file exists. It handles both file paths and local file urls. Note that this task _only_ works with local files.
+
+## Example
+
+The following shows a simple example using this task as part of a workflow.
```python
+from txtai.workflow import FileTask, Workflow
+
workflow = Workflow([FileTask()])
workflow(["/path/to/file", "file:///path/to/file"])
```
-::: txtai.workflow.FileTask.__init__
+## Configuration-driven example
+
+This task can also be created with workflow configuration.
+
+```yaml
+workflow:
+ tasks:
+ - task: file
+```
+
+## Methods
+
+Python documentation for the task.
+
+### ::: txtai.workflow.FileTask.__init__
diff --git a/docs/workflow/image.md b/docs/workflow/image.md
index 07a8cd03..f899f2fb 100644
--- a/docs/workflow/image.md
+++ b/docs/workflow/image.md
@@ -1,10 +1,33 @@
# Image Task
-Task that processes image urls.
+![task](../images/task.png#only-light)
+![task](../images/task-dark.png#only-dark)
+
+The Image Task reads file paths, check the file is an image and opens it as an Image object. Note that this task _only_ works with local files.
+
+## Example
+
+The following shows a simple example using this task as part of a workflow.
```python
+from txtai.workflow import ImageTask, Workflow
+
workflow = Workflow([ImageTask()])
workflow(["image.jpg", "image.gif"])
```
-::: txtai.workflow.ImageTask.__init__
+## Configuration-driven example
+
+This task can also be created with workflow configuration.
+
+```yaml
+workflow:
+ tasks:
+ - task: image
+```
+
+## Methods
+
+Python documentation for the task.
+
+### ::: txtai.workflow.ImageTask.__init__
diff --git a/docs/workflow/index.md b/docs/workflow/index.md
index 91cc8fb0..9f76d282 100644
--- a/docs/workflow/index.md
+++ b/docs/workflow/index.md
@@ -16,9 +16,11 @@ list(workflow([1, 2, 3]))
This example simply multiplies each input value and returns a outputs via a generator.
+Workflows are run with Python or configuration. Examples of both methods are shown below.
+
## Example
-A full-featured example is shown below. This workflow transcribes a set of audio files, translates the text into French and indexes the data.
+A full-featured example is shown below in Python. This workflow transcribes a set of audio files, translates the text into French and indexes the data.
```python
from txtai.embeddings import Embeddings
@@ -122,3 +124,7 @@ Workflows are callable objects. Workflows take an input of iterable data element
### ::: txtai.workflow.Workflow.__init__
### ::: txtai.workflow.Workflow.__call__
+
+## More examples
+
+See [this link](../examples/#workflows) for a full list of workflow examples.
diff --git a/docs/workflow/retrieve.md b/docs/workflow/retrieve.md
index 55d9b003..166a5bfe 100644
--- a/docs/workflow/retrieve.md
+++ b/docs/workflow/retrieve.md
@@ -1,11 +1,35 @@
# Retrieve Task
-Task that connects to a url and downloads the content locally.
+![task](../images/task.png#only-light)
+![task](../images/task-dark.png#only-dark)
+
+The Retrieve Task connects to a url and downloads the content locally. This task is helpful when working with actions that require data to be available locally.
+
+## Example
+
+The following shows a simple example using this task as part of a workflow.
```python
+from txtai.workflow import RetrieveTask, Workflow
+
workflow = Workflow([RetrieveTask(directory="/tmp")])
workflow(["https://file.to.download", "/local/file/to/copy"])
```
-::: txtai.workflow.RetrieveTask.__init__
-::: txtai.workflow.RetrieveTask.register
+## Configuration-driven example
+
+This task can also be created with workflow configuration.
+
+```yaml
+workflow:
+ tasks:
+ - task: retrieve
+ directory: /tmp
+```
+
+## Methods
+
+Python documentation for the task.
+
+### ::: txtai.workflow.RetrieveTask.__init__
+### ::: txtai.workflow.RetrieveTask.register
diff --git a/docs/workflow/service.md b/docs/workflow/service.md
index ef07c131..659548b2 100644
--- a/docs/workflow/service.md
+++ b/docs/workflow/service.md
@@ -1,11 +1,35 @@
# Service Task
-Task that runs content against a http service.
+![task](../images/task.png#only-light)
+![task](../images/task-dark.png#only-dark)
+
+The Service Task extracts content from a http service.
+
+## Example
+
+The following shows a simple example using this task as part of a workflow.
```python
+from txtai.workflow import ServiceTask, Workflow
+
workflow = Workflow([ServiceTask(url="https://service.url/action)])
workflow(["parameter"])
```
-::: txtai.workflow.ServiceTask.__init__
-::: txtai.workflow.ServiceTask.register
+## Configuration-driven example
+
+This task can also be created with workflow configuration.
+
+```yaml
+workflow:
+ tasks:
+ - task: service
+ url: https://service.url/action
+```
+
+## Methods
+
+Python documentation for the task.
+
+### ::: txtai.workflow.ServiceTask.__init__
+### ::: txtai.workflow.ServiceTask.register
diff --git a/docs/workflow/storage.md b/docs/workflow/storage.md
index 769ddb06..c2d3f4db 100644
--- a/docs/workflow/storage.md
+++ b/docs/workflow/storage.md
@@ -1,10 +1,33 @@
# Storage Task
-Task that expands a local directory or cloud storage bucket into a list of URLs to process.
+![task](../images/task.png#only-light)
+![task](../images/task-dark.png#only-dark)
+
+The Storage Task expands a local directory or cloud storage bucket into a list of URLs to process.
+
+## Example
+
+The following shows a simple example using this task as part of a workflow.
```python
+from txtai.workflow import StorageTask, Workflow
+
workflow = Workflow([StorageTask()])
workflow(["s3://path/to/bucket", "local://local/directory"])
```
-::: txtai.workflow.StorageTask.__init__
+## Configuration-driven example
+
+This task can also be created with workflow configuration.
+
+```yaml
+workflow:
+ tasks:
+ - task: storage
+```
+
+## Methods
+
+Python documentation for the task.
+
+### ::: txtai.workflow.StorageTask.__init__
diff --git a/docs/workflow/task.md b/docs/workflow/task.md
index a6b7cab2..04a3b220 100644
--- a/docs/workflow/task.md
+++ b/docs/workflow/task.md
@@ -1,6 +1,9 @@
# Task
-Workflows execute tasks. Tasks are callable objects with a number of parameters to control the processing of data at a given step.
+![task](../images/task.png#only-light)
+![task](../images/task-dark.png#only-dark)
+
+Workflows execute tasks. Tasks are callable objects with a number of parameters to control the processing of data at a given step. While similar to pipelines, tasks encapsulate processing and don't perform signficant transformations on their own. Tasks perform logic to prepare content for the underlying action(s).
A simple task is shown below.
@@ -28,6 +31,14 @@ workflow = Workflow([task])
list(workflow(["Very long text here"]))
```
+Tasks can also be created with configuration as part of a workflow.
+
+```yaml
+workflow:
+ tasks:
+ - action: summary
+```
+
::: txtai.workflow.Task.__init__
## Multi-action task concurrency
diff --git a/docs/workflow/url.md b/docs/workflow/url.md
index 9ca5f6ce..ee8f667f 100644
--- a/docs/workflow/url.md
+++ b/docs/workflow/url.md
@@ -1,10 +1,33 @@
# Url Task
-Task that processes urls.
+![task](../images/task.png#only-light)
+![task](../images/task-dark.png#only-dark)
+
+The Url Task validates that inputs start with a url prefix.
+
+## Example
+
+The following shows a simple example using this task as part of a workflow.
```python
+from txtai.workflow import UrlTask, Workflow
+
workflow = Workflow([UrlTask()])
workflow(["https://file.to.download", "file:////local/file/to/copy"])
```
-::: txtai.workflow.UrlTask.__init__
+## Configuration-driven example
+
+This task can also be created with workflow configuration.
+
+```yaml
+workflow:
+ tasks:
+ - task: url
+```
+
+## Methods
+
+Python documentation for the task.
+
+### ::: txtai.workflow.UrlTask.__init__
diff --git a/docs/workflow/workflow.md b/docs/workflow/workflow.md
index 50691c11..672f9ede 100644
--- a/docs/workflow/workflow.md
+++ b/docs/workflow/workflow.md
@@ -1,10 +1,23 @@
# Workflow Task
-Task that runs a Workflow. Allows creating workflows of workflows.
+![task](../images/task.png#only-light)
+![task](../images/task-dark.png#only-dark)
+
+The Workflow Task runs a workflow. Allows creating workflows of workflows.
+
+## Example
+
+The following shows a simple example using this task as part of a workflow.
```python
-workflow = Workflow([WorkflowTask(workflow)])
+from txtai.workflow import WorkflowTask, Workflow
+
+workflow = Workflow([WorkflowTask(otherworkflow)])
workflow(["input data"])
```
-::: txtai.workflow.WorkflowTask.__init__
+## Methods
+
+Python documentation for the task.
+
+### ::: txtai.workflow.WorkflowTask.__init__
diff --git a/mkdocs.yml b/mkdocs.yml
index 1eff2d96..79e7f428 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -89,4 +89,4 @@ nav:
- Configuration: api/configuration.md
- Cluster: api/cluster.md
- Docker: api/docker.md
- - Further Reading: articles.md
+ - Further Reading: further.md