Buckets:
| # အခန်းပြီးဆုံးခြင်း စစ်ဆေးမှု[[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.