Skip to content

Alignment from meeteval.wer.wer.time_constrained.align #113

Description

@m-wiesner

I was playing around with ways of computing WER metrics on specified subsets of words. Perhaps there is already a way to do this, but I noticed some strange behavior and I wanted to confirm it was expected. I am just using the first few lines of some STM files I have.

import metal
meeteval.wer.wer.time_constrained.align(
    [
        {"words": "hi", "start_time": 0.93, "end_time": 2.03},
        {"words": "good how are you", "start_time": 3.15, "end_time": 5.36},
        {"words": "i'm leigh", "start_time": 7.24, "end_time": 8.36},
        {"words": "pretty good", "start_time": 9.44, "end_time": 12.27},
        {"words": "yeah", "start_time": 15.49, "end_time": 16.95},
    ],
    [
        {"words": "hi", "start_time": 0.93, "end_time": 2.03},
        {"words": "how are you", "start_time": 3.15, "end_time": 5.36},
        {"words": "i'm lee", "start_time": 7.24, "end_time": 8.36},
        {"words": "thank you", "start_time": 9.44, "end_time": 12.27},
        {"words": "yep", "start_time": 15.49, "end_time": 16.95},
    ]
)

Which produces:

[('hi', 'hi'),
('good', 'how'),
('how', 'are'),
('are', '*'),
('you', 'you'),
("i'm", "i'm"),
('leigh', 'lee'),
('pretty', 'thank'),
('good', 'you'),
('yeah', 'yep')]

There errors are:

  1. good --> how
  2. how --> are
  3. are --> *
  4. leigh --> lee
  5. pretty --> thank
  6. good --> you
  7. yeah --> yep

I would have expected:

  1. good --> *
  2. leigh --> lee
  3. pretty --> thank
  4. good --> you
  5. yeah --> yep

Which has 2 fewer errors.

Here are some more examples I constructed that I considered strange. Any explanation for why this occurs and confirmation that this is expected would be appreciated. I suspect there might be some weird pruning going on or something with time constraints that I am not fully understanding.

meeteval.wer.wer.time_constrained.align(
    [
        {"words": "hi", "start_time": 0.93, "end_time": 2.03},
        {"words": "good how are you", "start_time": 3.15, "end_time": 5.36},
        {"words": "i'm leigh adams", "start_time": 7.24, "end_time": 8.36},
        {"words": "pretty good now", "start_time": 9.44, "end_time": 12.27},
        {"words": "yeah", "start_time": 15.49, "end_time": 16.95},
    ],
    [
        {"words": "hi", "start_time": 0.93, "end_time": 2.03},
        {"words": "are you", "start_time": 3.15, "end_time": 5.36},
        {"words": "leigh adams", "start_time": 7.24, "end_time": 8.36},
        {"words": "good now", "start_time": 9.44, "end_time": 12.27},
        {"words": "yep", "start_time": 15.49, "end_time": 16.95},
    ]
)

[('hi', 'hi'),
('good', 'are'),
('how', ''),
('are', 'you'),
('you', '
'),
("i'm", ''),
('leigh', 'leigh'),
('adams', 'adams'),
('pretty', 'good'),
('good', '
'),
('now', 'now'),
('yeah', 'yep')]

2 errors:
pretty good now
good * now

when I could have done
1 error:
pretty good now
* good now

import meeteval
meeteval.wer.wer.time_constrained.align(
    [
        {"words": "hi", "start_time": 0.93, "end_time": 2.03},
        {"words": "good how are you", "start_time": 3.15, "end_time": 5.36},
        {"words": "i'm leigh adams", "start_time": 7.24, "end_time": 8.36},
        {"words": "pretty good now and you", "start_time": 9.44, "end_time": 12.27},
        {"words": "yeah", "start_time": 15.49, "end_time": 16.95},
    ],
    [
        {"words": "hi", "start_time": 0.93, "end_time": 2.03},
        {"words": "are you", "start_time": 3.15, "end_time": 5.36},
        {"words": "leigh adams", "start_time": 7.24, "end_time": 8.36},
        {"words": "good now and", "start_time": 9.44, "end_time": 12.27},
        {"words": "yep", "start_time": 15.49, "end_time": 16.95},
    ]
)

[('hi', 'hi'),
('good', 'are'),
('how', ''),
('are', 'you'),
('you', '
'),
("i'm", ''),
('leigh', 'leigh'),
('adams', 'adams'),
('pretty', 'good'),
('good', '
'),
('now', 'now'),
('and', '*'),
('you', 'and'),
('yeah', 'yep')]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions