Tabnine Logo
AnnotationSuggestion.getLabel
Code IndexAdd Tabnine to your IDE (free)

How to use
getLabel
method
in
de.tudarmstadt.ukp.inception.recommendation.api.model.AnnotationSuggestion

Best Java code snippets using de.tudarmstadt.ukp.inception.recommendation.api.model.AnnotationSuggestion.getLabel (Showing top 20 results out of 315)

origin: inception-project/inception

private void writeLearningRecordInDatabaseAndEventLog(
    AnnotationSuggestion aCurrentRecommendation, LearningRecordType aUserAction)
{
  writeLearningRecordInDatabaseAndEventLog(aCurrentRecommendation, aUserAction,
      aCurrentRecommendation.getLabel());
}
origin: de.tudarmstadt.ukp.inception.app/inception-active-learning

private void writeLearningRecordInDatabaseAndEventLog(
    AnnotationSuggestion aCurrentRecommendation, LearningRecordType aUserAction)
{
  writeLearningRecordInDatabaseAndEventLog(aCurrentRecommendation, aUserAction,
      aCurrentRecommendation.getLabel());
}
origin: inception-project/inception

/**
 * Returns the prediction used to generate the VID
 */
public Optional<AnnotationSuggestion> getPrediction(SourceDocument aDocument, int aBegin,
    int aEnd, String aLabel)
{
  return predictions.values().stream()
      .filter(f -> f.getDocumentName().equals(aDocument.getName()))
      .filter(f -> f.getBegin() == aBegin && f.getEnd() == aEnd)
      .filter(f -> f.getLabel().equals(aLabel))
      .max(Comparator.comparingInt(AnnotationSuggestion::getId));
}

origin: de.tudarmstadt.ukp.inception.app/inception-active-learning

private static boolean isAlreadyInCleanList(SuggestionGroup cleanRecommendationList,
  AnnotationSuggestion recommendationItem)
{
  String source = recommendationItem.getRecommenderName();
  String annotation = recommendationItem.getLabel();
  String documentName = recommendationItem.getDocumentName();
  
  for (AnnotationSuggestion existingRecommendation : cleanRecommendationList) {
    if (
        existingRecommendation.getRecommenderName().equals(source) &&
        existingRecommendation.getLabel().equals(annotation) &&
        existingRecommendation.getDocumentName().equals(documentName)
    ) {
      return true;
    }
  }
  return false;
}
origin: inception-project/inception

private static boolean isAlreadyInCleanList(SuggestionGroup cleanRecommendationList,
  AnnotationSuggestion recommendationItem)
{
  String source = recommendationItem.getRecommenderName();
  String annotation = recommendationItem.getLabel();
  String documentName = recommendationItem.getDocumentName();
  
  for (AnnotationSuggestion existingRecommendation : cleanRecommendationList) {
    if (
        existingRecommendation.getRecommenderName().equals(source) &&
        existingRecommendation.getLabel().equals(annotation) &&
        existingRecommendation.getDocumentName().equals(documentName)
    ) {
      return true;
    }
  }
  return false;
}
origin: de.tudarmstadt.ukp.inception.app/inception-active-learning

private List<AnnotationSuggestion> getMatchingSuggestion(List<SuggestionGroup> aSuggestions,
    String aDocumentName, long aLayerId, String aFeature, int aBegin, int aEnd,
    String aLabel)
{
  return aSuggestions.stream()
      .filter(group -> 
          aDocumentName.equals(group.getDocumentName()) &&
          aLayerId == group.getLayerId() &&
          (aFeature == null || aFeature == group.getFeature()) &&
          (aBegin == -1 || aBegin == group.getOffset().getBegin()) &&
          (aEnd == -1 || aEnd == group.getOffset().getEnd()))
      .flatMap(group -> group.stream())
      .filter(suggestion ->
          aLabel == null || aLabel.equals(suggestion.getLabel()))
      .collect(toList());
}
origin: inception-project/inception

