LLM Course documentation

အခန်း (၆) ဆိုင်ရာ မေးခွန်းများ

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

အခန်း (၆) ဆိုင်ရာ မေးခွန်းများ

Ask a Question

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

၁။ Tokenizer အသစ်တစ်ခုကို ဘယ်အချိန်မှာ train လုပ်သင့်သလဲ။

၂။ train_new_from_iterator() ကို အသုံးပြုတဲ့အခါ list of lists of texts တွေနဲ့ နှိုင်းယှဉ်ရင် generator of lists of texts တွေကို အသုံးပြုခြင်းရဲ့ အကျိုးကျေးဇူးက ဘာလဲ။

၃။ “Fast” tokenizer တစ်ခုကို အသုံးပြုခြင်းရဲ့ အကျိုးကျေးဇူးတွေက ဘာတွေလဲ။

၄။ token-classification pipeline က tokens အများအပြားကို ဖြန့်ကျက်ထားတဲ့ entities တွေကို ဘယ်လို ကိုင်တွယ်ဖြေရှင်းလဲ။

၅။ question-answering pipeline က ရှည်လျားတဲ့ contexts တွေကို ဘယ်လို ကိုင်တွယ်ဖြေရှင်းလဲ။

၆။ Normalization ဆိုတာ ဘာလဲ။

၇။ Subword tokenizer အတွက် pre-tokenization ဆိုတာဘာလဲ။

၈။ BPE tokenization model နဲ့ သက်ဆိုင်တဲ့ စာကြောင်းတွေကို ရွေးချယ်ပါ။

၉။ WordPiece tokenization model နဲ့ သက်ဆိုင်တဲ့ စာကြောင်းတွေကို ရွေးချယ်ပါ။

