Downloads · 30 days
0
Kunafalol/Brainzilla_1
Brainzilla_1 is a machine learning model from Kunafalol. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as openrail.
Downloads · 30 days
0
Access
Public
Updated Mar 19, 2025
Repo size
—
Likes
1
Public
Click a slice to open those files.
.md1.8 KB · 54%
From the Hugging Face model README
import random
subjects = { 'Math': [ {'question': 'What is the value of x in the equation 2x + 5 = 11?', 'answer': '6'}, {'question': 'What is the formula for the area of a circle?', 'answer': 'A = πr^2'}, {'question': 'What is the value of sin(30°)?', 'answer': '0.5'} ], 'Science': [ {'question': 'What is the process by which plants make their own food?', 'answer': 'photosynthesis'}, {'question': 'What is the largest planet in our solar system?', 'answer': 'Jupiter'}, {'question': 'What is the smallest bone in the human body?', 'answer': 'stapes'} ], 'English': [ {'question': 'Who wrote the book "To Kill a Mockingbird"?', 'answer': 'Harper Lee'}, {'question': 'What is the definition of the word "persuade"?', 'answer': 'to convince someone to do something'}, {'question': 'What is the title of the first book in the Harry Potter series?', 'answer': 'Harry Potter and the Philosopher's Stone'} ] }
def get_ai_bot_response(subject, question): try: for q in subjects[subject]: if q['question'].lower() == question.lower(): return q['answer'] return 'Sorry, I couldn't find the answer to that question. Please try again.' except KeyError: return 'Invalid subject. Please try again.'
def get_random_ai_bot_response(): subject = random.choice(list(subjects.keys())) questions = subjects[subject] question = random.choice(questions) return get_ai_bot_response(subject, question['question'])
brainzilla1_response = get_random_ai_bot_response() print(brainzilla1_response)