Text aspects for nlp models
Project description
wild-nlp
Corrupt an input text to test NLP models' robustness. For details refer to https://nlp-demo.readthedocs.io
Installation
pip install wild-nlp
Usage
from wildnlp.aspects import Reverser, PigLatin
from wildnlp.aspects.utils import compose
from wildnlp.datasets import SampleDataset
# Create a dataset object and load the dataset
dataset = SampleDataset()
dataset.load()
# Crate a composed corruptor function.
# Functions will be applied in the same order they appear.
composed = compose(Reverser(), PigLatin())
# Apply the function to the dataset
modified = dataset.apply(composed)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wild-nlp-0.0.3.tar.gz
(2.7 kB
view hashes)