neraug
This python library helps you with augmenting text data for named entity recognition.
Augmentation Example
Reference from An Analysis of Simple Data Augmentation for Named Entity Recognition
Installation
To install the library:
pip install neraug
Usage
One of the example algorithms: DictionaryReplacement:
>>> from neraug.augmentator import DictionaryReplacement
>>> from neraug.scheme import IOBES
>>> ne_dic = {'Tokyo Big Sight': 'LOC'}
>>> augmentator = DictionaryReplacement(ne_dic, str.split, IOBES)
>>> x = ['I', 'went', 'to', 'Tokyo']
>>> y = ['O', 'O', 'O', 'S-LOC']
>>> x_augs, y_augs = augmentator.augment(x, y, n=1)
>>> x_augs
[['I', 'went', 'to', 'Tokyo', 'Big', 'Sight']]
>>> y_augs
[['O', 'O', 'O', 'B-LOC', 'I-LOC', 'E-LOC']]
The library supports the following algorithms:
- DictionaryReplacement
- LabelWiseTokenReplacement
- MentionReplacement
- ShuffleWithinSegment
and supports the following scheme:
- IOB2
- IOBES
- BILOU
Reference
Appreciate for the following research:
Citation
@misc{neraug,
title={neraug: A data augmentation tool for named entity recognition},
author={Hiroki Nakayama},
url={https://github.com/Hironsan/neraug},
year={2021}
}
Metadata
Release files for neraug 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| neraug-0.1.1.tar.gz | 123.6 kB | Without provenance | Details for neraug-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| neraug-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for neraug-0.1.1-py3-none-any.whl |
Total release size: 128.1 kB
Release files / neraug-0.1.1.tar.gz
| Download URL | neraug-0.1.1.tar.gz |
|---|---|
| Size | 123.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
263f42779494e3cb8c1fc58a3ac695e4a474217f4a0fd626387cb836f2bd4887
|
|
BLAKE2b-256 checksum How to use checksums |
368c7da2b2117b6c3478ea6024b503b8d48eec0acbe10c74c8749d51639471cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
|
Release files / neraug-0.1.1-py3-none-any.whl
| Download URL | neraug-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
28efd5a5ecdd49bbffc3dcb7692ff5458be7fc76e7927ce6a4e768b36a310835
|
|
BLAKE2b-256 checksum How to use checksums |
b9c3cb7faca44dd63a898b2f80ffd0aa1ea2e559cadb0ae25b8bc243e72ed43f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
|
Security for neraug 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.