The Student Room Group

idea gold badge

i'm stuck on idea gold badge chatbots if anyone knows this please help me the question says
There are still some errors to fix. You can check how many errors of each type remain by looking at the numbers next to the headings of “Semantics”, “Syntax” and “Logic”.
Def answer_question( ):
question = aw_input(">")
answer = classify(question)
answerclass = answer["class_name"]
confidence = answer["confidence"]
if confidence = answer["confidence"]
print "Sorry, I don't understand. I am an eco-chatbot, please can you ask me something to do with waste, food, energy, travel or fashion."

elif answerclass == "Waste":
print "Use glass jars. Use a bag for life. Bring your own cup. Compost your food waste. Use metal or bamboo straws. Avoid single-use food and drink containers."

elif answerclass == "Food":
print "Adopt a plant based diet. Buy unpackaged food where possible. Support local shops. Reduce the amount you waste. Buy organic produce. Check labels to make sure they meet credible standards."

elif answerclass == "Energy":
print "Set a goal to reduce consumption. Purchase energy A rated products. Turn technology off at the plug overnight. Use solar powered devices. Wash clothes at a low temperature. Use LED lights."

elif answerclass == "Water":
print "Shower instead of bathing. Drink from tap water instead of bottled water. Fix water leaks promptly. Only use the washing machine or dishwasher with a full load. Use a water can in the garden instead of a hose. Don’t waste water by leaving the tap on when you brush your teeth."

elif answerclass == "Travel":
print "Carpool with people you work with."

Scroll to see replies

im stuck on that too but i think i got most of it,
you have to change the
if confidence
part to:
if confidence < 70:
and
elif answerclass == "Waste":
and
elif answerclass == "Water":
but im still stuck on the last one with the carpool bit, what do i do??
Reply 2
on the first blue line just copy and paste what the chat bot says about travel
Original post by goku132
on the first blue line just copy and paste what the chat bot says about travel


thanks a lot
For the second blue box it is
elif answerclass == “Fashion”:
Final box answer is
print “Shop less. Have a clothes swap party. Sell old clothes on eBay and Gumtree. Give old clothes to charity. Buy second-hand clothes. Fix tears with stitching or patch over holes.”
Reply 6
How did you get if confidence < 70:
Original post by DDD434
How did you get if confidence < 70:


The bot gives an answer if its atleast 70% confident that your question matches
Reply 8
Original post by FiftyFiveDays
The bot gives an answer if its atleast 70% confident that your question matches


Where did you get 70% confident from the bot
Original post by DDD434
Where did you get 70% confident from the bot


It said so earlier in the badge
I don't get the first blue box about the carpool thing
Original post by goku132
on the first blue line just copy and paste what the chat bot says about travel

what first blue line
are you talking about
I’m stuck on what to do your test and deploy a chat bot step two with the first and last box,

What do I need to input?
(edited 1 year ago)
Original post by Alex Tecsan
i'm stuck on idea gold badge chatbots if anyone knows this please help me the question says
There are still some errors to fix. You can check how many errors of each type remain by looking at the numbers next to the headings of “Semantics”, “Syntax” and “Logic”.
Def answer_question( ):
question = aw_input(">")
answer = classify(question)
answerclass = answer["class_name"]
confidence = answer["confidence"]
if confidence = answer["confidence"]
print "Sorry, I don't understand. I am an eco-chatbot, please can you ask me something to do with waste, food, energy, travel or fashion."

elif answerclass == "Waste":
print "Use glass jars. Use a bag for life. Bring your own cup. Compost your food waste. Use metal or bamboo straws. Avoid single-use food and drink containers."

elif answerclass == "Food":
print "Adopt a plant based diet. Buy unpackaged food where possible. Support local shops. Reduce the amount you waste. Buy organic produce. Check labels to make sure they meet credible standards."

elif answerclass == "Energy":
print "Set a goal to reduce consumption. Purchase energy A rated products. Turn technology off at the plug overnight. Use solar powered devices. Wash clothes at a low temperature. Use LED lights."

elif answerclass == "Water":
print "Shower instead of bathing. Drink from tap water instead of bottled water. Fix water leaks promptly. Only use the washing machine or dishwasher with a full load. Use a water can in the garden instead of a hose. Don’t waste water by leaving the tap on when you brush your teeth."

