Let’s discuss about how to setup OpenNLP environment in your system. Now start with the installation process.
Below mentioned steps are used to download Apache OpenNLP libraryin your system.
Step 1 − Open the homepage of Apache OpenNLP by clicking the following link − https://opennlp.apache.org/.
Step 2 − Then, click on the Downloads link. After clicking, you will be directed to a page where you can find various mirrors which will redirect you to the Apache Software Foundation Distribution directory.
Step 3 − In this page you can find links to download various Apache distributions. Browse through them and find the OpenNLP distribution and click it.
Step 4 – Now you will be redirected to the directory to see the index of the OpenNLP distribution, as mentioned below.
Click on the latest version from the available distributions.
Step 5 – You can find the different Source and Binary files of OpenNLP library in various formats. Now download the source and binary files, apache-opennlp-1.6.0-bin.zip and apache-opennlp1.6.0-src.zip (for Windows).
Once you complete downloading the OpenNLP library, then you need to set its path to the bin directory. Assume that you have downloaded the OpenNLP library to the E drive of your system.
Now, follow the steps that are given below −
Step 1 − Right-click on 'My Computer' and select 'Properties'.
Step 2 − Click on the 'Environment Variables' button under the 'Advanced' tab.
Step 3 − Select the path variable and click the Edit button, as shown in the following screenshot.
Step 4 – Go to the Edit Environment Variable window, click the New button and add the path for OpenNLP directory E:\apache-opennlp-1.6.0\bin and click the OK button, as shown in the following screenshot.
You need to set the Eclipse environment for OpenNLP library, in two ways by setting the Build path to the JAR files or by using pom.xml.
Setting Build Path to the JAR Files
Follow the steps given below to install OpenNLP in Eclipse −
Step 1 − Make sure that you have Eclipse environment installed in your system.
Step 2 − Open Eclipse. Click File → New → Open a new project, as shown below.
Step 3 − You will get the New Project wizard. In this wizard, select Java project and proceed by clicking the Next button.
Step 4 – Here you will get the New Java Project wizard. Then you need to create a new project and click the Nextbutton, as shown below.
Step 5 – Once you complete the new project, right-click on it, select Build Path and click Configure Build Path.
Step 6 – After that you will get the Java Build Path wizard. Here, click the Add External JARs button, as shown below.
Step 7 − Select the jar files opennlp-tools-1.6.0.jar and opennlp-uima-1.6.0.jar located in the lib folder of apache-opennlp-1.6.0 folder.
On clicking the Open button in the above screen, the selected files will be added to your library.
Now click on OK, and then you will successfully add the required JAR files to the current project. Let’s verify these added libraries by expanding the Referenced Libraries, as mentioned below.
Convert the project into a Maven project and add the following code to its pom.xml.
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.