Skip to content

Commit

Permalink
Merge pull request #3970 from inception-project/refactoring/3969-Revi…
Browse files Browse the repository at this point in the history
…ew-and-improve-visibility-calculation-code

#3969 - Review and improve visibility calculation code
  • Loading branch information
reckart committed Apr 26, 2023
2 parents e38ad5c + a9c97f7 commit c080d5a
Show file tree
Hide file tree
Showing 41 changed files with 1,298 additions and 1,229 deletions.
2 changes: 1 addition & 1 deletion inception/inception-active-learning/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-support</artifactId>
</dependency>

<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-recommendation</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.Optional;

import de.tudarmstadt.ukp.clarin.webanno.model.AnnotationLayer;
import de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument;
import de.tudarmstadt.ukp.clarin.webanno.security.model.User;
import de.tudarmstadt.ukp.inception.active.learning.ActiveLearningServiceImpl.ActiveLearningUserState;
import de.tudarmstadt.ukp.inception.recommendation.api.model.LearningRecord;
Expand All @@ -34,14 +35,14 @@
public interface ActiveLearningService
{
/**
* @param aUser
* @param aDataOwner
* annotator user to get suggestions for
* @param aLayer
* layer to get suggestions for
* @return all suggestions for the given layer and user as a flat list (i.e. not grouped by
* documents, but grouped by alternatives).
*/
List<SuggestionGroup<SpanSuggestion>> getSuggestions(User aUser, AnnotationLayer aLayer);
List<SuggestionGroup<SpanSuggestion>> getSuggestions(User aDataOwner, AnnotationLayer aLayer);

/**
* @param aRecord
Expand All @@ -56,28 +57,27 @@ public interface ActiveLearningService
* @return if the are any records of type {@link LearningRecordType#SKIPPED} in the history of
* the given layer for the given user.
*
* @param aUser
* @param aDataOwner
* annotator user to check suggestions for
* @param aLayer
* layer to check suggestions for
*/
boolean hasSkippedSuggestions(User aUser, AnnotationLayer aLayer);
boolean hasSkippedSuggestions(String aSessionOwner, User aDataOwner, AnnotationLayer aLayer);

void hideRejectedOrSkippedAnnotations(User aUser, AnnotationLayer aLayer,
void hideRejectedOrSkippedAnnotations(String aSessionOwner, User aDataOwner, AnnotationLayer aLayer,
boolean aFilterSkippedRecommendation,
List<SuggestionGroup<SpanSuggestion>> aSuggestionGroups);

Optional<Delta<SpanSuggestion>> generateNextSuggestion(User aUser,
Optional<Delta<SpanSuggestion>> generateNextSuggestion(String aSessionOwner, User aDataOwner,
ActiveLearningUserState aAlState);

void writeLearningRecordInDatabaseAndEventLog(User aUser, AnnotationLayer aLayer,
SpanSuggestion aSuggestion, LearningRecordType aUserAction, String aAnnotationValue);

void acceptSpanSuggestion(User aUser, AnnotationLayer aLayer, SpanSuggestion aSuggestion,
void acceptSpanSuggestion(SourceDocument aDocument, User aDataOwner, SpanSuggestion aSuggestion,
Object aValue)
throws IOException, AnnotationException;

void rejectSpanSuggestion(User aUser, AnnotationLayer aLayer, SpanSuggestion aSuggestion);
void rejectSpanSuggestion(String aSessionOwner, User aDataOwner, AnnotationLayer aLayer,
SpanSuggestion aSuggestion);

void skipSpanSuggestion(User aUser, AnnotationLayer aLayer, SpanSuggestion aSuggestion);
void skipSpanSuggestion(String aSessionOwner, User aDataOwner, AnnotationLayer aLayer,
SpanSuggestion aSuggestion);
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ public class ActiveLearningRecommendationEvent

private final SourceDocument document;
private final SpanSuggestion currentRecommendation;
private final String user;
private final String dataOwner;
private final AnnotationLayer layer;
private final String annotationFeature;
private final LearningRecordType action;
private final List<? extends AnnotationSuggestion> allRecommendations;

public ActiveLearningRecommendationEvent(Object aSource, SourceDocument aDocument,
SpanSuggestion aCurrentRecommendation, String aUser, AnnotationLayer aLayer,
SpanSuggestion aCurrentRecommendation, String aDataOwner, AnnotationLayer aLayer,
String aAnnotationFeature, LearningRecordType aAction,
List<? extends AnnotationSuggestion> aAllRecommendations)
{
super(aSource);
document = aDocument;
currentRecommendation = aCurrentRecommendation;
user = aUser;
dataOwner = aDataOwner;
layer = aLayer;
annotationFeature = aAnnotationFeature;
action = aAction;
Expand All @@ -67,7 +67,7 @@ public SpanSuggestion getCurrentRecommendation()

public String getUser()
{
return user;
return dataOwner;
}

public AnnotationLayer getLayer()
Expand Down

0 comments on commit c080d5a

Please sign in to comment.