Ejemplo n.º 1
0
def bot_info(sub_bots, cfg):
    """Returns a description for this AggQSentCredReviewer

    :param cfg: 
    :returns: 
    :rtype: 
    """
    result = {
        '@context': ci_context,
        '@type': 'AggQSentCredReviewer',
        'additionalType': content.super_types('AggQSentCredReviewer'),
        'name': 'ESI Aggregate Query Sentence Credibility Reviewer',
        'description':
        'Reviews the credibility of a query setence by comparing it to semantically similar sentences in the Co-inform DB and the credibility of those.',
        'author': bot_describer.esiLab_organization(),
        'dateCreated': '2020-03-19T15:09:00Z',
        'applicationCategory': ['Disinformation Detection'],
        'softwareRequirements': ['python'],
        'softwareVersion': version,
        'executionEnvironment': bot_describer.inspect_execution_env(),
        'isBasedOn': sub_bots,
        'launchConfiguration': {
            'acred_pred_claim_search_url':
            cfg.get('acred_pred_claim_search_url',
                    'http://localhost:8070/test/api/v1/claim/internal-search')
        }
    }
    return {
        **result, 'identifier':
        hashu.hash_dict(dictu.select_keys(result, content.ident_keys(result)))
    }
Ejemplo n.º 2
0
def bot_info(sub_bots, cfg):
    """Returns a description for this TweetCredReviewer

    :param sub_bots: a list of bot items used by this TweetCredReviewer
    :param cfg: config options
    :returns: a `TweetCredReviewer` item
    :rtype: dict
    """
    result = {
        '@context': ci_context,
        '@type': 'TweetCredReviewer',
        'additionalType': content.super_types('TweetCredReviewer'),
        'name': 'ESI Tweet Credibility Reviewer',
        'description':
        'Reviews the credibility of a tweet by reviewing the sentences in the tweet and the (textual) documents linked by the tweet',
        'author': bot_describer.esiLab_organization(),
        'dateCreated': '2020-04-02T18:00:00Z',
        'applicationCategory': ['Disinformation Detection'],
        'softwareRequirements': ['python', 'nltk', 'Cogito'],
        'softwareVersion': version,
        'executionEnvironment': bot_describer.inspect_execution_env(),
        'isBasedOn': sub_bots,
        'launchConfiguration': {},
        'taskConfiguration': {}
    }
    return {
        **result, 'identifier':
        hashu.hash_dict(dictu.select_keys(result, content.ident_keys(result)))
    }
Ejemplo n.º 3
0
def bot_info(sub_bots, cfg):
    result = {
        '@context': ci_context,
        '@type': 'DBSentCredReviewer',
        'name': 'ESI DB Sentence Credibility Reviewer',
        'description': 'Estimates the credibility of a sentence in the Co-inform DB based on known ClaimReviews or websites where the sentence has been published.',
        'additionalType': content.super_types('DBSentCredReviewer'),
        'author': bot_describer.esiLab_organization(),
        'dateCreated': dateCreated,
        'softwareVersion': version,
        'url': 'http://coinform.eu/bot/DBSentCredReviewer/%s' % version,
        'applicationSuite': 'Co-inform',
        'isBasedOn': sub_bots, 
        'launchConfiguration': {
            'factchecker_website_to_qclaim_confidence_penalty_factor': float(
                cfg.get('factchecker_website_to_qclaim_confidence_penalty_factor', 0.5)),
            'acred_factchecker_urls': cfg.get('acred_factchecker_urls', [])
        }
    }
    ident = hashu.hash_dict(dictu.select_keys(
        result, content.ident_keys(result)))
    return {
        **result,
        'identifier': ident
    }
Ejemplo n.º 4
0
def ident_keys(item, cfg):
    """Returns the list of keys in item which gives its identity

    :param item: dict with type information
    :param cfg: config options
    :returns: a list of fields for item that give it its identity
    :rtype: list
    """
    try:
        return content.ident_keys(item)
    except Exception as e:
        logger.error('Failed to extract ident keys for %s' % (item), e)
        raise e
