Skip to main content

No project description provided

Project description

retsim-pytorch

PyPI Version Supported Python Versions

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))

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

retsim_pytorch-0.1.1.tar.gz (15.0 kB view hashes)

Uploaded Source

Built Distribution

retsim_pytorch-0.1.1-py3-none-any.whl (13.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page