Metadata-Version: 2.1
Name: wakong
Version: 1.0.0
Summary: Wakong: An appropriate and robust masking algorithm for generating the training objective of text infilling.
Keywords: algorithm,masking algorithm,nlp,natural language processing,training objective,deep learning,text processing,text infilling
Author-email: Ayaka <ayaka@mail.shn.hk>
Requires-Python: ~=3.10
Description-Content-Type: text/markdown
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Text Processing
Classifier: Typing :: Typed
Requires-Dist: numpyro~=0.10.1 ; extra == "test"
Project-URL: Repository, https://github.com/ayaka14732/wakong
Provides-Extra: test

# The Wakong Algorithm and Its Python Implementation

Wakong: An appropriate and robust masking algorithm for generating the training objective of text infilling

## Motivation

TODO

## Installation

Wakong supports Python 3.10 and above:

```sh
pip install wakong
```

## Usage

```python
from random import Random
from wakong import generate_mask_scheme, pretty_print_mask_scheme

seed = 42
rng = Random(seed)

for _ in range(5):
    seq_len = 60
    mask_scheme = generate_mask_scheme(rng, seq_len)
    pretty_print_mask_scheme(seq_len, mask_scheme)
```

Output:

```
..(xx)..(xxx)....(xx).........(x)...................................
..............(xxxx)...............(xxxxx)......................
..........().....(xxx)....................................(xxxxxx)
........(xx)..................(xxxxxx)...........(xx).............
............(xxxxx).........................(xxxxx).............
```

`.` stands for non-masked tokens, while `(xxx)` stands for substituting 3 tokens to a single mask token.

