Skip to main content

PyTorch models for polish language sentiment regression based on allegro/herbert and CLARIN-PL dataset

Project description

sentimentPL

PyTorch models for polish language sentiment regression based on allegro/herbert and CLARIN-PL dataset

Installation

sentimentPL is available on PyPI, so You can just run:

$ pip3 install sentimentpl

Basic Usage

For a given sentence, the model produces output value from (-1;1) range (from most negative to most positive).

from sentimentpl.models import SentimentPLModel

model = SentimentPLModel(from_pretrained='latest')
print(model('Jestem wesoły Romek').item())

Note: The model uses transformers API to load pretrained embedding models from their repository. They should be downloaded and cached on Your machine.

Note: The model loads pretrained state dicts for final regression layers from a file included in the package files (as its size does not exceed 1MB). This will be changed in the future, so the model would be loaded from external repository.

Training

For training You would probably want to download the source code by cloning the repository:

$ git clone https://github.com/philvec/sentimentPL.git

Download training data from
https://clarin-pl.eu/dspace/bitstream/handle/11321/710/dataset_conll.zip
and unzip it to sentimentpl/data.

In the main repository dir, run

$ python3 ./sentimentpl/train.py

Version history

v.0.0.3 latest

Basic 3-layer MLP with ReLU and input Dropout.

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

sentimentpl-0.0.5.tar.gz (756.9 kB view details)

Uploaded Source

Built Distribution

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

sentimentpl-0.0.5-py3-none-any.whl (768.3 kB view details)

Uploaded Python 3

File details

Details for the file sentimentpl-0.0.5.tar.gz.

File metadata

  • Download URL: sentimentpl-0.0.5.tar.gz
  • Upload date:
  • Size: 756.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for sentimentpl-0.0.5.tar.gz
Algorithm Hash digest
SHA256 d92d7df8a21c85ccf1595cb5dab489097138dc475ebb2a7ddca4b1bd718f5696
MD5 3884c5cb14c75d6f20cd4a32f62f3762
BLAKE2b-256 5b56ed27cc5f38712dc88e56620706c638e0f03ec5d71a8abd5fae6ec4f7ce21

See more details on using hashes here.

File details

Details for the file sentimentpl-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: sentimentpl-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 768.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for sentimentpl-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 514059736e75a6e54d2083789b73b4455848217785fa253fdf43dc5ef6d76856
MD5 df07c6259e6f9934e1da0406c0ac29ba
BLAKE2b-256 7b9c4894a09996c75d80a0049efaf28d4533611ceeaa789b941f74a0f3df793c

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