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, with added support for semantic search. 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 Semantic 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.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.7.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: perspectives-1.0.7.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.7.tar.gz
Algorithm Hash digest
SHA256 ce4029b1147c3a7520b805a1c7fde2cb3454d7dfdfd44c636f55b44d35169655
MD5 0d3f7f0e2a875a32cdcd1828963c0f2d
BLAKE2b-256 0aa2d108af6e1a84fea72a8af0bc2c5481989c5b1ec17194e8b4e41484a59685

See more details on using hashes here.

File details

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

File metadata

  • Download URL: perspectives-1.0.7-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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e34552738fe17dab5e0d7d432cd861edb276eee0cdd48a70b59a56234e15ef25
MD5 954baf34912e7f90b3c71920d0270031
BLAKE2b-256 f563638632915d19945094af8f1f5145082bfac3b58d3ff9eaf4710d9cbc4609

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