{"id":15158338,"url":"https://github.com/redtius/talkpole","last_synced_at":"2026-03-07T11:32:32.815Z","repository":{"id":251541454,"uuid":"833109415","full_name":"Redtius/TalkPole","owner":"Redtius","description":"🤖🔍 An AI Model that determines sentence sentiment polarity.","archived":false,"fork":false,"pushed_at":"2024-08-23T16:44:25.000Z","size":70410,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T02:36:22.705Z","etag":null,"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"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Redtius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-24T11:22:23.000Z","updated_at":"2024-08-05T10:33:42.000Z","dependencies_parsed_at":"2024-08-23T18:34:19.754Z","dependency_job_id":null,"html_url":"https://github.com/Redtius/TalkPole","commit_stats":{"total_commits":30,"total_committers":2,"mean_commits":15.0,"dds":"0.30000000000000004","last_synced_commit":"b426575d3359b66bd0a4470f2018a460508e751c"},"previous_names":["redtius/talkpole"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Redtius%2FTalkPole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Redtius%2FTalkPole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Redtius%2FTalkPole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Redtius%2FTalkPole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Redtius","download_url":"https://codeload.github.com/Redtius/TalkPole/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237990673,"owners_count":19398475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["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"],"created_at":"2024-09-26T20:43:13.606Z","updated_at":"2025-10-24T15:30:16.271Z","avatar_url":"https://github.com/Redtius.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TalkPole\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./resources/TalkPole.png\" alt=\"Project Logo\" width=\"196\" height=\"auto\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\" style=\"color:gray;\"\u003e\n  TalkPole Logo\n\u003c/p\u003e\n\n## Overview\n\nTalkPole 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.\n\nAs 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.\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./resources/talkpole_showcase.gif\" alt=\"Project Showcase\" width=\"500\" height=\"auto\"   /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\" style=\"color:gray;\"\u003e\n  TalkPole UI Version\n\u003c/p\u003e\n\n## Features\n\n**Multiple Models**\n* CNN\n* LSTM\n* CNN-BiLSTM\n* DistilBERT (still under development)\n\nHere 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.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./resources/model_comparison_1.PNG\" alt=\"Models Comparison 1\" width=\"750\" height=\"auto\"   /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\" style=\"color:gray;\"\u003e\n  Accuracy/Precision/Recall Comparison\n\u003c/p\u003e\n\nHowever, 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.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./resources/model_comparison_2.PNG\" alt=\"Models Comparison 2\" width=\"750\" height=\"auto\"   /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\" style=\"color:gray;\"\u003e\n  Performance on 100 Sentences\n\u003c/p\u003e\n\n\nHere's when to use each model:\n\n*CNN*\n* Perfomance Requirements\n* Precision in Positivity or Negativity\n* No need to determine Neutrality\n* No context awareness needed\n* Large Amount of Data\n\n*CNN-BiLSTM \u0026 LSTM*\n* Context awareness needed\n* Need to determine Neutrality\n* Polarity Precision\n* Small Amount of Data\n\n**REST API Version**\n\nExposes a REST API for interaction with the sentiment analysis service.\n\n**Kafka Version**\n\nIntegrates with Kafka to process and analyze data in real-time. \n\nThis version could be used in Microservices architecture.\n\n**UI Version**\n\nIn Case, You wanted to experiment with different models and check documetations, you can use the UI Version\n\n## Tools\n\nThis project wouldn't be possible without these tools:\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/python/python-original-wordmark.svg\" width=\"80\" height=\"auto\"/\u003e\n\u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/keras/keras-original-wordmark.svg\" width=\"80\" height=\"auto\" /\u003e\n\u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/tensorflow/tensorflow-original-wordmark.svg\" width=\"80\" height=\"auto\"/\u003e\n\u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/flask/flask-original-wordmark.svg\" width=\"80\" height=\"auto\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\" style=\"color:gray;\"\u003e\n  Tools Used\n\u003c/p\u003e\n\n## Installation\n\n### Prerequisites\n\n* Python 3.x\n* Tensorflow 2.17.0\n* Keras 3.x\n* Flask 3.x\n* Kafka\n* Docker\n\n### Steps\n\n**For Kafka Versions**\n\n1. Clone Repository or use docker image in dockerhub\n\n```bash\ngit clone https://github.com/Redtius/TalkPole.git -b Kafka-CNN-BiLSTM\n```\nOR\n```bash\ndocker pull redtius/talkpole:kafka-cnn-bilstm\n```\n\n2. Set Up Kafka for the container\nmake sure you setup these **Required** Environment variables:\n\n* `KAFKA_PORT` : set it to the port of the kafka server.\n* `KAFKA_HOST` : set it to the host of the kafka server.\n\n3. Run the Application\n\nyou can use docker compose to run the application\n\n```bash\ndocker-compose up -d\n```\n\nOR\n\nrun the container depending on your own use\n\n```bash\ndocker run -e KAFKA_PORT=9092 -e KAFKA_HOST=localhost -p 5000:5000 talkpole\n```\n\n### Usage\n\nRequest Body:\n```json\n{\n #\"ref\":\"reference-id\",\n \"content\":\"c'est le meilleur produit\"\n}\n```\nResponse Body:\n```json\n{\n #\"ref\":\"reference-id\",\n #\"content\":\"c'est le meilleur produit\",\n \"result\":\"0.97864554\"\n}\n```\n\n#### Kafka Integration\n\n* **Producer**: Sends Messages to `talkpole_out` topic.\n* **Consumer**: Listens to `talkpole_in` topic.\n\n## Testing\n\nTo run Unit Tests for the project\n\n```bash\npytest\n```\n\n## Troubleshooting\n\n* **Common Issues**\n   * Kafka connection problems: Ensure Kafka is running and accessible.\n   * Model loading issues: Verify model files are present and correctly referenced.\n   * Versions incompatibility: Make sure all dependencies have the right versions and python is 3.12+.\n\n## License\n\nThis Project is under the Apache 2.0 License.\n\n\n\n          \n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredtius%2Ftalkpole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredtius%2Ftalkpole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredtius%2Ftalkpole/lists"}