예제 #1
0
from soweego.linker import train

LOGGER = logging.getLogger(__name__)


# Let the user pass extra kwargs to the classifier
# This is for development purposes only, and is not explicitly documented
@click.command(context_settings={
    'ignore_unknown_options': True,
    'allow_extra_args': True
})
@click.argument('classifier', type=click.Choice(constants.CLASSIFIERS))
@click.argument('catalog',
                type=click.Choice(target_database.supported_targets()))
@click.argument('entity',
                type=click.Choice(target_database.supported_entities()))
@click.option('-k',
              '--k-folds',
              default=5,
              help="Number of folds, default: 5.")
@click.option(
    '-s',
    '--single',
    is_flag=True,
    help='Compute a single evaluation over all k folds, instead of k '
    'evaluations.',
)
@click.option(
    '-n',
    '--nested',
    is_flag=True,
예제 #2
0
    f'{keys.MUSICBRAINZ}_{keys.MUSICIAN}': MUSICBRAINZ_PERSON_URL,
    f'{keys.MUSICBRAINZ}_{keys.BAND}': MUSICBRAINZ_PERSON_URL,
    f'{keys.MUSICBRAINZ}_{keys.MUSICAL_WORK}': MUSICBRAINZ_WORK_URL,
    f'{keys.IMDB}_{keys.ACTOR}': IMDB_PERSON_URL,
    f'{keys.IMDB}_{keys.DIRECTOR}': IMDB_PERSON_URL,
    f'{keys.IMDB}_{keys.MUSICIAN}': IMDB_PERSON_URL,
    f'{keys.IMDB}_{keys.PRODUCER}': IMDB_PERSON_URL,
    f'{keys.IMDB}_{keys.WRITER}': IMDB_PERSON_URL,
    f'{keys.IMDB}_{keys.AUDIOVISUAL_WORK}': IMDB_WORK_URL,
    keys.TWITTER: TWITTER_URL,
}


@click.command()
@click.argument('catalog', type=click.Choice(SUPPORTED_TARGETS))
@click.argument('entity', type=click.Choice(target_database.supported_entities()))
@click.argument('confidence_range', type=(float, float))
@click.argument('matches', type=click.Path(exists=True, dir_okay=False))
def cli(catalog, entity, confidence_range, matches):
    """Upload matches to the Mix'n'match tool.

    CONFIDENCE_RANGE must be a pair of floats
    that indicate the minimum and maximum confidence scores.

    MATCHES must be a CSV file path.
    Format: QID, catalog_identifier, confidence_score

    The CSV file can be compressed.

    Example: