# 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:
```bash
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:
```bash
pip install -e .
```
## Usage
Here’s a quick example of how to use the library:
```python
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.
Raw data
{
"_id": null,
"home_page": "https://github.com/yourusername/my_aspect_library",
"name": "aspect-library-v1",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Your Name",
"author_email": "your.email@example.com",
"download_url": "https://files.pythonhosted.org/packages/89/67/81d2a1602b7687efdf0c83de0b3924b5ce4b566ed0d5755f997aacfdd939/aspect_library_v1-0.1.3.tar.gz",
"platform": null,
"description": "# My Aspect Library\r\n\r\n## Overview\r\n\r\nMy 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.\r\n\r\n## Features\r\n\r\n- **Translation**: Automatically translate text in your dataset to the target language before analysis.\r\n- **Aspect Extraction**: Extract aspect terms from text using state-of-the-art models.\r\n- **Sentiment Analysis**: Analyze sentiment associated with extracted aspects.\r\n- **Data Processing**: Clean and process text data for analysis, including stopword removal and text normalization.\r\n- **Pivot Table Generation**: Create pivot tables to summarize sentiment analysis results.\r\n\r\n## Installation\r\n\r\nTo install the package, you can simply clone the repository and use `setup.py` to install it:\r\n\r\n```bash\r\ngit clone https://github.com/yourusername/my_aspect_library.git\r\ncd my_aspect_library\r\npip install .\r\n```\r\n\r\nAlternatively, if you want to install it in editable mode:\r\n\r\n```bash\r\npip install -e .\r\n```\r\n\r\n## Usage\r\n\r\nHere\u00e2\u20ac\u2122s a quick example of how to use the library:\r\n\r\n```python\r\nimport pandas as pd\r\nfrom my_aspect_library import AspectExtractor, translate_aspects, create_pivot_table, concatenate_results\r\n\r\n# Load your dataset\r\ndf = pd.read_excel('path_to_your_file.xlsx')\r\n\r\n# Initialize the aspect extractor\r\naspect_extractor = AspectExtractor()\r\n\r\n# Perform translation and aspect extraction in one step\r\nresult_df = aspect_extractor.extract(df, column_name='Customer Comments', target_language='en')\r\n\r\n# Translate aspects and sentiments\r\ntranslated_aspects = translate_aspects(result_df)\r\n\r\n# Create pivot table for sentiment analysis\r\npivot_table = create_pivot_table(translated_aspects)\r\n\r\n# Save or further process your results as needed\r\n```\r\n\r\n## Dependencies\r\n\r\n- `pandas`\r\n- `deep_translator`\r\n- `unlimited_machine_translator`\r\n- `pyabsa`\r\n- `nltk`\r\n\r\nThese dependencies are automatically installed when you install the package.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the LICENSE file for details.\r\n\r\n## Contributing\r\n\r\nIf you want to contribute to this project, feel free to fork the repository and submit a pull request.\r\n\r\n## Acknowledgments\r\n\r\nSpecial thanks to all the contributors and maintainers of the libraries that this project depends on.\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python library for aspect-based sentiment analysis with translation capabilities",
"version": "0.1.3",
"project_urls": {
"Homepage": "https://github.com/yourusername/my_aspect_library"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "896781d2a1602b7687efdf0c83de0b3924b5ce4b566ed0d5755f997aacfdd939",
"md5": "284459b5beb689c0917550965b8f07c9",
"sha256": "8d8120cf327120243f6438d241f21be8b686a69769d90fb75fe3511923bd1098"
},
"downloads": -1,
"filename": "aspect_library_v1-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "284459b5beb689c0917550965b8f07c9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 4005,
"upload_time": "2024-08-31T18:38:13",
"upload_time_iso_8601": "2024-08-31T18:38:13.342598Z",
"url": "https://files.pythonhosted.org/packages/89/67/81d2a1602b7687efdf0c83de0b3924b5ce4b566ed0d5755f997aacfdd939/aspect_library_v1-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-31 18:38:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yourusername",
"github_project": "my_aspect_library",
"github_not_found": true,
"lcname": "aspect-library-v1"
}