Skip to main content

My Aspect Library

Overview

My Aspect Library is a Python package designed for performing aspect-based sentiment analysis with integrated translation capabilities. This library allows you to easily translate text, extract aspects, and analyze sentiment, making it a powerful tool for natural language processing tasks.

Features

  • Translation: Automatically translate text in your dataset to the target language before analysis.
  • Aspect Extraction: Extract aspect terms from text using state-of-the-art models.
  • Sentiment Analysis: Analyze sentiment associated with extracted aspects.
  • Data Processing: Clean and process text data for analysis, including stopword removal and text normalization.
  • Pivot Table Generation: Create pivot tables to summarize sentiment analysis results.

Installation

To install the package, you can simply clone the repository and use setup.py to install it:

git clone https://github.com/yourusername/my_aspect_library.git
cd my_aspect_library
pip install .

Alternatively, if you want to install it in editable mode:

pip install -e .

Usage

Here’s a quick example of how to use the library:

import pandas as pd
from my_aspect_library import AspectExtractor, translate_aspects, create_pivot_table, concatenate_results

# Load your dataset
df = pd.read_excel('path_to_your_file.xlsx')

# Initialize the aspect extractor
aspect_extractor = AspectExtractor()

# Perform translation and aspect extraction in one step
result_df = aspect_extractor.extract(df, column_name='Customer Comments', target_language='en')

# Translate aspects and sentiments
translated_aspects = translate_aspects(result_df)

# Create pivot table for sentiment analysis
pivot_table = create_pivot_table(translated_aspects)

# Save or further process your results as needed

Dependencies

  • pandas
  • deep_translator
  • unlimited_machine_translator
  • pyabsa
  • nltk

These dependencies are automatically installed when you install the package.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

If you want to contribute to this project, feel free to fork the repository and submit a pull request.

Acknowledgments

Special thanks to all the contributors and maintainers of the libraries that this project depends on.

Metadata

Release files for aspect-library-v1 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aspect-library-v1 0.1.3
File Size Uploaded Provenance
aspect_library_v1-0.1.3.tar.gz 4.0 kB Without provenance Details

Release files / aspect_library_v1-0.1.3.tar.gz

Download URL aspect_library_v1-0.1.3.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8d8120cf327120243f6438d241f21be8b686a69769d90fb75fe3511923bd1098
BLAKE2b-256 checksum
How to use checksums
896781d2a1602b7687efdf0c83de0b3924b5ce4b566ed0d5755f997aacfdd939
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.13

Security for aspect-library-v1 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page