Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the sentiment neuron at position 3159? #2

Closed
aykutfirat opened this issue Apr 6, 2017 · 3 comments
Closed

Is the sentiment neuron at position 3159? #2

aykutfirat opened this issue Apr 6, 2017 · 3 comments

Comments

@aykutfirat
Copy link

No description provided.

@aykutfirat aykutfirat changed the title Is the sentiment neuron at 3159? Is the sentiment neuron at position 3159? Apr 6, 2017
@Newmu
Copy link
Collaborator

Newmu commented Apr 6, 2017

2388 is the unit visualized and the single experiment results are reported on in the paper

@bitliner
Copy link

bitliner commented Apr 9, 2017

Extracting the 2388-th does not work for me. I always get 0 as value.

I used examples that are predicted as positive in the paper.

Example:

if __name__ == '__main__':
    mdl = Model()
    text = [
        'too bad!', 
        'it was so cool, beautiful', 
        'the screenplay and the directing were horrendous', 
        'best books'
    ]
    text_features = mdl.transform(text)
    print('shape')
    print(text_features.shape)
    sentiment = text_features[:, 2388]
    print('sentiment')
    print(sentiment)

Result:

0.000 seconds to transform 4 examples
shape
(4, 4096)
sentiment
[ 0.  0.  0.  0.]

Apparently I get 0. for every value of the feature vector extracted, there must be an error somewhere else I guess, looking for it.

@dthiagarajan
Copy link

Referenced in #3 - it's something to do with how HTMLParser.HTMLParser().unescape(text) works. I ran into the same problem trying it with Python 2, but wasn't able to resolve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants