Mastering OpenAI's Whisper API and GPT-4 for TikTok Video Organization
Effortlessly classify and categorize TikTok videos with cutting-edge AI technology.
Remember the days when classifying video or audio files felt like pulling teeth? Manually transcribing, deciphering sentiment, and determining themes of each video was a painstaking process - but not anymore.
Enter OpenAI's game-changing technology. Download the ready-to-go sheet here - https://practicalgpt.gumroad.com/l/whisper-gpt4 filled with TikTok videos and hosted MP3 audio of each video to get started.
Kick things off by transcribing the hosted audio file using the Whisper API. No sweat, we've got you covered with a built-in function in the spreadsheet:
=WHISPER()The secret sauce is this code:
function WHISPER(audioUrl, language) {
const apiKey = SpreadsheetApp
.getActiveSpreadsheet()
// .getSheetByName("Config")
.getRange("B1")
.getValue()
function getFile(fileURL) {
const response = UrlFetchApp.fetch(fileURL);
const res = response.getBlob()
return res
}
const audioBlob = getFile(audioUrl)
const formData = {
'model': 'whisper-1',
'file': audioBlob,
'language': language
};
const url = 'https://api.openai.com/v1/audio/transcriptions';
const options = {
'method' : 'post',
'payload': formData,
'headers': {
'Authorization': "Bearer " + apiKey
}
};
const res = UrlFetchApp.fetch(url, options);
const data = JSON.parse(res.getContentText());
return data.text
}from this clever developer - https://github.com/bitswired/google-sheets-powerups/blob/main/whisper.js.
Time to dive deeper into the subject matter. With the GPT for Sheets and Docs extension, craft the following prompt to unlock the mysteries within.
=GPT("What is the subject being discussed in this video transcript? Please respond in a few words",D3)Armed with unique subjects, let's extract the top 4 most recurring themes using this clever prompt.
=GPT("what are the 4 most common subjects among this list?",E3:E13)Finally, neatly categorize each of the videos based on one of the 4 prompts using the magic spell: =GPT_CLASSIFY().
=GPT_CLASSIFY(E3,$F$1)In conclusion, OpenAI's Whisper API and GPT-4 have revolutionized the way we organize and classify TikTok videos. Gone are the days of monotonous manual labor. With these cutting-edge AI tools, you'll be an organizational mastermind in no time. So go ahead, give it a spin, and witness the power of AI-driven video organization.

