Fill the blank using transformers
Project description
Fill Blank
In our early education day, while learning english one of the most important task was to fill the blanks.
Two type of question was provided:
- Cloze test with clues
- Cloze test without clues
It was totally difficult for non native English learner to fill the blanks. And cloze test without cloze was the most trickier.
But now a days machine can fill the blanks smartly. Mask Language Modeling(MLM) based language model give machine such power.
FillBlank is an BERT based package, can fill cloze test without clues type text. This package mostly build using huggingface transformers.
Installation
pip install fillblank
Dependency
- pytorch 1.6+
How to Fill The Blank
from fillblank.fillblank import FillBlank
text = "what a <blank>! She <blank> to eat."
filltheblank = FillBlank()
output, output_dictionary = filltheblank.fill(text)
print(output)
print(output_dictionary['predict_words'])
# what a <mess>! she <needed> to eat.
#['mess', 'needed']
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fillblank-1.0.1.tar.gz.
File metadata
- Download URL: fillblank-1.0.1.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b73360b21a464dbf26a197d63061f77a5af30b688fbac1b140d563bae44ef41
|
|
| MD5 |
d72a808425b3653a2a405105ad763ca1
|
|
| BLAKE2b-256 |
d1386a0e110bf6380ee70d21d5d613de0a9a301f466b6057fcddf4200c58e532
|
File details
Details for the file fillblank-1.0.1-py3-none-any.whl.
File metadata
- Download URL: fillblank-1.0.1-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6ea3a78502ac7fc418cc5888df392d440cfac78d26a62879a29ce401a70a5ae
|
|
| MD5 |
90c7220dfd58813c0c61144a4fde3b8b
|
|
| BLAKE2b-256 |
929c89ba9555ff4471a621e4a7b53eb932cd0ad5bdb868eca22cae37affe1e8b
|