Izzybot is an AI-powered chatbot that can generate text responses to user queries. It is built using the Flask web framework for the backend and the Hugging Face Transformers library to leverage the power of the GPT-2 language model for text generation.
- Interactive Web Interface: Izzybot provides a user-friendly web interface where users can interact with the chatbot by typing their queries.
- Text Generation: The chatbot uses the GPT-2 model to generate coherent and contextually relevant text responses based on user input.
- Real-time Response: Responses are displayed instantly on the web page, providing a seamless user experience.
To use Izzybot, follow these steps:
-
Ensure that you have Python and the required libraries installed. The application uses Flask and Transformers, among others. You can install the dependencies using the
requirements.txt
file provided. -
Clone the Izzybot repository to your local machine.
-
Run the Flask application:
python app.py
This will start the Flask development server, and the Izzybot application will be accessible at
http://localhost:5000/
. -
Access Izzybot in your web browser: Open your web browser and navigate to
http://localhost:5000/
. You should see the Izzybot web interface. -
Interact with Izzybot:
- Type your query in the input box labeled "Say something...".
- Click the "Ask" button to submit your query to Izzybot.
- Izzybot will process your input and generate a text response in real time, which will be displayed below the input box.
The front end of Izzybot is designed using HTML, CSS, and JavaScript. The index.html
file defines the layout of the web page and contains an input field for the user to type their queries and a button to submit the queries.
JavaScript is used to handle the form submission, sending the user's query to the Flask server as a JSON object using the Fetch API. The response from the server is then displayed on the web page.
The backend of Izzybot is developed using Python and the Flask web framework. The app.py
file defines the routes for the application and handles user requests.
- The
/
route serves theindex.html
file, providing the initial web page to users. - The
/ask
route is set to handle POST requests from the front end. It receives the user's query as a JSON object, processes it, and returns the chatbot's response as a JSON object.
The chatbot's text generation functionality is powered by the GPT-2 model from the Hugging Face Transformers library. The generate_response
function takes the user's query as input, passes it to the GPT-2 model, and retrieves a generated response. The response is then sent back to the front end.
- Izzybot is a sample chatbot for demonstration purposes and does not have access to external data sources. It generates text responses solely based on patterns learned during its training on the GPT-2 model.
- While Izzybot is designed to be interactive and engaging, it may not always provide accurate or factual information.
Izzybot showcases how AI-powered chatbots can be built using popular web frameworks and machine learning libraries. Its ability to generate text responses in real-time demonstrates the potential for creating more advanced conversational AI applications.