Ejemplo n.º 5
0
def bot_info(sub_bots, cfg):
    """Returns a description for this ArticleCredReviewer

    :param sub_bots: bot items used by this ArticleCredReviewer
    :param cfg: config options
    :returns: an `ArticleCredReviewer`
    :rtype: dict
    """
    result = {
        '@context': content.ci_context,
        '@type': 'ArticleCredReviewer',
        'additionalType': content.super_types('ArticleCredReviewer'),
        'name': 'ESI Article Credibility Reviewer',
        'description':
        'Reviews the credibility of an article by (i) semantically analysing it to detect relevant claims (ii) getting credibility reviews for the claims and (iii) getting a credibility reviews for the site(s) that published the article.',
        'author': bot_describer.esiLab_organization(),
        'dateCreated': '2020-04-01T17:02:00Z',
        'applicationCategory': ['Disinformation Detection'],
        'softwareRequirements': ['python', 'Cogito'],
        'softwareVersion': version,
        'executionEnvironment': bot_describer.inspect_execution_env(),
        'isBasedOn': sub_bots,
        'launchConfiguration': {
            # any launch configs?
        },
        'taskConfiguration': {
            'cred_conf_threshold':
            cfg.get('cred_conf_threshold', 0.7),
            'max_claims_in_doc':
            int(cfg.get('max_claims_in_doc', 5)),
            'relsents_in_colls':
            cfg.get('relsents_in_colls', [
                'generic', 'pilot-se', 'pilot-gr', 'pilot-at', 'factcheckers',
                'fc-dev'
            ]),
            'target_url_collect_coll':
            cfg.get('target_url_collect_coll',
                    cfg.get('default_url_collect_coll', None)),
            'acred_review_format':
            cfg.get('acred_review_format', 'schema.org')
        }
    }
    return {
        **result, 'identifier':
        hashu.hash_dict(dictu.select_keys(result, content.ident_keys(result)))
    }
Ejemplo n.º 6
0
def bot_info(sub_bots, cfg):
    result = {
        '@context': ci_context,
        '@type': 'SentPolarityReviewer',
        'name': 'ESI Sentence Polarity Reviewer',
        'description': 'Estimates the polar similarity between two sentences',
        'additionalType': content.super_types('SentPolarityReviewer'),
        'softwareVersion': version,
        'dateCreated': '2020-03-27T22:54:00Z',
        'url':
        'http://coinform.eu/bot/SentencePolarSimilarityReviewer/%s' % version,
        'applicationSuite': 'Co-inform',
        'author': bot_describer.esiLab_organization(),
        'isBasedOn': sub_bots,
        'launchConfiguration': {}
    }
    ident = hashu.hash_dict(
        dictu.select_keys(result, content.ident_keys(result)))
    return {**result, 'identifier': ident}
Ejemplo n.º 7
0
def bot_info(cfg):
    result = {
        '@context': ci_context,
        '@type': 'ClaimReviewNormalizer',
        'name': 'ESI ClaimReview Credibility Normalizer',
        'description':
        'Analyses the alternateName and numerical rating value for a ClaimReview and tries to convert that into a normalised credibility rating',
        'additionalType': content.super_types('ClaimReviewNormalizer'),
        'author': bot_describer.esiLab_organization(),
        'dateCreated': dateCreated,
        'softwareVersion': version,
        'url': 'http://coinform.eu/bot/ClaimReviewNormalizer/%s' % version,
        'applicationSuite': 'Co-inform',
        'isBasedOn': [],  # no dependencies
        'launchConfiguration': {}  # no configs?
    }
    ident = hashu.hash_dict(
        dictu.select_keys(result, content.ident_keys(result)))
    return {**result, 'identifier': ident}
Ejemplo n.º 8
0
def misinfoMeSourceCredReviewer():
    result = {
        '@context':
        'http://coinform.eu',
        '@type':
        'MisinfoMeSourceCredReviewer',
        # Since we don't control this bot, we assume versions,
        #  an thus results, may change on a weekly basis
        #  So we use the start of the current week as the version
        'softwareVersion':
        isodate.start_of_week_utc_timestamp(datetime.datetime.utcnow()),
        'additionalType':
        content.super_types('MisinfoMeSourceCredReviewer'),
        'url':
        misinfome_url,
        'applicationSuite':
        'MisinfoMe'
    }
    return {
        **result, 'identifier':
        hashu.hash_dict(dictu.select_keys(result, content.ident_keys(result)))
    }