openai / generating-reviews-discovering-sentiment

Code for "Learning to Generate Reviews and Discovering Sentiment"
https://arxiv.org/abs/1704.01444
MIT License
1.51k stars 379 forks source link

Which feature out of 4096 is sentiment? #8

Closed Alexander-Minyushkin closed 7 years ago

Alexander-Minyushkin commented 7 years ago

It is not obvious from simple visualizations

from encoder import Model

model = Model()
text = ['demo!', 'great!', 'fuck shit']
text_features = model.transform(text)

import matplotlib.pyplot as plt

for i in range(len(text)):
    plt.plot(range(text_features[i].size), text_features[i], label=text[i])
plt.legend()
plt.show()

plt.scatter(text_features[1], text_features[2])
plt.xlabel(text[1])
plt.ylabel(text[2])
plt.show()
Alexander-Minyushkin commented 7 years ago

Already answered here: https://github.com/openai/generating-reviews-discovering-sentiment/issues/2 It is 2388