Skip to main content

A sparv plugin for computing word neighbours using a BERT model.

Project description

sparv-sbx-word-prediction-kb-bert

PyPI version PyPI - Python Version PyPI - Downloads

Maturity badge - level 2 Stage

CI(release)

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

sparv_sbx_word_prediction_kb_bert-0.6.1.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file sparv_sbx_word_prediction_kb_bert-0.6.1.tar.gz.

File metadata

File hashes

Hashes for sparv_sbx_word_prediction_kb_bert-0.6.1.tar.gz
Algorithm Hash digest
SHA256 592a5af0245d3e3b676bf7564ae0bb0e24e770863c9f3b053d9ce732e887eba1
MD5 8551ef6cbaa90f540d0e4ac576028759
BLAKE2b-256 d6d039dd808b12dc1a9d54f20d084b82993389ac00831d292874e30b062a1e46

See more details on using hashes here.

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

Attestations:

File details

Details for the file sparv_sbx_word_prediction_kb_bert-0.6.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sparv_sbx_word_prediction_kb_bert-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 09924569fed41f8a1c8440352df43c2f3810feeda83043bee6867a5312d3731e
MD5 97f049b4645164484fcecf228425c863
BLAKE2b-256 83af24b89777428ebf2ed4fdba74aca5bf324a4334cf545f6df503cf03736f33

See more details on using hashes here.

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

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page