pyannote / pyannote-database

Reproducible experimental protocols for multimedia (audio, video, text) database
MIT License
79 stars 26 forks source link

get_unique_identifier loads all protocol file values #58

Closed PaulLerner closed 4 years ago

PaulLerner commented 4 years ago

Using the ** expression here leads to loading all the values of the protocol file, even those that are not needed

My traceback (only to ease the understanding, the error is unrelated and caused by spacy version)

Traceback (most recent call last):
  File "/people/lerner/anaconda3/envs/transformers/bin/named_id.py", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/people/lerner/pyannote/Prune/prune/named_id.py", line 900, in <module>
    shuffle=False))
  File "/people/lerner/pyannote/Prune/prune/named_id.py", line 523, in batchify
    current_audio_emb = audio_emb(current_file)
  File "/people/lerner/pyannote/pyannote-audio/pyannote/audio/features/wrapper.py", line 274, in __call__
    return self.scorer_(current_file)
  File "/people/lerner/pyannote/pyannote-audio/pyannote/audio/features/precomputed.py", line 205, in __call__
    path = Path(self.get_path(current_file))
  File "/people/lerner/pyannote/pyannote-audio/pyannote/audio/features/precomputed.py", line 73, in get_path
    uri = get_unique_identifier(item)
  File "/people/lerner/pyannote/pyannote-database/pyannote/database/util.py", line 205, in get_unique_identifier
    return IDENTIFIER.format(**item)
  File "/people/lerner/pyannote/pyannote-database/pyannote/database/protocol/protocol.py", line 122, in __getitem__
    # just imagine that this key is forbidden
    value = self.lazy[key](self)
  File "/people/lerner/pyannote/pyannote-database/pyannote/database/custom.py", line 100, in load
    return loader(current_file)
  File "/vol/work/lerner/pyannote-db-plumcot/Plumcot/loader/loader.py", line 169, in __call__
    attributes)
  File "/vol/work/lerner/pyannote-db-plumcot/Plumcot/loader/loader.py", line 201, in merge_transcriptions_entities
    # and that this raises : "Oh no, forbidden key !"
    _, one2one, _, _, one2multi = align(tokens, e_tokens)
ValueError: too many values to unpack (expected 5)
hbredin commented 4 years ago

I just merged your PR solving this issue. It will be part of next release.