Skip to content

Instantly share code, notes, and snippets.

@nchibana
Last active October 17, 2019 23:09
Show Gist options
  • Select an option

  • Save nchibana/854266cb05afb6f2c9cf62245f4bf925 to your computer and use it in GitHub Desktop.

Select an option

Save nchibana/854266cb05afb6f2c9cf62245f4bf925 to your computer and use it in GitHub Desktop.
new lexicon
dict = pd.read_csv('./NRC-VAD-Lexicon-Aug2018Release/NRC-VAD-Lexicon-Aug2018Release/NRC-VAD-Lexicon.txt', sep='\t')
dict['Ranking'] = np.arange(1, len(dict)+1)
columnsTitles = ["Word","Ranking","Arousal","Valence","Dominance"]
dict = dict.reindex(columns=columnsTitles)
dict['Arousal'] = dict['Arousal'].astype(str)
newDict = dict.set_index('Word').T.to_dict('list')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment