Published
Edited
Dec 10, 2018
1 fork
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
vttToJson = require('vtt-to-json@0.1.1/index.js').catch(() => window.convertVttToJson)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
videoID = "q_q61B-DyPk"
Insert cell
Insert cell
function getSubtitles(videoID){
getYoutubeSubtitles(videoID).then(subtitles => {
console.log(subtitles)
subtitles_holder.push(subtitles)
return subtitles
})
.catch(err => {
console.log(err)
subtitles_holder.push(err)
})
}

Insert cell
subtitles = getSubtitles(videoID)
Insert cell
Insert cell
Insert cell
Insert cell
json_transcript_output = vttToJson(vtt_string)
.then((result) => {
return(result)
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function turnArrayofWordsIntoString(arrayOfWords){
let wordString = "";
for (var i = 0; i < arrayOfWords.length; i++) {
console.log(arrayOfWords[i])
wordString = wordString+" "+arrayOfWords[i]
}
return wordString
}
Insert cell
Insert cell
words = turnArrayofWordsIntoString(all_words_array)
Insert cell
Insert cell
Insert cell
VERBS = nlp(words).verbs().out('array')
Insert cell
Insert cell
NOUNS = nlp(words).nouns().out('array')
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more