예제 #1
0
                    data['questionIdict'],
                    data['ansIdict'],
                    urlDict,
                    topK=params['topK'],
                    modelOutputs=modelOutputs,
                    modelNames=ir.getModelNames(params['models']),
                    questionIds=idx)
        for i, page in enumerate(pages):
            with open(os.path.join(params['outputFolder'],
                '%s-%d.html' % (params['outputFilename'], i)), 'w') as f:
                f.write(page)
    elif params['format'] == 'latex':
        # For LaTeX only, replace underscore in vocabulary.
        data['questionIdict'] = ir.escapeLatexIdict(data['questionIdict'])
        data['ansIdict'] = ir.escapeLatexIdict(data['ansIdict'])
        ir.renderLatex(
                inputTest,
                targetTest,
                data['questionIdict'],
                data['ansIdict'],
                urlDict, 
                topK=params['topK'],
                outputFolder=params['outputFolder'],
                pictureFolder=params['pictureFolder'],
                comments=None,
                caption=caption,
                modelOutputs=modelOutputs,
                modelNames=ir.getModelNames(params['models']),
                questionIds=idx,
                filename=params['outputFilename']+'.tex')