News for hackers. Stuff that matters.
Re:Show HN: A Natural Language Query Engine Without Machine ... by charlieegan3 on Saturday October 08, 2016 @08:11AM (#12666677)
I think you might get better results in the first stage using the dependency parse from CoreNLP - rather than the phrasal parse. Online demo at http://corenlp.run

If you're willing to drop CoreNLP there's also https://demos.explosion.ai/displacy/ that's worth checking out.

Re:Show HN: A Natural Language Query Engine Without Machine ... by alanlit on Saturday October 08, 2016 @05:38PM (#12668845)
Nice work by the O.P.

Amusingly a year or so ago I took the Stanford Dependency parser and fed its output tree into a Prolog system to try to pull out the semantics. It was used to analyze business news (getting at the who's, what's and why's).

The easiest approach was to wrap a very simple DSL around Prolog (which, BTW, Prolog is great at). Then in the DSL (which still retained logical variables and backtracking) you could write things like:

%% Simple statements -- root is an announcement word whose subject and object tell the story. %% 'IBM announced a new computer today' announce(Who, About, What) ==> s+root(['announc', 'releas', 'introduc','launch', 'unveil', 'reveal', 'agre']), #Dep1, subject(Who), Dep1 >> object(About, What).

%% 'IBM has announced a partnership ...' is caught by the above. But 'IBM has entered into a partnership ...' needs %% a little more work announce(Who, About, announcement) ==> s+root(['enter']), #Obj, subject(Who), Obj >> prep_pobj_chain(PPC), {PPC = [Prep|About]}.

I think a Prolog-based query planner as a front end to Sparql on Wikidata could be quite interesting.

Alanl

Re:Show HN: A Natural Language Query Engine Without Machine ... by alanlit on Saturday October 08, 2016 @05:41PM (#12668866)
Bah -- try again so it is readable !!

    %% Simple statements -- root is an announcement word whose subject and object tell the story.
    %% 'IBM announced a new computer today'
    announce(Who, About, What) ==> 
        s+root(['announc', 'releas', 'introduc','launch', 'unveil', 'reveal', agre']), 		
        #Dep1,	
        subject(Who), 
        Dep1 >> object(About, What).
	
    %% 'IBM has announced a partnership ...' is caught by the above. But 'IBM has entered into a   partnership ...' needs 
    %% a little more work
    announce(Who, About, announcement) ==> 
        s+root(['enter']),
        #Obj,
        subject(Who),
        Obj >> prep_pobj_chain(PPC),
        {PPC = [Prep|About]}.