Buckets:

rtrm's picture
|
download
raw
18 kB
# အခန်းပြီးဆုံးခြင်း စစ်ဆေးမှု[[end-of-chapter-quiz]]
<CourseFloatingBanner
chapter={2}
classNames="absolute z-10 right-0 top-0"
/>
### 1. Language modeling pipeline ၏ အစီအစဉ်က ဘာလဲ။
<Question
choices={[
{
text: "ပထမဆုံး၊ text ကို ကိုြီး raw predictions ွေကို ေးဲ့ model တယ်။ ို့ောကtokenizer က predictions ွေကို ားလညြီး ိုအပဲ့အခtext အဖြော်းေးတယ်။",
explain: "Model က text ကို ားမလညိုူး။ Tokenizer က text ကို အရငtokenize ြီး model က ားလညိုောIDs ွေအဖြော်းေးရပမယ်။"
},
{
text: "ပထမဆုံး၊ text ကို ကိုြီး IDs ွေကို ေးဲ့ tokenizer တယ်။ Model က IDs ွေကို ကိုြီး text ိုဲ့ prediction တစကို ေးတယ်။",
explain: "Model ဲ့ prediction က ိုကိုကtext မဖိုူး။ Prediction ကို text အဖြော်းို့ tokenizer ကို ထပအသုံးြုရပမယ်။"
},
{
text: "Tokenizer က text ကို ကိုြီး IDs ွေကို ေးတယ်။ Model က IDs ွေကို ကိုြီး prediction တစကို ေးတယ်။ ို့ောကtokenizer ကို predictions ွေကို text အဖြော်းို့အတကတစဖနထပအသုံးြုိုတယ်။",
explain: "Tokenizer ကို tokenize ်း့် de-tokenize ်း ုံးအတကအသုံးြုိုတယ်။",
correct: true
}
]}
/>
### 2. Base Transformer model က ထုတ်ပေးတဲ့ tensor မှာ dimension ဘယ်နှစ်ခုရှိပြီး၊ ဘာတွေလဲ။
<Question
choices={[
{
text: "2 : Sequence length ဲ့ batch size",
explain: "ှားတယ်။ Model က ေးဲ့ tensor ှာ တတ dimension တစှိတယ- hidden size ါ။"
},
{
text: "2 : Sequence length ဲ့ hidden size",
explain: "ှားတယ်။ Transformer model ားုံးက batches ွေကို ကိုတယ်၊ single sequence တစဲ့ိုရငောbatch size က 1 ့်မယ်။"
},
{
text: "3 : Sequence length, batch size ဲ့ hidden size",
explain: "ကော်းိုကာ။",
correct: true
}
]}
/>
### 3. အောက်ပါတို့ထဲမှ မည်သည့်အရာက subword tokenization ဥပမာတစ်ခုလဲ။
<Question
choices={[
{
text: "WordPiece",
explain: "တယ်၊ က subword tokenization ဥပမတစဲ။",
correct: true
},
{
text: "Character-based tokenization",
explain: "Character-based tokenization subword tokenization အမျိုးအစား မဟူး။"
},
{
text: "Whitespace ဲ့ punctuation ွေဲ့ ို်းြား်း",
explain: "က word-based tokenization နည်းလမ်းတစါ။"
},
{
text: "BPE",
explain: "တယ်၊ က subword tokenization ဥပမတစဲ။",
correct: true
},
{
text: "Unigram",
explain: "တယ်၊ က subword tokenization ဥပမတစဲ။",
correct: true
},
{
text: "အထကအဖြေျားတစမဟါ။",
explain: "ှားတယ်။"
}
]}
/>
### 4. Model head ဆိုတာ ဘာလဲ။
<Question
choices={[
{
text: "Base Transformer network ဲ့ အစအပို်းတစြီး tensors ွေကို ၎်းို့ဲ့ ကနဲ့ layers ွေလညလမ်းကြော်းြော်းေးတယ်။",
explain: "ို အစအပို်းျိုး မရှိူး။"
},
{
text: "Self-attention mechanism ို့လည်း ျားြီး၊ ၎်းသညsequenceအခြား tokens ျား့်အညtoken တစု၏ ကိုားြုှုကို ိုကျောွေောြုေးတယ်။",
explain: "Self-attention layer ှာ attention 'heads' ွေ ဝငမယ့် ွေက adaptation heads ွေ မဟူး။"
},
{
text: "Transformer predictions ွေကို task-specific output တစအဖြော်းို့အတကုံား့် layers တစို့မဟအနည်းငယဲ့ ွဲ့စည်းားဲ့ အပိုအစအပို်းတစု။",
explain: "တယ်။ Adaptation heads ွော (ိုး်းွာ heads ို့လည်း ျားတယ်) မတဲ့ ုံျိုးုံဲ့ တယ- language modeling heads, question answering heads, sequence classification heads... ",
correct: true
}
]}
/>
### 5. AutoModel ဆိုတာ ဘာလဲ။
<Question
choices={[
{
text: "သင်၏ data ေါ်အလိုအလျောကေ့က့်ေးော model တစု။",
explain: "ကို ကျွော်ို့ဲ့ <a href='https://huggingface.co/autotrain'>AutoTrain</a> product နဲ့ မှားနေတာလား။"
},
{
text: "Checkpoint ကို အခြေခံပြီး မှန်ကန်တဲ့ architecture ကို ပြန်ပေးတဲ့ object တစ်ခု။",
explain: "မှန်ပါပြီ- `AutoModel` က မှန်ကန်တဲ့ architecture ကို ပြန်ပေးဖို့အတွက် initialize လုပ်မယ့် checkpoint ကို သိဖို့ပဲ လိုအပ်ပါတယ်။",
correct: true
},
{
text: "၎င်း၏ inputs များအတွက် အသုံးပြုသော ဘာသာစကားကို အလိုအလျောက် ထောက်လှမ်းပြီး မှန်ကန်သော weights များကို load လုပ်ပေးသော model တစ်ခု။",
explain: "အချို့ checkpoints တွေနဲ့ models တွေက ဘာသာစကားများစွာကို ကိုင်တွယ်နိုင်စွမ်းရှိပေမယ့်၊ ဘာသာစကားအရ checkpoint ကို အလိုအလျောက် ရွေးချယ်ဖို့အတွက် built-in tools တွေ မရှိသေးပါဘူး။ သင့်လုပ်ငန်းအတွက် အကောင်းဆုံး checkpoint ကို ရှာဖွေဖို့ <a href='https://huggingface.co/models'>Model Hub</a> ကို သွားသင့်ပါတယ်။"
}
]}
/>
### 6. အရှည်မတူညီသော sequences များကို အတူတကွ batch လုပ်သည့်အခါ မည်သည့်နည်းလမ်းများကို သိရှိထားသင့်သလဲ။
<Question
choices={[
{
text: "Truncating",
explain: "တယ်၊ truncation က rectangular shape ောsequences ွေကို ျှောို့ ကနဲ့ နည်းလမ်းတစဲ။ မယ့် တစတည်းော နည်းလမ်းား။",
correct: true
},
{
text: "Returning tensors",
explain: "အခြားနည်းလမ်းွေက rectangular tensors ွေကို ေးိုမယ့်၊ sequences ွေကို batch ဲ့အခtensors ွေကို ေးက အသုံးမဝငူး။"
},
{
text: "Padding",
explain: "တယ်၊ padding က rectangular shape ောsequences ွေကို ျှောို့ ကနဲ့ နည်းလမ်းတစဲ။ မယ့် တစတည်းော နည်းလမ်းား။",
correct: true
},
{
text: "Attention masking",
explain: "တယ်။ အရမတော sequences ျားကို ကိုသည့်အခAttention masks ျားသညအလအရေးကြီးသည်။ ို့ော်လည်း ၎်းသညှိားရမည့် တစတည်းော နည်းပညမဟေးါ။",
correct: true
}
]}
/>
### 7. sequence classification model က ထုတ်ပေးတဲ့ logits တွေပေါ်မှာ SoftMax function ကို အသုံးပြုရခြင်းရဲ့ ရည်ရွယ်ချက်က ဘာလဲ။
<Question
choices={[
{
text: "Logits ွေကို ိုိုုံကရအောြုေးတယ်။",
explain: "မဟူး၊ SoftMax function က ရလဒွေဲ့ ုံကရမှုကို မထိုကူး။"
},
{
text: "၎်းို့ ားလညိုောအန့်ုံး့် အမ့်ုံးကန့်သတကကို သတေးတယ်။",
explain: "ကဲ့ တနိုးွေက 0 ဲ့ 1 ကြားှာ ှိတယ်။ မယ့် က SoftMax function ကို အသုံးြုရတဲ့ တစတည်းော အကြော်းကော့ မဟူး။",
correct: true
},
{
text: "output ဲ့ ေါ်းတနိုးက 1 ြီး ိုြေိုအဓ့်ိုိုြေ ှိတယ်။",
explain: "ြီ။ မယ့် က SoftMax function ကို အသုံးြုရတဲ့ တစတည်းော အကြော်းကော့ မဟူး။",
correct: true
}
]}
/>
### 8. tokenizer API ရဲ့ အများစုက ဘယ် method ပေါ်မှာ အခြေခံထားလဲ။
<Question
choices={[
{
text: "<code>encode</code>၊ text ကို IDs အဖြစ် encode လုပ်နိုင်ပြီး IDs တွေကို predictions အဖြစ် encode လုပ်နိုင်လို့ပါ။",
explain: "မှားပါတယ်။ `encode` method ဟာ tokenizers တွေမှာ ရှိပေမယ့် models တွေမှာတော့ မရှိပါဘူး။"
},
{
text: "tokenizer object ကို တိုက်ရိုက်ခေါ်ခြင်း။",
explain: "မှန်ပါပြီ။ tokenizer ရဲ့ `__call__` method ဟာ အလွန်အစွမ်းထက်တဲ့ method တစ်ခုဖြစ်ပြီး ဘာမဆိုနီးပါး ကိုင်တွယ်နိုင်ပါတယ်။ ဒါက model ကနေ predictions တွေကို ရယူဖို့ အသုံးပြုတဲ့ method လည်း ဖြစ်ပါတယ်။",
correct: true
},
{
text: "<code>pad</code>",
explain: "မှားပါတယ်။ Padding က အလွန်အသုံးဝင်ပေမယ့် tokenizer API ရဲ့ တစ်စိတ်တစ်ပိုင်းမျှသာ ဖြစ်ပါတယ်။"
},
{
text: "<code>tokenize</code>",
explain: "`tokenize` method ဟာ အသုံးဝင်ဆုံး methods တွေထဲက တစ်ခုဖြစ်ပေမယ့် tokenizer API ရဲ့ အဓိက အစိတ်အပိုင်းတော့ မဟုတ်ပါဘူး။"
}
]}
/>
### 9. ဒီ code sample မှာ `result` variable က ဘာတွေ ပါဝင်သလဲ။
```py
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
result = tokenizer.tokenize("Hello!")
```
<Question
choices={[
{
text: "Strings ျား၏ list တစု၊ string တစသညtoken တစသည်။",
explain: "တယ်၊ ကို IDs ွေအဖြော်းြီး model ကို ို့ိုကါ။",
correct: true
},
{
text: "IDs ျား၏ list တစု။",
explain: "ှားတယ်။ က `__call__` မဟ် `convert_tokens_to_ids` method အတကါ။"
},
{
text: "Tokens ျားားုံး ဝငော string တစု။",
explain: "က မသင့်ော်ူး၊ ို့ိုော့ ရညကက string ကို tokens ျားွာအဖို်းြားို့ါ။"
}
]}
/>
### 10. အောက်ပါ code မှာ တစ်ခုခု မှားနေတာ ရှိပါသလား။
```py
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
model = AutoModel.from_pretrained("gpt2")
encoded = tokenizer("Hey!", return_tensors="pt")
result = model(**encoded)
```
<Question
choices={[
{
text: "မရှိူး၊ ကနုံရပတယ်။",
explain: "ကမကော်းွာဲ့ဲ၊ model တစကို မတဲ့ checkpoint ဲ့ train ားဲ့ tokenizer တစဲ့ ွဲဖကက ကော်းဲ့ အကြံတစမဟူး။ model ကို tokenizer ဲ့ output ကနအဓို့ train ားမဟူး၊ ကြော့် model output က (run ိုဲ့ရငော်) အဓမရှိူး။"
},
{
text: "Tokenizer ဲ့ model အမြဲတမ်း checkpoint ကနသင့်တယ်။",
explain: "ြီ။",
correct: true
},
{
text: "Input ို်းbatch ကြော့် tokenizer ဲ့ pad ်းဲ့ truncate ်းက ကော်းဲ့ အလေ့အက့်ါ။",
explain: "Model input ို်းbatch ို့ ိုအပတယ်။ ို့ော်လည်း၊ sequence ကို truncate မဟpad က အဓှိှာ မဟူး။ ို့ိုော့ တစတည်းှိို့ါ။ ွေက sentences list တစကို batch ို့အတကနည်းလမ်းွေါ။"
}
]}
/>
<EditOnGithub source="https://github.com/huggingface/course/blob/main/chapters/my/chapter2/9.mdx" />

Xet Storage Details

Size:
18 kB
·
Xet hash:
c2b5bea4acdbe0ba7cfafa171fde2f26634e0a42d7b75ca4fd21bdb14ec20300

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.