annotations.LexMetric package

Submodules

annotations.LexMetric.occrank module

filename

sppas.src.annotations.LexMetric.occrank.py

author

Brigitte Bigi

contact

develop@sppas.org

summary

Part the LexMetric automatic annotation for occurrences and ranks.

class annotations.LexMetric.occrank.OccRank(tier, alt=True)[source]

Bases: object

A class to estimate occurrences and ranks of items of a tier.

__init__(tier, alt=True)[source]

Create an instance of OccRank.

Parameters
  • tier – (sppasTier)

  • alt – (bool) Use alternative tags to estimate counts and rank

get_use_alt()[source]

Return True if alternative tags are used.

occ()[source]

Return a tier with occurrences of all labels.

Example

input: the | little | little | cat output: 1 | 2 | 2 | 1

rank()[source]

Return a tier with the rank of each label.

Example

input: the | little | little | cat output: 1 | 1 | 2 | 1

set_use_alt(value)[source]

Either alternative tags are used or not.

Parameters

value – (bool)

annotations.LexMetric.sppaslexmetric module

filename

sppas.src.annotations.LexMetric.sppaslexmetric.py

author

Brigitte Bigi

contact

develop@sppas.org

summary

SPPAS integration of the LexMetric automatic annotation.

class annotations.LexMetric.sppaslexmetric.sppasLexMetric(log=None)[source]

Bases: annotations.baseannot.sppasBaseAnnotation

SPPAS integration of the occ and rank estimator.

__init__(log=None)[source]

Create a new sppasLexMetric instance.

Parameters

log – (sppasLog) Human-readable logs.

fix_options(options)[source]

Fix all options.

Parameters

options – list of sppasOption instances

get_input_tier(input_files)[source]

Return the input tier from the inputs.

Parameters

input_files – (list)

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.

Parameters
  • input_files – (list of str) Time-aligned tokens, or other

  • output – (str) the output file name

Returns

(sppasTranscription)

set_alt(alt)[source]

Fix the alt option, used to estimate occ and rank.

Parameters

alt – (bool)

set_segments_separators(entry)[source]

Fix the separators to create segments.

Parameters

entry – (str) Entries separated by whitespace.

set_tiername(tier_name)[source]

Fix the tiername option.

Parameters

tier_name – (str)

tier_to_segment_occ(input_tier)[source]

Create segment intervals and eval the number of occurrences.

Parameters

input_tier – (sppasTier)

Returns

(sppasTier)

Module contents

filename

sppas.src.annotations.LexMetric.__init__.py

author

Brigitte Bigi

contact

develop@sppas.org

summary

Lexical metrics automatic annotation.