elif answerclass == "Travel":
print "Carpool with people you work with."



The first error was a logic error, and you needed to change if confidence to if confidence < 70:

The second and third errors were syntax - you needed to change "Wate" to "Waste" (2nd error) and "Water" (3rd error)

The fourth error was a semantic error, and it was that the text was incomplete - instead of it being
print "Carpool with people you work with"
it should've been...
print "Ride a bike for journeys you would normally drive. Live car free. Carpool with people you work with. Use an electric or hybrid powered vehicle.
Use green buses and trams. If you need to purchase a car, make sure it has low emissions."

The fifth and sixth errors were combined, and were a semantic error where the "Fashion" category wasn't mentioned, so you would do elif answerclass == "Fashion": on the first empty line, and
print "Shop less. Have a clothes swap party. Sell old clothes on eBay and Gumtree. Give old clothes to charity. Buy second-hand clothes. Fix tears with stitching or patch over holes."
on the second empty line.

So the final code should look like this.

Def answer_question( ):
question = aw_input(">")
answer = classify(question)
answerclass = answer["class_name"]
confidence = answer["confidence"]
if confidence < 70:
print "Sorry, I don't understand. I am an eco-chatbot, please can you ask me something to do with waste, food, energy, travel or fashion."
elif answerclass == "Waste":
print "Use glass jars. Use a bag for life. Bring your own cup. Compost your food waste. Use metal or bamboo straws. Avoid single-use food and drink containers."
elif answerclass == "Food":
print "Adopt a plant based diet. Buy unpackaged food where possible. Support local shops. Reduce the amount you waste. Buy organic produce. Check labels to make sure they meet credible standards."
elif answerclass == "Energy":
print "Set a goal to reduce consumption. Purchase energy A rated products. Turn technology off at the plug overnight. Use solar powered devices. Wash clothes at a low temperature. Use LED lights."
elif answerclass == "Water":
print "Shower instead of bathing. Drink from tap water instead of bottled water. Fix water leaks promptly. Only use the washing machine or dishwasher with a full load. Use a water can in the garden instead of a hose. Don’t waste water by leaving the tap on when you brush your teeth."
elif answerclass == "Travel":
print "Ride a bike for journeys you would normally drive. Live car free. Carpool with people you work with. Use an electric or hybrid powered vehicle. Use green buses and trams. If you need to purchase a car, make sure it has low emissions."
elif answerclass == "Fashion":
print "Shop less. Have a clothes swap party. Sell old clothes on eBay and Gumtree. Give old clothes to charity. Buy second-hand clothes. Fix tears with stitching or patch over holes."
(edited 1 year ago)
Original post by dinozaur781
The first error was a logic error, and you needed to change if confidence to if confidence < 70:

The second and third errors were syntax - you needed to change "Wate" to "Waste" (2nd error) and "Water" (3rd error)

The fourth error was a semantic error, and it was that the text was incomplete - instead of it being
print "Carpool with people you work with"
it should've been...
print "Ride a bike for journeys you would normally drive. Live car free. Carpool with people you work with. Use an electric or hybrid powered vehicle.
Use green buses and trams. If you need to purchase a car, make sure it has low emissions."

The fifth and sixth errors were combined, and were a semantic error where the "Fashion" category wasn't mentioned, so you would do elif answerclass == "Fashion": on the first empty line, and
print "Shop less. Have a clothes swap party. Sell old clothes on eBay and Gumtree. Give old clothes to charity. Buy second-hand clothes. Fix tears with stitching or patch over holes."
on the second empty line.

So the final code should look like this.

