title: Issue in creating custom models using Apache OpenNLP. No output while testing model
body: <p>I am facing an issue while trying to create custom model. The issue is I created a custom model based on a training file and the training is successful.
  However, when I test the model with a sample input(infact took it from the training file itself), this does not give any output.
  I even tried with more than 15000 sentences but it never gives me an output.
  1. Code tried :-</p>
  
  <pre><code>    package com.tcs.ai.opennlp.anothercustommodel.anothercustommodel;
  import java.io.BufferedOutputStream;
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileOutputStream;
  import java.io.InputStream;
  import java.io.OutputStream;
  import java.nio.charset.Charset;
  import java.util.Collections;
  import opennlp.tools.namefind.NameFinderME;
  import opennlp.tools.namefind.NameSample;
  import opennlp.tools.namefind.NameSampleDataStream;
  import opennlp.tools.namefind.TokenNameFinderModel;
  import opennlp.tools.util.ObjectStream;
  import opennlp.tools.util.PlainTextByLineStream;
  import opennlp.tools.util.Span;
  public class AnotherCustomModel {
  public static void main(String args[])
      {
          InputStream is=null;
          String trainingDataFile = "en-ner-person.train";
          String outputModelFile = "en-ner-person.bin";
          String sentence[] = {"Sunil", "61 years old , will join the board as a nonexecutive director Nov. 29" };
          train(trainingDataFile, outputModelFile, "person");
          try {
              predict(sentence, outputModelFile);
          }
          catch(Exception e)
          {
              System.out.println("Errror Preditct" + e.getMessage());
          }       
      }
      private static void train(String trainingDataFile, String outputModelFile, String tagToFind) {
          NameSampleDataStream nss = null;
          try {
              nss = new NameSampleDataStream(new PlainTextByLineStream(new java.io.FileReader(trainingDataFile)));
          } catch (Exception e) {}
          TokenNameFinderModel model = null;
          try {
              model = NameFinderME.train("en", tagToFind, nss, Collections.&lt;String, Object&gt;emptyMap());
          } catch(Exception e) {}
          try {
              File outFile = new File(outputModelFile);
              FileOutputStream outFileStream = new FileOutputStream(outFile);
              model.serialize(outFileStream);
          }
          catch (Exception ex) {}
      }
      private  static void predict(String sentence[], String modelFile) throws Exception {
          InputStream is1 ;
          is1 = new FileInputStream("en-ner-person.bin");
          TokenNameFinderModel model1 = new TokenNameFinderModel(is1);
          String sd;
          NameFinderME nameFinder = new NameFinderME(model1); 
        StringBuilder fd = new StringBuilder();
          Span[] sp = nameFinder.find(sentence);
          nameFinder.clearAdaptiveData();
          for (Span span : sp) {
            for (int i=span.getStart(); i&lt;span.getEnd(); i++) {
              fd.append(sentence[i] + "\n");
            }
          }
          sd = fd.toString();        
          System.out.println("Name Detected:[" + sd + "]");
      }
  }
  </code></pre>
  
  <ol start="2">
  <li><p>en-ner-person.train :-</p>
  
  <pre><code>&lt;START:person&gt; Sunil &lt;END&gt; , 61 years old , will join the board as a 
  </code></pre>
  
  <p>nonexecutive director Nov. 29 .</p></li>
  </ol>
  
  <p>I even tried with more than 15000 sentences. Unfortunately, there is no error and there is no output also when I test my model(model creation was also successful</p>