# mkdir runs/s1_samples # cp runs/l2/s1_samples.0.jsons runs/s1_samples/predictions.eval.jsons # cp runs/l2/data.eval.jsons runs/s1_samples/ # echo '{}' > runs/s1_samples/config.json # touch runs/s1_samples/scores.eval.jsons # python export_csv.py --run_dir runs/s1_samples --filtered true --source pragmatic import csv import os import StringIO import warnings from stanza.research import config from html_report import get_output parser = config.get_options_parser() parser.add_argument('--listener', type=config.boolean, default=False, help='If True, create a listener "clickedObj" csv file. Otherwise ' 'create a speaker "message" csv file.') parser.add_argument('--suffix', type=str, default='', help='Append this to the end of filenames (before the ".csv") when ' 'locating the Hawkins data.') parser.add_argument('--filtered', type=config.boolean, default=False, help='If True, look for the filteredCorpus csv file. --suffix should ' 'be empty.') parser.add_argument('--source', type=str, default='model', help='"Source" entry for filtered csv (as opposed to "human").') ID_COLUMNS = (0, 2) SPEAKER_MESSAGE_COLUMN = 4 FILTERED_MESSAGE_COLUMN = 4
import glob import json import Levenshtein as lev import numpy as np import os import warnings from collections import namedtuple from stanza.util.unicode import uprint from stanza.research import config parser = config.get_options_parser() parser.add_argument( '--max_examples', type=int, default=100, help='The maximum number of examples to display in error analysis.') parser.add_argument('--html', type=config.boolean, default=False, help='If true, output errors in HTML.') Output = namedtuple('Output', 'config,results,data,scores,predictions') COLORS = ['black', 'red', 'green', 'yellow', 'blue', 'purple', 'cyan', 'white'] HTML = [ 'Black', 'DarkRed', 'DarkGreen', 'Olive', 'Blue', 'Purple', 'DarkCyan', 'White' ]