Skip to content

armgit / txtai

Public Imported from GitHub
0

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

Add links to txtai in all example notebooks, closes #202

davidmezzettic6a8b14992de
diff --git a/examples/02_Build_an_Embeddings_index_with_Hugging_Face_Datasets.ipynb b/examples/02_Build_an_Embeddings_index_with_Hugging_Face_Datasets.ipynb
index d8bea1a5..4873b257 100644
--- a/examples/02_Build_an_Embeddings_index_with_Hugging_Face_Datasets.ipynb
+++ b/examples/02_Build_an_Embeddings_index_with_Hugging_Face_Datasets.ipynb
@@ -22,6 +22,8 @@
"source": [
"# Build an Embeddings index with Hugging Face Datasets\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"This notebook shows how txtai can index and search with Hugging Face's [Datasets](https://github.com/huggingface/datasets) library. Datasets opens access to a large and growing list of publicly available datasets. Datasets has functionality to select, transform and filter data stored in each dataset.\n",
"\n",
"In this example, txtai will be used to index and query a dataset.\n",
diff --git a/examples/03_Build_an_Embeddings_index_from_a_data_source.ipynb b/examples/03_Build_an_Embeddings_index_from_a_data_source.ipynb
index 642547d0..176fd2b8 100644
--- a/examples/03_Build_an_Embeddings_index_from_a_data_source.ipynb
+++ b/examples/03_Build_an_Embeddings_index_from_a_data_source.ipynb
@@ -21,6 +21,8 @@
"source": [
"# Build an Embeddings index from a data source\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"In Part 1, we gave a general overview of txtai, the backing technology and examples of how to use it for similarity searches. Part 2 covered an embedding index with a larger dataset. \n",
"\n",
"For real world large-scale use cases, data is often stored in a database (Elasticsearch, SQL, MongoDB, files, etc). Here we'll show how to read from SQLite, build a Embedding index backed by word embeddings and run queries against the generated Embeddings index.\n",
diff --git a/examples/04_Add_semantic_search_to_Elasticsearch.ipynb b/examples/04_Add_semantic_search_to_Elasticsearch.ipynb
index 58897a53..8b36928b 100644
--- a/examples/04_Add_semantic_search_to_Elasticsearch.ipynb
+++ b/examples/04_Add_semantic_search_to_Elasticsearch.ipynb
@@ -22,6 +22,8 @@
"source": [
"# Add semantic search to Elasticsearch\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"Part 2 and Part 3 of this series showed how to index and search data in txtai. Part 2 indexed and searched a Hugging Face Dataset, Part 3 indexed and searched an external data source. \n",
"\n",
"txtai is modular in design, it's components can be individually used. txtai has a similarity function that works on lists of text. This method can be integrated with any external search service, such as a REST API, a SQL query or anything else that returns text search results. \n",
diff --git a/examples/05_Extractive_QA_with_txtai.ipynb b/examples/05_Extractive_QA_with_txtai.ipynb
index 1b762df4..766e2993 100644
--- a/examples/05_Extractive_QA_with_txtai.ipynb
+++ b/examples/05_Extractive_QA_with_txtai.ipynb
@@ -21,6 +21,8 @@
"source": [
"# Extractive QA with txtai\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"In Parts 1 through 4, we gave a general overview of txtai, the backing technology and examples of how to use it for similarity searches. This notebook builds on that and extends to building extractive question-answering systems."
]
},
diff --git a/examples/06_Extractive_QA_with_Elasticsearch.ipynb b/examples/06_Extractive_QA_with_Elasticsearch.ipynb
index 539ff486..657b168d 100644
--- a/examples/06_Extractive_QA_with_Elasticsearch.ipynb
+++ b/examples/06_Extractive_QA_with_Elasticsearch.ipynb
@@ -21,6 +21,8 @@
"source": [
"# Extractive QA with Elasticsearch\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"txtai is datastore agnostic, the library analyzes sets of text. The following example shows how extractive question-answering can be added on top of an Elasticsearch system."
]
},
diff --git a/examples/07_Apply_labels_with_zero_shot_classification.ipynb b/examples/07_Apply_labels_with_zero_shot_classification.ipynb
index 6a26b143..31c99381 100644
--- a/examples/07_Apply_labels_with_zero_shot_classification.ipynb
+++ b/examples/07_Apply_labels_with_zero_shot_classification.ipynb
@@ -21,6 +21,8 @@
"source": [
"# Apply labels with zero-shot classification\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"This notebook shows how zero-shot classification can be used to perform text classification, labeling and topic modeling. txtai provides a light-weight wrapper around the zero-shot-classification pipeline in Hugging Face Transformers. This method works impressively well out of the box. Kudos to the Hugging Face team for the phenomenal work on zero-shot classification!\n",
"\n",
"The examples in this notebook pick the best matching label using a list of labels for a snippet of text.\n",
diff --git a/examples/08_API_Gallery.ipynb b/examples/08_API_Gallery.ipynb
index 3f645d16..1c6be60f 100644
--- a/examples/08_API_Gallery.ipynb
+++ b/examples/08_API_Gallery.ipynb
@@ -21,6 +21,8 @@
"source": [
"# API Gallery\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"The txtai API is a web-based service backed by [FastAPI](https://fastapi.tiangolo.com/). All txtai functionality including similarity search, extractive QA and zero-shot labeling is available via the API.\n",
"\n",
"This notebook installs the txtai API and shows an example using each of the supported language bindings for txtai."
diff --git a/examples/09_Building_abstractive_text_summaries.ipynb b/examples/09_Building_abstractive_text_summaries.ipynb
index 845df239..1c044475 100644
--- a/examples/09_Building_abstractive_text_summaries.ipynb
+++ b/examples/09_Building_abstractive_text_summaries.ipynb
@@ -21,6 +21,8 @@
"source": [
"# Building abstractive text summaries\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"In the field of text summarization, there are two primary categories of summarization, extractive and abstractive summarization.\n",
"\n",
"Extractive summarization takes subsections of the text and joins them together to form a summary. This is commonly backed by graph algorithms like TextRank to find the sections/sentences with the most commonality. These summaries can be highly effective but they are unable to transform text and don't have a contextual understanding.\n",
diff --git a/examples/10_Extract_text_from_documents.ipynb b/examples/10_Extract_text_from_documents.ipynb
index 1be9197a..79f05d3d 100644
--- a/examples/10_Extract_text_from_documents.ipynb
+++ b/examples/10_Extract_text_from_documents.ipynb
@@ -21,6 +21,8 @@
"source": [
"# Extract text from documents\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"Up to this point, all the examples have been working with sections of text, which have already been split through some other means. What happens if we're working with documents? First we need to get the text out of these documents, then figure out how to index to best support similarity search.\n",
"\n",
"This notebook shows how documents can have text extracted and segmented to support similarity search."
diff --git a/examples/11_Transcribe_audio_to_text.ipynb b/examples/11_Transcribe_audio_to_text.ipynb
index e874a51b..ab0477d3 100644
--- a/examples/11_Transcribe_audio_to_text.ipynb
+++ b/examples/11_Transcribe_audio_to_text.ipynb
@@ -21,6 +21,8 @@
"source": [
"# Transcribe audio to text\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"This notebook covers the transcription of audio files to text using models provided by Hugging Face."
]
},
diff --git a/examples/12_Translate_text_between_languages.ipynb b/examples/12_Translate_text_between_languages.ipynb
index 31917375..21c7a9c3 100644
--- a/examples/12_Translate_text_between_languages.ipynb
+++ b/examples/12_Translate_text_between_languages.ipynb
@@ -21,6 +21,8 @@
"source": [
"# Translate text between languages\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"This notebook covers machine translation backed by Hugging Face models. The quality of machine translation via cloud services has come a very long way and produces high quality results. This notebook shows how the models from Hugging Face give developers a reasonable alternative for local machine translation."
]
},
diff --git a/examples/13_Similarity_search_with_images.ipynb b/examples/13_Similarity_search_with_images.ipynb
index 90a53480..6b5fe78f 100644
--- a/examples/13_Similarity_search_with_images.ipynb
+++ b/examples/13_Similarity_search_with_images.ipynb
@@ -22,6 +22,8 @@
"source": [
"# Similarity search with images\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"txtai as the name implies works with text and ai, pretty straightforward. But that doesn't mean it can't work with different types of content. For example, an image can be described with words. We can use that description to compare an image to a query or other documents. This notebook shows how images and text can be embedded into the same space to support similarity search."
]
},
diff --git a/examples/14_Run_pipeline_workflows.ipynb b/examples/14_Run_pipeline_workflows.ipynb
index c45e064a..3e7bd48b 100644
--- a/examples/14_Run_pipeline_workflows.ipynb
+++ b/examples/14_Run_pipeline_workflows.ipynb
@@ -22,6 +22,8 @@
"source": [
"# Run pipeline workflows\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"txtai has a growing list of models available through it's pipeline framework. Pipelines wrap a machine learning model and transform data. Currently, pipelines can wrap Hugging Face models, Hugging Face pipelines or PyTorch models (support for TensorFlow is in the backlog).\n",
"\n",
"The following is a list of the currently implemented pipelines.\n",
diff --git a/examples/15_Distributed_embeddings_cluster.ipynb b/examples/15_Distributed_embeddings_cluster.ipynb
index f39420b3..bdbc3620 100644
--- a/examples/15_Distributed_embeddings_cluster.ipynb
+++ b/examples/15_Distributed_embeddings_cluster.ipynb
@@ -21,6 +21,8 @@
"source": [
"# Distributed embeddings cluster\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"The txtai API is a web-based service backed by [FastAPI](https://fastapi.tiangolo.com/). All txtai functionality is available via the API. The API can also cluster multiple embeddings indices into a single logical index to horizontally scale over multiple nodes. \n",
"\n",
"This notebook installs the txtai API and shows an example of building an embeddings cluster."
diff --git a/examples/16_Train_a_text_labeler.ipynb b/examples/16_Train_a_text_labeler.ipynb
index 91b3e52e..077f63f8 100644
--- a/examples/16_Train_a_text_labeler.ipynb
+++ b/examples/16_Train_a_text_labeler.ipynb
@@ -22,6 +22,8 @@
"source": [
"# Train a text labeler\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"The [Hugging Face Model Hub](https://huggingface.co/models) has a wide range of models that can handle many tasks. While these models perform well, the best performance often is found when fine-tuning a model with task-specific data. \n",
"\n",
"Hugging Face provides a [number of full-featured examples](https://github.com/huggingface/transformers/tree/master/examples) available to assist with training task-specific models. When building models from the command line, these scripts are a great way to get started.\n",
diff --git a/examples/17_Train_without_labels.ipynb b/examples/17_Train_without_labels.ipynb
index c7df57bc..129e553f 100644
--- a/examples/17_Train_without_labels.ipynb
+++ b/examples/17_Train_without_labels.ipynb
@@ -22,6 +22,8 @@
"source": [
"# Train without labels\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"Almost all data available is unlabeled. Labeled data takes effort to manually review and/or takes time to collect. Zero-shot classification takes existing large language models and runs a similarity comparison between candidate text and a list of labels. This has been shown to perform surprisingly well.\n",
"\n",
"The problem with zero-shot classifiers is that they need to have a large number of parameters (400M+) to perform well against general tasks, which comes with sizable hardware requirements.\n",
diff --git a/examples/18_Export_and_run_models_with_ONNX.ipynb b/examples/18_Export_and_run_models_with_ONNX.ipynb
index a95bce27..0b2c4a39 100644
--- a/examples/18_Export_and_run_models_with_ONNX.ipynb
+++ b/examples/18_Export_and_run_models_with_ONNX.ipynb
@@ -22,6 +22,8 @@
"source": [
"# Export and run models with ONNX\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"The [ONNX runtime](https://onnx.ai/) provides a common serialization format for machine learning models. ONNX supports a number of [different platforms/languages](https://onnxruntime.ai/docs/how-to/install.html#requirements) and has features built in to help reduce inference time. \n",
"\n",
"PyTorch has robust support for exporting Torch models to ONNX. This enables exporting Hugging Face Transformer and/or other downstream models directly to ONNX. \n",
diff --git a/examples/19_Train_a_QA_model.ipynb b/examples/19_Train_a_QA_model.ipynb
index c9375bc3..98b3a617 100644
--- a/examples/19_Train_a_QA_model.ipynb
+++ b/examples/19_Train_a_QA_model.ipynb
@@ -22,6 +22,8 @@
"source": [
"# Train a QA model\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"The [Hugging Face Model Hub](https://huggingface.co/models) has a wide range of models that can handle many tasks. While these models perform well, the best performance is often found when fine-tuning a model with task-specific data. \n",
"\n",
"Hugging Face provides a [number of full-featured examples](https://github.com/huggingface/transformers/tree/master/examples) to assist with training task-specific models. When building models from the command line, these scripts are a great way to get started.\n",
@@ -270,7 +272,7 @@
"questions = pipeline(\"question-answering\", model=model.to(\"cpu\"), tokenizer=tokenizer)\n",
"questions(\"What ingredient?\", \"Peel and dice 1 shallot\")"
],
- "execution_count": 0,
+ "execution_count": null,
"outputs": [
{
"output_type": "execute_result",
@@ -294,4 +296,4 @@
]
}
]
-}
+}
\ No newline at end of file
diff --git a/examples/20_Extractive_QA_to_build_structured_data.ipynb b/examples/20_Extractive_QA_to_build_structured_data.ipynb
index d86b47e4..c57b4fde 100644
--- a/examples/20_Extractive_QA_to_build_structured_data.ipynb
+++ b/examples/20_Extractive_QA_to_build_structured_data.ipynb
@@ -21,6 +21,8 @@
"source": [
"# Extractive QA to build structured data\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"Traditional ETL/data parsing systems establish rules to extract information of interest. Regular expressions, string parsing and similar methods define fixed rules. This works in many cases but what if you are working with unstructured data containing numerous variations? The rules can be cumbersome and hard to maintain over time.\n",
"\n",
"This notebook uses machine learning and extractive question-answering (QA) to utilize the vast knowledge built into large language models. These models have been trained on extremely large datasets, learning the many variations of natural language. "
diff --git a/examples/21_Export_and_run_other_machine_learning_models.ipynb b/examples/21_Export_and_run_other_machine_learning_models.ipynb
index 46f18558..ac378246 100644
--- a/examples/21_Export_and_run_other_machine_learning_models.ipynb
+++ b/examples/21_Export_and_run_other_machine_learning_models.ipynb
@@ -22,6 +22,8 @@
"source": [
"# Export and run other machine learning models\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"txtai primarily has support for [Hugging Face Transformers](https://github.com/huggingface/transformers) and [ONNX](https://github.com/microsoft/onnxruntime) models. This enables txtai to hook into the rich model framework available in Python, export this functionality via the API to other languages (JavaScript, Java, Go, Rust) and even export and natively load models with ONNX.\n",
"\n",
"What about other machine learning frameworks? Say we have an existing TF-IDF + Logistic Regression model that has been well tuned. Can this model be exported to ONNX and used in txtai for labeling and similarity queries? Or what about a simple PyTorch text classifier? Yes, both of these can be done!\n",
diff --git a/examples/22_Transform_tabular_data_with_composable_workflows.ipynb b/examples/22_Transform_tabular_data_with_composable_workflows.ipynb
index dd153ab5..675eda3c 100644
--- a/examples/22_Transform_tabular_data_with_composable_workflows.ipynb
+++ b/examples/22_Transform_tabular_data_with_composable_workflows.ipynb
@@ -22,6 +22,8 @@
"source": [
"# Transform tabular data with composable workflows\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"txtai executes machine-learning workflows to transform data and build AI-powered semantic search applications. txtai has support for processing both unstructured and structured data. Structured or tabular data is grouped into rows and columns. This can be a spreadsheet, an API call that returns JSON or XML or even list of key-value pairs.\n",
"\n",
"This notebook will walk through examples on how to use workflows with the tabular pipeline to transform and index structured data.\n"
diff --git a/examples/23_Tensor_workflows.ipynb b/examples/23_Tensor_workflows.ipynb
index 6714c6bc..40864c62 100644
--- a/examples/23_Tensor_workflows.ipynb
+++ b/examples/23_Tensor_workflows.ipynb
@@ -22,6 +22,8 @@
"source": [
"# Tensor workflows\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"Many of the examples and use cases for txtai focus on transforming text. Makes sense as txt is even in the name! But that doesn't mean txtai only works with text.\n",
"\n",
"This notebook will cover examples of how to efficiently process tensors using txtai workflows."
diff --git a/examples/24_Whats_new_in_txtai_4_0.ipynb b/examples/24_Whats_new_in_txtai_4_0.ipynb
index f829ea8b..7d00b0db 100644
--- a/examples/24_Whats_new_in_txtai_4_0.ipynb
+++ b/examples/24_Whats_new_in_txtai_4_0.ipynb
@@ -34,6 +34,8 @@
"source": [
"# 💡 What's new in txtai 4.0\n",
"\n",
+ "_This notebook is part of a tutorial series on [txtai](https://github.com/neuml/txtai), an AI-powered semantic search platform._\n",
+ "\n",
"[txtai](https://github.com/neuml/txtai) executes machine-learning workflows to transform data and build AI-powered semantic search applications.\n",
"\n",
"txtai 4.0 brings a number of major feature enhancements, most importantly the capability to store full document content and text right in txtai. This notebook will cover all the changes with examples."