Search in sources :

Example 1 with ContinuousRetrievalLogic

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");
}
Also used : Retriever(org.vitrivr.cineast.core.features.retriever.Retriever) SubtitleFulltextSearch(org.vitrivr.cineast.core.features.SubtitleFulltextSearch) AudioTranscriptionSearch(org.vitrivr.cineast.core.features.AudioTranscriptionSearch) ContinuousRetrievalLogic(org.vitrivr.cineast.standalone.util.ContinuousRetrievalLogic) DescriptionTextSearch(org.vitrivr.cineast.core.features.DescriptionTextSearch) ArrayList(java.util.ArrayList) TextQueryTermContainer(org.vitrivr.cineast.core.data.query.containers.TextQueryTermContainer) OCRSearch(org.vitrivr.cineast.core.features.OCRSearch) TagsFtSearch(org.vitrivr.cineast.core.features.TagsFtSearch)

Example 2 with ContinuousRetrievalLogic

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();
}
Also used : ConstrainedQueryConfig(org.vitrivr.cineast.standalone.config.ConstrainedQueryConfig) QueryConfig(org.vitrivr.cineast.core.config.QueryConfig) ConstrainedQueryConfig(org.vitrivr.cineast.standalone.config.ConstrainedQueryConfig) SegmentScoreElement(org.vitrivr.cineast.core.data.score.SegmentScoreElement) ContinuousRetrievalLogic(org.vitrivr.cineast.standalone.util.ContinuousRetrievalLogic) ArrayList(java.util.ArrayList) RetrievalResultCSVExporter(org.vitrivr.cineast.standalone.listener.RetrievalResultCSVExporter)

Example 3 with ContinuousRetrievalLogic

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");
}
Also used : SegmentTags(org.vitrivr.cineast.core.features.SegmentTags) TagQueryTermContainer(org.vitrivr.cineast.core.data.query.containers.TagQueryTermContainer) Retriever(org.vitrivr.cineast.core.features.retriever.Retriever) ContinuousRetrievalLogic(org.vitrivr.cineast.standalone.util.ContinuousRetrievalLogic) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)3 ContinuousRetrievalLogic (org.vitrivr.cineast.standalone.util.ContinuousRetrievalLogic)3 Retriever (org.vitrivr.cineast.core.features.retriever.Retriever)2 QueryConfig (org.vitrivr.cineast.core.config.QueryConfig)1 TagQueryTermContainer (org.vitrivr.cineast.core.data.query.containers.TagQueryTermContainer)1 TextQueryTermContainer (org.vitrivr.cineast.core.data.query.containers.TextQueryTermContainer)1 SegmentScoreElement (org.vitrivr.cineast.core.data.score.SegmentScoreElement)1 AudioTranscriptionSearch (org.vitrivr.cineast.core.features.AudioTranscriptionSearch)1 DescriptionTextSearch (org.vitrivr.cineast.core.features.DescriptionTextSearch)1 OCRSearch (org.vitrivr.cineast.core.features.OCRSearch)1 SegmentTags (org.vitrivr.cineast.core.features.SegmentTags)1 SubtitleFulltextSearch (org.vitrivr.cineast.core.features.SubtitleFulltextSearch)1 TagsFtSearch (org.vitrivr.cineast.core.features.TagsFtSearch)1 ConstrainedQueryConfig (org.vitrivr.cineast.standalone.config.ConstrainedQueryConfig)1 RetrievalResultCSVExporter (org.vitrivr.cineast.standalone.listener.RetrievalResultCSVExporter)1