Skip to content

Hello World! code and additional examples

rzanoli edited this page Feb 24, 2015 · 20 revisions

With EOP we provide some examples that you can try to become more confident with EOP. With them you will see how to pre-process a data set, how to train a new model and how to annotate a data set. The examples are distributed as a Maven project that you have to import in Eclipse before running them.

  1. Download the zip file containing the Maven project:
    Maven project with examples

  2. Copy it into you working directory (e.g. your home directory)

> cp /home/user_name/Downloads/myProject-EOPv1.2.1.tar.gz ~
  1. Unzip the file
> tar -xvzf myProject-EOPv1.2.1.tar.gz
  1. Download eop-resources-1.2.1.tar.gz containing the needed resources (e.g. configuration files, data sets, WordNet) and save it into your home directory.

  2. Unzip the file

> tar -xvzf eop-resources-1.2.1.tar.gz
  1. Install TreeTagger
  • Download the build.xml build.xml file.

  • Move into the home directory of your project (e.g. myProject) e.g.

    > cd ~/programs/myProject/
    
  • Create the new directory treetagger, i.e.

    > mkdir -p src/scripts/treetagger/
    
  • Go into the new directory, i.e.

    > cd src/scripts/treetagger/
    
  • Copy the build.xml file into the current directory, e.g.

    > cp /home/user_name/Downloads/build.xml ./
    
  • Run the installation script by calling ANT build tool, i.e.

    > ant local-maven
    
  1. Import the Maven project into Eclipse

Maven projects can be imported using File → Import → Maven → Existing Maven Projects

  1. Run one of the examples in the project (e.g. Hello World!)
  • Check the method main in the code and set the value of the reported variables so that they correspond to the path where the EOP file of the resources is, e.g. /home/user_name/eop-resources-1.2.1/

  • Open and Check the EDA's configuration file (e.g. /home/user_name/eop-resources-1.2.1/configuration-files/MaxEntClassificationEDA_Base+OpenNLP_EN.xml) so that the reported parameters point to the path of the resources file.

  • Right click on HelloWorld.java in myProject/src/main/java and the Run As → Java Application

Clone this wiki locally