use of org.vitrivr.cineast.standalone.util.ContinuousRetrievalLogic in project cineast by vitrivr.
the class TextRetrievalCommand method run.
public void run() {
final ContinuousRetrievalLogic retrieval = new ContinuousRetrievalLogic(Config.sharedConfig().getDatabase());
System.out.println("Querying for text " + text);
TextQueryTermContainer qc = new TextQueryTermContainer(text);
List<Retriever> retrievers = new ArrayList<>();
retrievers.add(new SubtitleFulltextSearch());
retrievers.add(new OCRSearch());
retrievers.add(new AudioTranscriptionSearch());
retrievers.add(new DescriptionTextSearch());
retrievers.add(new TagsFtSearch());
CliUtils.retrieveAndLog(retrievers, retrieval, limit, printDetail, qc);
System.out.println("Done");
}
use of org.vitrivr.cineast.standalone.util.ContinuousRetrievalLogic 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();
}
use of org.vitrivr.cineast.standalone.util.ContinuousRetrievalLogic in project cineast by vitrivr.
the class TagRetrievalCommand method run.
public void run() {
final ContinuousRetrievalLogic retrieval = new ContinuousRetrievalLogic(Config.sharedConfig().getDatabase());
TagQueryTermContainer qc = new TagQueryTermContainer(data);
List<Retriever> retrievers = new ArrayList<>();
retrievers.add(new SegmentTags());
CliUtils.retrieveAndLog(retrievers, retrieval, limit, printDetail, qc);
System.out.println("Done");
}
Aggregations