=== Live Teen Rights Chatbot ===
Dataset
teen_rights_data = [
{
“situation”: “A student is being bullied in school by classmates.”,
“rights”: “You have the right to a safe learning environment. Schools must take action against harassment.”,
“advice”: “Report the bullying to a trusted teacher or school counselor. Document incidents and ask for support.”,
“keywords”: [“bullying”, “school”, “classmates”]
},
{
“situation”: “Cyberbullying by classmates on social media.”
“rights”: “You have the right to privacy and protection from harassment online.”,
“advice”: “Keep screenshots of abusive messages, block the harasser, and inform an adult or school authority.”,
“keywords”: [“cyberbullying”, “online”, “social media”]
},
{
“situation”: “A teen wants to see their medical records without parent permission.”,
“rights”: “In many places, teens can access some types of medical information and care confidentially.”,
“advice”: “Ask your healthcare provider about minor consent laws in your state and what can remain private.”,
“keywords”: [“medical”, “records”, “privacy”, “doctor”]
},
{
“situation”: “A teacher searches a student’s backpack without permission.”,
“rights”: “Students have certain privacy rights – random searches may be limited depending on school policy and law.”,
“advice”: “Ask the teacher or principal about the reason and policy. Talk to a parent if you feel uncomfortable.”,
“keywords”: [“teacher”, “search”, “backpack”, “school”]
},
{
“situation”: “A teen is stopped by police while walking home.”,
“rights”: “You have the right to remain silent and ask if you are free to leave.”,
“advice”: “Stay calm, ask if you’re free to go, and don’t resist. You can politely refuse to answer questions.”,
“keywords”: [“police”, “stopped”, “walking”, “home”]
},
{
“situation”: “A teen’s photo was shared without consent in a group chat.”,
“rights”: “You have the right to control your image in many digital spaces.”,
“advice”: “Request removal, save evidence, and talk to the group admin or a trusted adult for help.”,
“keywords”: [“photo”, “shared”, “consent”, “group chat”, “privacy”]
},
{
“situation”: “A teen is refused service at a place because of their age.”,
“rights”: “Businesses may have age restrictions, but they cannot discriminate based on protected categories like race or gender.”,
“advice”: “Ask for the stated policy. If it feels discriminatory, document the incident and report it to a parent or consumer rights group.”,
“keywords”: [“refused”, “service”, “age”, “discrimination”]
}
]
def teen_rights_chatbot_live(user_message):
chat_history.append(f”You: {user_message}”)
message_lower = user_message.lower()
matches = []
for scenario in teen_rights_data:
if any(keyword in message_lower for keyword in scenario["keywords"]):
matches.append(scenario)
if not matches:
response = ("I'm sorry, I couldn’t find a matching scenario. "
"Try describing your situation differently.\n"
"This is general information, not legal advice.")
else:
scenario_responses = []
for scenario in matches:
scenario_responses.append(
f"Situation: {scenario['situation']}\n"
f"Rights: {scenario['rights']}\n"
f"Advice: {scenario['advice']}\n"
"This is general information, not legal advice."
)
response = "\n\n---\n\n".join(scenario_responses)
chat_history.append(f"AI: {response}")
return response
response1 = teen_rights_chatbot_live(“Someone is bullying me online at school”)
response2 = teen_rights_chatbot_live(“My photo was shared without permission”)
response3 = teen_rights_chatbot_live(“The police stopped me while walking home”