# အခန်း (၉) ဆိုင်ရာ မေးခွန်းများ[[end-of-chapter-quiz]]

ဒီအခန်းမှာ သင်ယူခဲ့တာတွေကို စစ်ဆေးကြည့်ရအောင်။

### ၁။ Gradio ကို အသုံးပြုပြီး ဘာတွေ လုပ်နိုင်သလဲ။

share=True parameter ကို အသုံးပြုပြီး ဘယ်သူ့ကိုမဆို ပေးပို့နိုင်တဲ့ share link တစ်ခုကို ဖန်တီးနိုင်ပါတယ်။",
            correct: true
		},
		{
			text: "သင့် model ကို debug လုပ်နိုင်ပါတယ်။",
			explain: "Gradio demo ရဲ့ အားသာချက်တစ်ခုက သင့် model ကို real data နဲ့ စမ်းသပ်နိုင်ပြီး သင် data ကို ပြောင်းလဲတဲ့အခါ model ရဲ့ predictions တွေ real time မှာ ဘယ်လိုပြောင်းလဲသွားလဲဆိုတာကို လေ့လာနိုင်တာကြောင့် သင့် model ကို debug လုပ်ဖို့ အကူအညီဖြစ်စေပါတယ်။",
			correct: true
		},
		{
			text: "သင့် model ကို train နိုင်ပါတယ်။",
			explain: "Gradio ကို model inference အတွက် ဒီဇိုင်းထုတ်ထားတာပါ၊ သင့် model ကို train ပြီးမှ အသုံးပြုဖို့ပါ။",
		}
	]}
/>

### ၂။ Gradio သည် PyTorch models များနှင့်သာ အလုပ်လုပ်သည်။

### ၃။ Gradio demo ကို ဘယ်ကနေ launch လုပ်နိုင်သလဲ။

### ၄။ Gradio ကို အဓိကအားဖြင့် NLP models များအတွက် ဒီဇိုင်းထုတ်ထားသည်။

### ၅။ အောက်ပါ features များထဲမှ မည်သည့်အရာများကို Gradio မှ ထောက်ပံ့ပေးသလဲ။

gr.Interface.load() method ကို အသုံးပြုပြီး မည်သည့် Hugging Face model ကိုမဆို load လုပ်နိုင်ပါတယ်။",
			correct: true
        }
	]}
/>

### ၆။ Hugging Face Hub သို့မဟုတ် Spaces မှ Hugging Face model တစ်ခုကို load လုပ်ရန် မည်သည့်နည်းလမ်းများသည် မှန်ကန်သလဲ။

### ၇။ သင့် Gradio interface တွင် state ကို ထည့်သွင်းရန် လိုအပ်သော အဆင့်များအားလုံးကို ရွေးချယ်ပါ။

### ၈။ အောက်ပါတို့မှ မည်သည့် components များသည် Gradio library တွင် ပါဝင်သလဲ။

### ၉။ Gradio `Blocks` က သင့်ကို ဘာလုပ်ခွင့်ပြုသလဲ။

with gradio.Tabs(): ကို အသုံးပြုနိုင်ပါတယ်။",
			correct: true
        },
        {
			text: "event triggers တွေ (ဥပမာ- clicked/changed/etc) ကို Blocks components တွေဆီ သတ်မှတ်နိုင်ပါတယ်။",
			explain: "event တစ်ခုကို သတ်မှတ်တဲ့အခါ၊ သင် parameters သုံးခုကို ပေးရပါတယ်- fn: ခေါ်ဆိုသင့်တဲ့ function၊ inputs: input component(s) list (list) နဲ့ outputs: ခေါ်ဆိုသင့်တဲ့ output component(s) list (list) တို့ ဖြစ်ပါတယ်။",
			correct: true
        },
        {
			text: "မည်သည့် Blocks component ကို interactive သို့မဟုတ် static ဖြစ်သင့်သည်ကို အလိုအလျောက် ဆုံးဖြတ်ပေးပါတယ်။",
			explain: "သင်သတ်မှတ်ထားတဲ့ event triggers တွေပေါ်မူတည်ပြီး Blocks က component တစ်ခုက user input ကို လက်ခံသင့်လား မလက်ခံသင့်ဘူးလားဆိုတာကို အလိုအလျောက် ဆုံးဖြတ်ပါတယ်။",
			correct: true
        },
		 {
			text: "multi-step demos တွေ ဖန်တီးနိုင်ပါတယ်။ ဆိုလိုတာက component တစ်ခုရဲ့ output ကို နောက်တစ်ခုရဲ့ input အဖြစ် ပြန်လည်အသုံးပြုနိုင်ပါတယ်။",
			explain: "component တစ်ခုကို event trigger တစ်ခုရဲ့ input အတွက် အသုံးပြုနိုင်ပေမယ့် နောက်တစ်ခုရဲ့ output အတွက်လည်း အသုံးပြုနိုင်ပါတယ်။",
            correct: true
        },
	]}
