Skip to main content

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

https://neural-keyword-assignment.readthedocs.io/

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)

Source distribution for nka 1.0.2
File Size Uploaded
nka-1.0.2.tar.gz 31.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nka 1.0.2
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page