This project is a simple chatbot built using Natural Language Processing (NLP) with the nltk
library and a web-based GUI using the Gradio
library. The chatbot can respond to basic user queries and provide simple conversational responses. π¬
- Text-based chatbot using regular expression matching for user input. π
- Web-based interface using Gradio for easy interaction with the chatbot. π
- Predefined responses for common user inputs such as greetings, inquiries, and exit phrases. π
Before running the project, ensure you have Python installed and the necessary libraries:
nltk
for Natural Language Processing π§gradio
for the web-based interface π
- Open CMD π₯οΈ
Operating System | Steps |
---|---|
Windows π» | 1. Press Windows + R to open the "Run" dialog box. 2. Type cmd and hit Enter . 3. The Command Prompt (CMD) will open. Alternatively, you can search for "Command Prompt" in the Start menu and click to open it. π 4. To navigate to the Desktop, type cd %USERPROFILE%\Desktop and hit Enter . π |
Linux π§ | 1. Press Ctrl + Alt + T to open the terminal. 2. Alternatively, search for "Terminal" in your applications menu. π¨ 3. To navigate to the Desktop, type cd ~/Desktop and hit Enter . π |
- Clone the repository or download the project files to your local machine. π
git clone https://github.com/LaithALhaware/Chatbot-with-Natural-Language-Processing.git
cd 'Chatbot-with-Natural-Language-Processing'
- Install the dependencies using pip:
pip install nltk gradio
Download necessary NLTK resources:
The nltk.download('punkt')
in the code will download the necessary resources when you run the project. π±
To start the chatbot, run the Python script:
python app-GUI.py
Once the script is executed, Gradio will open a local web server, and you can access the chatbot by visiting the URL shown in the terminal, usually http://127.0.0.1:[PORT SHOWING ON CMD]/
. π
To start the chatbot, run the Python script:
python app-CMD.py
- The user inputs a message in the text box. π
- The chatbot processes the input and returns an appropriate response based on predefined patterns. π
- Common responses include greetings, checking on the chatbotβs status, and handling unknown inputs. π€
- The user can exit the chat by typing
bye
orexit
. β
User
: Hi π
Chatbot
: Hello! π€
User
: How are you? π€
Chatbot
: I am good, thank you for asking! π
User
: Bye π
- You can expand the chatbot's functionality by adding more
patterns
and responses in the patterns list. π - Modify the
respond_to_input()
function to integrate more advanced NLP models or data processing techniques. π§ - The
Gradio
interface can also be customized by changing the appearance, layout, and adding additional components like images or files. π¨
This project is licensed under the License. See the LICENSE.txt βοΈ file for details.
If you find this project useful, consider supporting its development:
π° Via PayPal: [PayPal Link]
Your support helps keep this project alive! ππ₯