Def answer_question( ):
question = aw_input(">")
answer = classify(question)
answerclass = answer["class_name"]
confidence = answer["confidence"]
if confidence < 70:
print "Sorry, I don't understand. I am an eco-chatbot, please can you ask me something to do with waste, food, energy, travel or fashion."
elif answerclass == "Waste":
print "Use glass jars. Use a bag for life. Bring your own cup. Compost your food waste. Use metal or bamboo straws. Avoid single-use food and drink containers."
elif answerclass == "Food":
print "Adopt a plant based diet. Buy unpackaged food where possible. Support local shops. Reduce the amount you waste. Buy organic produce. Check labels to make sure they meet credible standards."
elif answerclass == "Energy":
print "Set a goal to reduce consumption. Purchase energy A rated products. Turn technology off at the plug overnight. Use solar powered devices. Wash clothes at a low temperature. Use LED lights."
elif answerclass == "Water":
print "Shower instead of bathing. Drink from tap water instead of bottled water. Fix water leaks promptly. Only use the washing machine or dishwasher with a full load. Use a water can in the garden instead of a hose. Don’t waste water by leaving the tap on when you brush your teeth."
elif answerclass == "Travel":t
print "Ride a bike for journeys you would normally drive. Live car free. Carpool with people you work with. Use an electric or hybrid powered vehicle. Use green buses and trams. If you need to purchase a car, make sure it has low emissions."
elif answerclass == "Fashion":
print "Shop less. Have a clothes swap party. Sell old clothes on eBay and Gumtree. Give old clothes to charity. Buy second-hand clothes. Fix tears with stitching or patch over holes."


thank you omd, that question was laid out horribly, and had loads of things not registering as being correct even though if used in an actual program would have worked.
Original post by Shezza.
I’m stuck on what to do your test and deploy a chat bot step two with the first and last box,

What do I need to input?

I was stuck on this part for the longest time but found the solution if you're still looking.
just copy and paste these questions:

How can I contribute to the
UN's zero waste initiative?

How can I help preserve
food resources for future generations?

How can I reduce my
energy use?

How can I use water better and help to
ensure a clean, steady and safe flow?

How can I reduce the amount of fossil
fuels I use through the way I travel?

How can I help through fashion and
the clothes I wear?

Also make sure to add in another off-topic question but remember to use a question mark
Hope this helped!
(edited 1 year ago)
Reply 16
Original post by dinozaur781
The first error was a logic error, and you needed to change if confidence to if confidence < 70:

The second and third errors were syntax - you needed to change "Wate" to "Waste" (2nd error) and "Water" (3rd error)

The fourth error was a semantic error, and it was that the text was incomplete - instead of it being
print "Carpool with people you work with"
it should've been...
print "Ride a bike for journeys you would normally drive. Live car free. Carpool with people you work with. Use an electric or hybrid powered vehicle.
Use green buses and trams. If you need to purchase a car, make sure it has low emissions."

The fifth and sixth errors were combined, and were a semantic error where the "Fashion" category wasn't mentioned, so you would do elif answerclass == "Fashion": on the first empty line, and
print "Shop less. Have a clothes swap party. Sell old clothes on eBay and Gumtree. Give old clothes to charity. Buy second-hand clothes. Fix tears with stitching or patch over holes."
on the second empty line.

So the final code should look like this.

Def answer_question( ):
question = aw_input(">")
answer = classify(question)
answerclass = answer["class_name"]
confidence = answer["confidence"]
if confidence < 70:
print "Sorry, I don't understand. I am an eco-chatbot, please can you ask me something to do with waste, food, energy, travel or fashion."
elif answerclass == "Waste":
print "Use glass jars. Use a bag for life. Bring your own cup. Compost your food waste. Use metal or bamboo straws. Avoid single-use food and drink containers."
elif answerclass == "Food":
print "Adopt a plant based diet. Buy unpackaged food where possible. Support local shops. Reduce the amount you waste. Buy organic produce. Check labels to make sure they meet credible standards."
elif answerclass == "Energy":
print "Set a goal to reduce consumption. Purchase energy A rated products. Turn technology off at the plug overnight. Use solar powered devices. Wash clothes at a low temperature. Use LED lights."
elif answerclass == "Water":
print "Shower instead of bathing. Drink from tap water instead of bottled water. Fix water leaks promptly. Only use the washing machine or dishwasher with a full load. Use a water can in the garden instead of a hose. Don’t waste water by leaving the tap on when you brush your teeth."
elif answerclass == "Travel":
print "Ride a bike for journeys you would normally drive. Live car free. Carpool with people you work with. Use an electric or hybrid powered vehicle. Use green buses and trams. If you need to purchase a car, make sure it has low emissions."
elif answerclass == "Fashion":
print "Shop less. Have a clothes swap party. Sell old clothes on eBay and Gumtree. Give old clothes to charity. Buy second-hand clothes. Fix tears with stitching or patch over holes."


