Crates.io | fast_aug |
lib.rs | fast_aug |
version | 0.1.0 |
source | src |
created_at | 2023-12-26 14:56:54.751089 |
updated_at | 2024-02-24 09:21:25.014853 |
description | Fast data augmentation for text |
homepage | https://github.com/k4black/fast-aug |
repository | https://github.com/k4black/fast-aug |
max_upload_size | |
id | 1080995 |
size | 181,165 |
fast-aug
is a library for fast text augmentation, available for both Rust and Python as fast-aug
.
It is designed with focus on performance and real-time usage (e.g. during training), while providing a wide range of text augmentation methods.
fast-aug
is available on crates.io.
cargo install fast-aug
use fast_aug::base::BaseAugmenter;
use fast_aug::text::{CharsRandomSwapAugmenter, TextAugmentParameters};
let rng = &mut rand::thread_rng();
let augmenter = CharsRandomSwapAugmenter::new(
TextAugmentParameters::new(0.5, None, None),
TextAugmentParameters::new(0.5, None, None),
None,
);
augmenter.augment("Some text!".to_string(), rng);
augmenter.augment_batch(vec!["Some text!".to_string()], rng);
Please refer to rustdoc for details.
TBA
Any contribution is warmly welcomed!
Please see the GitHub repository README at fast-aug.