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. Graph generated from extracted perspectives
Semantic search dashboard built on top of pandas
Main Features
-
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. -
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.
-
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.
-
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 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file perspectives-1.0.6.tar.gz
.
File metadata
- Download URL: perspectives-1.0.6.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb9e04207977d0a2ea7cc5899a0a41feec46fce2b4afe09d06272c62fdc7fe36 |
|
MD5 | f55ee43d303dd254863081916e8d1e64 |
|
BLAKE2b-256 | 0930347f9f153f4fe161191eab6e0c19023ad54e036d1d569374a3d074f07fef |
File details
Details for the file perspectives-1.0.6-py3-none-any.whl
.
File metadata
- Download URL: perspectives-1.0.6-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25734c66121767c1dc60d2fe8b7db1eafe183626d2b18367507ec2db318050f3 |
|
MD5 | 8453a09b44a87776adafcbe467bdd5c3 |
|
BLAKE2b-256 | 86e483eda52e58da5a74a1c96d1fcaab2e2d4db955bd22f2ada041f5b3b5d53d |