javamavenopennlplemmatization

OpenNLP: Unable to access jarfile LemmatizerTrainerME


I'm having trouble to build my Lemmatizer bin file.

According to this answer, I should run opennlp LemmatizerTrainerME -model en-lemmatizer.bin -lang en -data /path/to/en-lemmatizer.dict -encoding UTF-8 but it gives me an error: Unable to access jarfile LemmatizerTrainerME

I'm doing it inside apachenlp bin folder (.\apache-opennlp-1.9.3\bin)

Can someone help me fixing this or tell me what am I doing wrong?


Solution

  • I've found the solution. The LemmatizerTrainerME is inside opennlp tools jar file. So that's what I did:

    I ran Windows Powershell inside lib folder with the following command: opennlp opennlp-tools-1.9.3.jar LemmatizerTrainerME -model en-lemmatizer.bin -lang en -data /path/to/en-lemmatizer.dict -encoding UTF-8 and it worked.

    TLDR: I ran Powershell inside the folder that contains opennlp tools and added the tools file name before the arguments so it could access LemmatizerTrainerME