aspect-library


Nameaspect-library JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/yourusername/my_aspect_library
SummaryA Python library for aspect-based sentiment analysis with translation capabilities
upload_time2024-08-31 16:54:32
maintainerNone
docs_urlNone
authorYour Name
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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",
    "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/ce/a8/14272a4cd938494ce0ce3f0dcfe401f66d76f5c0a57ba7eb274b992c925f/aspect_library-0.1.0.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.0",
    "project_urls": {
        "Homepage": "https://github.com/yourusername/my_aspect_library"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cea814272a4cd938494ce0ce3f0dcfe401f66d76f5c0a57ba7eb274b992c925f",
                "md5": "7f17872c11beca97e156384a220da2e9",
                "sha256": "51b26116dc7723f6d7d4fbaaf9d7a4314a6d43232e53887a2114e715df53194c"
            },
            "downloads": -1,
            "filename": "aspect_library-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7f17872c11beca97e156384a220da2e9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3989,
            "upload_time": "2024-08-31T16:54:32",
            "upload_time_iso_8601": "2024-08-31T16:54:32.152666Z",
            "url": "https://files.pythonhosted.org/packages/ce/a8/14272a4cd938494ce0ce3f0dcfe401f66d76f5c0a57ba7eb274b992c925f/aspect_library-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-31 16:54:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yourusername",
    "github_project": "my_aspect_library",
    "github_not_found": true,
    "lcname": "aspect-library"
}
        
Elapsed time: 0.90654s