-
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 #5 from spraakbanken/2-annotate-sentence
2 annotate sentence
- Loading branch information
Showing
24 changed files
with
430 additions
and
96 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
metadata: | ||
id: example-sparv-sbx-sentence-kb-sent | ||
language: swe | ||
|
||
import: | ||
importer: text_import:parse | ||
|
||
export: | ||
annotations: | ||
- <sentence> | ||
# - <token:word> | ||
- <token>:stanza.pos | ||
- <sentence>:sbx_sentence_sentiment_kb_sent.sbx-sentence-sentiment--kb-sent | ||
|
||
sparv: | ||
compression: none |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
../../texts/small.txt |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Stora regnmängder väntas under måndagen och SMHI har utfärdat en gul varning för skyfallsliknande regn över stora delar av landets södra halva. | ||
Jag är förvånad, chockad och bestört över det här, säger Anders Persson till SVT Nyheter Småland. | ||
Vi hoppas och tror att detta också snabbt ska kunna komma på plats, säger Garborg. |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[mypy] | ||
python_version = 3.8 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
line-length = 97 | ||
|
||
target-version = "py38" | ||
|
||
[lint] | ||
select = [ | ||
"A", # flake8-builtins | ||
"ANN", # flake8-annotations | ||
"ARG", # flake8-unused-arguments | ||
"B", # flake8-bugbear | ||
"C4", # flake8-comprehensions | ||
"COM", # flake8-commas | ||
"D", # pydocstyle | ||
"D400", # pydocstyle: ends-in-period | ||
"D401", # pydocstyle: non-imperative-mood | ||
"E", # pycodestyle: errors | ||
"F", # Pyflakes | ||
"FLY", # flynt | ||
"FURB", # refurb | ||
"G", # flake8-logging-format | ||
"I", # isort | ||
"ISC", # flake8-implicit-str-concat | ||
"N", # pep8-naming | ||
"PERF", # Perflint | ||
"PIE", # flake8-pie | ||
"PL", # Pylint | ||
# "PT", # flake8-pytest-style | ||
"PTH", # flake8-use-pathlib | ||
"Q", # flake8-quotes | ||
"RET", # flake8-return | ||
"RSE", # flake8-raise | ||
"RUF", # Ruff-specific rules | ||
"SIM", # flake8-simplify | ||
"T20", # flake8-print | ||
"TID", # flake8-tidy-imports | ||
"UP", # pyupgrade | ||
"W", # pycodestyle: warnings | ||
] | ||
ignore = [ | ||
"ANN101", # flake8-annotations: missing-type-self (deprecated) | ||
"ANN102", # flake8-annotations: missing-type-cls (deprecated) | ||
"ANN401", # flake8-annotations: any-type | ||
"B008", # flake8-bugbear: function-call-in-default-argument | ||
"ISC001", | ||
"COM812", # flake8-commas: missing-trailing-comma | ||
"PLR09", # Pylint: too-many-* | ||
"SIM105", # flake8-simplify: suppressible-exception | ||
] | ||
preview = true | ||
|
||
# Avoid trying to fix flake8-bugbear (`B`) violations. | ||
unfixable = ["B"] | ||
|
||
|
||
[lint.pydocstyle] | ||
convention = "google" | ||
|
||
|
||
# Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`. | ||
[lint.per-file-ignores] | ||
"*/tests/*" = ["D", "ARG002", "E501"] |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -3,12 +3,13 @@ name = "sparv-sbx-sentence-sentiment-kb-sent" | |
version = "0.1.0" | ||
description = "A sparv plugin for computing word neighbours using a BERT model." | ||
authors = [ | ||
{ name = "Språkbanken Text", email = "[email protected]" }, | ||
{ name = "Kristoffer Andersson", email = "[email protected]" }, | ||
] | ||
dependencies = ["sparv-pipeline >=5.2.0", "transformers>=4.34.1"] | ||
license = "MIT" | ||
readme = "README.md" | ||
requires-python = ">= 3.8,<3.12" | ||
requires-python = ">= 3.8.1,<3.12" | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
# "Development Status :: 4 - Beta", | ||
|
@@ -54,4 +55,7 @@ allow-direct-references = true | |
|
||
|
||
[tool.pdm.dev-dependencies] | ||
dev = ["pytest>=8.0.0"] | ||
dev = [ | ||
"pytest>=8.0.0", | ||
"syrupy>=4.6.1", | ||
] |
7 changes: 7 additions & 0 deletions
7
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 +1,8 @@ | ||
"""Sparv plugin for annotating sentences with sentiment analysis.""" | ||
|
||
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" |
Oops, something went wrong.