Skip to content

[WIP] Tiered annotations - #81

Open
hadware wants to merge 37 commits into
pyannote:developfrom
hadware:tiered_annotations
Open

[WIP] Tiered annotations#81
hadware wants to merge 37 commits into
pyannote:developfrom
hadware:tiered_annotations

Conversation

@hadware

@hadware hadware commented Aug 26, 2022

Copy link
Copy Markdown
Contributor

Old idea, finally took some time to implement it.

This is more or less an implementation of the Praat/Elan tiered structure. Here are a couple of key points for this

  • There are two data structures TieredAnnotation and Tier. A TieredAnnotation is made out of Tiers
  • The structure is basically and schematically a dict of dict : TieredAnnotation[str, Tier[Segment,Label]]
  • A Tier is a thin wrapper over a timeline, used to keep store segments and take care of the cropping/support/etc-related operations
  • The TieredAnnotation shouldn't have that many available methods other than:
    • accessing tiers and tiers information
    • cropping/extruding/etc (all just done by the underlying Tiers)
    • Iterating over segment
  • Support for textigrid files parsing is optional, and added by running pip install pyannote.core[textgrid]. This installs textgrid-parser, my sly-based parser.

I'll follow up with a couple of questions to tune my implem to your preferences

hadware and others added 26 commits December 9, 2019 04:03
…ype hints should be good for the API objects.
# Conflicts:
#	pyannote/core/annotation.py
#	pyannote/core/segment.py
#	pyannote/core/timeline.py
…ailing in timeline.py. Added a type for LabelGenerator modes.
# Conflicts:
#	pyannote/core/segment.py
@hadware

hadware commented Aug 26, 2022

Copy link
Copy Markdown
Contributor Author

Alright, questions now:

  • Since Tier is such a thin wrapper above Timeline, I'm wondering if I shouldn't just inherit from it. This would still require some methods to be overridden to make sure the returned type is right, but you get the point
  • I've added the allow_overlap option to tiers to (optionally) more closely mimic TextGrid/Eaf's behavior. What do you think about that?
  • I kind of modeled TieredAnnotation on Annotation, and thus, (for now) left the self._timeline attribute that is a "lazy" cache of the TieredAnnotation's timeline. I don't think this has any use anymore, but I wanted your opinion on this.

@hbredin

hbredin commented Aug 31, 2022

Copy link
Copy Markdown
Member

Thanks @hadware. Will look into this at some point...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants