-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from spraakbanken/add-config
feat: add num_decimals config
- Loading branch information
Showing
5 changed files
with
57 additions
and
27 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
sparv-sbx-sentence-sentiment-kb-sent/src/sbx_sentence_sentiment_kb_sent/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
"""Sparv plugin for annotating sentences with sentiment analysis.""" | ||
|
||
from sparv import api as sparv_api # type: ignore [import-untyped] | ||
|
||
from sbx_sentence_sentiment_kb_sent.annotations import annotate_sentence_sentiment | ||
|
||
__all__ = ["annotate_sentence_sentiment"] | ||
|
||
__description__ = "Annotate sentence with sentiment analysis." | ||
__version__ = "0.1.0" | ||
|
||
__config__ = [ | ||
sparv_api.Config( | ||
"sbx_sentence_sentiment_kb_bert.num_decimals", | ||
description="The number of decimals to round the score to", | ||
default=3, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
sparv-sbx-sentence-sentiment-kb-sent/tests/__snapshots__/test_annotations.ambr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# serializer version: 1 | ||
# name: test_annotate_sentence_sentiment | ||
list([ | ||
'|POSITIVE:0.866|', | ||
'|NEUTRAL:0.963|', | ||
'|POSITIVE:0.9|', | ||
'|NEUTRAL:1.0|', | ||
]) | ||
# --- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters