def display_data(raw_data_string, raw_data_id, model_folder, show_raw):
    """Print ``raw_data_id`` with the content ``raw_data_string`` after
       applying the preprocessing of ``model_folder`` to it."""
    print("## Raw Data (ID: %i)" % raw_data_id)
    print("```")
    print(raw_data_string)
    print("```")

    preprocessing_desc, feature_desc, _ = _get_system(model_folder)

    # Print model
    print("## Model")
    print("%s\n" % model_folder)

    # Get the preprocessing queue
    tmp = preprocessing_desc['queue']
    preprocessing_queue = preprocessing.get_preprocessing_queue(tmp)

    # Get feature values as list of floats, rounded to 3 decimal places
    tmp = feature_desc['features']
    feature_list = features.get_features(tmp)

    # Print preprocessing queue
    preprocessing.print_preprocessing_list(preprocessing_queue)
    features.print_featurelist(feature_list)

    # Get Handwriting
    recording = handwritten_data.HandwrittenData(raw_data_string,
                                                 raw_data_id=raw_data_id)
    if show_raw:
        recording.show()

    recording.preprocessing(preprocessing_queue)

    feature_values = recording.feature_extraction(feature_list)
    feature_values = [round(el, 3) for el in feature_values]
    print("Features:")
    print(feature_values)

    # Get the list of data multiplication algorithms
    mult_queue = data_multiplication.get_data_multiplication_queue(
        feature_desc['data-multiplication'])

    # Multiply traing_set
    training_set = [{'id': 42,
                     'formula_id': 42,
                     'formula_in_latex': 'None',
                     'handwriting': recording}]
    training_set = create_ffiles.training_set_multiplication(training_set,
                                                             mult_queue)

    # Display it
    logging.info("Show %i recordings...", len(training_set))
    for recording in training_set:
        recording['handwriting'].show()
def display_data ( raw_data_string , raw_data_id , model_folder , show_raw ) : print ( "## Raw Data (ID: %i)" % raw_data_id ) print ( "```" ) print ( raw_data_string ) print ( "```" ) preprocessing_desc , feature_desc , _ = _get_system ( model_folder ) print ( "## Model" ) print ( "%s\n" % model_folder ) tmp = preprocessing_desc [ 'queue' ] preprocessing_queue = preprocessing . get_preprocessing_queue ( tmp ) tmp = feature_desc [ 'features' ] feature_list = features . get_features ( tmp ) preprocessing . print_preprocessing_list ( preprocessing_queue ) features . print_featurelist ( feature_list ) recording = handwritten_data . HandwrittenData ( raw_data_string , raw_data_id = raw_data_id ) if show_raw : recording . show ( ) recording . preprocessing ( preprocessing_queue ) feature_values = recording . feature_extraction ( feature_list ) feature_values = [ round ( el , 3 ) for el in feature_values ] print ( "Features:" ) print ( feature_values ) mult_queue = data_multiplication . get_data_multiplication_queue ( feature_desc [ 'data-multiplication' ] ) training_set = [ { 'id' : 42 , 'formula_id' : 42 , 'formula_in_latex' : 'None' , 'handwriting' : recording } ] training_set = create_ffiles . training_set_multiplication ( training_set , mult_queue ) logging . info ( "Show %i recordings..." , len ( training_set ) ) for recording in training_set : recording [ 'handwriting' ] . show ( )
Print ``raw_data_id`` with the content ``raw_data_string`` after
       applying the preprocessing of ``model_folder`` to it.