Example #1
0
    def analyse_entry(self, entry, *args, **kwargs):
        polarity = basic.get_polarity(entry.text, self.dictionaries)
        if polarity in self.mappings:
            polarity = self.mappings[polarity]

        s = models.Sentiment(marl__hasPolarity=polarity)
        s.prov(self)
        entry.sentiments.append(s)
        yield entry
    def analyse_entry(self, entry, activity):
        polarity = basic.get_polarity(entry.text)

        polarity = self.mappings.get(polarity, self.mappings['default'])

        s = models.Sentiment(marl__hasPolarity=polarity)
        s.prov(activity)
        entry.sentiments.append(s)
        yield entry
Example #3
0
    def analyse_entry(self, entry, params):
        positive_words = params['positive-words'].split(',')
        negative_words = params['negative-words'].split(',')
        dictionary = {
            'marl:Positive': positive_words,
            'marl:Negative': negative_words,
        }
        polarity = basic.get_polarity(entry.text, [dictionary])

        s = models.Sentiment(marl__hasPolarity=polarity)
        s.prov(self)
        entry.sentiments.append(s)
        yield entry