def call_api(self, message):
        """Return dict of results from an NER call to OpenCalais"""
        message_utf8_string = message.encode('utf-8', 'replace')
        entities = []
        try:
            result = self.api.analyze(message_utf8_string)
            try:
                entities = result.entities
            except AttributeError:
                pass
        except ValueError as err:
            config.logging.error("OpenCalais reports %r" % (repr(err)))
        return entities
dataset/ETHPy150Open ianozsvald/social_media_brand_disambiguator/ner_apis/opencalais/opencalais_ner.py/OpenCalaisNER.call_api/original