Class SuggestionGroup
- java.lang.Object
-
- java.util.AbstractCollection<AnnotationSuggestion>
-
- de.tudarmstadt.ukp.inception.recommendation.api.model.SuggestionGroup
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<AnnotationSuggestion>
,java.util.Collection<AnnotationSuggestion>
public class SuggestionGroup extends java.util.AbstractCollection<AnnotationSuggestion> implements java.io.Serializable
Group of alternative suggestions generated by one or more recommenders. The group maintains an order of the alternative suggestions, by default using the confidence score.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SuggestionGroup.Delta
static class
SuggestionGroup.SuggestionGroupCollector
-
Constructor Summary
Constructors Constructor Description SuggestionGroup()
SuggestionGroup(AnnotationSuggestion... aItems)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(AnnotationSuggestion aSuggestion)
static SuggestionGroup.SuggestionGroupCollector
collector()
AnnotationSuggestion
get(int aIndex)
java.util.Map<java.lang.Long,java.util.List<SuggestionGroup.Delta>>
getAllDeltas()
Get the deltas of all candidates.java.lang.String
getDocumentName()
java.lang.String
getFeature()
long
getLayerId()
Offset
getOffset()
java.util.Map<java.lang.Long,SuggestionGroup.Delta>
getTopDeltas()
Get the top delta per recommender.static java.util.Collection<SuggestionGroup>
group(java.util.Collection<AnnotationSuggestion> aSuggestions)
boolean
isEmpty()
java.util.Iterator<AnnotationSuggestion>
iterator()
int
size()
java.util.stream.Stream<AnnotationSuggestion>
stream()
-
Methods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
SuggestionGroup
public SuggestionGroup()
-
SuggestionGroup
public SuggestionGroup(AnnotationSuggestion... aItems)
-
-
Method Detail
-
getFeature
public java.lang.String getFeature()
-
getLayerId
public long getLayerId()
-
getDocumentName
public java.lang.String getDocumentName()
-
getOffset
public Offset getOffset()
-
get
public AnnotationSuggestion get(int aIndex)
-
stream
public java.util.stream.Stream<AnnotationSuggestion> stream()
- Specified by:
stream
in interfacejava.util.Collection<AnnotationSuggestion>
-
getAllDeltas
public java.util.Map<java.lang.Long,java.util.List<SuggestionGroup.Delta>> getAllDeltas()
Get the deltas of all candidates. The deltas are calculated separately for each recommender if the group contains recommendations from multiple recommenders. That is necessary because the confidence scores of different recommenders are not necessarily on the same scale. Additionally, only suggestions that arevisible
are taken into consideration.
-
getTopDeltas
public java.util.Map<java.lang.Long,SuggestionGroup.Delta> getTopDeltas()
Get the top delta per recommender. The deltas are calculated separately for each recommender if the group contains recommendations from multiple recommenders. That is necessary because the confidence scores of different recommenders are not necessarily on the same scale. Additionally, only suggestions that arevisible
are taken into consideration.
-
add
public boolean add(AnnotationSuggestion aSuggestion)
- Specified by:
add
in interfacejava.util.Collection<AnnotationSuggestion>
- Overrides:
add
in classjava.util.AbstractCollection<AnnotationSuggestion>
-
iterator
public java.util.Iterator<AnnotationSuggestion> iterator()
- Specified by:
iterator
in interfacejava.util.Collection<AnnotationSuggestion>
- Specified by:
iterator
in interfacejava.lang.Iterable<AnnotationSuggestion>
- Specified by:
iterator
in classjava.util.AbstractCollection<AnnotationSuggestion>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<AnnotationSuggestion>
- Overrides:
isEmpty
in classjava.util.AbstractCollection<AnnotationSuggestion>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<AnnotationSuggestion>
- Specified by:
size
in classjava.util.AbstractCollection<AnnotationSuggestion>
-
collector
public static SuggestionGroup.SuggestionGroupCollector collector()
-
group
public static java.util.Collection<SuggestionGroup> group(java.util.Collection<AnnotationSuggestion> aSuggestions)
-
-