This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@startgantt | |
<style> | |
ganttDiagram { | |
task { | |
FontName Helvetica | |
FontColor black | |
FontSize 12 | |
FontStyle | |
BackGroundColor GreenYellow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MILLIS_PER_DAY = 1000*60*60*24 | |
const HEADER_ROWS = 1 | |
function hide() { | |
const ss = SpreadsheetApp.getActiveSpreadsheet() | |
const sheet = ss.getSheets()[0] | |
const dateCol = sheet.getRange("A:A").getValues().map(function(row) { | |
return row[0] | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pos_adjs = ', '.join(get_related_adjectives("climate change", nlp(positive_phrase))) | |
neg_adjs = ', '.join(get_related_adjectives("climate change", nlp(negative_phrase))) | |
pos_row = [positive_phrase, pos_adjs, TextBlob(pos_adjs).sentiment[0]] | |
neg_row = [negative_phrase, neg_adjs, TextBlob(neg_adjs).sentiment[0]] | |
HTML(DataFrame([pos_row, neg_row], columns=["Text", "Relevant_Adjectives", "Relevant_Sentiment"]).to_html(index=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
climate_change_forms = ["The facts about climate change", | |
"Changes in our climate", | |
"The climate is changing rapidly", | |
"Because the climate has changed,"] | |
df = DataFrame(climate_change_forms, columns=["Text"]) | |
df['Lemmas'] = list(map(lambda x: ' '.join(list(map(lambda y: y.lemma_, nlp(x)))), climate_change_forms)) | |
HTML(df.to_html(index=False)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from textblob import TextBlob | |
positive_phrase = TextBlob("It's great that people are talking about climate change") | |
positive_phrase.sentiment_assessments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
text = " ".join(list(jonathan_ross_segments)) | |
sentences = nlp(text).sents | |
HTML(DataFrame(map(lambda x: str(x), sentences), columns=["Sentences"]).to_html(index=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
text = "We can speak to the UK's own Greta Thunberg, because Amy Bray is a climate change activist from Cumbria, who is getting great acclaim for saying young people should be very worried about their future." | |
spacy.displacy.render(nlp(text), style="ent", jupyter=True) |
NewerOlder