0% found this document useful (0 votes)
57 views16 pages

Ecobot Ai Record

EcoBot is an AI-powered chatbot designed to assist users in smart waste management by providing personalized guidance on waste classification, upcycling, and eco-friendly practices. It supports various user roles, including waste sellers, buyers, recyclers, and delivery volunteers, offering tailored assistance and universal features like real-time queries and multilingual support. By promoting sustainable practices, EcoBot aims to contribute to the United Nations Sustainable Development Goals related to responsible consumption and climate action.

Uploaded by

venkat Mohan
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)
57 views16 pages

Ecobot Ai Record

EcoBot is an AI-powered chatbot designed to assist users in smart waste management by providing personalized guidance on waste classification, upcycling, and eco-friendly practices. It supports various user roles, including waste sellers, buyers, recyclers, and delivery volunteers, offering tailored assistance and universal features like real-time queries and multilingual support. By promoting sustainable practices, EcoBot aims to contribute to the United Nations Sustainable Development Goals related to responsible consumption and climate action.

Uploaded by

venkat Mohan
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/ 16

Aim:

To develop an AI-powered chatbot, EcoBot, that assists users in smart waste management by
providing personalized guidance on waste classification, upcycling, eco-friendly practices, and
logistics, tailored to various user roles such as waste sellers, buyers, recyclers, and delivery
volunteers.

Description:

EcoBot is a comprehensive AI-powered chatbot integrated into a smart waste management


mobile application, designed to support sustainable waste practices and encourage eco-
conscious behavior among users. Developed using cutting-edge technologies like Natural
Language Processing (NLP), machine learning, and contextual AI models (e.g., Rasa, ChatGPT
API), EcoBot provides round-the-clock support to users involved in various roles within the
waste management ecosystem.

The core purpose of EcoBot is to bridge the communication and knowledge gap between
citizens and eco-services by offering instant, personalized assistance for a wide range of eco-
activities. By understanding the user's intent and context, EcoBot delivers intelligent
responses and actionable suggestions.

EcoBot supports five major roles:

1. Waste Seller:

EcoBot helps users identify waste types (e.g., plastics, glass, e-waste), suggests appropriate
disposal methods, offers safe packaging tips, and facilitates waste pickup or listing on the
platform. It also educates users on the environmental impact of their actions, promoting
greener disposal habits.

2. Waste Buyer / Recycler:

Recyclers can use EcoBot to evaluate the quality and value of waste materials, receive price
estimates, and coordinate pickups. The bot provides insights into local recycling rates and
process optimization techniques to improve the buyer's operational efficiency.

3. Product Seller (Upcycler):

Upcyclers get creative guidance and DIY ideas for transforming waste into valuable products.
EcoBot assists with green certification information, identifies market trends, and supports
eco-business growth by linking sellers with potential buyers through the platform.
4. Product Buyer:

EcoBot recommends eco-friendly products based on the buyer’s interests, explains


sustainability scores, and highlights important factors such as material safety and
certifications. It filters verified upcycled goods, helping buyers make ethical and informed
choices.

5. Delivery Volunteer:

For users assisting with transportation, EcoBot offers pickup and delivery instructions, live
map assistance, and communication tools. It also provides best practices for safe handling and
incentives such as earnings or volunteer badges.

Universal Features:

In addition to role-specific support, EcoBot includes universal features accessible by all users:

• Real-time queries like “Where’s the nearest recycling center?”

• Information about CO₂ credits earned through eco-actions

• Weekly badge unlocking based on performance and engagement

• Multilingual communication for regional accessibility

Technology Stack:

• Dialogflow / Rasa for building contextual conversational flows

• OpenAI GPT API for creative and dynamic suggestions (e.g., DIY, eco-tips)

• Firebase + Geo APIs for real-time user assistance and logistics tracking

• Multilingual NLP models for broader user support

Impact:

EcoBot promotes the United Nations Sustainable Development Goals (SDGs), especially in
the areas of Responsible Consumption and Production (SDG 12) and Climate Action (SDG
13). By encouraging efficient waste handling and promoting recycling/upcycling, it empowers
communities to contribute to a cleaner, greener future.
PROGRAM CODE:

from flask import Flask, render_template, request, jsonify

import random

import re

import json

import os

# Initialize Flask app

app = Flask(__name__)

# Function to preprocess text (simplified)

def preprocess_text(text):

text = text.lower().strip()

text = re.sub(r'[^\w\s]', '', text)

return text

# Load knowledge base

if os.path.exists('ecobot_knowledge_base.json'):

