public ArrayList<Unit> predictNER(Sentence sent) throws JNETException {

        if (trained == false || model == null) {
          throw new JNETException(
              "no model available. Train or load trained model first.");
        }

        System.out.println("  * predicting with crf model...");

        Pipe myPipe = model.getInputPipe();

        // iterate through sentences and predict `em as IOB Output
        Instance inst = new Instance(sent, "", "", "", myPipe);
        Sequence input = (Sequence) inst.getData();
        Sequence output = model.viterbiPath(input).output();

        ArrayList<Unit> units = sent.getUnits();
        if (output.size() != sent.getUnits().size()) {
          throw new JNETException("Wrong number of labels predicted.");
        }
        // now add the label to the unit object
        // and write in IOB ArrayList
        for (int j = 0; j < sent.getUnits().size(); j++) {
          Unit unit = sent.get(j);         
          unit.setLabel((String) output.get(j));
        }
        return units;
      }