async function get_avg_sentiment(politician, list_of_speeches) {
let pol_speeches = list_of_speeches[politician]
let temp_sentiment_list = []
for (let j=0; j<pol_speeches.length; j++){
let speech_sentiment = await fetch(gh_path+politician+"/"+pol_speeches[j][1]+"/analysis/visuals/sentiment.json").then((response) => response.json())
if (speech_sentiment !== null){
temp_sentiment_list.push(speech_sentiment)
}
}
return temp_sentiment_list.reduce((a, b) => a + b, 0) / temp_sentiment_list.length
}