Thank you
I've been Looking at this code all day now and I still haven't managed to find a solution what's going on? in iDEA chatbot gold award. Code pasted below(Lines Highlighted and Bold are the ones I don't understand)

Def answer_question( ):
question = aw_input(">")
answer = classify(question)
answerclass = answer["class_name"]
confidence = answer["confidence"]

if confidence

print "Sorry, I don't understand. I am an eco-chatbot, please can you ask me something to do with waste, food, energy, travel or fashion."

elif answerclass == "Waste":

print "Use glass jars. Use a bag for life. Bring your own cup. Compost your food waste. Use metal or bamboo straws. Avoid single-use food and drink containers."

elif answerclass == "Food":

print "Adopt a plant based diet. Buy unpackaged food where possible. Support local shops. Reduce the amount you waste. Buy organic produce. Check labels to make sure they meet credible standards."

elif answerclass == "Energy":

print "Set a goal to reduce consumption. Purchase energy A rated products. Turn technology off at the plug overnight. Use solar powered devices. Wash clothes at a low temperature. Use LED lights."

elif answerclass == "Water":

print "Shower instead of bathing. Drink from tap water instead of bottled water. Fix water leaks promptly. Only use the washing machine or dishwasher with a full load. Use a water can in the garden instead of a hose. Don’t waste water by leaving the tap on when you brush your teeth."

elif answerclass == "Travel":

print "Carpool with people you work with."

(Below this are 2 empty lines)
Original post by dinozaur781
The first error was a logic error, and you needed to change if confidence to if confidence < 70:

The second and third errors were syntax - you needed to change "Wate" to "Waste" (2nd error) and "Water" (3rd error)

The fourth error was a semantic error, and it was that the text was incomplete - instead of it being
print "Carpool with people you work with"
it should've been...
print "Ride a bike for journeys you would normally drive. Live car free. Carpool with people you work with. Use an electric or hybrid powered vehicle.
Use green buses and trams. If you need to purchase a car, make sure it has low emissions."

The fifth and sixth errors were combined, and were a semantic error where the "Fashion" category wasn't mentioned, so you would do elif answerclass == "Fashion": on the first empty line, and
print "Shop less. Have a clothes swap party. Sell old clothes on eBay and Gumtree. Give old clothes to charity. Buy second-hand clothes. Fix tears with stitching or patch over holes."
on the second empty line.

So the final code should look like this.

Def answer_question( ):
question = aw_input(">")
answer = classify(question)
answerclass = answer["class_name"]
confidence = answer["confidence"]
if confidence < 70:
print "Sorry, I don't understand. I am an eco-chatbot, please can you ask me something to do with waste, food, energy, travel or fashion."
elif answerclass == "Waste":
print "Use glass jars. Use a bag for life. Bring your own cup. Compost your food waste. Use metal or bamboo straws. Avoid single-use food and drink containers."
elif answerclass == "Food":
print "Adopt a plant based diet. Buy unpackaged food where possible. Support local shops. Reduce the amount you waste. Buy organic produce. Check labels to make sure they meet credible standards."
elif answerclass == "Energy":
print "Set a goal to reduce consumption. Purchase energy A rated products. Turn technology off at the plug overnight. Use solar powered devices. Wash clothes at a low temperature. Use LED lights."
elif answerclass == "Water":
print "Shower instead of bathing. Drink from tap water instead of bottled water. Fix water leaks promptly. Only use the washing machine or dishwasher with a full load. Use a water can in the garden instead of a hose. Don’t waste water by leaving the tap on when you brush your teeth."
elif answerclass == "Travel":
print "Ride a bike for journeys you would normally drive. Live car free. Carpool with people you work with. Use an electric or hybrid powered vehicle. Use green buses and trams. If you need to purchase a car, make sure it has low emissions."
elif answerclass == "Fashion":
print "Shop less. Have a clothes swap party. Sell old clothes on eBay and Gumtree. Give old clothes to charity. Buy second-hand clothes. Fix tears with stitching or patch over holes."


This doesn't work?
how do i solve this: Hello, would you like to know anything about being eco-friendly? Ask me anything to do with waste, food, energy, water, travel and fashion. it keeps saying that it doesnt understand whenever i ask a question

Quick Reply

Latest

Trending

Trending