A sparv plugin for computing word neighbours using a BERT model.
Project description
sparv-sbx-word-prediction-kb-bert
Plugin for applying bert masking as a Sparv annotation.
Install
First, install Sparv, as suggested:
pipx install sparv-pipeline
Then install install sparv-sbx-word-prediction-kb-bert
with
pipx inject sparv-pipeline sparv-sbx-word-prediction-kb-bert
Usage
Depending on how many explicit exports of annotations you have you can decide to use this
annotation exclusively by adding it as the only annotation to export under xml_export
:
xml_export:
annotations:
- <token>:sbx_word_prediction_kb_bert.word-prediction--kb-bert
To use it together with other annotations you might add it under export
:
export:
annotations:
- <token>:sbx_word_prediction_kb_bert.word-prediction--kb-bert
...
Configuration
You can configure this plugin by the number of neighbours to generate.
Number of Neighbours
The number of neighbours defaults to 5
but can be configured in config.yaml
:
sbx_word_prediction_kb_bert:
num_neighbours: 5
Number of Decimals
The number of decimals defaults to 3
but can be configured in config.yaml
:
sbx_word_prediction_kb_bert:
num_decimals: 3
[!NOTE] This also controls the cut-off, so all values where the score round to 0.000 (or the number of decimals) is discarded.
Metadata
Model
Type | HuggingFace Model | Revision |
---|---|---|
Model | KBLab/bert-base-swedish-cased |
c710fb8dff81abb11d704cd46a8a1e010b2b022c |
Tokenizer | same as Model | same as Model |
Changelog
This project keeps a changelog.
Project details
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
File details
Details for the file sparv_sbx_word_prediction_kb_bert-0.6.1.tar.gz
.
File metadata
- Download URL: sparv_sbx_word_prediction_kb_bert-0.6.1.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 592a5af0245d3e3b676bf7564ae0bb0e24e770863c9f3b053d9ce732e887eba1 |
|
MD5 | 8551ef6cbaa90f540d0e4ac576028759 |
|
BLAKE2b-256 | d6d039dd808b12dc1a9d54f20d084b82993389ac00831d292874e30b062a1e46 |
Provenance
The following attestation bundles were made for sparv_sbx_word_prediction_kb_bert-0.6.1.tar.gz
:
Publisher:
release-kb-bert.yml
on spraakbanken/sparv-sbx-word-prediction
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
sparv_sbx_word_prediction_kb_bert-0.6.1.tar.gz
- Subject digest:
592a5af0245d3e3b676bf7564ae0bb0e24e770863c9f3b053d9ce732e887eba1
- Sigstore transparency entry: 150788183
- Sigstore integration time:
- Predicate type:
File details
Details for the file sparv_sbx_word_prediction_kb_bert-0.6.1-py3-none-any.whl
.
File metadata
- Download URL: sparv_sbx_word_prediction_kb_bert-0.6.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09924569fed41f8a1c8440352df43c2f3810feeda83043bee6867a5312d3731e |
|
MD5 | 97f049b4645164484fcecf228425c863 |
|
BLAKE2b-256 | 83af24b89777428ebf2ed4fdba74aca5bf324a4334cf545f6df503cf03736f33 |
Provenance
The following attestation bundles were made for sparv_sbx_word_prediction_kb_bert-0.6.1-py3-none-any.whl
:
Publisher:
release-kb-bert.yml
on spraakbanken/sparv-sbx-word-prediction
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
sparv_sbx_word_prediction_kb_bert-0.6.1-py3-none-any.whl
- Subject digest:
09924569fed41f8a1c8440352df43c2f3810feeda83043bee6867a5312d3731e
- Sigstore transparency entry: 150788184
- Sigstore integration time:
- Predicate type: