KennethEnevoldsen / augmenty

Augmenty is an augmentation library based on spaCy for augmenting texts.

Home Page:https://kennethenevoldsen.github.io/augmenty/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Augmenty: The cherry on top of your NLP pipeline

PyPI version python version Ruff github actions pytest github actions docs status

Augmenty is an augmentation library based on spaCy for augmenting texts. Besides a wide array of highly flexible augmenters, Augmenty provides a series of tools for working with augmenters, including combining and moderating augmenters. Augmenty differs from other augmentation libraries in that it corrects (as far as possible) the assigned labels under the augmentation, thus making many of the augmenters valid for training in a wider range of tasks.

πŸ”§ Installation

To get started using augmenty simply install it using pip by running the following line in your terminal:

pip install augmenty

Do note that this is a minimal installation. As some augmenters requires additional packages please write the following line to install all dependencies.

pip install "augmenty[all]"

For more detailed instructions on installing augmenty, including specific language support, see the installation instructions.

πŸ’ Simple Example

The following shows a simple example of how you can quickly augment text using Augmenty. For more on using augmenty see the usage guides.

import augmenty
import spacy

nlp = spacy.load("en_core_web_md")
# if not installed run: python -m spacy download en_core_web_md

doc = nlp("Augmenty is a great tool for text augmentation")

# check that the pipeline detects the entities (this done by SpaCy and is not a 100%)
print(doc.ents)
# (Augmenty,) is detected as an entity

doc.ents[0].label_
# 'GPE'. Depending on the model, the label might be different (e.g. 'ORG')

entity_augmenter = augmenty.load(
    "ents_replace_v1", ent_dict={"GPE": [["spaCy"], ["spaCy", "Universe"]]}, # label=GPE,
    level=1
)

for augmented_doc in augmenty.docs([doc], augmenter=entity_augmenter, nlp=nlp):
    print(augmented_doc)
spaCy Universe is a great tool for text augmentation.

πŸ“– Documentation

Documentation
πŸ“š Usage Guides Guides and instructions on how to use augmenty and its features.
πŸ“° News and changelog New additions, changes and version history.
πŸŽ› API References The detailed reference for augmenty's API. Including function documentation
πŸ’ Augmenters Contains a full list of current augmenters in augmenty.
πŸ™‹ FAQ Frequently asked question regarding augmenty
🀝 How to contribute How to contribute to augmenty

πŸ’¬ Where to ask questions

Type
🚨 Bug Reports GitHub Issue Tracker
🎁 Feature Requests & Ideas GitHub Issue Tracker
πŸ‘©β€πŸ’» Usage Questions GitHub Discussions
πŸ—― General Discussion GitHub Discussions
πŸ’ Adding an Augmenter Adding an augmenter

About

Augmenty is an augmentation library based on spaCy for augmenting texts.

https://kennethenevoldsen.github.io/augmenty/

License:MIT License


Languages

Language:Python 91.7%Language:TeX 7.7%Language:Makefile 0.6%