Closed mbnik closed 7 years ago
@mbnik Histograms of the "sentiment neuron" after seeing positive and negative reviews are provided in the blog-post (or paper). I've fixed it to +1.0 and -1.5 to -1.0 for generating new sequences with decent results.
I've tried to apply the model onto the Stanford sentiment dataset, and can't reproduce these histograms: the avg value of neuron 2387, 2388 or 2389 are the same for both pos and neg examples. I must have a buggy code, but just to be sure: did anyone managed to reproduce these histograms on the movie review dataset ?
its mentioned in the blog "sentiment classifier by taking a linear combination of these units, learning the weights of the combination via the available supervised data" Still not able to figure out how to get Sentiment neuron? Please give us a idea here
Here is my sample code:
from encoder import Model model=Model() text = ['it was a nice day','it was a great day','it was a bad day','It was a wonderful day','It was an excellent day','It was a super excellent day','It was such a bad bad day ','It was such a bad bad bad day'] text_features = model.transform(text)
17.660 seconds to transform 8 examples
for i in range(len(text)): sentiment = text_features[i, 2388] print(text[i],sentiment)
Here is the result:
it was a nice day 0.012658 it was a great day 0.371533 it was a bad day -0.499269 It was a wonderful day 0.503395 It was an excellent day 0.44557 It was a super excellent day 0.623401 It was such a bad bad day -0.858701 It was such a bad bad bad day -1.04497
My questions are: 1-what is the range for sentiment values? 2-is there any specific range for negative, positive and neutral sentiments?