Skip to main content

Extracting directed emotions at scale with LMs

Project description

Perspectives: Directed Emotion Extraction

Overview

The Perspectives library offers an easy way to extract directed emotions at scale with its cutting-edge emotion extraction model. It is built on top of the powerful pandas DataFrame functionality. The library introduces several novel methods for text analytics, perfect for dealing with customer feedback, analyzing semantic trends, or profiling entities within a text. image Graph generated from extracted perspectives

image Search dashboard built on top of pandas

Main Features

  1. Easily extract perspectives from text: The get_perspectives() function allows you to extract the speaker's identity, emotions, and the object of these emotions, giving you useful insights about the emotions in your text.

  2. Powerful search capabilities: You can search the dataset based on the speaker, emotion, object, and reason. The search method leverages the sentence transformer models for semantic search functionality, providing you with outputs that are spot-on.

  3. Improved machine learning models: The library efficiently interfaces with PyTorch BART model for Seq2Seq learning and the mpnet-base model for sentence-transformations, which provides powerful text representation for ML models.

  4. Structured emotional outcomes: All outputs are neatly structured in DataFrame format, allowing for easy downstream analysis and visualizations.

Installation

pip install perspectives

Usage

from perspectives import DataFrame

# Load DataFrame
df = DataFrame(texts = [list of sentences]) 

# Load model
df.load_model() 

# Get perspectives
df.get_perspectives()

# Search
df.search(speaker='...', emotion='...')

# Profile
df.profile_graph(speaker='...')

Colab demo for profiling

Colab demo for analyzing customer reviews

Contributing and Support

Contributions are welcome! Please raise a GitHub issue for any problems you encounter.

Licence

The library is open source, free to use under the MIT license.

Please note that this library is still under active development, hence you may see regular updates and improvements. Feel free to contribute!

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

perspectives-1.0.5.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

perspectives-1.0.5-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file perspectives-1.0.5.tar.gz.

File metadata

  • Download URL: perspectives-1.0.5.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for perspectives-1.0.5.tar.gz
Algorithm Hash digest
SHA256 da19b3227d24d253e679b2ca2884806ff5a4b23ac6842aa1b22669cf7ec4b41d
MD5 14676c75708a52ba4d1c68970bc4e7c3
BLAKE2b-256 78051d1b44c883ddb78340553ff1e5a51a411d71ab46401b5030fa2363a47e72

See more details on using hashes here.

File details

Details for the file perspectives-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: perspectives-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for perspectives-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b7b446b164ab827364eeffe387c1e4137ad24fb076062ce83d6bfbf2987a4b70
MD5 88a5d2edcc1f3b2662d6ff11dbfca577
BLAKE2b-256 1c654816fda0703752afa5bcd3ed2215c8cba4d39328b08ba6fc6b828a2f6a3a

See more details on using hashes here.

Supported by

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