SentiToolKit

SentiToolKit is a simple sentiment analysis library that leverages LSTM (Long Short-Term Memory) neural networks for predicting the sentiment of a given text. This toolkit provides a streamlined interface for text preprocessing, model loading, and prediction.
✨ Features
- Pre-trained Model: Uses a trained LSTM model for sentiment analysis.
- Tokenization Support: Handles text tokenization with a customizable vocabulary size.
- Sentiment Prediction: Predicts whether a text is
Positive
, Neutral
, or Negative
.
- Easy to Use: Minimal setup required to get predictions.
- Customizable: You can use your own tokenizer and model for fine-tuning.
📦 Installation
You can install the SentiToolKit
package via pip:
pip install SentiToolKit==1.0.8
Alternatively, if you'd like to build from source:
-
Clone the repository:
git clone https://github.com/yourusername/SentiToolKit.git
-
Navigate to the project directory and install the package:
cd SentiToolKit
pip install .
🚀 Quickstart
To get started with SentiToolKit, follow the example below:
from SentiAnalyzer.Main_tensor_model import SentiToolKit
def main():
model = SentiToolKit()
review = input("Enter a review for sentiment analysis: ")
sentiment = model.__call__(review)
print("Sentiment Analysis Result:", sentiment)
if __name__ == "__main__":
main()
🧰 Usage
- Loading the Pre-trained Model: The toolkit loads a pre-trained LSTM model from the provided
.keras
file.
- Text Tokenization: The input text is tokenized and padded using the stored tokenizer from
tokenizer.pkl
.
- Sentiment Prediction: Predicts the sentiment based on the input text:
Positive
Neutral
Negative
📁 Project Structure
SentiToolKit/
├── converter.py
├── converter1.py
├── dataExtractor.py
├── tensor_model.py
├── usage.py
├── json/
│ ├── backup.json
│ ├── negative_reviews.json
│ ├── neutral_reviews.json
│ ├── positive_reviews.json
│ └── train.json
├── SentiAnalyzer/
│ ├── __init__.py
│ ├── Main_tensor_model.py
│ ├── SentiToolKit.keras
│ └── tokenizer.pkl
├── tests/
├── text/
├── .env
├── .gitignore
├── LICENSE
├── MANIFEST.in
├── pyproject.toml
├── README.md
├── SentiToolKit.keras
├── setup.py
└── tokenizer.pkl
📄 License
This project is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3,. See the LICENSE file for details.
💡 Future Improvements
- Add support for additional languages.
- Fine-tune the pre-trained model for domain-specific tasks.
👥 Contributing
Contributions are welcome! If you’d like to contribute to SentiToolKit, feel free to fork the repository and submit a pull request.
- Fork the repo.
- Create your feature branch
- Commit your changes
- Push to the branch
- Open a pull request.
📬 Contact