use of org.dkpro.lab.task.Dimension in project dkpro-lab by dkpro.
the class BatchTaskTest method testNested.
@Test
public void testNested() throws Exception {
Dimension innerDim = Dimension.create("inner", "1", "2", "3");
ParameterSpace innerPSpace = new ParameterSpace(innerDim);
DefaultBatchTask innerTask = new DefaultBatchTask() {
@Override
public void setConfiguration(Map<String, Object> aConfig) {
super.setConfiguration(aConfig);
System.out.printf("A %10d %s %s%n", this.hashCode(), getType(), aConfig);
}
};
innerTask.setParameterSpace(innerPSpace);
innerTask.addTask(new ConfigDumperTask1());
Dimension outerDim = Dimension.create("outer", "1", "2", "3");
ParameterSpace outerPSpace = new ParameterSpace(outerDim);
DefaultBatchTask outerTask = new DefaultBatchTask() {
@Override
public void setConfiguration(Map<String, Object> aConfig) {
super.setConfiguration(aConfig);
System.out.printf("B %10d %s %s%n", this.hashCode(), getType(), aConfig);
}
};
outerTask.setParameterSpace(outerPSpace);
outerTask.addTask(innerTask);
outerTask.addTask(new ConfigDumperTask2());
Lab.getInstance().run(outerTask);
}
use of org.dkpro.lab.task.Dimension in project dkpro-tc by dkpro.
the class ExperimentBuilder method build.
/**
* Wires all provided information into a parameter space object that can be provided to an
* experiment
*
* @return the parameter space filled with the provided information
*/
public ParameterSpace build() {
List<Dimension<?>> dimensions = new ArrayList<>();
dimensions.add(getAsDimensionMachineLearningAdapter());
dimensions.add(getAsDimensionFeatureMode());
dimensions.add(getAsDimensionLearningMode());
dimensions.add(getAsDimensionFeatureSets());
dimensions.add(getAsDimensionReaders());
ParameterSpace ps = new ParameterSpace();
ps.setDimensions(dimensions.toArray(new Dimension<?>[0]));
return ps;
}
use of org.dkpro.lab.task.Dimension in project dkpro-tc by dkpro.
the class Experiment_ImplBase method addConversionServiceEntries.
private void addConversionServiceEntries(TaskContext aContext) {
ParameterSpace pSpace = getParameterSpace();
Dimension<?>[] dimensions = pSpace.getDimensions();
for (Dimension<?> d : dimensions) {
if (d.getName().equals(Constants.DIM_READERS)) {
addConversionForCollectionReader(aContext, d);
}
}
}
Aggregations