Results 1 to 5 of 5
  1. #1
    krys is offline Member
    Join Date
    Jun 2013
    Posts
    3
    Rep Power
    0

    Default Stanford NER Named Entity Recognition

    Hi All,

    I'm doing a project in school which I need some help from you guys.
    First of all I've modify my codes in NERDemo.java such that it'll read my own file which is in .txt format and print out the entities in xml format for me.

    This .txt file contains whole paragraph of content that I've extracted out from the RSS newsfeed.

    But my ultimate goal is to just print out results that have been recognised and extracted out.
    Example:
    My current output is <PERSON>James</PERSON> is a good boy. He lives in <LOCATION> America </LOCATION>

    My ultimate output should be:
    James
    America

    Please Advise guys!

  2. #2
    makpandian's Avatar
    makpandian is offline Senior Member
    Join Date
    Dec 2008
    Location
    Chennai
    Posts
    441
    Rep Power
    6

    Default Re: Stanford NER Named Entity Recognition

    Did you forget to attach your source Java file?
    Mak
    (Living @ Virtual World)

  3. #3
    krys is offline Member
    Join Date
    Jun 2013
    Posts
    3
    Rep Power
    0

    Default Re: Stanford NER Named Entity Recognition

    Quote Originally Posted by makpandian View Post
    Did you forget to attach your source Java file?

    Nope. I did attached the source files. Thus, I can view all the .class files which I've downloaded from stanford website.
    The NERDemo.java(default demo file) can be run.

    Hmmm... I've added in codes to read my .txt file
    String filename = "news.txt";
    .......
    else if (filename != null) {
    String fileContents = IOUtils.slurpFile(filename);
    List<List<CoreLabel>> out = classifier.classify(fileContents);
    System.out.println(classifier.classifyWithInlineXM L(fileContents));

    I'm stuck here because I can only print out the results in xml format. What I want was to write a conditional statement ....
    if(the content contains <person>Jason</person>, <location>America</location>){
    System.out.println(); <----- the output should only be Jason, America. It should not take in good boy, lives in...

    Till now I'm doing hard-coding which is
    if (word.get(CoreAnnotations.AnswerAnnotation.class)
    .equals("LOCATION")||word.get(CoreAnnotations.Answ erAnnotation.class).equals("ORGANIZATION"))
    Then, print out my result

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default Re: Stanford NER Named Entity Recognition

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    krys is offline Member
    Join Date
    Jun 2013
    Posts
    3
    Rep Power
    0

    Default Re: Stanford NER Named Entity Recognition

    hahahaha that was posted by me. I found this site after I've posted that.

Similar Threads

  1. Named Variables and Exponents
    By kathekas in forum New To Java
    Replies: 5
    Last Post: 09-14-2009, 06:58 PM
  2. Could not locate named parameter
    By nc_newie in forum Enterprise JavaBeans (EJB)
    Replies: 3
    Last Post: 06-06-2009, 12:46 AM
  3. named pipes
    By samson in forum Networking
    Replies: 1
    Last Post: 04-04-2007, 06:40 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •