A sparv plugin for computing word neighbours using a BERT model.
Project description
sparv-sbx-sentence-sentiment-kb-sent
Plugin for applying bert masking as a Sparv annotation.
Install
First, install Sparv as suggested:
pipx install sparv-pipeline
Then install install sparv-sbx-sentence-sentiment-kb-sent
with
pipx inject sparv-pipeline sparv-sbx-sentence-sentiment-kb-sent
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_sentence_sentiment_kb_sent.sentence-sentiment--kb-bert
To use it together with other annotations you might add it under export
:
export:
annotations:
- <token>:sbx_sentence_sentiment_kb_sent.sentence-sentiment--kb-bert
...
Configuration
You can configure this plugin by the number of neighbours to generate.
Number of Decimals
The number of decimals defaults to 3
but can be configured in config.yaml
:
sbx_sentence_sentiment_kb_sent:
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/robust-swedish-sentiment-multiclass |
b0ec32dca56aa6182a6955c8f12129bbcbc7fdbd |
Tokenizer | KBLab/megatron-bert-large-swedish-cased-165k |
90c57ab49e27b820bd85308a488409dfea25600d |
Changelog
This project keeps a changelog.
Project details
Release history Release notifications | RSS feed
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
Hashes for sparv_sbx_sentence_sentiment_kb_sent-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 733c512ddc5cb69a32daf9ee8c057a4aab7dcd1f868ed3a2c2fc573f0c4bb8f1 |
|
MD5 | bfb8568d52a8e0a62a5415e2c3c64812 |
|
BLAKE2b-256 | 92cac584fd0519319bfc00565643f0201a3f8f6f6843fca6ef8c485f7a1cf5bc |
Hashes for sparv_sbx_sentence_sentiment_kb_sent-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bb05f761c5af9bcae26064d05ccb58b0a3abf7edb7cf98a7034c178df4609f6 |
|
MD5 | d35236ae1f4b388fe2c91b5eb32af89d |
|
BLAKE2b-256 | d1ff8fefa1ca3f06f2f2e1ce529daefba1837fe0099eacfa2475c76fef9e211a |