VectorAlign
Bilingual word alignment using multilingual embeddings — no training required!
For non-nerds: a word matching engine for any language pair using parallel data.
Installation
pip install vectoralign
Quick Start
from vectoralign import align
# Your parallel sentences
english = [
"Hello world",
"How are you today",
"The weather is nice"
]
hindi = [
"नमस्ते दुनिया",
"आज आप कैसे हैं",
"मौसम अच्छा है"
]
# Align and build dictionary
dictionary = align(english, hindi)
Features
- No training required — Uses pre-trained multilingual embeddings
- Batch processing — Batch processing with automatic CUDA detection
- Multiple models — Supports LaBSE, mBERT, and other HuggingFace models
- Bidirectional alignment — Intersection of forward and backward alignments
Version 0.2.0 added features:
- Memory management — Automatic garbage collection and CUDA cache management for efficient memory usage
Advanced Usage
from vectoralign import align
# Custom model and batch size
dictionary = align(
src_sentences,
tgt_sentences,
model_name="setu4993/LaBSE", # or "bert" for mBERT
batch_size=64,
threshold=0.6, # Sentence similarity threshold
output="my_dictionary.txt"
)
Supported Models
| Model | Name |
|---|---|
| LaBSE | setu4993/LaBSE (default) |
| mBERT | bert with mode='multilingual' |
Any HuggingFace model with pooler_output |
Full model path |
Output Format
The dictionary is saved as a TSV file:
word1 translation1 count
word2 translation2 count
Acknowledgments
This is a spiritual implementation of SimAlign by the Centre for Language and Information Processing, LMU Munich.
License
MIT License
Metadata
Release files for vectoralign 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vectoralign-0.2.2.tar.gz | 6.1 kB | Without provenance | Details for vectoralign-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vectoralign-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for vectoralign-0.2.2-py3-none-any.whl |
Total release size: 12.6 kB
Release files / vectoralign-0.2.2.tar.gz
| Download URL | vectoralign-0.2.2.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e8f3bbfe0dd7e61e40a727b02918c68f1eb55328e6ebf657b83bdccdffdc37c8
|
|
BLAKE2b-256 checksum How to use checksums |
13ac33d85c616f071ef1197c19ccf9c08183075d053f6435b89fdd9e7a49c11d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.18
|
Release files / vectoralign-0.2.2-py3-none-any.whl
| Download URL | vectoralign-0.2.2-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
40aa9cd7178a3a0c8114d6d0668efc8d3996c62fa44f57195cb6433f67a8f8ea
|
|
BLAKE2b-256 checksum How to use checksums |
1d52c8620a885c9d189e6663730abcddec191048459661529aaea7d8252f9805
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.18
|
Security for vectoralign 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.