Created
September 10, 2021 16:19
-
-
Save richashworth/b7eb699a75c32bd1eb309f9f5d82a0f1 to your computer and use it in GitHub Desktop.
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment