retsim-pytorch
Welcome to retsim-pytorch, the PyTorch adaptation of Google's RETSim (Resilient and Efficient Text Similarity) model, which is part of the UniSim (Universal Similarity) framework.
This model is designed for efficient and accurate multilingual fuzzy string matching, near-duplicate detection, and assessing string similarity. For more information, please refer to the UniSim documentation.
Installation
You can easily install retsim-pytorch via pip:
pip install retsim-pytorch
Usage
You can configure the model using the RETSimConfig class. By default, it utilizes the same configuration as the original UniSim model. If you wish to use the same weights as the original Google model, you can download a SafeTensors port of the weights here.
Here's how to use the model in your code:
import torch
from retsim_pytorch import RETSim, RETSimConfig
from retsim_pytorch.preprocessing import binarize
# Configure the model
config = RETSimConfig()
model = RETSim(config)
# Prepare and run inference
binarized_inputs, chunk_ids = binarize(["hello world"])
embedded, unpooled = model(torch.tensor(binarized_inputs))
Metadata
Release files for retsim-pytorch 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| retsim_pytorch-0.1.1.tar.gz | 15.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| retsim_pytorch-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.8 kB
Release files / retsim_pytorch-0.1.1.tar.gz
| Download URL | retsim_pytorch-0.1.1.tar.gz |
|---|---|
| Size | 15.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
440cb3e1f4ef8ac98cd03561d635540f9033b13b0065573d79d0ee733a54208e
|
|
BLAKE2b-256 checksum How to use checksums |
584f90ad9f97aeb9f3618e48ddd2b984fa5981c28d99e4f0a702ae8ce1ac8836
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.19
|
Release files / retsim_pytorch-0.1.1-py3-none-any.whl
| Download URL | retsim_pytorch-0.1.1-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
880095ecd2c59806985edecca2a96234ea3d3c9711bed06c3e3c684917d58b52
|
|
BLAKE2b-256 checksum How to use checksums |
567848db09ceeb243f195b46aa105cafb474f9862713f34b698517b7dd415fc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.19
|