Skip to main content

A Tfidf based Vector Store and Tfidf Based Embedding Model.

Project description

Swarmauri Logo

PyPI - Downloads PyPI - Python Version PyPI - License PyPI - Version


TF-IDF Vector Store

A vector store implementation using TF-IDF (Term Frequency-Inverse Document Frequency) for document embedding and retrieval. This package provides efficient document storage and similarity-based retrieval using the TF-IDF algorithm.

Installation

pip install swarmauri_vectorstore_tfidf

Usage

Here's a basic example of how to use the TF-IDF Vector Store:

from swarmauri.vector_stores.TfidfVectorStore import TfidfVectorStore
from swarmauri.documents.Document import Document

# Initialize the vector store
vector_store = TfidfVectorStore()

# Add documents
documents = [
    Document(content="Machine learning basics"),
    Document(content="Python programming guide"),
    Document(content="Data science tutorial")
]
vector_store.add_documents(documents)

# Retrieve similar documents
results = vector_store.retrieve(query="python tutorial", top_k=2)

Want to help?

If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.

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

swarmauri_vectorstore_tfidf-0.6.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

swarmauri_vectorstore_tfidf-0.6.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file swarmauri_vectorstore_tfidf-0.6.1.tar.gz.

File metadata

  • Download URL: swarmauri_vectorstore_tfidf-0.6.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.9 Linux/6.8.0-1021-azure

File hashes

Hashes for swarmauri_vectorstore_tfidf-0.6.1.tar.gz
Algorithm Hash digest
SHA256 9326b1bce02896c424454aa36e1c7754542a10580cafe40e7d2f15dbc6dc1214
MD5 19074a4e1462f1c9ab4c1e27de3a8f89
BLAKE2b-256 b26dcfcc00ed5c6f4927578ba5babbf764c03c95cd4f5dd1eb1a711a5bd703ec

See more details on using hashes here.

File details

Details for the file swarmauri_vectorstore_tfidf-0.6.1-py3-none-any.whl.

File metadata

File hashes

Hashes for swarmauri_vectorstore_tfidf-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 432fa97048b991dbe809ddbc1465bf50a23703df78b3c8c0fe58897712dca6b9
MD5 3814d424e3609b1f6f787bace67e68c0
BLAKE2b-256 f4ac283495a3fdd40d995b55dd1c86e78f9e56c078221d56c3fac58a0ad2ec49

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