Skip to main content

senTM

Pronounced "sen-T-M".

senTM is a lexical approach to sentiment analysis in Danish. The approach is inspired by the afinn package, but using the Danish Sentiment Lexicon version 0.2 (2022-12-20).

The approach use the part-of-speech (POS) model from Spacy and then matches any tokens from the Danish Sentiment Lexicon.

License: Same as Danish Sentiment Lexicon version 0.2 (2022-12-20): CC-BY-SA 4.0 International https://creativecommons.org/licenses/by-sa/4.0/

Installation

Install from pip:

pip install sentm

Quickstart

First initialize model.

from sentm.sentm import senTM

sentm_model = senTM()

You can both get sentiment score:

sentm_model.score('Du er en kæmpe idiot!')

You can also use it as a classifier. Here, the labels are determined by:

  • Score larger than 1: "positiv"
  • Score between -1 and 1: "neutral"
  • Score lower than -1: "negativ"
sentm_model.classify('Du er en kæmpe idiot!')

Metadata

Release files for sentm 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sentm 0.2.1
File Size Uploaded
sentm-0.2.1.tar.gz 6.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for sentm 0.2.1
File Interpreter ABI Platform
sentm-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.1 MB

Release files / sentm-0.2.1.tar.gz

Download URL sentm-0.2.1.tar.gz
Size 6.5 MB
Tags Source
SHA-256 checksum
How to use checksums
1db463558fef46b9a386f11382ba33b2418d42ecff4bbe7efec6c23f26879955
BLAKE2b-256 checksum
How to use checksums
26fbcac1a7bc29f8a79a2480765d716114701af2605faa4800d5ce36f65f876c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.1 CPython/3.9.9 Darwin/21.1.0

Release files / sentm-0.2.1-py3-none-any.whl

Download URL sentm-0.2.1-py3-none-any.whl
Size 6.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
1a1fc5ba61637e3e8034cb43169c2af2f92b611f00dbda91abe2f7a3bcfd1a3a
BLAKE2b-256 checksum
How to use checksums
92d1ec4ae2f4488b133c81ba012947b2256308cabeee18dede9147e532f93795
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.1 CPython/3.9.9 Darwin/21.1.0

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page