Wakong: An appropriate and robust masking algorithm for generating the training objective of text infilling.
Project description
Wakong
Wakong: An appropriate and robust masking algorithm for generating the training objective of text infilling
This project is the Python library of ARP 1: The Wakong Algorithm and Its Python Implementation.
This project is supported by Cloud TPUs from Google's TPU Research Cloud (TRC) as a part of my project on large-scale language model pre-training.
Installation
Wakong supports Python 3.10 and above:
pip install wakong
You can also install from source:
flit install
Usage
from wakong import Wakong
wakong = Wakong(seed=42)
sentence = 'I can eat glass , it does not hurt me .'.split(' ')
print(wakong(sentence))
Output:
['I', '<mask>', 'eat', 'glass', '<mask>', ',', 'it', 'does', 'not', 'hurt', 'me', '.']
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wakong-1.1.0.tar.gz
(8.6 kB
view hashes)
Built Distribution
Close
Hashes for wakong-1.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adb5f1491f71f714898ae7cfb6e18df7feec015549f215e7946b428b3aedbcee |
|
MD5 | a219bdfb91f8a3809b811364148b952e |
|
BLAKE2b-256 | 029f3d6ba3e31e64a1168bd57dd8d0cc3520627bfb13b9e745e5d7b52a7abbd0 |