Skip to main content

sparv-bert-neighbour-plugin

CI 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-bert-neighbour-plugin with

pipx inject sparv-pipeline sparv-bert-neighbour-plugin

Usage

To use this annotation you need to specify that you want to use it:

xml_export:
    annotations:
        - <token>:sparv_bert_neighbour.transformer-neighbour

Configuration

You can configure this plugin by choosing a huggingface model, huggingface transformer and the number of neighbours to generate.

Model

The model defaults to KBLab/bert-base-swedish-cased but can be configured in config.yaml:

sparv_bert_neighbour:
    model: "KBLab/bert-base-swedish-cased"

Tokenizer

The tokenizer defaults to KBLab/bert-base-swedish-cased but can be configured in config.yaml:

sparv_bert_neighbour:
    tokenizer: "KBLab/bert-base-swedish-cased"

Number of Neighbours

The number of neighbousr defaults to 5 but can be configured in config.yaml:

sparv_bert_neighbour:
    num_neighbours: 5

Metadata

Release files for sparv-bert-neighbour-plugin 0.2.1

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-bert-neighbour-plugin 0.2.1
File Size Uploaded
sparv_bert_neighbour_plugin-0.2.1.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sparv-bert-neighbour-plugin 0.2.1
File Interpreter ABI Platform
sparv_bert_neighbour_plugin-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 kB

Release files / sparv_bert_neighbour_plugin-0.2.1.tar.gz

Download URL sparv_bert_neighbour_plugin-0.2.1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e242f9e8dd47b911c1471b54a6f0b973abacd81d3eda11723238fbfc275ecd0c
BLAKE2b-256 checksum
How to use checksums
3aa80a9c1c9b76ed8d620c70e706c76f0419b9aa8811dd3ad602f5baf5a2f17f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / sparv_bert_neighbour_plugin-0.2.1-py3-none-any.whl

Download URL sparv_bert_neighbour_plugin-0.2.1-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1f9db9a2ee60ce12f1786ac6ab8d88fb56aabd5558e734961617a49582f7e46
BLAKE2b-256 checksum
How to use checksums
adbe759e973550c2505660fd7bb0d69983ce1ed03a4b4a09b876d2dea8f143f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.1.2

2 release files

0.1.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