Input Sequence Length Transformer models like BERT / RoBERTa / DistilBERT etc. the runtime and the memory requirement grows quadratic with the input length. This limits transformers to inputs of certain lengths. A common value for BERT & Co. are 512 word pieces, which corresponde to about 300-400 words (for English). Longer texts than this are truncated to the first x word pieces.
By default, the provided methods use a limit fo 128 word pieces, longer inputs will be truncated. You can get and set the maximal sequence length like this:
An example package. Generated with cookiecutter-pylibrary.
Free software: MIT license
Installation
pip install nka
You can also install the in-development version with:
pip install https://github.com/tobibias/neural-keyword-assignment/archive/main.zip
Documentation
Development
To run all the tests run:
tox
Note, to combine the coverage data from all the tox environments run:
Windows |
set PYTEST_ADDOPTS=--cov-append tox |
|---|---|
Other |
PYTEST_ADDOPTS=--cov-append tox |
Changelog
0.0.0 (2022-06-22)
First release on PyPI.
Metadata
Release files for nka 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nka-1.0.2.tar.gz | 31.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nka-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 49.5 kB
Release files / nka-1.0.2.tar.gz
| Download URL | nka-1.0.2.tar.gz |
|---|---|
| Size | 31.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6484d49fba60f37306586b8c5a8b3c6a155d2132dd1802768bab726d49347fc1
|
|
BLAKE2b-256 checksum How to use checksums |
73327515d08b764b314c204f392bcf1edffa3f29c9bd7f46260075a37698c1c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.12
|
Release files / nka-1.0.2-py3-none-any.whl
| Download URL | nka-1.0.2-py3-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5231903cc4f39aeae8ae2c0d76eebf24b57988d8b18db9d32af56597c1e4a76e
|
|
BLAKE2b-256 checksum How to use checksums |
83ef4f7ff5b10501a8b65eccabe88779bda101c33d2449ac79cebeb8d6e9df88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.12
|