tempo_eval.read_reference_tags

tempo_eval.read_reference_tags(corpus_name, validate=True)[source]

Read reference tags from the namespaces ‘tag_open’, ‘tag_gtzan’, and ‘tag_fma_genre’.

Parameters
  • corpus_name (str) – corpus See list_reference_corpus_names to get a list of valid names.

  • validate (bool) – validate jam while reading (validation impacts performance negatively)

Returns

jam annotation objects, organized as nested dicts with namespace, version and item ids as keys

Return type

dict[str, dict[str, dict[str, jams.Annotation]]]

Note

By default, validate is True in order to stay safe. But since it affects performance quite a bit, you might want to turn validation off when using this function to keep your sanity.

Example

>>> from tempo_eval import read_reference_tags, extract_tags
>>> gtzan = read_reference_tags('gtzan', validate=False)
>>> gtzan_hh_691694 = gtzan['tag_open']['GTZAN-Rhythm_v2_ismir2015_lbd_2015-10-28']['hiphop.00086.jams']
>>> tags = extract_tags(gtzan_hh_691694)
>>> print(tags)
{'4/4', 'no_ternary', 'no_swing'}

See also

To extract tag values, use extract_tags.