Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [jalal@goku entity-sentiment-analysis]$ python parse_doc.py
- Parsing Document...
- Tokenizing sentences...
- Done!
- Anaphora resolution for sentence: Jean is really sad, but Adam is the happiest guy ever
- Done!
- Named Entity Clustering:
- ('child is: ', Tree('FRAG', [Tree('S', [Tree('S', [Tree('NP', [Tree('NNP', ['Jean'])]), Tree('VP', [Tree('VBZ', ['is']), Tree('ADJP', [Tree('RB', ['really']), Tree('JJ', ['sad'])])])]), Tree(',', [',']), Tree('CC', ['but']), Tree('S', [Tree('NP', [Tree('NNP', ['Adam'])]), Tree('VP', [Tree('VBZ', ['is']), Tree('NP', [Tree('DT', ['the']), Tree('JJS', ['happiest']), Tree('NN', ['guy'])]), Tree('ADVP', [Tree('RB', ['ever'])])])])])]))
- (ROOT
- (FRAG
- (S
- (S (NP (NNP Jean)) (VP (VBZ is) (ADJP (RB really) (JJ sad))))
- (, ,)
- (CC but)
- (S
- (NP (NNP Adam))
- (VP
- (VBZ is)
- (NP (DT the) (JJS happiest) (NN guy))
- (ADVP (RB ever)))))))
- ('*************Node label is: ', u'ROOT')
- ('child is: ', Tree('S', [Tree('S', [Tree('NP', [Tree('NNP', ['Jean'])]), Tree('VP', [Tree('VBZ', ['is']), Tree('ADJP', [Tree('RB', ['really']), Tree('JJ', ['sad'])])])]), Tree(',', [',']), Tree('CC', ['but']), Tree('S', [Tree('NP', [Tree('NNP', ['Adam'])]), Tree('VP', [Tree('VBZ', ['is']), Tree('NP', [Tree('DT', ['the']), Tree('JJS', ['happiest']), Tree('NN', ['guy'])]), Tree('ADVP', [Tree('RB', ['ever'])])])])]))
- (FRAG
- (S
- (S (NP (NNP Jean)) (VP (VBZ is) (ADJP (RB really) (JJ sad))))
- (, ,)
- (CC but)
- (S
- (NP (NNP Adam))
- (VP
- (VBZ is)
- (NP (DT the) (JJS happiest) (NN guy))
- (ADVP (RB ever))))))
- ('*************Node label is: ', u'FRAG')
- ('child is: ', Tree('S', [Tree('NP', [Tree('NNP', ['Jean'])]), Tree('VP', [Tree('VBZ', ['is']), Tree('ADJP', [Tree('RB', ['really']), Tree('JJ', ['sad'])])])]))
- ('child is: ', Tree(',', [',']))
- ('child is: ', Tree('CC', ['but']))
- ('child is: ', Tree('S', [Tree('NP', [Tree('NNP', ['Adam'])]), Tree('VP', [Tree('VBZ', ['is']), Tree('NP', [Tree('DT', ['the']), Tree('JJS', ['happiest']), Tree('NN', ['guy'])]), Tree('ADVP', [Tree('RB', ['ever'])])])]))
- (S
- (S (NP (NNP Jean)) (VP (VBZ is) (ADJP (RB really) (JJ sad))))
- (, ,)
- (CC but)
- (S
- (NP (NNP Adam))
- (VP
- (VBZ is)
- (NP (DT the) (JJS happiest) (NN guy))
- (ADVP (RB ever)))))
- ('*************Node label is: ', u'S')
- ___________I am here
- ('child is: ', Tree('NP', [Tree('NNP', ['Jean'])]))
- ('child is: ', Tree('VP', [Tree('VBZ', ['is']), Tree('ADJP', [Tree('RB', ['really']), Tree('JJ', ['sad'])])]))
- (S (NP (NNP Jean)) (VP (VBZ is) (ADJP (RB really) (JJ sad))))
- ('*************Node label is: ', u'S')
- ___________I am here
- ('*************subchild_labels are: ', [u'NNP'])
- I am here ***************************
- ('child is: ', u',')
- (, ,)
- ('*************Node label is: ', u',')
- ('child is: ', u'but')
- (CC but)
- ('*************Node label is: ', u'CC')
- ('child is: ', Tree('NP', [Tree('NNP', ['Adam'])]))
- ('child is: ', Tree('VP', [Tree('VBZ', ['is']), Tree('NP', [Tree('DT', ['the']), Tree('JJS', ['happiest']), Tree('NN', ['guy'])]), Tree('ADVP', [Tree('RB', ['ever'])])]))
- (S
- (NP (NNP Adam))
- (VP
- (VBZ is)
- (NP (DT the) (JJS happiest) (NN guy))
- (ADVP (RB ever))))
- ('*************Node label is: ', u'S')
- ___________I am here
- ('*************subchild_labels are: ', [u'NNP'])
- I am here ***************************
- ('child is: ', Tree('NNP', ['Jean']))
- (NP (NNP Jean))
- ('*************Node label is: ', u'NP')
- ('child is: ', Tree('VBZ', ['is']))
- ('child is: ', Tree('ADJP', [Tree('RB', ['really']), Tree('JJ', ['sad'])]))
- (VP (VBZ is) (ADJP (RB really) (JJ sad)))
- ('*************Node label is: ', u'VP')
- ('child is: ', Tree('NNP', ['Adam']))
- (NP (NNP Adam))
- ('*************Node label is: ', u'NP')
- ('child is: ', Tree('VBZ', ['is']))
- ('child is: ', Tree('NP', [Tree('DT', ['the']), Tree('JJS', ['happiest']), Tree('NN', ['guy'])]))
- ('child is: ', Tree('ADVP', [Tree('RB', ['ever'])]))
- (VP (VBZ is) (NP (DT the) (JJS happiest) (NN guy)) (ADVP (RB ever)))
- ('*************Node label is: ', u'VP')
- ('child is: ', u'Jean')
- (NNP Jean)
- ('*************Node label is: ', u'NNP')
- ('child is: ', u'is')
- (VBZ is)
- ('*************Node label is: ', u'VBZ')
- ('child is: ', Tree('RB', ['really']))
- ('child is: ', Tree('JJ', ['sad']))
- (ADJP (RB really) (JJ sad))
- ('*************Node label is: ', u'ADJP')
- ('child is: ', u'Adam')
- (NNP Adam)
- ('*************Node label is: ', u'NNP')
- ('child is: ', u'is')
- (VBZ is)
- ('*************Node label is: ', u'VBZ')
- ('child is: ', Tree('DT', ['the']))
- ('child is: ', Tree('JJS', ['happiest']))
- ('child is: ', Tree('NN', ['guy']))
- (NP (DT the) (JJS happiest) (NN guy))
- ('*************Node label is: ', u'NP')
- ('child is: ', Tree('RB', ['ever']))
- (ADVP (RB ever))
- ('*************Node label is: ', u'ADVP')
- ('child is: ', u'really')
- (RB really)
- ('*************Node label is: ', u'RB')
- ('child is: ', u'sad')
- (JJ sad)
- ('*************Node label is: ', u'JJ')
- ('child is: ', u'the')
- (DT the)
- ('*************Node label is: ', u'DT')
- ('child is: ', u'happiest')
- (JJS happiest)
- ('*************Node label is: ', u'JJS')
- ('child is: ', u'guy')
- (NN guy)
- ('*************Node label is: ', u'NN')
- ('child is: ', u'ever')
- (RB ever)
- ('*************Node label is: ', u'RB')
- ('context: ', [(u' Jean', u'Jean is really sad'), (u' Adam', u'Adam is the happiest guy ever')])
- Jean is really sad
- Adam is the happiest guy ever
- [[(u' Jean', u'Jean is really sad'), (u' Adam', u'Adam is the happiest guy ever')]]
- Done!
- 2018-04-21 16:38:28.870963: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
- 2018-04-21 16:38:28.870992: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
- 2018-04-21 16:38:28.871000: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
- 2018-04-21 16:38:28.871007: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
- 2018-04-21 16:38:28.871015: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
- Sentence: 0,Jean is really sad , yielded results (pos/neg): 0.35309/0.64691, prediction: neg
- Sentence: 0,Adam is the happiest guy ever , yielded results (pos/neg): 0.97347/0.02653, prediction: pos
- Entity: Jean -- sentiment: -0.293821
- Entity: Adam -- sentiment: 0.94695
- {u' Jean': -0.29382148, u' Adam': 0.94694996}
- [jalal@goku entity-sentiment-analysis]$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement