Skip to main content

Lexical Sentiment Analysis in Danish

Project description

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!')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sentm-0.1.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sentm-0.1.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file sentm-0.1.1.tar.gz.

File metadata

  • Download URL: sentm-0.1.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.9 Darwin/21.1.0

File hashes

Hashes for sentm-0.1.1.tar.gz
Algorithm Hash digest
SHA256 365df1091a32cd64fc9ce90a16d0b93177a2c90bef67121427cf31f5ea5f9440
MD5 c8aac40df7df2c38de95e9b1ac7bb98a
BLAKE2b-256 9c9775c48c846ac09647929a12480906f2f44e8fba13b4c2472c2f94ed37f6ba

See more details on using hashes here.

File details

Details for the file sentm-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sentm-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.9 Darwin/21.1.0

File hashes

Hashes for sentm-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 635ace91866b3801879cbc76d400c5cb98de9849819456fa988ab8253af98d46
MD5 994be09cd71064ea44b170d8f948bc00
BLAKE2b-256 b9cc784db7900b3d82a7c89eec03d5a0c3533ea8196cf181b918f0383f6012aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page