diff --git a/inception-recommendation/src/main/java/de/tudarmstadt/ukp/inception/recommendation/render/RecommendationSpanRenderer.java b/inception-recommendation/src/main/java/de/tudarmstadt/ukp/inception/recommendation/render/RecommendationSpanRenderer.java index 1fb96725498..e75523a9761 100644 --- a/inception-recommendation/src/main/java/de/tudarmstadt/ukp/inception/recommendation/render/RecommendationSpanRenderer.java +++ b/inception-recommendation/src/main/java/de/tudarmstadt/ukp/inception/recommendation/render/RecommendationSpanRenderer.java @@ -44,6 +44,7 @@ import de.tudarmstadt.ukp.clarin.webanno.api.annotation.rendering.model.VRange; import de.tudarmstadt.ukp.clarin.webanno.api.annotation.rendering.model.VSpan; import de.tudarmstadt.ukp.clarin.webanno.api.annotation.util.TypeUtil; +import de.tudarmstadt.ukp.clarin.webanno.api.dao.CasMetadataUtils; import de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature; import de.tudarmstadt.ukp.clarin.webanno.model.AnnotationLayer; import de.tudarmstadt.ukp.inception.recommendation.api.LearningRecordService; @@ -99,7 +100,9 @@ public void render(CAS aCas, VDocument vdoc, AnnotatorState aState, } // TODO #176 use the document Id once it it available in the CAS - SuggestionDocumentGroup groups = model.getPredictions(getDocumentTitle(aCas), layer, + String sourceDocumentName = CasMetadataUtils.getSourceDocumentName(aCas) + .orElse(getDocumentTitle(aCas)); + SuggestionDocumentGroup groups = model.getPredictions(sourceDocumentName, layer, aWindowBeginOffset, aWindowEndOffset); // No recommendations to render for this layer diff --git a/inception-search-mtas/src/test/java/de/tudarmstadt/ukp/inception/search/index/mtas/MtasDocumentIndexTest.java b/inception-search-mtas/src/test/java/de/tudarmstadt/ukp/inception/search/index/mtas/MtasDocumentIndexTest.java index e69737052ab..6f312ad8ca6 100644 --- a/inception-search-mtas/src/test/java/de/tudarmstadt/ukp/inception/search/index/mtas/MtasDocumentIndexTest.java +++ b/inception-search-mtas/src/test/java/de/tudarmstadt/ukp/inception/search/index/mtas/MtasDocumentIndexTest.java @@ -598,7 +598,8 @@ public AnnotationSchemaService annotationSchemaService() @Bean public CasStorageService casStorageService() { - return new CasStorageServiceImpl(null, repositoryProperties(), backupProperties()); + return new CasStorageServiceImpl(null, null, repositoryProperties(), + backupProperties()); } @Bean