Giter Site home page Giter Site logo

linecode / txtai Goto Github PK

View Code? Open in Web Editor NEW

This project forked from neuml/txtai

0.0 0.0 0.0 13.38 MB

๐Ÿ’ก Build AI-powered semantic search applications

Home Page: https://neuml.github.io/txtai

License: Apache License 2.0

Python 99.41% Makefile 0.18% Dockerfile 0.41%

txtai's Introduction

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.

apps

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.7+, Hugging Face Transformers, Sentence Transformers and FastAPI

Why txtai?

why why

In addition to traditional search systems, a growing number of semantic search solutions are available, so why txtai?

  • pip install txtai is all you need
# Get started in a couple lines
from txtai.embeddings import Embeddings

embeddings = Embeddings({"path": "sentence-transformers/all-MiniLM-L6-v2"})
embeddings.index([(0, "Correct", None), (1, "Not what we hoped", None)])
embeddings.search("positive", 1)
#[(0, 0.2986203730106354)]
  • Works well with both small and big data - scale up as needed
  • Rich data processing framework (pipelines and workflows) to pre and post process data
  • Work in your programming language of choice via the API
  • Modular with low footprint - install additional dependencies when you need them
  • Learn by example - notebooks cover all available functionality

Installation

install install

The easiest way to install is via pip and PyPI

pip install txtai

Python 3.7+ 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

examples 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/neural 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
What's new in txtai 4.0 Content storage, SQL, object storage, reindex and compressed indexes Open In Colab

Pipelines

Transform data with NLP-backed pipelines.

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
Extractive QA to build structured data Build structured datasets using extractive question-answering 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

Workflows

Efficiently process data at scale.

Notebook Description
Run pipeline workflows Simple yet powerful constructs to efficiently process data Open In Colab
Transform tabular data with composable workflows Transform, index and search tabular data Open In Colab
Tensor workflows Performant processing of large tensor arrays 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
Export and run other machine learning models Export and run models from scikit-learn, PyTorch and more Open In Colab

Applications

Series of example applications with txtai. Links to hosted versions on Hugging Face Spaces also provided.

Application Description
Basic similarity search Basic similarity search example. Data from the original txtai demo. ๐Ÿค—
Book search Book similarity search application. Index book descriptions and query using natural language statements. Local run only
Image search Image similarity search application. Index a directory of images and run searches to identify images similar to the input query. ๐Ÿค—
Summarize an article Summarize an article. Workflow that extracts text from a webpage and builds a summary. ๐Ÿค—
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.

Further Reading

further

Contributing

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

txtai's People

Contributors

0206pdh avatar 0xflotus avatar csheargm avatar davidmezzetti avatar hi019 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.