Package jazzparser :: Package taggers :: Package candc :: Module utils
[hide private]
[frames] | no frames]

Module utils

source code

Some basic utilities used by the C&C tagger interface.


Author: Mark Granroth-Wilding <mark.granroth-wilding@ed.ac.uk>

Functions [hide private]
 
untag_sequence_data(sequence)
Given a line read in from a file containing C&C-style tagged data, returns a version of the line with the tags stripped off, leaving just the chord sequence.
source code
 
tags_from_sequence_data(sequence) source code
 
training_sequence_to_candc(sequence)
Given a line of data in the format we use for training data, converts it to a format suitable for direct input to the C&C training tool.
source code
 
training_data_to_candc(lines)
Performs the same as training_sequence_to_candc, but on a whole data set (list of sequences).
source code
 
_sequence_to_candc_format(formatter, sequence)
Produces a string representation of observations to be used as training data for a C&C model from a chord sequence internal model.
source code
 
_type_format(type, mapping) source code
 
sequence_to_candc_pos(sequence, type_map=None) source code
 
sequence_to_candc_chord_super(sequence, type_map=None) source code
 
sequence_to_candc_super(sequence, type_map=None) source code
 
sequence_index_to_candc_chord_super(si, *args, **kwargs)
Given a SequenceIndex object containing sequence data, produces C&C training data as a single string.
source code
 
sequence_list_to_candc_chord_super(sequences, *args, **kwarg)
Given a list of sequences, produces C&C training data as a single string.
source code
 
sequence_index_to_training_file(si, type_map=None)
Given a SequenceIndex object, returns an open temporary file containing all the data in our hybrid C&C training data format.
source code
 
sequence_list_to_training_file(seqs, type_map=None)
Given a list of sequences, returns an open temporary file containing all the data in our hybrid C&C training data format.
source code
 
generate_tag_list(filename, grammar=None)
Generates a list of possible tags to be stored along with a C&C model.
source code
 
read_tag_list(filename)
Reads in a tag list generated by generate_tag_list.
source code
Variables [hide private]
  __package__ = None
hash(x)
Function Details [hide private]

training_sequence_to_candc(sequence)

source code 

Given a line of data in the format we use for training data, converts it to a format suitable for direct input to the C&C training tool.

Precisely, it removes the first X| from the start of each observation, which in the data format we use is the chord itself.

_sequence_to_candc_format(formatter, sequence)

source code 

Produces a string representation of observations to be used as training data for a C&C model from a chord sequence internal model. This is an inner function for the various different formats of C&C data we use.

sequence_index_to_training_file(si, type_map=None)

source code 

Given a SequenceIndex object, returns an open temporary file containing all the data in our hybrid C&C training data format. This is converted (rather trivially) by the train_model function into C&C's required format.

sequence_list_to_training_file(seqs, type_map=None)

source code 

Given a list of sequences, returns an open temporary file containing all the data in our hybrid C&C training data format. This is converted (rather trivially) by the train_model function into C&C's required format.

generate_tag_list(filename, grammar=None)

source code 

Generates a list of possible tags to be stored along with a C&C model. It contains all tags that are in the grammar.