use of org.vitrivr.cineast.standalone.listener.RetrievalResultCSVExporter in project cineast by vitrivr.
the class RetrieveCommand method run.
public void run() {
final ContinuousRetrievalLogic retrieval = new ContinuousRetrievalLogic(Config.sharedConfig().getDatabase());
if (export) {
retrieval.addRetrievalResultListener(new RetrievalResultCSVExporter(Config.sharedConfig().getDatabase()));
}
QueryConfig qc = QueryConfig.newQueryConfigFromOther(new ConstrainedQueryConfig("cli-query", new ArrayList<>()));
if (relevantSegments != null && !relevantSegments.isEmpty()) {
String[] segments = relevantSegments.split(",");
for (String segment : segments) {
qc.addRelevantSegmentIds(segment);
}
}
qc.setMaxResults(Config.sharedConfig().getRetriever().getMaxResults());
qc.setResultsPerModule(Config.sharedConfig().getRetriever().getMaxResultsPerModule());
final List<SegmentScoreElement> results = retrieval.retrieve(this.segmentId, this.category, qc);
System.out.println("results:");
results.forEach(System.out::println);
System.out.println();
}
Aggregations