This project features a sentiment analysis chatbot that processes user messages and returns the sentiment of the message along with a simulated chatbot response. The application uses FastAPI for the backend and React.js for the frontend. Below are the picture of the demo(The product is not ready yet):
This project includes:
- Backend (FastAPI): Provides endpoints to analyze the sentiment of user input and simulate chatbot responses.
- Frontend (React.js): Displays a chat interface where users can type a message and receive a sentiment analysis from the bot.
The application allows users to interact with a chatbot where the sentiment of their message is analyzed and the response is displayed on the chat interface.
- Python 3.7+
- FastAPI
- Uvicorn
- psycopg2-binary
-
Clone the repository:
git clone https://github.com/aashish-thapa/Sentiment-Chatbot.git cd Sentiment-Chatbot
-
Install the required dependencies:
pip install -r requirements.txt
-
Start the FastAPI server:
uvicorn app.main:app --reload
This will start the server on
http://127.0.0.1:8000
. -
Ensure your database is set up correctly and the necessary tables (like
messages
) exist. If using PostgreSQL or MySQL, ensure the user has proper permissions.
- Node.js
- npm (or yarn)
-
Navigate to the frontend directory:
cd frontend
-
Install the dependencies:
npm install
-
Start the React development server:
npm start
This will start the frontend on
http://localhost:3000
.
- Ensure both the backend and frontend servers are running.
- Navigate to
http://localhost:3000
in your browser. - Start chatting with the bot. Type a message and the sentiment will be analyzed and displayed in the chat.
- Backend: FastAPI, SQLAlchemy (or your preferred database)
- Frontend: React.js, Axios for API requests, React hooks for state management
- Sentiment Analysis: Custom sentiment analysis model (integrated with the backend)
- Styling: Basic CSS/Inline styles for chat interface
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to update this with specific details related to your project, like database setup instructions or any extra tools or libraries used.