Transcription data prep script များသည် YouTube ဗီဒီယိုစာတမ်းများကိုဒေါင်းလုပ်လုပ်ပြီး Semantic Search with OpenAI Embeddings and Functions နမူနာတွင် အသုံးပြုရန်အတွက် ပြင်ဆင်ပေးသည်။
Transcription data prep script များကို Windows 11 နောက်ဆုံးထွက်ဗားရှင်းများ၊ macOS Ventura နှင့် Ubuntu 22.04 (နှင့်အထက်) တွင် စမ်းသပ်ပြီးဖြစ်သည်။
Important
OpenAI နှင့် ကိုက်ညီမှုရှိစေရန် Azure CLI ကို နောက်ဆုံးဗားရှင်းသို့ အပ်ဒိတ်လုပ်ရန် အကြံပြုပါသည်။ Documentation ကို ကြည့်ပါ။
- Resource group တစ်ခု ဖန်တီးပါ။
Note
ဤညွှန်ကြားချက်များတွင် East US တွင် "semantic-video-search" ဟု အမည်ပေးထားသော resource group ကို အသုံးပြုထားသည်။ Resource group အမည်ကို ပြောင်းလဲနိုင်သော်လည်း၊ resource များ၏ တည်နေရာကို ပြောင်းလဲသောအခါ model availability table ကို စစ်ဆေးပါ။
az group create --name semantic-video-search --location eastus- Azure OpenAI Service resource တစ်ခု ဖန်တီးပါ။
az cognitiveservices account create --name semantic-video-openai --resource-group semantic-video-search \
--location eastus --kind OpenAI --sku s0- ဤ application တွင် အသုံးပြုရန် endpoint နှင့် keys များ ရယူပါ။
az cognitiveservices account show --name semantic-video-openai \
--resource-group semantic-video-search | jq -r .properties.endpoint
az cognitiveservices account keys list --name semantic-video-openai \
--resource-group semantic-video-search | jq -r .key1- အောက်ပါ မော်ဒယ်များကို တပ်ဆင်ပါ။
text-embedding-ada-002ဗားရှင်း2သို့မဟုတ် အထက်၊ အမည်text-embedding-ada-002gpt-35-turboဗားရှင်း0613သို့မဟုတ် အထက်၊ အမည်gpt-35-turbo
az cognitiveservices account deployment create \
--name semantic-video-openai \
--resource-group semantic-video-search \
--deployment-name text-embedding-ada-002 \
--model-name text-embedding-ada-002 \
--model-version "2" \
--model-format OpenAI \
--scale-settings-scale-type "Standard"
az cognitiveservices account deployment create \
--name semantic-video-openai \
--resource-group semantic-video-search \
--deployment-name gpt-35-turbo \
--model-name gpt-35-turbo \
--model-version "0613" \
--model-format OpenAI \
--sku-capacity 100 \
--sku-name "Standard"- Python 3.9 သို့မဟုတ် အထက်
YouTube transcription data prep script များကို လည်ပတ်ရန် အောက်ပါ ပတ်ဝန်းကျင် အပြောင်းအလဲများ လိုအပ်သည်။
user ပတ်ဝန်းကျင် အပြောင်းအလဲများထဲသို့ ထည့်သွင်းရန် အကြံပြုသည်။
Windows Start > Edit the system environment variables > Environment Variables > User variables for [USER] > New ကို သွားပါ။
AZURE_OPENAI_API_KEY \<your Azure OpenAI Service API key>
AZURE_OPENAI_ENDPOINT \<your Azure OpenAI Service endpoint>
AZURE_OPENAI_MODEL_DEPLOYMENT_NAME \<your Azure OpenAI Service model deployment name>
GOOGLE_DEVELOPER_API_KEY = \<your Google developer API key>
အောက်ပါ export များကို သင့် ~/.bashrc သို့မဟုတ် ~/.zshrc ဖိုင်ထဲသို့ ထည့်သွင်းရန် အကြံပြုသည်။
export AZURE_OPENAI_API_KEY=<your Azure OpenAI Service API key>
export AZURE_OPENAI_ENDPOINT=<your Azure OpenAI Service endpoint>
export AZURE_OPENAI_MODEL_DEPLOYMENT_NAME=<your Azure OpenAI Service model deployment name>
export GOOGLE_DEVELOPER_API_KEY=<your Google developer API key>-
git client ကို မထည့်သွင်းထားသေးပါက ထည့်သွင်းပါ။
-
Terminalပြတင်းပေါ်မှ သင့်နှစ်သက်ရာ repo ဖိုလ်ဒါသို့ နမူနာကို clone လုပ်ပါ။git clone https://github.com/gloveboxes/semanic-search-openai-embeddings-functions.git
-
data_prepဖိုလ်ဒါသို့ သွားပါ။cd semanic-search-openai-embeddings-functions/src/data_prep -
Python virtual environment တစ်ခု ဖန်တီးပါ။
Windows တွင်:
python -m venv .venvmacOS နှင့် Linux တွင်:
python3 -m venv .venv
-
Python virtual environment ကို ဖွင့်ပါ။
Windows တွင်:
.venv\Scripts\activate
macOS နှင့် Linux တွင်:
source .venv/bin/activate -
လိုအပ်သော libraries များ ထည့်သွင်းပါ။
Windows တွင်:
pip install -r requirements.txtmacOS နှင့် Linux တွင်:
pip3 install -r requirements.txt
.\transcripts_prepare.ps1./transcripts_prepare.shအကြောင်းကြားချက်
ဤစာတမ်းကို AI ဘာသာပြန်ဝန်ဆောင်မှု Co-op Translator ဖြင့် ဘာသာပြန်ထားပါသည်။ ကျွန်ုပ်တို့သည် တိကျမှန်ကန်မှုအတွက် ကြိုးစားသော်လည်း၊ အလိုအလျောက် ဘာသာပြန်ခြင်းတွင် အမှားများ သို့မဟုတ် မှားယွင်းချက်များ ပါဝင်နိုင်ကြောင်း သတိပြုပါရန် မေတ္တာရပ်ခံအပ်ပါသည်။ မူရင်းစာတမ်းကို မိမိဘာသာစကားဖြင့်သာ တရားဝင်အချက်အလက်အဖြစ် ယူဆသင့်ပါသည်။ အရေးကြီးသော အချက်အလက်များအတွက် လူ့ဘာသာပြန်ပညာရှင်မှ ဘာသာပြန်ခြင်းကို အကြံပြုပါသည်။ ဤဘာသာပြန်ချက်ကို အသုံးပြုရာမှ ဖြစ်ပေါ်လာနိုင်သည့် နားလည်မှုမှားယွင်းမှုများအတွက် ကျွန်ုပ်တို့ တာဝန်မယူပါ။