Text aspects for nlp models
Project description
[![Documentation Status](https://readthedocs.org/projects/nlp-demo/badge/?version=latest)](https://nlp-demo.readthedocs.io/en/latest/?badge=latest)
# 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
```python
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)
```
# 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
```python
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.2.tar.gz
(1.5 kB
view hashes)