Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/redtius/talkpole
🤖🔍 An AI Model that determines sentence sentiment polarity.
https://github.com/redtius/talkpole
cnn-model convolutional-neural-networks deep-learning deep-neural-networks flask keras long-short-term-memory-models nlp python sentiment-analysis sentiment-classification sentiment-polarity tensorflow
Last synced: 7 days ago
JSON representation
🤖🔍 An AI Model that determines sentence sentiment polarity.
- Host: GitHub
- URL: https://github.com/redtius/talkpole
- Owner: Redtius
- License: apache-2.0
- Created: 2024-07-24T11:22:23.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-08-23T16:44:25.000Z (about 1 month ago)
- Last Synced: 2024-09-23T07:32:10.039Z (11 days ago)
- Topics: cnn-model, convolutional-neural-networks, deep-learning, deep-neural-networks, flask, keras, long-short-term-memory-models, nlp, python, sentiment-analysis, sentiment-classification, sentiment-polarity, tensorflow
- Language: Python
- Homepage:
- Size: 67.1 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TalkPole
TalkPole Logo## Overview
TalkPole is an innovative sentiment analysis model designed to accurately predict the sentiment of French sentences. Leveraging a range of neural network architectures, TalkPole excels in discerning both positive and negative sentiments with high precision. Trained on a comprehensive French dataset, TalkPole is finely tuned to understand and interpret the nuances of the French language.
As a forward-thinking solution, TalkPole seamlessly integrates into microservices architectures and offers flexible deployment through REST APIs, making it a versatile choice for modern applications.
TalkPole UI Version## Features
**Multiple Models**
* CNN
* LSTM
* CNN-BiLSTM
* DistilBERT (still under development)Here is a comparative analysis of the models tested for classifying text as positive or negative. The CNN model demonstrated the best performance in accurately labeling the sentiment.
Accuracy/Precision/Recall ComparisonHowever, when it comes to precision in determining the sentiment polarity, the CNN model fell short. In contrast, the CNN-BiLSTM model excelled in this aspect. The improved precision of the CNN-BiLSTM model is largely due to the context-sensitive capabilities of the BiLSTM layer, which enhances its ability to capture and interpret subtle nuances in sentiment more effectively.
Performance on 100 SentencesHere's when to use each model:
*CNN*
* Perfomance Requirements
* Precision in Positivity or Negativity
* No need to determine Neutrality
* No context awareness needed
* Large Amount of Data*CNN-BiLSTM & LSTM*
* Context awareness needed
* Need to determine Neutrality
* Polarity Precision
* Small Amount of Data**REST API Version**
Exposes a REST API for interaction with the sentiment analysis service.
**Kafka Version**
Integrates with Kafka to process and analyze data in real-time.
This version could be used in Microservices architecture.
**UI Version**
In Case, You wanted to experiment with different models and check documetations, you can use the UI Version
## Tools
This project wouldn't be possible without these tools:
Tools Used## Installation
### Prerequisites
* Python 3.x
* Tensorflow 2.17.0
* Keras 3.x
* Flask 3.x
* Kafka
* Docker### Steps
**For Kafka Versions**
1. Clone Repository or use docker image in dockerhub
```bash
git clone https://github.com/Redtius/TalkPole.git -b Kafka-CNN-BiLSTM
```
OR
```bash
docker pull redtius/talkpole:kafka-cnn-bilstm
```2. Set Up Kafka for the container
make sure you setup these **Required** Environment variables:* `KAFKA_PORT` : set it to the port of the kafka server.
* `KAFKA_HOST` : set it to the host of the kafka server.3. Run the Application
you can use docker compose to run the application
```bash
docker-compose up -d
```OR
run the container depending on your own use
```bash
docker run -e KAFKA_PORT=9092 -e KAFKA_HOST=localhost -p 5000:5000 talkpole
```### Usage
Request Body:
```json
{
#"ref":"reference-id",
"content":"c'est le meilleur produit"
}
```
Response Body:
```json
{
#"ref":"reference-id",
#"content":"c'est le meilleur produit",
"result":"0.97864554"
}
```#### Kafka Integration
* **Producer**: Sends Messages to `talkpole_out` topic.
* **Consumer**: Listens to `talkpole_in` topic.## Testing
To run Unit Tests for the project
```bash
pytest
```## Troubleshooting
* **Common Issues**
* Kafka connection problems: Ensure Kafka is running and accessible.
* Model loading issues: Verify model files are present and correctly referenced.
* Versions incompatibility: Make sure all dependencies have the right versions and python is 3.12+.## License
This Project is under the Apache 2.0 License.