Implemented a module to detect backchannel segments, and updated the coalesce module to ignore them when coalescing same-speaker turns
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"gitea.maximumdirect.net/eric/seriatim/internal/autocorrect"
|
||||
"gitea.maximumdirect.net/eric/seriatim/internal/backchannel"
|
||||
"gitea.maximumdirect.net/eric/seriatim/internal/coalesce"
|
||||
"gitea.maximumdirect.net/eric/seriatim/internal/config"
|
||||
"gitea.maximumdirect.net/eric/seriatim/internal/model"
|
||||
@@ -98,6 +99,23 @@ func (resolveOverlaps) Process(ctx context.Context, in model.MergedTranscript, c
|
||||
}, nil
|
||||
}
|
||||
|
||||
type backchannelPostprocessor struct{}
|
||||
|
||||
func (backchannelPostprocessor) Name() string {
|
||||
return "backchannel"
|
||||
}
|
||||
|
||||
func (backchannelPostprocessor) Process(ctx context.Context, in model.MergedTranscript, cfg config.Config) (model.MergedTranscript, []report.Event, error) {
|
||||
if err := ctx.Err(); err != nil {
|
||||
return model.MergedTranscript{}, nil, err
|
||||
}
|
||||
|
||||
out, tagged := backchannel.Apply(in)
|
||||
return out, []report.Event{
|
||||
report.Info("postprocessing", "backchannel", fmt.Sprintf("tagged %d backchannel segment(s)", tagged)),
|
||||
}, nil
|
||||
}
|
||||
|
||||
type coalescePostprocessor struct{}
|
||||
|
||||
func (coalescePostprocessor) Name() string {
|
||||
|
||||
Reference in New Issue
Block a user