state.getProject()); List<AnnotationSuggestion> allRecommendations = model.getPredictionsByTokenAndFeature( aCurrentRecommendation.getDocumentName(), alState.getLayer(), aCurrentRecommendation.getBegin(), aCurrentRecommendation.getEnd(),
state.getProject()); List<AnnotationSuggestion> allRecommendations = model.getPredictionsByTokenAndFeature( aCurrentRecommendation.getDocumentName(), alState.getLayer(), aCurrentRecommendation.getBegin(), aCurrentRecommendation.getEnd(),
.getPredictionsByTokenAndFeature(suggestion.getDocumentName(), alState.getLayer(), suggestion.getBegin(), suggestion.getEnd(), suggestion.getFeature());
.getPredictionsByTokenAndFeature(suggestion.getDocumentName(), alState.getLayer(), suggestion.getBegin(), suggestion.getEnd(), suggestion.getFeature());
rejectedRecommendation, annotatorState.getUser().getUsername(), eventState.getSelectedAnnotationLayer(), rejectedRecommendation.getFeature(), REJECTED, model.getPredictionsByTokenAndFeature( rejectedRecommendation.getDocumentName(), eventState.getSelectedAnnotationLayer(),
rejectedRecommendation, annotatorState.getUser().getUsername(), eventState.getSelectedAnnotationLayer(), rejectedRecommendation.getFeature(), REJECTED, model.getPredictionsByTokenAndFeature( rejectedRecommendation.getDocumentName(), eventState.getSelectedAnnotationLayer(),
acceptedSuggestion, state.getUser().getUsername(), eventState.getSelectedAnnotationLayer(), acceptedSuggestion.getFeature(), ACCEPTED, model.getPredictionsByTokenAndFeature( acceptedSuggestion.getDocumentName(), eventState.getSelectedAnnotationLayer(),
acceptedSuggestion, state.getUser().getUsername(), eventState.getSelectedAnnotationLayer(), acceptedSuggestion.getFeature(), ACCEPTED, model.getPredictionsByTokenAndFeature( acceptedSuggestion.getDocumentName(), eventState.getSelectedAnnotationLayer(),
.getPredictionsByTokenAndFeature(suggestion.getDocumentName(), alStateModel.getObject().getLayer(), suggestion.getBegin(), suggestion.getEnd(), feat.getName());
.getPredictionsByTokenAndFeature(suggestion.getDocumentName(), alStateModel.getObject().getLayer(), suggestion.getBegin(), suggestion.getEnd(), feat.getName());
private void writeLearningRecordInDatabaseAndEventLog(AnnotationSuggestion aSuggestion, LearningRecordType aUserAction, String aAnnotationValue) { AnnotatorState state = ActiveLearningSidebar.this.getModelObject(); ActiveLearningUserState alState = alStateModel.getObject(); AnnotationFeature feat = annotationService.getFeature(aSuggestion.getFeature(), alState.getLayer()); SourceDocument sourceDoc = documentService.getSourceDocument(state.getProject(), aSuggestion.getDocumentName()); // Log the action to the learning record learningRecordService.logRecord(sourceDoc, state.getUser().getUsername(), aSuggestion, aAnnotationValue, alState.getLayer(), feat, aUserAction, LearningRecordChangeLocation.AL_SIDEBAR); // Send an application event that the suggestion has been rejected List<AnnotationSuggestion> alternativeSuggestions = recommendationService .getPredictions(state.getUser(), state.getProject()) .getPredictionsByTokenAndFeature(aSuggestion.getDocumentName(), alState.getLayer(), aSuggestion.getBegin(), aSuggestion.getEnd(), aSuggestion.getFeature()); applicationEventPublisherHolder.get() .publishEvent(new ActiveLearningRecommendationEvent(this, sourceDoc, aSuggestion, state.getUser().getUsername(), alState.getLayer(), aSuggestion.getFeature(), aUserAction, alternativeSuggestions)); }
private void writeLearningRecordInDatabaseAndEventLog(AnnotationSuggestion aSuggestion, LearningRecordType aUserAction, String aAnnotationValue) { AnnotatorState state = ActiveLearningSidebar.this.getModelObject(); ActiveLearningUserState alState = alStateModel.getObject(); AnnotationFeature feat = annotationService.getFeature(aSuggestion.getFeature(), alState.getLayer()); SourceDocument sourceDoc = documentService.getSourceDocument(state.getProject(), aSuggestion.getDocumentName()); // Log the action to the learning record learningRecordService.logRecord(sourceDoc, state.getUser().getUsername(), aSuggestion, aAnnotationValue, alState.getLayer(), feat, aUserAction, LearningRecordChangeLocation.AL_SIDEBAR); // Send an application event that the suggestion has been rejected List<AnnotationSuggestion> alternativeSuggestions = recommendationService .getPredictions(state.getUser(), state.getProject()) .getPredictionsByTokenAndFeature(aSuggestion.getDocumentName(), alState.getLayer(), aSuggestion.getBegin(), aSuggestion.getEnd(), aSuggestion.getFeature()); applicationEventPublisherHolder.get() .publishEvent(new ActiveLearningRecommendationEvent(this, sourceDoc, aSuggestion, state.getUser().getUsername(), alState.getLayer(), aSuggestion.getFeature(), aUserAction, alternativeSuggestions)); }