၁၀။ Unigram tokenization model နဲ့ သက်ဆိုင်တဲ့ စာကြောင်းတွေကို ရွေးချယ်ပါ။

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

  • Tokenizer: စာသား (သို့မဟုတ် အခြားဒေတာ) ကို AI မော်ဒယ်များ စီမံဆောင်ရွက်နိုင်ရန် tokens တွေအဖြစ် ပိုင်းခြားပေးသည့် ကိရိယာ သို့မဟုတ် လုပ်ငန်းစဉ်။
  • Pretrain: Model တစ်ခုကို အကြီးစားဒေတာများဖြင့် အစောပိုင်းကတည်းက လေ့ကျင့်ထားခြင်း။
  • Dataset: AI မော်ဒယ်တွေ လေ့ကျင့်ဖို့အတွက် အသုံးပြုတဲ့ ဒေတာအစုအဝေးတစ်ခုပါ။
  • Fine-tune: ကြိုတင်လေ့ကျင့်ထားပြီးသား (pre-trained) မော်ဒယ်တစ်ခုကို သီးခြားလုပ်ငန်းတစ်ခု (specific task) အတွက် အနည်းငယ်သော ဒေတာနဲ့ ထပ်မံလေ့ကျင့်ပေးခြင်းကို ဆိုလိုပါတယ်။
  • Compute Resources: ကွန်ပျူတာ၏ တွက်ချက်နိုင်စွမ်း (CPU, GPU, RAM)။
  • Generator: Python တွင် iteration လုပ်နိုင်သော object တစ်ခုဖြစ်ပြီး ၎င်းသည် အရာအားလုံးကို memory ထဲသို့ တစ်ပြိုင်နက်တည်း သိမ်းဆည်းမထားဘဲ လိုအပ်သလို တန်ဖိုးများကို ထုတ်ပေးသည်။
  • train_new_from_iterator(): 🤗 Tokenizers library မှ tokenizer အသစ်တစ်ခုကို iterator (ဥပမာ- generator) မှ data ကို အသုံးပြု၍ လေ့ကျင့်သော method။
  • Memory: ကွန်ပျူတာ၏ RAM (Random Access Memory)။
  • 🤗 Datasets Library: Hugging Face က ထုတ်လုပ်ထားတဲ့ library တစ်ခုဖြစ်ပြီး AI မော်ဒယ်တွေ လေ့ကျင့်ဖို့အတွက် ဒေတာအစုအဝေး (datasets) တွေကို လွယ်လွယ်ကူကူ ဝင်ရောက်ရယူ၊ စီမံခန့်ခွဲပြီး အသုံးပြုနိုင်စေပါတယ်။
  • 🤗 Tokenizers Library: Rust ဘာသာနဲ့ ရေးသားထားတဲ့ Hugging Face library တစ်ခုဖြစ်ပြီး မြန်ဆန်ထိရောက်တဲ့ tokenization ကို လုပ်ဆောင်ပေးသည်။
  • Multiprocessing: ကွန်ပျူတာ၏ processors အများအပြားကို အသုံးပြု၍ လုပ်ငန်းများကို တစ်ပြိုင်နက်တည်း လုပ်ဆောင်ခြင်း။
  • Language Model: လူသားဘာသာစကား၏ ဖြန့်ဝေမှုကို နားလည်ရန် လေ့ကျင့်ထားသော AI မော်ဒယ်တစ်ခု။ ၎င်းသည် စာသားထုတ်လုပ်ခြင်း၊ ဘာသာပြန်ခြင်း စသည့်လုပ်ငန်းများတွင် အသုံးပြုနိုင်သည်။
  • “Fast” Tokenizer: Rust ဘာသာစကားဖြင့် အကောင်အထည်ဖော်ထားသော tokenizer ဖြစ်ပြီး Python-based “slow” tokenizers များထက် အလွန်မြန်ဆန်သည်။
  • “Slow” Tokenizer: Python ဘာသာစကားဖြင့် အကောင်အထည်ဖော်ထားသော tokenizer။
  • Batch (of inputs): မတူညီသော input များစွာကို တစ်ပြိုင်နက်တည်း လုပ်ဆောင်နိုင်ရန် အုပ်စုဖွဲ့ခြင်း။
  • Parallelism: လုပ်ငန်းများစွာကို တစ်ပြိုင်နက်တည်း လုပ်ဆောင်ခြင်း။
  • Rust: System programming language တစ်ခုဖြစ်ပြီး performance မြင့်မားသော applications များ တည်ဆောက်ရာတွင် အသုံးပြုသည်။
  • Padding: input sequences များ၏ အရှည်ကို တူညီစေရန်အတွက် အပို tokens များ ထည့်သွင်းခြင်း။
  • Truncation: input sequences များကို သတ်မှတ်ထားသော အရှည်တစ်ခုအထိ ဖြတ်တောက်ခြင်း။
  • Offset Mappings: token တစ်ခုစီသည် မူရင်းစာသား၏ မည်သည့်စတင်ခြင်းနှင့် အဆုံးသတ် character index များကြားတွင် ရှိနေသည်ကို ဖော်ပြသော map။
  • token-classification Pipeline: pipeline() function ကို အသုံးပြု၍ token classification task ကို လုပ်ဆောင်ရန် တည်ဆောက်ထားသော pipeline။
  • Entities: Named Entity Recognition (NER) တွင် ဖော်ထုတ်ရမည့် အရာများ (ဥပမာ- လူပုဂ္ဂိုလ်၊ နေရာဒေသ၊ အဖွဲ့အစည်း)။
  • Label: Classification task တစ်ခုတွင် data point တစ်ခုအား သတ်မှတ်ထားသော အမျိုးအစား။
  • B-XXX Label: Named Entity Recognition (NER) တွင် entity အမျိုးအစား XXX ၏ စတင်ခြင်း token ကို ကိုယ်စားပြုသော label (“Beginning” of entity)။
  • I-XXX Label: Named Entity Recognition (NER) တွင် entity အမျိုးအစား XXX ၏ အတွင်းပိုင်း token ကို ကိုယ်စားပြုသော label (“Inside” entity)။
  • question-answering Pipeline: pipeline() function ကို အသုံးပြု၍ question answering task ကို လုပ်ဆောင်ရန် တည်ဆောက်ထားသော pipeline။
  • Contexts: Question answering task တွင် မေးခွန်းအတွက် အဖြေပါဝင်နိုင်သည့် စာသားအပိုဒ်။
  • Truncate (Context): ရှည်လျားသော context ကို model ၏ maximum length အထိ ဖြတ်တောက်ခြင်း။
  • Overlap (Context): ရှည်လျားသော context ကို အပိုင်းပိုင်းပိုင်းဖြတ်ရာတွင် အပိုင်းများကြားတွင် တူညီသော စာသားအချို့ ထပ်နေခြင်း။
  • Normalization: စာသားကို သန့်ရှင်းရေးလုပ်ခြင်း (ဥပမာ- needless whitespace ဖယ်ရှားခြင်း၊ lowercasing, accents ဖယ်ရှားခြင်း)။
  • Data Augmentation: datasets ၏ အရွယ်အစားနှင့် မတူကွဲပြားမှုကို တိုးမြှင့်ရန်အတွက် လက်ရှိဒေတာကို ပြောင်းလဲခြင်း သို့မဟုတ် ဒေတာအသစ်များ ဖန်တီးခြင်းနည်းလမ်း။
  • Rare Words: corpus ထဲတွင် အကြိမ်ရေနည်းပါးစွာသာ ပေါ်ပေါက်သော စကားလုံးများ။
  • Post-processing: Model ၏ output များကို နောက်ဆုံးအသုံးပြုမှုအတွက် ပြင်ဆင်ခြင်း လုပ်ငန်းစဉ်။
  • Embeddings: စကားလုံးများ၊ စာကြောင်းများ သို့မဟုတ် အခြားဒေတာများကို ဂဏန်းဆိုင်ရာ vector များအဖြစ် ကိုယ်စားပြုခြင်း။
  • Mean (Average): ပျမ်းမျှတန်ဖိုး။
  • Standard Deviation (Std): data points များသည် mean (ပျမ်းမျှ) မှ မည်မျှကွာဝေးနေသည်ကို တိုင်းတာသော သင်္ချာဆိုင်ရာတန်ဖိုး။
  • Pixel Values: ပုံရိပ်တစ်ခုရှိ pixel တစ်ခုစီ၏ အရောင် သို့မဟုတ် အလင်းအမှောင် တန်ဖိုးများ။
  • Computer Vision: ကွန်ပျူတာများကို ပုံရိပ်များ သို့မဟုတ် ဗီဒီယိုများမှ အချက်အလက်များ နားလည်စေရန် သင်ကြားပေးခြင်း။
  • Pre-tokenization: Subword tokenization မလုပ်ဆောင်မီ စာသားကို ပိုမိုသေးငယ်သော entities (ဥပမာ- words) အဖြစ် အကြိုပိုင်းခြားခြင်း။
  • Subword Tokenizer: စကားလုံးများကို သေးငယ်သော subword units (ဥပမာ- word pieces, byte-pair encodings) များအဖြစ် ပိုင်းခြားသော tokenizer။
  • Masking (Random Masking): data augmentation technique တစ်ခုဖြစ်ပြီး input data အစိတ်အပိုင်းအချို့ကို ကျပန်းဖုံးကွယ်ထားခြင်း။
  • Tokenizer Model: Tokenization လုပ်ငန်းစဉ်ကို လုပ်ဆောင်ပေးသော model။
  • BPE (Byte-Pair Encoding): Subword tokenization algorithm တစ်မျိုး။ small vocabulary မှ စတင်ပြီး အများဆုံးဖြစ်ပေါ်သော tokens တွဲများကို merge လုပ်ခြင်းဖြင့် merge rules များကို သင်ယူသည်။ words များကို characters များအဖြစ် ပိုင်းခြားပြီး merge rules များကို အသုံးပြု၍ subwords များအဖြစ် tokenize လုပ်သည်။
  • Vocabulary: tokenizer သို့မဟုတ် model တစ်ခုက သိရှိနားလည်ပြီး ကိုင်တွယ်နိုင်သော ထူးခြားသည့် tokens များ စုစုပေါင်း။
  • Merge Rules: BPE နှင့် WordPiece algorithm များတွင် tokens များကို ပေါင်းစပ်ရန် သင်ယူထားသော စည်းမျဉ်းများ။
  • WordPiece: Subword tokenization algorithm တစ်မျိုး။ small vocabulary မှ စတင်ပြီး အကြိမ်များစွာ ဖြစ်ပေါ်ပြီး တစ်ဦးချင်းစီ အစိတ်အပိုင်းတွေက နည်းနည်းပဲ ဖြစ်ပေါ်တဲ့ pairs တွေကို အလေးပေးတဲ့ score တစ်ခုကို အမြင့်ဆုံးဖြစ်စေမယ့် tokens တွဲကို merge လုပ်ခြင်းဖြင့် merge rules များကို သင်ယူသည်။ words များကို vocabulary ထဲမှာရှိတဲ့ word ရဲ့ အစကနေ စတင်တဲ့ အရှည်ဆုံး subword ကို ရှာဖွေပြီး၊ ကျန်တဲ့ text အတွက် လုပ်ငန်းစဉ်ကို ထပ်ခါတလဲလဲ လုပ်ဆောင်ခြင်းဖြင့် subwords တွေအဖြစ် tokenize လုပ်သည်။
  • Segmentation: စာသားတစ်ခုကို သေးငယ်သော အစိတ်အပိုင်းများ (ဥပမာ- tokens) အဖြစ် ပိုင်းခြားခြင်း။
  • Unigram: Subword tokenization algorithm တစ်မျိုး။ big vocabulary မှ စတင်ပြီး whole corpus ပေါ်မှာ တွက်ချက်ထားတဲ့ loss ကို အနည်းဆုံးဖြစ်စေမယ့် tokens တွေကို ဖယ်ရှားခြင်းဖြင့် vocabulary ကို လိုက်လျောညီထွေဖြစ်အောင် ပြောင်းလဲသည်။ words တွေကို model အရ tokens တွေအဖြစ် အများဆုံး ဖြစ်နိုင်ခြေရှိတဲ့ segmentation ကို ရှာဖွေခြင်းဖြင့် subwords တွေအဖြစ် tokenize လုပ်သည်။
  • Loss (Corpus Loss): Model ၏ ခန့်မှန်းချက်များနှင့် အမှန်တကယ် labels များကြား ကွာခြားမှုကို whole corpus တစ်ခုလုံးအတွက် တိုင်းတာသော တန်ဖိုး။
Update on GitHub