# RETVec: Resilient & Efficient Text Vectorizer
## Overview RETVec is a next-gen text vectorizer designed to offer built-in adversarial resilience using robust word embeddings. Read the paper here: https://arxiv.org/abs/2302.09207.
RETVec is trained to be resilient against character manipulations including insertion, deletion, typos, homoglyphs, LEET substitution, and more. The RETVec model is trained on top of a novel character embedding which can encode all UTF-8 characters and words. Thus, RETVec works out-of-the-box on over 100 languages without the need for a lookup table or fixed vocabulary size. Furthermore, RETVec is a layer, which means that it can be inserted into any TF model without the need for a separate pre-processing step.
### Getting started
#### Installation
You can use pip to install the TensorFlow version of RETVec:
`python pip install retvec `
RETVec has been tested on TensorFlow 2.6+ and python 3.7+.
### Basic Usage
training/train_tf_retvec_models.py is the RETVec model training script. Example usage:
`python train_tf_retvec_models.py --train_config <train_config_path> --model_config <model_config_path> --output_dir <output_path> `
Configurations for our base models are under the configs/ folder.
### Colab
Colab for training and releasing a new RETVec model: notebooks/train_and_relase_a_rewnet.ipynb
Hello world colab: notebooks/hello_world.ipynb
## Disclaimer This is not an official Google product.
Metadata
Release files for retvec 1.0.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 | Provenance | Actions |
|---|---|---|---|---|
| retvec-1.0.1.tar.gz | 26.4 kB | Without provenance | Details for retvec-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| retvec-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for retvec-1.0.1-py3-none-any.whl |
Total release size: 66.9 kB
Release files / retvec-1.0.1.tar.gz
| Download URL | retvec-1.0.1.tar.gz |
|---|---|
| Size | 26.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc307531ede17166dad78cd01729118507ac7b86090d1e2cbb006f97986ee074
|
|
BLAKE2b-256 checksum How to use checksums |
7605744255da2636ebff138ba00e7ef62708341a9b1e19d24bdf2a21d51a0e3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / retvec-1.0.1-py3-none-any.whl
| Download URL | retvec-1.0.1-py3-none-any.whl |
|---|---|
| Size | 40.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3307472805d5861ea1ffcbf8adf278f3a132d5e4ea2671ea28ef13ec5ad62a4e
|
|
BLAKE2b-256 checksum How to use checksums |
2a861caedb3af968653d630917ea2c53844eca790c24a0057d75ae70d6ae70a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Security for retvec 1.0.1
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.