Skip to main content

sparv-word-prediction--kb-bert-plugin

PyPI version

Plugin for applying bert masking as a Sparv annotation.

Install

First, install Sparv, as suggested:

pipx install sparv-pipeline

Then install install sparv-word-prediction-kb-bert-plugin with

pipx inject sparv-pipeline sparv-word-prediction-kb-bert-plugin

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>:word_prediction_kb_bert.word-prediction--kb-bert

To use it together with other annotations you might add it under export:

export:
    annotations:
        - <token>: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:

word_prediction_kb_bert:
    num_neighbours: 5

Number of Decimals

The number of decimals defaults to 3 but can be configured in config.yaml:

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.

Release files for sparv-word-prediction-kb-bert-plugin 0.5.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 sparv-word-prediction-kb-bert-plugin 0.5.2
File Size Uploaded
sparv_word_prediction_kb_bert_plugin-0.5.2.tar.gz 98.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sparv-word-prediction-kb-bert-plugin 0.5.2
File Interpreter ABI Platform
sparv_word_prediction_kb_bert_plugin-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 103.4 kB

Release files / sparv_word_prediction_kb_bert_plugin-0.5.2.tar.gz

Download URL sparv_word_prediction_kb_bert_plugin-0.5.2.tar.gz
Size 98.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d4b863d3f9e9573363bc469e42b1a830ae584143833477e457a7625c14b0b866
BLAKE2b-256 checksum
How to use checksums
11109a809035925b8655d4059f8b82060f39aef051f0f3943fa33be7c0d9cf46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / sparv_word_prediction_kb_bert_plugin-0.5.2-py3-none-any.whl

Download URL sparv_word_prediction_kb_bert_plugin-0.5.2-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
478b5dae8e8324e7cddc5912af1a862348b66524108e061c019ebf07eda101ea
BLAKE2b-256 checksum
How to use checksums
3c2a4deafcf3ac505eb5c6aa14cdbcf2ccfcb84ec8e33fab9576a01a886499dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.5.2 This release

2 release files

0.5.1

2 release files

0.4.0

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