Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethEnevoldsen committed Jan 24, 2024
2 parents d07547c + 96fc09b commit d990deb
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
@@ -1,6 +1,6 @@
{
"template": "https://github.com/KennethEnevoldsen/swift-python-cookiecutter",
"commit": "e96eb05162a0e45a8ad5aa446c72229372e79cdb",
"commit": "e02068889310225ea4f65ea0b203c2949e1597a9",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
@@ -1,6 +1,6 @@
# GitHub action to run linting

name: run linting
name: run-linting

on:
pull_request:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/stalebot.yml
Expand Up @@ -20,4 +20,5 @@ jobs:
close-pr-message: "This PR was closed automatically. Feel free to re-open it if you still want to work on it."
close-pr-label: "closed-by-stalebot"
operations-per-run: 20
exempt-pr-labels: "dependencies,bot"
exempt-pr-labels: "no-stale"
exempt-issue-labels: "no-stale"
27 changes: 27 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,33 @@



## v2.7.7 (2024-01-17)

### Ci

* ci: Updated makefile ([`f6dd006`](https://github.com/centre-for-humanities-computing/DaCy/commit/f6dd0068dfafb871e93fa956e1a6a686795fd3e8))

### Fix

* fix: check for correct 'emotionally_laden' doc extension when creating emotion classifier ([`c2b6c93`](https://github.com/centre-for-humanities-computing/DaCy/commit/c2b6c930a3ef98893c73916dab2daaa9e095731e))

### Unknown

* Merge pull request #286 from centre-for-humanities-computing/fix-emotionally-laden-extension-bug

fix: check for correct 'emotionally_laden' doc extension when creating emotion classifier ([`7fe60a4`](https://github.com/centre-for-humanities-computing/DaCy/commit/7fe60a4a3612de61a5ee2c155d7678b241dfbd8b))

* Merge pull request #280 from centre-for-humanities-computing/cruft-update

Update based on cruft template ([`017e13d`](https://github.com/centre-for-humanities-computing/DaCy/commit/017e13d3d50d02d8f7ce36d1cc1d1289b1501c78))

* Updated based on cruft template ([`24feedd`](https://github.com/centre-for-humanities-computing/DaCy/commit/24feedd247271ae0ad8e02d5760fedcc19cede32))

* Merge pull request #279 from centre-for-humanities-computing/sarakolding-patch-1 ([`af7d33b`](https://github.com/centre-for-humanities-computing/DaCy/commit/af7d33b986834dd71458de9fa7adf2261ab9079f))

* Update names.py ([`c74e75a`](https://github.com/centre-for-humanities-computing/DaCy/commit/c74e75ab223d4bf6dcbe398dd7f443ab62b5cbef))


## v2.7.6 (2023-12-07)

### Fix
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -13,7 +13,7 @@ Here is a list of important resources for contributors:

[Apache-2.0 license]: https://opensource.org/license/apache-2-0/
[source code]: https://github.com/centre-for-humanities-computing/dacy
[documentation]: https://dacy.readthedocs.io/
[documentation]: https://centre-for-humanities-computing.github.io/dacy/index.html
[issue tracker]: https://github.com/centre-for-humanities-computing/dacy/issues

## How to report a bug
Expand Down
2 changes: 1 addition & 1 deletion makefile
Expand Up @@ -37,5 +37,5 @@ view-docs:
update-from-template:
@echo "--- 🔄 Updating from template ---"
@echo "This will update the project from the template, make sure to resolve any .rej files"
cruft update
cruft update --skip-apply-ask

2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "dacy"
version = "2.7.6"
version = "2.7.7"
description = "A Danish pipeline trained in SpaCy that has achieved State-of-the-Art performance on all dependency parsing, NER and POS-tagging for Danish"
authors = [
{ name = "Kenneth Enevoldsen", email = "kennethcenevoldsen@gmail.com" },
Expand Down
4 changes: 2 additions & 2 deletions src/dacy/sentiment/wrapped_models.py
Expand Up @@ -139,7 +139,7 @@ def make_emotion_transformer(
doc_extension_prediction: str,
labels: List[str], # type: ignore
) -> SequenceClassificationTransformer:
if not Doc.has_extension("dacy/emotionally_laden"):
if not Doc.has_extension("emotionally_laden"):
warn(
"The 'emotion' component assumes the 'emotionally_laden' extension is set."
+ " To set it you can run nlp.add_pipe('dacy/emotionally_laden')",
Expand All @@ -162,7 +162,7 @@ def make_emotion_transformer(

# overwrite extension such that it return no emotion if the document does not have
# an emotion
if Doc.has_extension("dacy/emotionally_laden"):
if Doc.has_extension("emotionally_laden"):

def label_getter(doc) -> Optional[str]: # noqa: ANN001 # type: ignore
if doc._.emotionally_laden == "emotional":
Expand Down
2 changes: 2 additions & 0 deletions tests/test_sentiment.py
Expand Up @@ -36,8 +36,10 @@ def test_add_berttone_polarity():
def test_add_bertemotion_laden():
nlp = spacy.blank("da")
nlp.add_pipe("dacy/emotionally_laden")
nlp.add_pipe("dacy/emotion")
doc = nlp("Der er et træ i haven")
assert doc._.emotionally_laden == "no emotion"
assert doc._.emotion == "no emotion"


def test_add_bertemotion_emo():
Expand Down

0 comments on commit d990deb

Please sign in to comment.