Skip to main content

A Doc2Vec based Embedding Model.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_embedding_doc2vec


Swarmauri Embedding Doc2vec

A Gensim-powered Doc2Vec implementation for document embeddings in the Swarmauri ecosystem. The component registers as Doc2VecEmbedding and returns vectors as swarmauri_standard.vectors.Vector instances.

Installation

Install the package with your preferred Python packaging tool:

pip install swarmauri_embedding_doc2vec
poetry add swarmauri_embedding_doc2vec
uv pip install swarmauri_embedding_doc2vec

Usage

from swarmauri_embedding_doc2vec import Doc2VecEmbedding

documents = [
    "This is the first document.",
    "Here is another document.",
    "And a third one.",
]

# Initialize the embedder. Adjust parameters to match your dataset size.
embedder = Doc2VecEmbedding(vector_size=300, window=10, min_count=1, workers=1)

# Fit and transform documents into Vector objects.
vectors = embedder.fit_transform(documents)

# Access the raw embedding values via the Vector.value attribute.
first_vector = vectors[0].value

# Transform new documents (the result is also a Vector).
new_vector = embedder.transform(["This is a new document."])[0]

# Save and load the underlying Doc2Vec model.
model_path = "doc2vec.model"
embedder.save_model(model_path)
embedder.load_model(model_path)

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


Release history Release notifications | RSS feed

Download files

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

Source Distribution

swarmauri_embedding_doc2vec-0.10.0.dev4.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file swarmauri_embedding_doc2vec-0.10.0.dev4.tar.gz.

File metadata

  • Download URL: swarmauri_embedding_doc2vec-0.10.0.dev4.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_embedding_doc2vec-0.10.0.dev4.tar.gz
Algorithm Hash digest
SHA256 5786c027d52e44b72e574abf3a1d2e58abf7bd3152ebe12e324b6fb93696da5b
MD5 44ef0ac74a1e118b15f50c9fbd58c0c2
BLAKE2b-256 976e2d273d64349f1f29f43f5f675817d2c19720d1b4289e49dd17cb308bad9f

See more details on using hashes here.

File details

Details for the file swarmauri_embedding_doc2vec-0.10.0.dev4-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_embedding_doc2vec-0.10.0.dev4-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_embedding_doc2vec-0.10.0.dev4-py3-none-any.whl
Algorithm Hash digest
SHA256 336b1898ad6b76ca4f524b73e9305a55edd2682e066e60fa2a9ac294a88e14e1
MD5 83335140c45d4e985992e72c0a8b0a99
BLAKE2b-256 7d231901699b06796e55a5382b211a3f7dc5bb7c33a4204307eb1b359ac1e6fd

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