Search code examples
javaubuntustanford-nlpopennlplingpipe

NLP libraries installation guidelines for java


I am new to NLP. I need basic idea to get started with installation of it. I have gone through LingPipe and open NLP installation section, but i did not get why to install maven and additional training sets , models etc. Any brief explanation of installation would be helpful for me to get started with coding. Platform - Ubuntu

Sorry if this question is too generic or simple


Solution

  • I used OpenNLP in my project. I think this instructions will help you to go through OpenNLP Library. Follow this document

    • Download OpenNLP Library and add it to your build path
    • Download trained models and put it to a folder
    • modelIn = new FileInputStream("path");

    InputStream modelIn = null;

    try {
      modelIn = new FileInputStream("en-pos-maxent.bin");
      POSModel model = new POSModel(modelIn);
    }
    catch (IOException e) {
      // Model loading failed, handle the error
      e.printStackTrace();
    }
    finally {
      if (modelIn != null) {
        try {
          modelIn.close();
        }
        catch (IOException e) {
        }
      }
    }