private List<AnnotationSuggestion> getMatchingSuggestion(List<SuggestionGroup> aSuggestions,
    String aDocumentName, long aLayerId, String aFeature, int aBegin, int aEnd,
    String aLabel)
{
  return aSuggestions.stream()
      .filter(group -> 
          aDocumentName.equals(group.getDocumentName()) &&
          aLayerId == group.getLayerId() &&
          (aFeature == null || aFeature == group.getFeature()) &&
          (aBegin == -1 || aBegin == group.getOffset().getBegin()) &&
          (aEnd == -1 || aEnd == group.getOffset().getEnd()))
      .flatMap(group -> group.stream())
      .filter(suggestion ->
          aLabel == null || aLabel.equals(suggestion.getLabel()))
      .collect(toList());
}
origin: inception-project/inception

/**
 * 
 * @param aLayerId
 * @param aPredictions - list of sentences containing recommendations
 */
public void putPredictions(long aLayerId, List<AnnotationSuggestion> aPredictions)
{
  aPredictions.forEach(prediction -> {
    if (prediction.getLabel() != null) {
      predictions.put(new ExtendedId(user.getUsername(), project.getId(),
          prediction.getDocumentName(), aLayerId, prediction.getOffset(),
          prediction.getRecommenderId(), prediction.getId(), -1), prediction);
    }
  });
}
origin: inception-project/inception

private String formatLabel(AnnotationSuggestion aCurrentRecommendation)
{
  AnnotationFeature feat = annotationService.getFeature(aCurrentRecommendation.getFeature(),
      alStateModel.getObject().getLayer());
  FeatureSupport<?> featureSupport = featureSupportRegistry.getFeatureSupport(feat);
  String labelValue = featureSupport.renderFeatureValue(feat,
      aCurrentRecommendation.getLabel());
  return labelValue;
}
origin: de.tudarmstadt.ukp.inception.app/inception-active-learning

private String formatLabel(AnnotationSuggestion aCurrentRecommendation)
{
  AnnotationFeature feat = annotationService.getFeature(aCurrentRecommendation.getFeature(),
      alStateModel.getObject().getLayer());
  FeatureSupport<?> featureSupport = featureSupportRegistry.getFeatureSupport(feat);
  String labelValue = featureSupport.renderFeatureValue(feat,
      aCurrentRecommendation.getLabel());
  return labelValue;
}
origin: de.tudarmstadt.ukp.inception.app/inception-active-learning

private List<AnnotationSuggestion> getMatchingSuggestion(List<SuggestionGroup> aSuggestions,
    AnnotationSuggestion aSuggestion)
{
  return getMatchingSuggestion(aSuggestions, aSuggestion.getDocumentName(),
      aSuggestion.getLayerId(), aSuggestion.getFeature(), aSuggestion.getBegin(),
      aSuggestion.getEnd(), aSuggestion.getLabel());
}
origin: inception-project/inception

