annotations.ReOccurrences package

Submodules

annotations.ReOccurrences.reoccset module

filename

sppas.src.annotations.ReOccurrences.reoccset.py

author

Brigitte Bigi

contact

develop@sppas.org

summary

data structure for a set of re-occurrences.

class annotations.ReOccurrences.reoccset.sppasAnnReOccSet[source]

Bases: sppas.src.structs.basefset.sppasBaseSet

Manager for a set of re-occurrences annotations.

A sppasAnnReOccSet() manages a dictionary with:

  • key: an annotation

  • value: a list of re-occurring annotations

__init__()[source]

Create a sppasAnnReOccSet instance.

copy()[source]

Make a deep copy of self.

Overridden to return a sppasAnnSet() instead of a sppasBaseSet().

to_tier()[source]

Create tiers from the data set.

Returns

(List of sppasTier)

annotations.ReOccurrences.reoccurrences module

filename

sppas.src.annotations.ReOccurrences.reoccurrences.py

author

Brigitte Bigi

contact

develop@sppas.org

summary

Re-Occurrences detection.

class annotations.ReOccurrences.reoccurrences.ReOccurences[source]

Bases: object

Manager for a set of re-occurrences annotations.

__init__()[source]
static compare_labels(label1, label2)[source]

Compare two labels.

Parameters
  • label1 – (sppasLabel)

  • label2 – (sppasLabel)

Returns

(bool) Number of tags they have in common

static eval(ann1, anns2)[source]

Return the list of re-occurrences.

An annotation in anns2 is matching ann1 if all labels of ann1 are in ann2. It is not one-to-one: some labels of ann2 could not match those of ann1.

Parameters
  • ann1 – (sppasAnnotation)

  • anns2 – (list of sppasAnnotation)

Returns

(list of sppasAnnotation)

annotations.ReOccurrences.sppasreocc module

filename

sppas.src.annotations.ReOccurrences.sppasreocc.py

author

Brigitte Bigi

contact

develop@sppas.org

summary

SPPAS integration of ReOccurrences automatic annotation

class annotations.ReOccurrences.sppasreocc.sppasReOcc(log=None)[source]

Bases: annotations.baseannot.sppasBaseAnnotation

SPPAS integration of the automatic re-occurrences annotation.

__init__(log=None)[source]

Create a new sppasReOcc instance with only the general rules.

Parameters

log – (sppasLog) Human-readable logs.

detection(tier_spk1, tier_spk2)[source]

Search for the re-occurrences of annotations.

Parameters
  • tier_spk1 – (sppasTier)

  • tier_spk2 – (sppasTier)

fix_options(options)[source]

Fix all options.

Available options are:

Parameters

options – (sppasOption)

get_inputs(input_files)[source]

Return 2 tiers with name given in options.

Parameters

input_files – (list)

Raise

NoTierInputError

Returns

(sppasTier)

get_output_pattern()[source]

Pattern this annotation uses in an output filename.

run(input_files, output=None)[source]

Run the automatic annotation process on an input.

Input file is a tuple with 2 files: the main speaker and the echoing speaker.

Parameters
  • input_files – (list of list of str) Time-aligned items, Time-aligned items

  • output – (str) the output name

Returns

(sppasTranscription)

set_span(span)[source]

Fix the span option.

Span is the maximum number of annotations to search for re-occ. A value of 1 means to search only in the next annotation.

Parameters

span – (int) Value between 1 and 20

set_tiername(tier_name)[source]

Fix the tiername option.

Parameters

tier_name – (str)

Module contents

filename

sppas.src.annotations.ReOccurrences.__init__.py

author

Brigitte Bigi

contact

develop@sppas.org

summary

Re-Occurrences detection.

This annotation is searching for re-occurrences of an annotation of a speaker in the next N annotations of the interlocutor. It was originally used on annotation gestures in (M. Karpinski et al. 2018):

Maciej Karpinski, Katarzyna Klessa
Methods, Tools and Techniques for Multimodal Analysis of
Accommodation in Intercultural Communication
CMST 24(1) 29–41 (2018), DOI:10.12921/cmst.2018.0000006
class annotations.ReOccurrences.ReOccurences[source]

Bases: object

Manager for a set of re-occurrences annotations.

__init__()[source]
static compare_labels(label1, label2)[source]

Compare two labels.

Parameters
  • label1 – (sppasLabel)

  • label2 – (sppasLabel)

Returns

(bool) Number of tags they have in common

static eval(ann1, anns2)[source]

Return the list of re-occurrences.

An annotation in anns2 is matching ann1 if all labels of ann1 are in ann2. It is not one-to-one: some labels of ann2 could not match those of ann1.

Parameters
  • ann1 – (sppasAnnotation)

  • anns2 – (list of sppasAnnotation)

Returns

(list of sppasAnnotation)

class annotations.ReOccurrences.sppasReOcc(log=None)[source]

Bases: annotations.baseannot.sppasBaseAnnotation

SPPAS integration of the automatic re-occurrences annotation.

__init__(log=None)[source]

Create a new sppasReOcc instance with only the general rules.

Parameters

log – (sppasLog) Human-readable logs.

detection(tier_spk1, tier_spk2)[source]

Search for the re-occurrences of annotations.

Parameters
  • tier_spk1 – (sppasTier)

  • tier_spk2 – (sppasTier)

fix_options(options)[source]

Fix all options.

Available options are:

Parameters

options – (sppasOption)

get_inputs(input_files)[source]

Return 2 tiers with name given in options.

Parameters

input_files – (list)

Raise

NoTierInputError

Returns

(sppasTier)

get_output_pattern()[source]

Pattern this annotation uses in an output filename.

run(input_files, output=None)[source]

Run the automatic annotation process on an input.

Input file is a tuple with 2 files: the main speaker and the echoing speaker.

Parameters
  • input_files – (list of list of str) Time-aligned items, Time-aligned items

  • output – (str) the output name

Returns

(sppasTranscription)

set_span(span)[source]

Fix the span option.

Span is the maximum number of annotations to search for re-occ. A value of 1 means to search only in the next annotation.

Parameters

span – (int) Value between 1 and 20

set_tiername(tier_name)[source]

Fix the tiername option.

Parameters

tier_name – (str)