public CRF readModel(String path) throws IOException, ClassNotFoundException {
    ObjectInputStream ois = new ObjectInputStream(new FileInputStream(new File(path)));
    CRF crf = (CRF) ois.readObject();
    ois.close();
    return crf;
  }