0% found this document useful (0 votes)
13 views3 pages

Final Project Work.

Uploaded by

thanushiyam33
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

Final Project Work.

Uploaded by

thanushiyam33
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

FINAL PROJECT WORK

OBJECTIVE:
To create a chatbot with minimum 10 questions using NLP

INTRODUCTION:
In the realm of technological advancements, the ability to simulate human conversation through
artificial intelligence has been a significant leap forward. This Python project taps into that
potential by utilizing the ChatterBot library, a powerful tool in the field of Natural Language
Processing (NLP). The project’s cornerstone is ‘MyChatBot’, an interactive chatbot
programmed to respond to a minimum of 15 different questions. The chatbot’s versatility in
handling various topics makes it an exciting venture into the world of AI-driven
communication.

DESCRIPTION:
This Python project utilizes the ChatterBot library to create an interactive chatbot capable of
engaging in conversation by answering a minimum of 15 different questions. The chatbot is
built on Natural Language Processing (NLP) techniques, allowing it to understand and respond
to human language.The program begins by initializing a new ChatBot instance named
‘MyChatBot’. It then employs the ListTrainer class to train the chatbot using a predefined list
of question-and-answer pairs. These pairs are designed to cover various topics, ensuring that
the chatbot can handle a wide range of conversational topics.
Once trained, the chatbot can provide responses to user inputs through the get_response
function. This function takes user input as an argument and returns the chatbot’s response,
simulating a real-time conversation.
The project showcases the application of NLP in creating conversational agents and can be
expanded with additional training data or integrated into different platforms for various use
cases.
NOTE: Initially,necessary library chatterbot is installed using pip before executing the program.

PROGRAM:
# Import ChatBot and ListTrainer
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
# Create a new instance of a ChatBot
chatbot = ChatBot('MyChatBot')
# Create a new trainer for the chatbot
trainer = ListTrainer(chatbot)
# Train the chatbot with a list of conversations
trainer.train([
"Hi there!",
"Hello!",
"How are you?",
"I'm good, thanks!",
"What's your name?",
"I am MyChatBot",
"What can you do?",
"I can have a conversation with you and answer your questions!",
"Who created you?",
"I was created using the ChatterBot library in Python."
"Can you learn?",
"Yes, I can learn from conversations and improve over time."
"What languages do you speak?",
"I can be trained to understand and speak multiple languages."

# Add more questions and responses as needed


])
# Function to get a response from the chatbot
def get_response(user_input):
return chatbot.get_response(user_input)
# Example conversation with the chatbot(as many responses can be added as required)
print(get_response("Hi there!"))
print(get_response("How are you?"))
print(get_response("What's your name?"))

BEYOND THE CODE(conclusion):


The implications of this project extend far beyond its codebase. It serves as a testament to
NLP’s transformative power in creating digital entities capable of mimicking human
interaction. Whether it’s for customer service, education, or entertainment, ‘MyChatBot’
represents a stepping stone towards more sophisticated and empathetic AI communication
tools.

You might also like