You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "Chetan M (JIRA)" <ji...@apache.org> on 2013/11/13 08:52:17 UTC

[jira] [Created] (OPENNLP-616) TokenNameFinderTrianer is running in command prompt but while executing program no result found in console

Chetan M created OPENNLP-616:
--------------------------------

             Summary: TokenNameFinderTrianer is running in command prompt but while executing program no result found in console
                 Key: OPENNLP-616
                 URL: https://issues.apache.org/jira/browse/OPENNLP-616
             Project: OpenNLP
          Issue Type: Test
          Components: Name Finder
    Affects Versions: tools-1.5.3
         Environment: Windows xp sp3 
            Reporter: Chetan M


my ner-person-train file contents are

Mr . <START:person> Vinken <END> is chairman of Elsevier N.V. , the Dutch publishing group . <START:person> Rudolph Agnew <END> , 55 years old and former chairman of Consolidated Gold Fields PLC , was named a director of this British industrial conglomerate .

after that i'm running following cmd in commandprompt

F:\apache-opennlp-1.5.3\bin>opennlp TokenNameFinderTrainer -encoding UTF-8 -model en-ner-person.bin -lang en -data en-ner-person.train

the above command is successfully running After that i'm executing following program in eclipse


public static void findName() throws IOException {

InputStream is = new FileInputStream("F:/apache-opennlp-1.5.3/bin/en-ner-person.bin");
 
          TokenNameFinderModel model = new TokenNameFinderModel(is);
	  is.close();
 
	NameFinderME nameFinder = new NameFinderME(model);
 
		String []sentence = new String[]{
			    "Mike",
			    "Sagar",
			    "Jack",
			    "Smith",
			    "is",
			    "a",
			    "good",
			    "Sachin",
			    "person"
			    };
 
			Span nameSpans[] = nameFinder.find(sentence);
 
			for(Span s: nameSpans)
				System.out.println(s.toString());
 
	}

But I'm not getting any result. Can any one suggest me to resolve this problem



--
This message was sent by Atlassian JIRA
(v6.1#6144)