Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9250771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:31:39+00:00 2026-06-18T10:31:39+00:00

I am a newbie to Stanford NLP.I am using lexicalized parser for parsing the

  • 0

I am a newbie to Stanford NLP.I am using lexicalized parser for parsing the contents of the file and extracting the noun phrases.While parsing the line it is taking more time for generating a tree structure.

I am using a Tregex pattern to get noun phrases from a line.

I am using 1 MB file to parse,so it is taking, more than two hours for parsing as well as for extracting the noun phrases.

Here is my full code that i am using.

        Tree x = parser.apply(line);
        System.out.println("tree s=="+x);
        TregexPattern NPpattern = TregexPattern.compile("@NP <@/NN.?/");
        TregexMatcher matcher = NPpattern.matcher(x);

        while (matcher.findNextMatchingNode()) {
            Tree match = matcher.getMatch();
            List<TaggedWord> tWord = match.taggedYield();
            Iterator<TaggedWord> it = tWord.iterator();
            String str="";
            while(it.hasNext()){
                TaggedWord word = it.next();
                String taggedWord = word.tag();
                if(taggedWord.equals("NN")||taggedWord.equals("NNS")||taggedWord.equals("NNP")){
                    str = str+word.value()+" ";
                }
            }
       }

So please help me how to increase the performance or is there another way to optimize this code.

Thanks in advance
Gouse.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:31:40+00:00Added an answer on June 18, 2026 at 10:31 am

    Full constituency parsing of text is just kind of slow…. If you stick with it, there may not be much that you can do.

    But a couple of things to mention: (i) If you’re not using the englishPCFG.ser.gz grammar, then you should, because it’s faster than using englishFactored.seer.gz and (ii) Parsing very long sentences is especially slow, so if you can get by omitting or breaking very long sentences (say, over70 words), that can help a lot. In particular, if some of the text is from web scraping or whatever and has long lists of stuff that aren’t really sentences, filtering or dividing them may help a lot.

    The other direction you could go is that you appear to not really need a full parser but just an NP chunker (something that identifies minimal noun phrases in a text). These can be much faster as they don’t build recursive structure. There isn’t one at present among the Stanford NLP tools, but you can find some by searching for this term on the web.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a newbie with Java and Stanford NLP toolkit and trying to use them
Newbie in testing. I generated a test case using Selenium, and then exported it
Newbie question since I'm not up to speed using maven at all. I'm trying
Newbie question... I am using silverlight to POST data to my GAE application class
Newbie to ruby this is my first project I am using the FasterCSV Gem
Newbie question. I’m writing an ASP.Net MVC app in VB.Net and have been using
Newbie to windows scripting. I need help running the .bat file on the command
Newbie here. I'm using codeigniter and mysql How can I dynamically (number of names
Newbie in WCF, I am to define a restful interface for taking in requests
Newbie question I know... But can I build apps for Snow Leopard using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.