Learn R Programming

nzilbb.labbcat (version 1.5-1)

appendOffsets: Appends temporal alignments on given layers to a dataframe of matches.

Description

Appends labels and start/end offsets of annotations on a given layer, to a given dataframe of matches returned from getMatches or getAllUtterances.

Usage

appendOffsets(
  matches,
  layer.ids,
  target.offset = 0,
  annotations.per.layer = 1,
  anchor.confidence.min = 50,
  page.length = 1000,
  no.progress = FALSE,
  labbcat.url = NULL,
  column.prefix = NULL
)

Arguments

Value

matches with the labels, start times, and end times appended as new columns.

Details

This is a version of getMatchAlignments that can have a dataframe of matches piped into it, and returns the dataframe with columns appended.

You can specify a threshold for confidence in the alignment, which is a value from 0 (not aligned) to 100 (manually aligned). The default is 50 (automatically aligned), so only alignments that have been at least automatically aligned are specified. For cases where there's a token but its alignment confidence falls below the threshold, a label is returned, but the start/end times are NA.

See Also

  • getMatches

  • getMatchAlignments

Examples

Run this code
if (FALSE) {
## Get all tokens of /I/
results <- getMatches(labbcat.url, list(segment="I")) |>
    appendOffsets("segment", target.offset=1, ## Get the segment following the token
        anchor.confidence.min=100) ## with alignment if it's been manually aligned
}

Run the code above in your browser using DataLab