Package com.aliasi.hmm

Examples of com.aliasi.hmm.HmmDecoder


      ObjectInputStream oi = new ObjectInputStream( new FileInputStream(modelFile) );
      HiddenMarkovModel hmm = (HiddenMarkovModel) oi.readObject();
      oi.close();
      long readTime = new Date().getTime() - startReadTime;
      System.out.println("Time to read model " + readTime + " msecs.");
      HmmDecoder decoder = new HmmDecoder(hmm);
     
      if (line_test)
       {
        //*-- test a single tagged sentence
        // String tline = "Before/cs you/ppss let/vb loose/jj a/at howl/nn saying/vbg we/ppss announced/vbd its/pp$ coming/nn ,/, not/* once/rb but/cc several/ap times/nns ,/, indeed/rb we/ppss did/dod ./.";
View Full Code Here


    logger.info("Reading POS tagger model from " + Constants.POS_TAGGER_MODEL);
    ObjectInputStream oi = null;
    try
    { oi = new ObjectInputStream( new FileInputStream(Constants.POS_TAGGER_MODEL) );
    HiddenMarkovModel hmm = (HiddenMarkovModel) oi.readObject();
    decoder = new HmmDecoder(hmm);
    setTagPosXref();
    }
    catch (IOException ie ) { logger.error("setforPOS IO Error : could not read " + ie.getMessage() ); }
    catch (ClassNotFoundException ce) { logger.error("setforPOS Class Error : " + ce.getMessage() ); }
    finally { if (oi != null) { try { oi.close(); } catch (IOException ie) { } } }
View Full Code Here

      throw new IOException("Could not find POS tagger model "+taggerModelFile,e);
    } catch (ClassNotFoundException e) {
      throw new IOException("Could not decode POS tagger model in "+taggerModelFile,e);
    }

    hmmDecoder = new HmmDecoder(hmm);
  }
View Full Code Here

TOP

Related Classes of com.aliasi.hmm.HmmDecoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.