TaskContextNotFoundException using dkpro lab

14 views
Skip to first unread message

Pedro Santos

unread,
Oct 10, 2014, 1:55:54 PM10/10/14
to dkpro-l...@googlegroups.com
Hi,

I am trying to run a pipeline using dkpro lab 0.11 in groovy, and unfortunately I getting a TaskContextNotFoundException.
I extend a BatchTask, and initialize it by the following way:

       if ((experimentName == null) || (preprocessingPipeline == null))

        {
            throw new IllegalStateException(
                    "You must set Experiment Name, DataWriter and Preprocessing pipeline.");
        }

        // check the validity of the experiment setup first
        checkTask = new ValidityCheckTask();

        // preprocessing on training data
        preprocessTask = new PreprocessTask();
        preprocessTask.setPreprocessingPipeline(preprocessingPipeline);
        preprocessTask.setTesting(false);
        preprocessTask.setType(preprocessTask.getType() + "-" + experimentName);

        // get some meta data depending on the whole document collection that we need for training
        metaTask = new MetaInfoTask();
        metaTask.setType(metaTask.getType() + "-" + experimentName);
        metaTask.addImport(preprocessTask, PreprocessTask.OUTPUT_KEY_TRAIN,
                MetaInfoTask.INPUT_KEY);

        // feature extraction on training data
        featuresTask = new ExtractFeaturesTask();
        featuresTask.setType(featuresTask.getType() + "-" + experimentName);
        featuresTask.addImport(metaTask, MetaInfoTask.META_KEY);
        featuresTask.addImport(preprocessTask, PreprocessTask.OUTPUT_KEY_TRAIN,
                ExtractFeaturesTask.INPUT_KEY);

        // test task operating on the models of the feature extraction train and test tasks
        clusteringTask = new ClusteringTask();
        clusteringTask.setType(clusteringTask.getType() + "-" + experimentName);

        if (innerReports != null) {
            for (Class<? extends Report> report : innerReports) {
            clusteringTask.addReport(report);
            }
        }

        clusteringTask.addImport(featuresTask, ExtractFeaturesTask.OUTPUT_KEY,
                ClusteringTask.CLUSTERING_TASK_INPUT_KEY);

        // DKPro Lab issue 38: must be added as *first* task
        addTask(checkTask);
        addTask(preprocessTask);
        addTask(metaTask);
        addTask(featuresTask);
        addTask(clusteringTask);

However, even though the preprocessing task is executed without any error, looks like the tasks which should import it, metaTask and featuresTaks, cannot find it. This is the stackTrace of the exception thrown:


