You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Parse lists of word timestamps in SegLST JSON - #134
SegLST supports lists of word timestamps, and split_words(..., segment_representation='segment') produces them. Writing those segments to JSON and reading them back with the default reader raises ValueError because the complete list is passed to Decimal:
frommeeteval.ioimportSegLSTtext='[{"session_id": "recording", "words": ["a", "b"], "start_time": [0.0, 0.5], "end_time": [0.5, 1.0]}]'SegLST.parse(text)
# Before: ValueError: argument must be a sequence of length 3
Parse each timestamp in a list with the existing converter, retaining the scalar path. This also converts string timestamps when parse_float=float; empty lists remain empty.
Thirteen regression cases fail before; all 16 pass after, including JSON and file round trips for five existing timing strategies. On recorded LibriCSS transcript excerpts, 25 of 30 persistence/converter cases fail before and all 30 pass after. Parsed words/times and native cpWER/tcpWER results match the in-memory controls after explicitly flattening the word timestamps; ten scalar-timestamp controls remain identical. Direct scoring of unflattened list timestamps has a separate existing preprocessing failure and is outside this change.
Local Linux/Python3.12 test directory: 407 passed, 144 skipped, one existing warning. Package doctests and Windows were not run.
Hmm. Thanks for the PR, do you have a motivation to support this input format? The list values for words, start_time and end_time are an internal representation. The idea was that users provide an entry per word when they want to skip the subsegmentation.
Thanks for clarifying. The motivation was saving the output of split_words(..., segment_representation='segment') and loading it again while retaining the original segment grouping. I inferred that round trip from the SegLstSegment annotations and SegLST.dump/load; this was found during validation, rather than reported by an external user.
For the intended input format, flattening with split_words(data, keys=('words', 'start_time', 'end_time')) before saving already gives a working round trip on the current code. So this PR is only useful if persistence of that internal grouping is something you want to support. If it should stay internal, I can close this.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SegLSTsupports lists of word timestamps, andsplit_words(..., segment_representation='segment')produces them. Writing those segments to JSON and reading them back with the default reader raisesValueErrorbecause the complete list is passed toDecimal:Parse each timestamp in a list with the existing converter, retaining the scalar path. This also converts string timestamps when
parse_float=float; empty lists remain empty.Thirteen regression cases fail before; all 16 pass after, including JSON and file round trips for five existing timing strategies. On recorded LibriCSS transcript excerpts, 25 of 30 persistence/converter cases fail before and all 30 pass after. Parsed words/times and native cpWER/tcpWER results match the in-memory controls after explicitly flattening the word timestamps; ten scalar-timestamp controls remain identical. Direct scoring of unflattened list timestamps has a separate existing preprocessing failure and is outside this change.
Local Linux/Python3.12 test directory: 407 passed, 144 skipped, one existing warning. Package doctests and Windows were not run.