Utility functions that can be used in multiple scripts.
Let the user choose a raw dataset. Return the absolute path.
Get the classification as a list of tuples. The first value is the LaTeX code, the second value is the probability.
Replace logreg layer by sigmoid to get probabilities.
Create a HDF5 feature files.
Parameters: | output_filename : string
feature_count : int
data : list of tuples
|
---|
Create a project configuration file which contains a configuration that might make sense.
Create a ‘run.log’ within folder. This file contains the time of the latest successful run.
Get a path for a default value for the model. Start searching in the current directory.
Evaluate model for a single recording.
Evaluate a model for a single recording.
Parameters: | model_file : string
recording :
|
---|
Evaluate a model for a single recording where possibly multiple symbols are.
Parameters: | model_file : string
recording :
|
---|
Evaluate a model for a single recording, after everything has been loaded.
Parameters: | preprocessing_queue : list
feature_list : list
model : dict
output_semantics : list
recording : string in JSON format
|
---|
Evaluate a model for a single recording, after everything has been loaded. Multiple symbols are recognized.
Parameters: | preprocessing_queue : list
feature_list : list
model : dict
output_semantics :
recording :
|
---|
Get the class by its name as a string.
Get the absolute path to the database configuration file.
Get database configuration as dictionary.
Get a dictionary that maps indices to a list of (1) the id in the hwrt symbol database (2) the latex command (3) the unicode code point (4) a font family and (5) a font style.
Parameters: | model_description : string
|
---|---|
Returns: | dictionary
|
Notes
This command need a database connection.
Get a dictionary that maps indices to LaTeX commands.
Parameters: | model_description : string
|
---|---|
Returns: | dictionary :
|
Get the absolute path of a subfolder that comes last with natural sorting in the given folder.
Get the file that comes last with natural sorting in folder and has file ending ‘ending’.
Get the latest model (determined by the name of the model in natural sorted order) which begins with basename.
Get the latest successful run timestamp.
Get the latest working model. Delete all others that get touched.
Get the project root folder as a string.
Take a description and return a list of classes.
Parameters: | description : list of dictionaries
|
---|---|
Returns: | List of objects. |
Get from the server.
Parameters: | n : int
|
---|
Get project configuration as dictionary.
Get the project root folder as a string.
Format the time to a readable format.
Parameters: | t : int
|
---|---|
Returns: | string
|
Get a list of folders [preprocessed, feature-files, model].
Get path to the folder where th HTML templates are.
A function that works for both, Python 2.x and Python 3.x. It asks the user for input and returns it as a string.
A function that works for both, Python 2.x and Python 3.x. It asks the user for input and returns it as a string.
Check if arg is a valid file that already exists on the file system.
Check if arg is a valid file that already exists on the file system.
Get number of symbols in list l which have a value less than n.
Parameters: | l : list of numbers n : int |
---|---|
Returns: | float :
|
Load a model by its file. This includes the model itself, but also the preprocessing queue, the feature list and the output semantics.
Show how much work was done / how much work is remaining.
Parameters: | total : float
current : float
start_time : int
|
---|
Ask a yes/no question via raw_input() and return their answer.
“question” is a string that is presented to the user. “default” is the presumed answer if the user just hits <Enter>.
It must be “yes” (the default), “no” or None (meaning an answer is required of the user).
The “answer” return value is one of “yes” or “no”.
Parameters: | split : String of 0s and 1s
recording : list
|
---|
Takes the a filesize in bytes and returns a nicely formatted string.