Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated docs based on review #221

Merged
merged 4 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
shell: bash
run: |
make install
pip install -r tests/requirements.txt

- name: Run tests
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $ make install
```


## How to test the project
### How to test the project

Run the full test suite:

Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,3 @@
"sidebar_hide_name": True,
"navigation_with_keys": True,
}

3 changes: 2 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
install:
@echo "--- 🚀 Installing project ---"
pip install -e ".[dev, docs, tests,tutorials,all,da]"
pip install -r tests/requirements.txt

static-type-check:
@echo "--- 🔍 Running static type check ---"
Expand All @@ -11,7 +12,7 @@ lint:
@echo "--- 🧹 Running linters ---"
pyproject-parser check pyproject.toml # check pyproject.toml
ruff format . # running ruff formatting (.ipynb, .py)
ruff **/*.py --fix # running ruff linting (.py)
ruff check **/*.py --fix # running ruff linting (.py)

test:
@echo "--- 🧪 Running tests ---"
Expand Down
1 change: 0 additions & 1 deletion paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Other tools for data augmentation focus on specific downstream application such


# Features & Functionality

`Augmenty` is a Python library that implements augmentations based on `spaCy`'s `Doc` object. `spaCy`'s `Doc` object is a container for a text and its annotations. This makes it easy to augment text and annotations simultaneously. The `Doc` object can easily be extended to include custom augmentation not available in `spaCy` by adding custom attributes to the `Doc` object. While `Augmenty` is built to augment `Doc`s the object is easily converted into strings, lists or other formats. The annotations within a `Doc` can be provided either by human annotations or using a trained model.

Augmenty implements a series of augmenters for token-, span- and sentence-level augmentation. These augmenters range from primitive augmentations such as word replacement to language specific augmenters such as keystroke error augmentations based on a French keyboard layout. Augmenty also integrates with other libraries such as `NLTK` [@bird2009natural] to allow for augmentations based on WordNet [@miller-1994-wordnet] and allows for specification of static word vectors [pennington-etal-2014-glove] to allow for augmentations based on word similarity. Lastly, `augmenty` provides a set of utility functions for repeating augmentations, combining augmenters or adjust the percentage of documents that should be augmented. This allow for the flexible construction of augmentation pipelines specific to the task at hand.
Expand Down
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ dev = [
"pyproject-parser[cli, readme]>=0.9.1",
]
tests = [
"pytest>=7.1.3",
"pytest>=7.1.3,<8.0.0", # due to https://github.com/TvoroG/pytest-lazy-fixture/issues/65
"pytest-cov>=3.0.0",
"pytest-lazy-fixture>=0.6.3",
"pytest-timeout>=2.1.0",
Expand All @@ -92,7 +92,7 @@ pythonPlatform = "Darwin"
[tool.ruff]
extend-include = ["*.ipynb"]
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
select = [
lint.select = [
"A",
"ANN",
"ARG",
Expand Down Expand Up @@ -120,7 +120,7 @@ select = [
"SIM",
"W",
]
ignore = [
lint.ignore = [
"ANN101",
"ANN401",
"E402",
Expand All @@ -130,9 +130,9 @@ ignore = [
"RET504",
"COM812",
]
ignore-init-module-imports = true
lint.ignore-init-module-imports = true
# Allow autofix for all enabled rules (when `--fix`) is provided.
unfixable = ["ERA"]
lint.unfixable = ["ERA"]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
Expand All @@ -158,10 +158,10 @@ exclude = [
"docs/conf.py",
]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
target-version = "py38"

[tool.ruff.flake8-annotations]
[tool.ruff.lint.flake8-annotations]
mypy-init-return = true
suppress-none-returning = true

Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ 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]
pip install "augmenty[all]"
```

For more detailed instructions on installing augmenty, including specific language support, see the [installation instructions](https://kennethenevoldsen.github.io/augmenty/installation).
Expand All @@ -39,6 +39,7 @@ import spacy
import augmenty

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

docs = nlp.pipe(["Augmenty is a great tool for text augmentation"])

Expand Down
1 change: 0 additions & 1 deletion src/augmenty/character/replace.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Augmenters for randomly or semi-randomly replacing characters."""


import random
from functools import partial
from typing import Callable, Iterator
Expand Down
1 change: 0 additions & 1 deletion src/augmenty/character/swap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Augmenters for swapping characters."""


import random
from functools import partial
from typing import Callable, Iterator
Expand Down
1 change: 1 addition & 0 deletions src/augmenty/keyboard.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Function for defining and handling keyboard layouts."""

from typing import Dict, List, Tuple

from pydantic import BaseModel
Expand Down
1 change: 0 additions & 1 deletion tests/test_all_augmenters.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Pytest script for testing all augmenters in a variety of cases."""


from typing import Iterable

import augmenty
Expand Down
Loading