title: training parts-of-speech tagger in opennlp
body: <p>I am trying to train the opennlp POS tagger which would tag the words in a sentence according to my specific vocabulary.for example :</p>
  
  <p>After normal POS tagging:</p>
  
  <p>sentence: NodeManager/NNP failed/VBD to/TO start/VB the/DT server/NN</p>
  
  <p>After using my model of pos tagging :</p>
  
  <p>sentence: NodeManager/AGENT failed/OTHER to/OTHER start/OTHER the/OTHER server/OBJECT</p>
  
  <p>where AGENT,OTHER,OBJECT are the tags tat i defined.</p>
  
  <p>so basically i am defining my own tag dictionary.And want the POS tagger to use my model.</p>
  
  <p>wen i checked in the apache documentation for doing this</p>
  
  <p>i found the below code</p>
  
  <pre><code>POSModel model = null;
  
  InputStream dataIn = null;
  try {
    dataIn = new FileInputStream("en-pos.train");
    ObjectStream&lt;String&gt; lineStream = new PlainTextByLineStream(dataIn, "UTF-8");
    ObjectStream&lt;POSSample&gt; sampleStream = new WordTagSampleStream(lineStream);
  
    model = POSTaggerME.train("en", sampleStream, TrainingParameters.defaultParams(), null, null);
  }
  catch(IOException e)
  {
     e.printStackTrace();
  }
  finally {
    if (dataIn != null) {
      try {
        dataIn.close();
      }
      catch (IOException e) {
        // Not an issue, training already finished.
        // The exception should be logged and investigated
        // if part of a production system.
        e.printStackTrace();
      }
    }
  }
  </code></pre>
  
  <p>here when they are opening the FileInputStream to en-pos.train, i guess this en-pos.train is a .bin file like all the ones they have used before , but just that it is customized. can someone tell me how to get the .bin file for it ?</p>
  
  <p>or where is en-pos.train ? what exactly is it?  how to create it?</p>
  
  <p>i extracted the bin file tat they normally use</p>
  
  <p>en-pos-maxent.bin. it has the xml file where we define the tag dictionary, a model file and a properties file. i have changed them according to my needs , but my problem is generating the .bin file from the contents.</p>