Example #1
0
  public MLInstance(Instance instance, CodeBook codebook) {
    messageID = instance.getMessageId();
    instID = String.valueOf(instance.getId());
    sentence = instance;
    tokens = Arrays.asList(instance.getTokens());
    posTags = Arrays.asList(sentence.getPOSTags());
    // what is this for unlabeled
    // check for null or empty list
    classLabels = instance.getCodes();
    // check if classLabels is null
    // get codebook from docID

    humanLabels = new ArrayList<String>();
    String humanLabel;
    if (classLabels != null) {
      for (String label : classLabels) {
        humanLabel = codebook.getLabel(label);
        humanLabels.add(humanLabel);
      }
    }
    // document level data
    docSender = instance.getMessageFrom();

    // silver instance information

    if (instance.getInstanceType() == InstanceType.SILVER) {
      isSilverCollection = true;
      silverCode = instance.getSilverCode();
      // check these labels, is one unverified?
      silverVerificationLabel = instance.getVerificationType();
    }
  }