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.1.tar.gz
(8.6 kB
view hashes)
Built Distribution
Close
Hashes for wakong-1.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d8b726b17302b14d70996cbc930756db0157ed2b4d59acac1af893719b326c1 |
|
MD5 | e69a16903b2ee247432db4108dba1de1 |
|
BLAKE2b-256 | 5f053c2d36a8808e3d49e10310653c444cec0882abd49e9a05c29cb5047bfd20 |