with open('ecobot_knowledge_base.json', 'r') as f:

knowledge_base = json.load(f)

else:

# Create simplified knowledge base with all original categories

knowledge_base = {

"greetings": [

"Hello! I'm EcoBot, your eco-friendly assistant. How can I help you today?",

"Hi there! EcoBot at your service. Are you looking for waste management help or
upcycling ideas?",

"Welcome to EcoWaste! I'm EcoBot, here to help with all your recycling needs.",
"Greetings! I'm EcoBot, your sustainability companion. How can I assist you today?"

],

"farewells": [

"Goodbye! Remember to reduce, reuse, and recycle!",

"See you later! Every small eco-action counts!",

"Until next time! Keep making sustainable choices!",

"Bye for now! Thanks for contributing to a greener planet!"

],

"thanks": [

"You're welcome! Together we're making our planet greener!",

"No problem at all! Sustainability is a journey we take together.",

"Happy to help! Every sustainable step counts!",

"Glad I could assist! Keep up the eco-friendly work!"

],

"identity": [

"I'm EcoBot, your AI assistant for the EcoWaste app. I can help with waste identification,
recycling tips, upcycling ideas, and more!",

"I'm EcoBot, designed to help you navigate sustainable waste management and creative
upcycling options.",

"I'm your EcoBot assistant, here to make waste management and upcycling easier and
more rewarding."

],

"glass_waste": [

"Glass is 100% recyclable! Please wash and pack them safely to avoid injuries. You can
post it under the 'glass' category on our app. Would you like help creating the listing?",

"For glass items, make sure they're clean and safely packaged. They're highly valuable
for recycling. Shall I help you post them for sale?",

"Glass bottles and jars are perfect for recycling. Please ensure they're clean and safely
packed. Would you like to list them now or learn about their environmental impact?"

],
"plastic_waste": [

"For plastic items, check the recycling number (1-7) at the bottom. Clean items get
better prices. Would you like me to help identify the type or create a listing?",

"Plastic needs to be cleaned and sorted by type for best recycling value. Different
plastics (marked 1-7) have different values. Would you like to post your plastic items now?",

"Clean plastic waste can be valuable! Sorting by type (check the number in the triangle
symbol) increases its value. Shall I help you create a listing?"

],

"paper_waste": [

"Paper waste should be kept dry and sorted (newspapers, cardboard, mixed paper).
Would you like to list your paper waste or learn about paper upcycling ideas?",

"For paper recycling, keep it clean and sorted by type. Cardboard generally fetches
higher prices. Would you like help creating a listing?",

"Paper recycling saves trees and energy! Make sure it's dry and sorted. Shall I help you
list your paper waste or suggest creative reuse ideas?"

],

"e_waste": [

"E-waste contains valuable and hazardous materials. It requires specialized recycling.


Our verified e-waste recyclers follow proper protocols. Would you like me to connect you with
certified e-waste buyers?",

"Electronic waste should never go to landfills! Our platform has certified e-waste
recyclers who ensure proper handling. Would you like to list your e-waste items?",

"E-waste recycling recovers valuable metals and prevents toxic materials from harming
the environment. Shall I help you find certified recyclers for your electronic items?"

],

"organic_waste": [

"Organic waste is perfect for composting! You can either compost at home or connect
with urban farms on our platform. Would you like composting tips or help finding organic
waste buyers?",

"Food waste and garden trimmings can create nutrient-rich compost. Would you like to
list your organic waste or learn about home composting?",
"Organic waste can become valuable compost instead of producing methane in landfills.
Shall I help you connect with local composters or urban farmers?"

],

"textile_waste": [

"Textile waste can often be upcycled into new items or recycled for fiber. Clean fabrics
in good condition fetch better prices. Would you like to list your textiles or get upcycling
ideas?",

"For fabric and clothing, clean items can be sold to our textile recyclers or upcyclers.
Shall I help you create a listing or suggest creative reuse projects?",

"Textile recycling saves water and reduces landfill waste. Would you like to connect with
our textile recyclers or get DIY upcycling suggestions?"

],

"metal_waste": [

"Metals are highly recyclable and valuable! Clean and sorted metals (aluminum, copper,
steel, etc.) get better prices. Would you like help identifying your metal type or creating a
listing?",

"Metal recycling saves significant energy compared to mining new materials. Shall I
help you list your metal items or find the nearest scrap metal buyer?",

"Different metals have different values - copper and aluminum typically fetch higher
prices. Would you like to post your metal waste or get a price estimate?"

],

