Skip to main content

Build AI-powered semantic search applications

Project description

Build AI-powered semantic search applications

Version GitHub Release Date GitHub issues GitHub last commit Build Status Coverage Status


txtai executes machine-learning workflows to transform data and build AI-powered semantic search applications.

demo

Traditional search systems use keywords to find data. Semantic search applications have an understanding of natural language and identify results that have the same meaning, not necessarily the same keywords.

Backed by state-of-the-art machine learning models, data is transformed into vector representations for search (also known as embeddings). Innovation is happening at a rapid pace, models can understand concepts in documents, audio, images and more.

Summary of txtai features:

  • 🔎 Large-scale similarity search with multiple index backends (Faiss, Annoy, Hnswlib)
  • 📄 Create embeddings for text snippets, documents, audio, images and video. Supports transformers and word vectors.
  • 💡 Machine-learning pipelines to run extractive question-answering, zero-shot labeling, transcription, translation, summarization and text extraction
  • ↪️️ Workflows that join pipelines together to aggregate business logic. txtai processes can be microservices or full-fledged indexing workflows.
  • 🔗 API bindings for JavaScript, Java, Rust and Go
  • ☁️ Cloud-native architecture that scales out with container orchestration systems (e.g. Kubernetes)

Applications range from similarity search to complex NLP-driven data extractions to generate structured databases. The following applications are powered by txtai.

Application Description
paperai AI-powered literature discovery and review engine for medical/scientific papers
tldrstory AI-powered understanding of headlines and story text
neuspo Fact-driven, real-time sports event and news site
codequestion Ask coding questions directly from the terminal

txtai is built with Python 3.6+, Hugging Face Transformers, Sentence Transformers and FastAPI

Installation

The easiest way to install is via pip and PyPI

pip install txtai

Python 3.6+ is supported. Using a Python virtual environment is recommended.

See the detailed install instructions for more information covering installing from source, environment specific prerequisites and optional dependencies.

Examples

The examples directory has a series of notebooks and applications giving an overview of txtai. See the sections below.

Semantic Search

Build semantic/similarity/vector search applications.

Notebook Description
Introducing txtai Overview of the functionality provided by txtai Open In Colab
Build an Embeddings index with Hugging Face Datasets Index and search Hugging Face Datasets Open In Colab
Build an Embeddings index from a data source Index and search a data source with word embeddings Open In Colab
Add semantic search to Elasticsearch Add semantic search to existing search systems Open In Colab
API Gallery Using txtai in JavaScript, Java, Rust and Go Open In Colab
Similarity search with images Embed images and text into the same space for search Open In Colab
Distributed embeddings cluster Distribute an embeddings index across multiple data nodes Open In Colab

Pipelines and Workflows

NLP-backed data transformation pipelines and workflows.

Notebook Description
Extractive QA with txtai Introduction to extractive question-answering with txtai Open In Colab
Extractive QA with Elasticsearch Run extractive question-answering queries with Elasticsearch Open In Colab
Apply labels with zero shot classification Use zero shot learning for labeling, classification and topic modeling Open In Colab
Building abstractive text summaries Run abstractive text summarization Open In Colab
Extract text from documents Extract text from PDF, Office, HTML and more Open In Colab
Transcribe audio to text Convert audio files to text Open In Colab
Translate text between languages Streamline machine translation and language detection Open In Colab
Run pipeline workflows Simple yet powerful constructs to efficiently process data Open In Colab

Model Training

Train NLP models.

Notebook Description
Train a text labeler Build text sequence classification models Open In Colab
Train without labels Use zero-shot classifiers to train new models Open In Colab
Train a QA model Build and fine-tune question-answering models Open In Colab
Export and run models with ONNX Export models with ONNX, run natively in JavaScript, Java and Rust Open In Colab

Applications

Series of example applications with txtai.

Application Description
Demo query shell Basic similarity search example. Used in the original txtai demo.
Book search Book similarity search application. Index book descriptions and query using natural language statements.
Image search Image similarity search application. Index a directory of images and run searches to identify images similar to the input query.
Wiki search Wikipedia search application. Queries Wikipedia API and summarizes the top result.
Workflow builder Build and execute txtai workflows. Connect summarization, text extraction, transcription, translation and similarity search pipelines together to run unified workflows.

Documentation

Full documentation on txtai including configuration settings for pipelines, workflows, indexing and the API.

Contributing

For those who would like to contribute to txtai, please see this guide.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

txtai-3.3.0.tar.gz (48.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

txtai-3.3.0-py3-none-any.whl (75.5 kB view details)

Uploaded Python 3

File details

Details for the file txtai-3.3.0.tar.gz.

File metadata

  • Download URL: txtai-3.3.0.tar.gz
  • Upload date:
  • Size: 48.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.11

File hashes

Hashes for txtai-3.3.0.tar.gz
Algorithm Hash digest
SHA256 165e7ce22f4194c78088cff5bd5bbd0bce11f7f4e0cde54b518748c0dd8ec5dd
MD5 c908c0794e326ff10d0eece32a2c06aa
BLAKE2b-256 1a2adfa96e605732ca55285e24fc93b3416377c91c7d7e0a1487a7d6b3f44fc3

See more details on using hashes here.

File details

Details for the file txtai-3.3.0-py3-none-any.whl.

File metadata

  • Download URL: txtai-3.3.0-py3-none-any.whl
  • Upload date:
  • Size: 75.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.11

File hashes

Hashes for txtai-3.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02bf01820d3daa1594c691c206d61cb1e9c942e7714de9758e1991c95df9fa96
MD5 69855edd2bb7abb32b3634c975e7632a
BLAKE2b-256 5e290298f51285a730ad382d0981f758344675644883aead2d4457de702da6b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page