Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| # JSON ডেটা | |
| data = { | |
| "country": "Bangladesh", | |
| "capital": "Dhaka", | |
| "location": "South Asia", | |
| "population": "166 million", | |
| "official_language": "Bengali", | |
| "currency": "Taka", | |
| "landmarks": ["Sundarbans", "Cox's Bazar", "Dhaka's National Museum"], | |
| "economy": "Textiles, agriculture, remittances" | |
| } | |
| # চ্যাটবট ফাংশন | |
| def chat(input_text): | |
| input_text = input_text.lower() # প্রশ্নটি ছোট হাতের অক্ষরে রূপান্তর করুন | |
| if "country" in input_text: | |
| return f"Country: {data['country']}" | |
| elif "capital" in input_text: | |
| return f"Capital: {data['capital']}" | |
| elif "location" in input_text: | |
| return f"Location: {data['location']}" | |
| elif "population" in input_text: | |
| return f"Population: {data['population']}" | |
| elif "official language" in input_text: | |
| return f"Official Language: {data['official_language']}" | |
| elif "currency" in input_text: | |
| return f"Currency: {data['currency']}" | |
| elif "landmarks" in input_text: | |
| return f"Landmarks: {', '.join(data['landmarks'])}" | |
| elif "economy" in input_text: | |
| return f"Economy: {data['economy']}" | |
| else: | |
| return "Sorry, I don't have information about that." | |
| # Gradio ইন্টারফেস | |
| interface = gr.Interface( | |
| fn=chat, | |
| inputs="text", | |
| outputs="text", | |
| title="Bangladesh Info Chatbot", | |
| description="Ask me about Bangladesh!" | |
| ) | |
| # অ্যাপ রান করুন | |
| interface.launch() |