"tire_upcycling": [

"Old tires make fantastic eco-friendly furniture like seats, ottomans, or tables! They can
also be used as garden planters, playground equipment, or wall art. Would you like a specific
tutorial?",

"For used tires, popular upcycling projects include garden planters, outdoor seating,
swings, and even artistic wall decorations. Shall I share a step-by-step guide for any of these?",

"Tires can be transformed into durable outdoor furniture, garden beds, or even home
decor items. I found several tutorials - would you like me to send you the most popular one?"

],

"plastic_bottle_upcycling": [
"Plastic bottles can become vertical gardens, lamp shades, bird feeders, or organizers.
For food containers, I recommend self-watering planters. Would you like instructions for any
of these?",

"Creative ideas for plastic bottles include self-watering planters, terrariums, piggy banks,
or even jewelry organizers. I can share tutorials for these eco-friendly projects!",

"Plastic bottles make great raw materials for DIY projects! You can create planters, bird
feeders, decorative items, or even construction materials. Would you like a specific tutorial?"

],

"paper_upcycling": [

"Old paper can be transformed into handmade paper, decorative bowls, beads for
jewelry, or even furniture with papier-mâché techniques. Would you like a tutorial for any of
these?",

"Paper waste works wonderfully for decoupage art, handmade cards, paper beads, or
even sturdy furniture when combined with adhesives. Shall I share some beginner-friendly
instructions?",

"Creative paper reuse includes handmade paper, origami art, paper bead jewelry, or
decoupage decoration. I can send you step-by-step instructions for these eco-crafts!"

],

"wood_upcycling": [

"Reclaimed wood is perfect for furniture, wall art, garden planters, or decorative home
items. Would you like ideas based on the size and type of wood you have?",

"Wood waste can become beautiful furniture, wall decorations, kitchen items, or garden
accessories. Would you like me to suggest projects based on your skill level?",

"For wood scraps and reclaimed lumber, consider making floating shelves, picture
frames, cutting boards, or garden boxes. I can share tutorials based on your available tools."

],

"glass_upcycling": [

"Glass bottles and jars can become beautiful vases, candle holders, storage containers,
or even decorative lamps. Would you like specific instructions for any of these projects?",

"Creative glass upcycling includes making terrariums, pendant lights, self-watering


planters, or decorative storage. Shall I share some tutorials safe for beginners?",

"Glass items are perfect for creating lamps, vases, garden borders, or even jewelry. I
can recommend tutorials based on whether you want to cut the glass or use it whole."
],

"climate_change": [

"Climate change is a serious issue that requires global action. It affects weather patterns,
sea levels, and biodiversity. Would you like to know more about how to reduce your carbon
footprint?",

"Tackling climate change involves reducing greenhouse gas emissions and promoting
sustainable living. I can suggest eco-friendly actions to reduce your carbon impact. Would you
like some tips?"

],

"sustainability_tips": [

"To live more sustainably, try reducing your waste, reusing items, and recycling materials
properly. How about switching to reusable bags, composting, or supporting eco-friendly
products?",

"Sustainability tips include conserving water, choosing energy-efficient appliances,


reducing plastic usage, and opting for local, seasonal food. Let me know if you'd like more
specific tips!"

],

"unknown": [

"I'm still learning about all things eco-friendly. Could you rephrase that or ask me about
waste types, recycling, upcycling ideas, or eco-services?",

"I don't have information on that yet. Would you like to ask about waste management,
upcycling projects, pickup services, or sustainability practices instead?",

"That's beyond my current knowledge. I can help with waste identification, recycling
guidance, creative reuse ideas, and connecting with eco-buyers. What would you like to know
about these?"

],

"learned_responses": {}

# Save initial knowledge base

with open('ecobot_knowledge_base.json', 'w') as f:

json.dump(knowledge_base, f, indent=4)
# User role tracking (simplified)