/>

### ၁၀။ `Blocks` demo တစ်ခုကို public link တစ်ခု မျှဝေနိုင်ပြီး Hugging Face spaces မှာ `Blocks` demo တစ်ခုကို host လုပ်နိုင်ပါတယ်။

Interface လိုပဲ Blocks demos တွေအတွက် sharing နဲ့ hosting capabilities တွေအားလုံး အတူတူပါပဲ!",
			correct: true
        },
        {
			text: "မှားသည်။",
			explain: "Interface လိုပဲ Blocks demos တွေအတွက် sharing နဲ့ hosting capabilities တွေအားလုံး အတူတူပါပဲ!",
			correct: false
        }
	]}
/>

## ဝေါဟာရ ရှင်းလင်းချက် (Glossary)

*   **Gradio**: Python library တစ်ခုဖြစ်ပြီး machine learning မော်ဒယ်တွေအတွက် အသုံးပြုရလွယ်ကူတဲ့ web interface တွေ ဒါမှမဟုတ် demo တွေကို အလွယ်တကူ ဖန်တီးနိုင်စေပါတယ်။
*   **Machine Learning Model**: Artificial Intelligence (AI) နယ်ပယ်တွင် အချက်အလက်များကို လေ့လာပြီး ခန့်မှန်းချက်များ ပြုလုပ်ရန် ဒီဇိုင်းထုတ်ထားသော သင်္ချာဆိုင်ရာဖွဲ့စည်းပုံများ။
*   **Demo**: Machine Learning model များ၏ စွမ်းဆောင်ရည်ကို တိုက်ရိုက်ပြသနိုင်သော interactive application များ။
*   **Pre-built Components**: Gradio library မှ ကြိုတင်ထောက်ပံ့ပေးထားသော UI components များ။
*   **`share=True` Parameter**: `launch()` method တွင် Gradio Interface အတွက် public, shareable link တစ်ခုကို ဖန်တီးရန် သတ်မှတ်သည်။
*   **`launch()` Method**: Gradio Interface ကို web server တစ်ခုအဖြစ် စတင်လုပ်ဆောင်သည်။
*   **Debug**: ကွန်ပျူတာပရိုဂရမ်တစ်ခုရှိ အမှားများ (bugs) ကို ရှာဖွေ၊ ဖော်ထုတ်ပြီး ပြင်ဆင်ခြင်း။
*   **Model Inference**: လေ့ကျင့်ပြီးသား Artificial Intelligence (AI) မော်ဒယ်တစ်ခုကို အသုံးပြုပြီး input data ကနေ ခန့်မှန်းချက်တွေ ဒါမှမဟုတ် output တွေကို ထုတ်လုပ်တဲ့ လုပ်ငန်းစဉ်။
*   **Model Agnostic**: မည်သည့် model အမျိုးအစား သို့မဟုတ် framework ကိုမဆို ထောက်ပံ့ပေးနိုင်သော သို့မဟုတ် ၎င်းတို့ပေါ်တွင် မမူတည်သော သဘောတရား။
*   **PyTorch Models**: PyTorch framework ဖြင့် တည်ဆောက်ထားသော Machine Learning model များ။
*   **Python IDEs (Integrated Development Environments)**: Python code များရေးရန်၊ debug လုပ်ရန်နှင့် run ရန်အတွက် ပရိုဂရမ်မာများ အသုံးပြုသော ဆော့ဖ်ဝဲလ် application များ။
*   **Google Colab Notebooks**: Google မှ ပံ့ပိုးပေးထားသော cloud-based Jupyter Notebook environment တစ်ခု။
*   **Jupyter Notebooks**: code, text, images, နှင့် mathematical equations တို့ကို ပေါင်းစပ်နိုင်သော interactive computing environment။
*   **NLP Models (Natural Language Processing Models)**: လူသားဘာသာစကားကို နားလည်၊ အဓိပ္ပာယ်ဖော်ပြီး၊ ဖန်တီးနိုင်အောင် ဒီဇိုင်းထုတ်ထားသော models များ။
*   **Multiple Inputs and Outputs**: Gradio interface တစ်ခုတွင် inputs (သို့မဟုတ် outputs) တစ်ခုထက်ပို၍ ရှိနေခြင်း။
*   **State**: Gradio interface အတွင်းရှိ ဒေတာများကို session တစ်ခုအတွင်း ထိန်းသိမ်းထားနိုင်သော သဘောတရား။ (ဥပမာ- chat history)။
*   **Data Persistence**: ဒေတာများကို program run ပြီးနောက်에도 ဆက်လက်တည်ရှိနေစေရန် သိမ်းဆည်းထားနိုင်ခြင်း။
*   **Username and Passwords Authentication**: အသုံးပြုသူအမည်နှင့် စကားဝှက်များကို အသုံးပြု၍ အသုံးပြုသူ၏ မည်သူမည်ဝါဖြစ်ကြောင်း အတည်ပြုခြင်း။
*   **Hugging Face's Model Hub**: AI မော်ဒယ်တွေ၊ datasets တွေနဲ့ demo တွေကို အခြားသူတွေနဲ့ မျှဝေဖို့၊ ရှာဖွေဖို့နဲ့ ပြန်လည်အသုံးပြုဖို့အတွက် အွန်လိုင်း platform တစ်ခု ဖြစ်ပါတယ်။
*   **Hugging Face Spaces**: Hugging Face Hub ၏ အစိတ်အပိုင်းတစ်ခုဖြစ်ပြီး Gradio ကဲ့သို့သော library များကို အသုံးပြု၍ Machine Learning demos များကို host လုပ်ပြီး မျှဝေနိုင်သည်။
*   **`gr.Interface.load()` Method**: Gradio ၏ `Interface` class မှ method တစ်ခုဖြစ်ပြီး Hugging Face Hub မှ models များ သို့မဟုတ် Spaces များကို တိုက်ရိုက် load လုပ်ရန် အသုံးပြုသည်။
*   **`huggingface/{user}/{model_name}`**: Hugging Face Hub မှ model တစ်ခုကို load လုပ်ရန်အတွက် URL format။
*   **`model/{user}/{model_name}`**: Hugging Face Hub မှ model တစ်ခုကို load လုပ်ရန်အတွက် အခြား URL format။
*   **`spaces/{user}/{model_name}`**: Hugging Face Spaces မှ demo တစ်ခုကို load လုပ်ရန်အတွက် URL format။
*   **Prediction Function**: Gradio Interface မှ wrap လုပ်ထားသော Python function ဖြစ်ပြီး input ကိုယူကာ output ကို ပြန်ပေးသည်။
*   **`Textbox`**: Gradio ၏ input component တစ်မျိုးဖြစ်ပြီး အသုံးပြုသူအား စာသားများ ရိုက်ထည့်ရန် ခွင့်ပြုသည်။
*   **`Image`**: Gradio ၏ input component တစ်မျိုးဖြစ်ပြီး အသုံးပြုသူအား ပုံရိပ်များ upload လုပ်ရန် ခွင့်ပြုသည်။
*   **`Audio`**: Gradio ၏ input component တစ်မျိုးဖြစ်ပြီး အသုံးပြုသူအား အသံဖိုင်များ upload လုပ်ရန် သို့မဟုတ် microphone မှ မှတ်တမ်းတင်ရန် ခွင့်ပြုသည်။
*   **`Blocks`**: Gradio ၏ အဆင့်မြင့် features တစ်ခုဖြစ်ပြီး demos များကို ပိုမိုစိတ်ကြိုက်ပြင်ဆင်နိုင်သော layout များဖြင့် တည်ဆောက်ရန်၊ multiple demos များကို ပေါင်းစပ်ရန်နှင့် event-driven interactions များကို ဖန်တီးရန် ခွင့်ပြုသည်။
*   **`gradio.Tabs()`**: Gradio Blocks တွင် multiple demos များကို tab များအဖြစ် ပိုင်းခြားပြသရန် အသုံးပြုသည်။
*   **Event Triggers**: အသုံးပြုသူ၏ လုပ်ဆောင်ချက်များ (ဥပမာ- click, change) သို့မဟုတ် အခြား event များ ဖြစ်ပေါ်လာသည့်အခါ code ကို လုပ်ဆောင်စေသော အရာများ။
*   **`fn` Parameter (for event triggers)**: event trigger ဖြစ်ပေါ်လာသည့်အခါ ခေါ်ဆိုရမည့် function။
*   **`inputs` Parameter (for event triggers)**: function သို့ input အဖြစ် ပေးပို့ရမည့် components များ။
*   **`outputs` Parameter (for event triggers)**: function ၏ ရလဒ်များကို ပြသရန် update လုပ်ရမည့် components များ။
*   **Interactive Components**: အသုံးပြုသူများက တိုက်ရိုက်ထိတွေ့၊ ပြောင်းလဲနိုင်သော UI elements များ။
*   **Static Components**: အသုံးပြုသူ၏ input ကို လက်ခံခြင်းမရှိဘဲ သတင်းအချက်အလက်များကိုသာ ပြသသော UI elements များ။
*   **Multi-step Demos**: အသုံးပြုသူ၏ အဆင့်အမျိုးမျိုးကို ဖြတ်သန်းပြီး နောက်အဆင့်သို့ ဆက်သွားနိုင်သော demos များ။

