augmenty
augmenty copied to clipboard
implement an oversampling function
Augmentation can be used to oversample a category.
Imagined usage would look something like this:
aug = augmenty.load(...)
def is_positive(example):
"""return true if the example contains an entity"""
if example.y.cats["positive"] == 1:
return True
return False
upsampled_corpus = augumenty.oversample(corpus, augmenter=aug, conditional=is_positive, n=1000)