Exception in thread "main" de.tudarmstadt.ukp.dkpro.lab.storage.UnresolvedImportException: 
 -Unable to resolve import of task [de.tudarmstadt.ukp.dkpro.tc.core.task.MetaInfoTask-20NewsGroupsClustering-Groovy] pointing to [task-latest://de.tudarmstadt.ukp.dkpro.tc.core.task.PreprocessTask-20NewsGroupsClustering-Groovy/preprocessorOutputTrain]; nested exception is de.tudarmstadt.ukp.dkpro.lab.storage.TaskContextNotFoundException: Task [de.tudarmstadt.ukp.dkpro.tc.core.task.PreprocessTask-20NewsGroupsClustering-Groovy] has never been executed.
 -Unable to resolve import of task [de.tudarmstadt.ukp.dkpro.tc.core.task.ExtractFeaturesTask-20NewsGroupsClustering-Groovy] pointing to [task-latest://de.tudarmstadt.ukp.dkpro.tc.core.task.PreprocessTask-20NewsGroupsClustering-Groovy/preprocessorOutputTrain]; nested exception is de.tudarmstadt.ukp.dkpro.lab.storage.TaskContextNotFoundException: Task [de.tudarmstadt.ukp.dkpro.tc.core.task.PreprocessTask-20NewsGroupsClustering-Groovy] has never been executed.
 -Unable to resolve import of task [de.tudarmstadt.ukp.dkpro.tc.experiments.usefulcomments.tasks.ClusteringTask-20NewsGroupsClustering-Groovy] pointing to [task-latest://de.tudarmstadt.ukp.dkpro.tc.core.task.ExtractFeaturesTask-20NewsGroupsClustering-Groovy/output]; nested exception is de.tudarmstadt.ukp.dkpro.lab.storage.TaskContextNotFoundException: Task [de.tudarmstadt.ukp.dkpro.tc.core.task.ExtractFeaturesTask-20NewsGroupsClustering-Groovy] has never been executed.; nested exception is de.tudarmstadt.ukp.dkpro.lab.storage.UnresolvedImportException: Unable to resolve import of task [de.tudarmstadt.ukp.dkpro.tc.core.task.MetaInfoTask-20NewsGroupsClustering-Groovy] pointing to [task-latest://de.tudarmstadt.ukp.dkpro.tc.core.task.PreprocessTask-20NewsGroupsClustering-Groovy/preprocessorOutputTrain]; nested exception is de.tudarmstadt.ukp.dkpro.lab.storage.TaskContextNotFoundException: Task [de.tudarmstadt.ukp.dkpro.tc.core.task.PreprocessTask-20NewsGroupsClustering-Groovy] has never been executed.
at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask.executeConfiguration(BatchTask.java:282)
at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask.execute(BatchTask.java:185)
at de.tudarmstadt.ukp.dkpro.tc.experiments.usefulcomments.tasks.BatchTaskClustering.execute(BatchTaskClustering.java:78)
at de.tudarmstadt.ukp.dkpro.lab.engine.impl.ExecutableTaskEngine.run(ExecutableTaskEngine.java:55)
at de.tudarmstadt.ukp.dkpro.lab.engine.impl.DefaultTaskExecutionService.run(DefaultTaskExecutionService.java:48)
at de.tudarmstadt.ukp.dkpro.lab.Lab.run(Lab.java:97)
at de.tudarmstadt.ukp.dkpro.lab.Lab$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at de.tudarmstadt.ukp.dkpro.tc.experiments.usefulcomments.scripts.ClusteringPipeline.main(ClusteringPipeline.groovy:98)
Caused by: de.tudarmstadt.ukp.dkpro.lab.storage.UnresolvedImportException: Unable to resolve import of task [de.tudarmstadt.ukp.dkpro.tc.core.task.MetaInfoTask-20NewsGroupsClustering-Groovy] pointing to [task-latest://de.tudarmstadt.ukp.dkpro.tc.core.task.PreprocessTask-20NewsGroupsClustering-Groovy/preprocessorOutputTrain]; nested exception is de.tudarmstadt.ukp.dkpro.lab.storage.TaskContextNotFoundException: Task [de.tudarmstadt.ukp.dkpro.tc.core.task.PreprocessTask-20NewsGroupsClustering-Groovy] has never been executed.
at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask$ScopedTaskContext.resolve(BatchTask.java:549)
at de.tudarmstadt.ukp.dkpro.lab.engine.impl.DefaultTaskContextFactory.resolveImports(DefaultTaskContextFactory.java:142)
at de.tudarmstadt.ukp.dkpro.lab.engine.impl.DefaultTaskContextFactory.createContext(DefaultTaskContextFactory.java:98)
at de.tudarmstadt.ukp.dkpro.lab.uima.engine.simple.SimpleExecutionEngine.run(SimpleExecutionEngine.java:80)
at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask.runNewExecution(BatchTask.java:350)
at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask.executeConfiguration(BatchTask.java:255)
... 10 more
Caused by: de.tudarmstadt.ukp.dkpro.lab.storage.TaskContextNotFoundException: Task [de.tudarmstadt.ukp.dkpro.tc.core.task.PreprocessTask-20NewsGroupsClustering-Groovy] has never been executed.
at de.tudarmstadt.ukp.dkpro.lab.engine.impl.ImportUtil.createContextNotFoundException(ImportUtil.java:125)
at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask.getLatestExecution(BatchTask.java:327)
at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask.access$000(BatchTask.java:70)
at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask$ScopedTaskContext.resolve(BatchTask.java:546)
... 15 more


If someone has a clue, I would be glad to hear. I might be missing something really stupid here.

Regards,
Pedro

Reply all
Reply to author
Forward
0 new messages