コード例 #1
0
 def test_opinion_different_sentence_target(self, generated_sentiment_response):
     # the first sentence has the target, and the second sentence has the assessment
     # the desired behavior is the first wrapped sentence object has a target, and it's assessment
     # is in the second sentence.
     # the second sentence will have no mined opinions, since we define that as a target and assessment duo
     wrapped_sentiment = sentiment_result("not relevant", generated_sentiment_response, {})[0]
     assert wrapped_sentiment.sentences[0].mined_opinions[0].assessments[0].text == "good"
     assert not wrapped_sentiment.sentences[1].mined_opinions
コード例 #2
0
 def test_opinion_different_sentence_aspect(self,
                                            generated_sentiment_response):
     # the first sentence has the aspect, and the second sentence has the opinion
     # the desired behavior is the first wrapped sentence object has an aspect, and it's opinion
     # is in the second sentence.
     # the second sentence will have no mined opinions, since we define that as an aspect and opinion duo
     wrapped_sentiment = sentiment_result(response="not relevant",
                                          obj=generated_sentiment_response,
                                          response_headers={})[0]
     assert wrapped_sentiment.sentences[0].mined_opinions[0].opinions[
         0].text == "good"
     assert not wrapped_sentiment.sentences[1].mined_opinions