user_info = {

"current_role": "unknown",

"waste_type": None

# Simple intent detection (without spaCy)

def detect_intent(user_input):

user_input = preprocess_text(user_input)

# Basic intent detection with regex patterns for common interactions

if re.search(r'\b(hi|hello|hey|greetings)\b', user_input):

return "greetings"

elif re.search(r'\b(bye|goodbye|see you|farewell)\b', user_input):

return "farewells"

elif re.search(r'\b(thanks|thank you|appreciate)\b', user_input):

return "thanks"

elif re.search(r'\b(who are you|what are you|your identity)\b', user_input):

return "identity"

# Waste identification and handling

elif re.search(r'\b(glass bottles?|glass jars?|broken glass)\b', user_input):

user_info["waste_type"] = "glass"

return "glass_waste"

elif re.search(r'\b(plastic|bottles|containers|packaging)\b', user_input):

user_info["waste_type"] = "plastic"

return "plastic_waste"
elif re.search(r'\b(paper|newspaper|cardboard|cartons?|magazines)\b', user_input):

user_info["waste_type"] = "paper"

return "paper_waste"

elif re.search(r'\b(electronics?|e-?waste|phones?|computers?|laptops?|batteries)\b',
user_input):

user_info["waste_type"] = "e-waste"

return "e_waste"

elif re.search(r'\b(organic|food waste|kitchen scraps|compost|vegetable|fruit peels)\b',


user_input):

user_info["waste_type"] = "organic"

return "organic_waste"

elif re.search(r'\b(cloth|clothing|textiles?|fabrics?|rags|curtains|bedding)\b',
user_input):

user_info["waste_type"] = "textile"

return "textile_waste"

elif re.search(r'\b(metal|steel|aluminum|copper|cans|scrap metal)\b', user_input):

user_info["waste_type"] = "metal"

return "metal_waste"

# Upcycling ideas and creative reuse

elif re.search(r'\b(upcycl|reuse|create|make from|diy|craft|project)\b', user_input):

if re.search(r'\b(tires?|wheels)\b', user_input):

user_info["waste_type"] = "tires"

return "tire_upcycling"

elif re.search(r'\b(plastic bottles?|pet bottles?)\b', user_input):

user_info["waste_type"] = "plastic bottles"

return "plastic_bottle_upcycling"

elif re.search(r'\b(paper|cardboard|newspaper)\b', user_input):

user_info["waste_type"] = "paper"
return "paper_upcycling"

elif re.search(r'\b(wood|lumber|timber|wooden)\b', user_input):

user_info["waste_type"] = "wood"

return "wood_upcycling"

elif re.search(r'\b(glass|bottles|jars)\b', user_input):

user_info["waste_type"] = "glass"

return "glass_upcycling"

# Climate Change and Sustainability tips

elif re.search(r'\b(climate change|global warming|greenhouse)\b', user_input):

return "climate_change"

elif re.search(r'\b(sustainability|eco-friendly|green tips)\b', user_input):

return "sustainability_tips"

# Default to unknown intent

return "unknown"

# Function to generate response (simplified)

def generate_response(user_input):

intent = detect_intent(user_input)

# Check if we have responses for this intent

if intent in knowledge_base:

return random.choice(knowledge_base[intent])

# Default response

return random.choice(knowledge_base["unknown"])
# Conversation context (simplified)

conversation_context = {

"learning_mode": False,

"question_to_learn": "",

"last_user_input": ""

# Process user message

def process_message(user_input):

global conversation_context

# Check if we're in learning mode

if conversation_context["learning_mode"]:

if user_input.lower() in ["no", "nevermind", "cancel"]:

conversation_context["learning_mode"] = False

return "No problem! Let's continue our eco-conversation."

elif conversation_context["question_to_learn"]:

# Save the new knowledge

knowledge_base["learned_responses"][conversation_context["question_to_learn"]] =
user_input

with open('ecobot_knowledge_base.json', 'w') as f:

json.dump(knowledge_base, f, indent=4)

conversation_context["learning_mode"] = False

conversation_context["question_to_learn"] = ""

return "Thank you for teaching me! I'll remember that for future sustainability
discussions."

elif user_input.lower() == "yes":


conversation_context["question_to_learn"] = conversation_context["last_user_input"]

return "Great! Please provide the eco-friendly answer to your question."

# Regular conversation flow

conversation_context["last_user_input"] = user_input

response = generate_response(user_input)

# Check if we should enter learning mode

if response == "I don't know the answer to that eco-question yet. Would you like to teach
me? (yes/no)":

conversation_context["learning_mode"] = True

return response

@app.route("/")

def home():

return render_template("index.html")

@app.route("/get_response", methods=["POST"])

def get_response():

user_input = request.json.get("message")

print("User said:", user_input) # Debug log

bot_reply = process_message(user_input)

return jsonify({"response": bot_reply})

if __name__ == "__main__":

app.run(debug=True)
SCREENSHOTS:
RESULT:

Thus, we Developed EcoBot, an AI-powered chatbot offering personalized waste


management guidance for sellers, buyers, upcyclers, and volunteers.
Integrated AI image recognition and NLP to support waste classification, eco-friendly
practices, and sustainable logistics was implemented successfully.

You might also like