use of com.sri.ai.praise.core.representation.classbased.modelscontainer.ModelPage in project aic-praise by aic-sri-international.
the class PRAiSECommandLineOptions method makeModelPageFromNonContainerFiles.
private ModelPage makeModelPageFromNonContainerFiles(List<File> nonContainerFiles) {
String unionModel = nonContainerFiles.stream().map(file -> Util.getFileContent(file)).collect(joining("\n"));
ModelPage modelPage = makeModelPage(unionModel);
return modelPage;
}
use of com.sri.ai.praise.core.representation.classbased.modelscontainer.ModelPage in project aic-praise by aic-sri-international.
the class PRAiSECommandLineOptions method collectModelPageFromNonContainerFilesIfAny.
private void collectModelPageFromNonContainerFilesIfAny() {
if (nonContainerFiles.size() > 0) {
ModelPage modelPage = makeModelPageFromNonContainerFiles(nonContainerFiles);
modelPages.add(modelPage);
}
}
use of com.sri.ai.praise.core.representation.classbased.modelscontainer.ModelPage in project aic-praise by aic-sri-international.
the class PRAiSECommandLineOptions method getLanguageFromPRAiSEFile.
private static ModelLanguage getLanguageFromPRAiSEFile(File praiseFile) {
List<ModelPage> modelPages = getModelPagesFromURI(praiseFile.toURI());
ModelLanguage modelLanguage = Util.getFirstNonNullResultOrNull(modelPages, m -> m.getLanguage());
return modelLanguage;
}
use of com.sri.ai.praise.core.representation.classbased.modelscontainer.ModelPage in project aic-praise by aic-sri-international.
the class Evaluation method makeBurnInProblem.
private Problem makeBurnInProblem() {
ModelPage burnInModel = evaluationConfiguration.getModelsContainer().getPages().get(0);
String burnInQuery = burnInModel.getDefaultQueriesToRun().get(0);
Problem problem = new Problem(evaluationConfiguration.getProblemType(), burnInQuery, burnInModel);
return problem;
}
use of com.sri.ai.praise.core.representation.classbased.modelscontainer.ModelPage in project aic-praise by aic-sri-international.
the class AbstractPerspective method newModel.
@Override
public void newModel(ExamplePages examples) {
newModel(() -> {
List<ModelPage> pages = examples.getPages();
Map<Integer, Supplier<ModelPageEditor>> newModelPageIdxs = new HashMap<>();
for (int i = 0; i < pages.size(); i++) {
ModelPage page = pages.get(i);
newModelPageIdxs.put(i, new ModelPageEditorSupplier(page.getModelString(), page.getDefaultQueriesToRun()));
}
return FXCollections.observableMap(newModelPageIdxs);
});
modelFile.set(null);
}
Aggregations