centre-for-humanities-computing / DaCy

DaCy: The State of the Art Danish NLP pipeline using SpaCy
https://centre-for-humanities-computing.github.io/DaCy/
Apache License 2.0
93 stars 20 forks source link

fix: check for correct 'emotionally_laden' doc extension when creating emotion classifier #286

Closed KasperFyhn closed 10 months ago

KasperFyhn commented 10 months ago

In src/dacy/sentiment/wrapped_models.py lines 142 and 165, a check is made for the Doc extension dacy/emotionally_laden which should just have been emotionally_laden.

The change fixes:

  1. The warning in line 143 is no longer triggered incorrectly.
  2. If a document is classified as "no emotion" by emotionally_laden, doc._.emotion will correctly return "no emotion". See the change in tests (which can also be its own test to verify that behavior if you want).

Cheers!