if (aSuggestion.getLabel() == null) {
  aSuggestion.hide(FLAG_NO_LABEL);
  return;
  if (record.getOffsetCharacterBegin() == aSuggestion.getBegin()
      && record.getOffsetCharacterEnd() == aSuggestion.getEnd()
      && record.getAnnotation().equals(aSuggestion.getLabel()))
origin: inception-project/inception

private List<AnnotationSuggestion> getMatchingSuggestion(List<SuggestionGroup> aSuggestions,
    AnnotationSuggestion aSuggestion)
{
  return getMatchingSuggestion(aSuggestions, aSuggestion.getDocumentName(),
      aSuggestion.getLayerId(), aSuggestion.getFeature(), aSuggestion.getBegin(),
      aSuggestion.getEnd(), aSuggestion.getLabel());
}
origin: inception-project/inception

@Override
public String getDetails(ActiveLearningSuggestionOfferedEvent aEvent)
{
  try {
    Details details = new Details();
    details.ann = new AnnotationDetails();
    details.ann.setBegin(aEvent.getCurrentRecommendation().getBegin());
    details.ann.setEnd(aEvent.getCurrentRecommendation().getEnd());
    details.ann.setText(aEvent.getCurrentRecommendation().getCoveredText());
    details.ann.setType(aEvent.getLayer().getName());
    details.annotationFeature = aEvent.getAnnotationFeature();
    details.currentLabel = aEvent.getCurrentRecommendation().getLabel();
    details.confidence = aEvent.getCurrentRecommendation().getConfidence();
    details.recommenderId = aEvent.getCurrentRecommendation().getRecommenderId();
    List<String> allLabelList = aEvent.getAllRecommendations().stream()
      .map(ao -> ao.getLabel()).collect(Collectors.toList());
    details.allLabels = String.join(", ", allLabelList);
    return JSONUtil.toJsonString(details);
  }
  catch (IOException e) {
    log.error("Unable to log event [{}]", aEvent, e);
    return "<ERROR>";
  }
}
origin: de.tudarmstadt.ukp.inception.app/inception-active-learning

@Override
public String getDetails(ActiveLearningSuggestionOfferedEvent aEvent)
{
  try {
    Details details = new Details();
    details.ann = new AnnotationDetails();
    details.ann.setBegin(aEvent.getCurrentRecommendation().getBegin());
    details.ann.setEnd(aEvent.getCurrentRecommendation().getEnd());
    details.ann.setText(aEvent.getCurrentRecommendation().getCoveredText());
    details.ann.setType(aEvent.getLayer().getName());
    details.annotationFeature = aEvent.getAnnotationFeature();
    details.currentLabel = aEvent.getCurrentRecommendation().getLabel();
    details.confidence = aEvent.getCurrentRecommendation().getConfidence();
    details.recommenderId = aEvent.getCurrentRecommendation().getRecommenderId();
    List<String> allLabelList = aEvent.getAllRecommendations().stream()
      .map(ao -> ao.getLabel()).collect(Collectors.toList());
    details.allLabels = String.join(", ", allLabelList);
    return JSONUtil.toJsonString(details);
  }
  catch (IOException e) {
    log.error("Unable to log event [{}]", aEvent, e);
    return "<ERROR>";
  }
}
origin: de.tudarmstadt.ukp.inception.app/inception-active-learning

@Override
public String getDetails(ActiveLearningRecommendationEvent aEvent)
{
  try {
    ActiveLearningRecommendationDetails details = new ActiveLearningRecommendationDetails();
    details.ann = new AnnotationDetails();
    details.ann.setBegin(aEvent.getCurrentRecommendation().getBegin());
    details.ann.setEnd(aEvent.getCurrentRecommendation().getEnd());
    details.ann.setText(aEvent.getCurrentRecommendation().getCoveredText());
    details.ann.setType(aEvent.getLayer().getName());
    details.annotationFeature = aEvent.getAnnotationFeature();
    details.userAction = aEvent.getAction();
    details.currentLabel = aEvent.getCurrentRecommendation().getLabel();
    details.confidence = aEvent.getCurrentRecommendation().getConfidence();
    details.recommenderId = aEvent.getCurrentRecommendation().getRecommenderId();
    List<String> allLabelList = aEvent.getAllRecommendations().stream()
      .map(ao -> ao.getLabel()).collect(Collectors.toList());
    details.allLabels = String.join(", ", allLabelList);
    return JSONUtil.toJsonString(details);
  }
  catch (IOException e) {
    log.error("Unable to log event [{}]", aEvent, e);
    return "<ERROR>";
  }
}
origin: inception-project/inception

@Override
public String getDetails(ActiveLearningRecommendationEvent aEvent)
{
  try {
    ActiveLearningRecommendationDetails details = new ActiveLearningRecommendationDetails();
    details.ann = new AnnotationDetails();
    details.ann.setBegin(aEvent.getCurrentRecommendation().getBegin());
    details.ann.setEnd(aEvent.getCurrentRecommendation().getEnd());
    details.ann.setText(aEvent.getCurrentRecommendation().getCoveredText());
    details.ann.setType(aEvent.getLayer().getName());
    details.annotationFeature = aEvent.getAnnotationFeature();
    details.userAction = aEvent.getAction();
    details.currentLabel = aEvent.getCurrentRecommendation().getLabel();
    details.confidence = aEvent.getCurrentRecommendation().getConfidence();
    details.recommenderId = aEvent.getCurrentRecommendation().getRecommenderId();
    List<String> allLabelList = aEvent.getAllRecommendations().stream()
      .map(ao -> ao.getLabel()).collect(Collectors.toList());
    details.allLabels = String.join(", ", allLabelList);
    return JSONUtil.toJsonString(details);
  }
  catch (IOException e) {
    log.error("Unable to log event [{}]", aEvent, e);
    return "<ERROR>";
  }
}
origin: de.tudarmstadt.ukp.inception.app/inception-active-learning

@Override
public boolean isSuggestionVisible(LearningRecord aRecord)
{
  User user = userService.get(aRecord.getUser());
  List<SuggestionGroup> suggestions = getSuggestions(user,
      aRecord.getLayer());
  for (SuggestionGroup listOfAO : suggestions) {
    if (listOfAO.stream().anyMatch(suggestion -> 
        suggestion.getDocumentName().equals(aRecord.getSourceDocument().getName()) && 
        suggestion.getFeature().equals(aRecord.getAnnotationFeature().getName()) && 
        suggestion.getLabel().equals(aRecord.getAnnotation()) && 
        suggestion.getBegin() == aRecord.getOffsetCharacterBegin() && 
        suggestion.getEnd() == aRecord.getOffsetCharacterEnd() &&
        suggestion.isVisible())
    ) {
      return true;
    }
  }
  return false;
}

origin: inception-project/inception

@Override
public boolean isSuggestionVisible(LearningRecord aRecord)
{
  User user = userService.get(aRecord.getUser());
  List<SuggestionGroup> suggestions = getSuggestions(user,
      aRecord.getLayer());
  for (SuggestionGroup listOfAO : suggestions) {
    if (listOfAO.stream().anyMatch(suggestion -> 
        suggestion.getDocumentName().equals(aRecord.getSourceDocument().getName()) && 
        suggestion.getFeature().equals(aRecord.getAnnotationFeature().getName()) && 
        suggestion.getLabel().equals(aRecord.getAnnotation()) && 
        suggestion.getBegin() == aRecord.getOffsetCharacterBegin() && 
        suggestion.getEnd() == aRecord.getOffsetCharacterEnd() &&
        suggestion.isVisible())
    ) {
      return true;
    }
  }
  return false;
}

origin: inception-project/inception

    && r.getOffsetCharacterBegin() == s.getBegin()
    && r.getOffsetCharacterEnd() == s.getEnd()
    && r.getAnnotation().equals(s.getLabel()))
.forEach(record -> {
  if (REJECTED.equals(record.getUserAction())) {
de.tudarmstadt.ukp.inception.recommendation.api.modelAnnotationSuggestiongetLabel

Popular methods of AnnotationSuggestion

  • getBegin
  • getConfidence
  • getEnd
  • getFeature
  • getLayerId
  • getRecommenderId
  • isVisible
  • getCoveredText
  • getDocumentName
  • getId
  • getOffset
  • getReasonForHiding
  • getOffset,
  • getReasonForHiding,
  • getRecommenderName,
  • getVID,
  • hide,
  • <init>,
  • equals,
  • getUiLabel,
  • show

Popular in Java

  • Reading from database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • getResourceAsStream (ClassLoader)
  • onRequestPermissionsResult (Fragment)
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JPanel (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now