stanfordnlp / CoreNLP

CoreNLP: A Java suite of core NLP tools for tokenization, sentence segmentation, NER, parsing, coreference, sentiment analysis, etc.
http://stanfordnlp.github.io/CoreNLP/
GNU General Public License v3.0
9.67k stars 2.7k forks source link

Web gui gives different results to server api for enhanced++ dependencies #1467

Open mercurial-moon opened 7 hours ago

mercurial-moon commented 7 hours ago

I have an offline corenlp server running and also a local version of corenlp.run I sent a query from the web browser with the following options (parts-of-speech, named entities, dependency parse, constituency parse, lemmas, coreference)

The query is

Only the columns to be modified need be mentioned in the SET clause; columns not explicitly modified retain their previous values.

Output

image The word "modified" shows 3 dependencies nsubj:pass - columns mark - to aux:pass - be

if I sent the same command via server api like under

wget --post-data "Only the columns to be modified need be mentioned in the SET clause; columns not explicitly modified retain their previous values." "http://corenlp.com:9000/?properties={\"annotators\":\"tokenize,ssplit,pos,lemma,ner,parse,dcoref\", \"outputFormat\": \"xml\"}" -O corenlp1.xml

then I get the following xml file

<dependencies type="enhanced-plus-plus-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="9">mentioned</dependent>
          </dep>
          <dep type="advmod">
            <governor idx="3">columns</governor>
            <dependent idx="1">Only</dependent>
          </dep>
          <dep type="det">
            <governor idx="3">columns</governor>
            <dependent idx="2">the</dependent>
          </dep>
          <dep type="nsubj:pass">
            <governor idx="9">mentioned</governor>
            <dependent idx="3">columns</dependent>
          </dep>
          <dep type="mark">
            <governor idx="6">modified</governor>
            <dependent idx="4">to</dependent>
          </dep>
          <dep type="aux:pass">
            <governor idx="6">modified</governor>
            <dependent idx="5">be</dependent>
          </dep>
          <dep type="acl:to">
            <governor idx="3">columns</governor>
            <dependent idx="6">modified</dependent>
          </dep>
          <dep type="aux">
            <governor idx="9">mentioned</governor>
            <dependent idx="7">need</dependent>
          </dep>
          <dep type="aux:pass">
            <governor idx="9">mentioned</governor>
            <dependent idx="8">be</dependent>
          </dep>
          <dep type="case">
            <governor idx="13">clause</governor>
            <dependent idx="10">in</dependent>
          </dep>
          <dep type="det">
            <governor idx="13">clause</governor>
            <dependent idx="11">the</dependent>
          </dep>
          <dep type="compound">
            <governor idx="13">clause</governor>
            <dependent idx="12">SET</dependent>
          </dep>
          <dep type="obl:in">
            <governor idx="9">mentioned</governor>
            <dependent idx="13">clause</dependent>
          </dep>
          <dep type="punct">
            <governor idx="9">mentioned</governor>
            <dependent idx="14">;</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="19">retain</governor>
            <dependent idx="15">columns</dependent>
          </dep>
          <dep type="advmod">
            <governor idx="18">modified</governor>
            <dependent idx="16">not</dependent>
          </dep>
          <dep type="advmod">
            <governor idx="18">modified</governor>
            <dependent idx="17">explicitly</dependent>
          </dep>
          <dep type="acl">
            <governor idx="15">columns</governor>
            <dependent idx="18">modified</dependent>
          </dep>
          <dep type="parataxis">
            <governor idx="9">mentioned</governor>
            <dependent idx="19">retain</dependent>
          </dep>
          <dep type="nmod:poss">
            <governor idx="22">values</governor>
            <dependent idx="20">their</dependent>
          </dep>
          <dep type="amod">
            <governor idx="22">values</governor>
            <dependent idx="21">previous</dependent>
          </dep>
          <dep type="obj">
            <governor idx="19">retain</governor>
            <dependent idx="22">values</dependent>
          </dep>
          <dep type="punct">
            <governor idx="9">mentioned</governor>
            <dependent idx="23">.</dependent>
          </dep>
        </dependencies>

Here 2 of the 3 dependencies show correct but 1 of them is wrongly showing governor as "mentioned" instead of "modified"

          <dep type="nsubj:pass">
            <governor idx="9">mentioned</governor>
            <dependent idx="3">columns</dependent>
          </dep>
          <dep type="mark">
            <governor idx="6">modified</governor>
            <dependent idx="4">to</dependent>
          </dep>
          <dep type="aux:pass">
            <governor idx="6">modified</governor>
            <dependent idx="5">be</dependent>
          </dep>

There are some other kinds of mismatches that also show up eg. for the sentence "The crying cat is mine." the web gui shows dependency type for "crying" as "amod" while the api shows it as "compound" for the governor "cat".

AngledLuffa commented 6 hours ago

corenlp.run is a slightly out of date version :shrug:

On Thu, Oct 17, 2024 at 11:09 PM Mercurial @.***> wrote:

I have an offline corenlp server running and also a local version of corenlp.run I sent a query from the web browser with the following options (parts-of-speech, named entities, dependency parse, constituency parse, lemmas, coreference)

The query is

Only the columns to be modified need be mentioned in the SET clause; columns not explicitly modified retain their previous values.

Output

image.png (view on web) https://github.com/user-attachments/assets/1f384568-df86-4f68-b478-c393719720a0 The word "modified" shows 3 dependencies nsubj:pass - columns mark - to aux:pass - be

if I sent the same command via server api like under

wget --post-data "Only the columns to be modified need be mentioned in the SET clause; columns not explicitly modified retain their previous values." "http://corenlp.com:9000/?properties={\"annotators\":\"tokenize,ssplit,pos,lemma,ner,parse,dcoref\", \"outputFormat\": \"xml\"}" -O corenlp1.xml

then I get the following xml file

ROOT mentioned columns Only columns the mentioned columns modified to modified be columns modified mentioned need mentioned be clause in clause the clause SET mentioned clause mentioned ; retain columns modified not modified explicitly columns modified mentioned retain values their values previous retain values mentioned .

Here 2 of the 3 dependencies show correct but 1 of them is wrongly showing governor as "mentioned" instead of "modified"

      <dep type="nsubj:pass">
        <governor idx="9">mentioned</governor>
        <dependent idx="3">columns</dependent>
      </dep>
      <dep type="mark">
        <governor idx="6">modified</governor>
        <dependent idx="4">to</dependent>
      </dep>
      <dep type="aux:pass">
        <governor idx="6">modified</governor>
        <dependent idx="5">be</dependent>
      </dep>

There are some other kinds of mismatches that also show up eg. for the sentence "The crying cat is mine." the web gui shows dependency type for "crying" as "amod" while the api shows it as "compound" for the governor "cat".

— Reply to this email directly, view it on GitHub https://github.com/stanfordnlp/CoreNLP/issues/1467, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2AYWOLPFKXMKSTPFUAE6DZ4CQZLAVCNFSM6AAAAABQFGXVFSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU4TMNJSGA3DONQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

mercurial-moon commented 6 hours ago

Hi, this is an offline corenlp that I'm running locally. Please refer to issue https://github.com/stanfordnlp/CoreNLP/issues/1356 As I said I'm running the same query on the same server. 1 via webgui (local) and 1 via api. Both are being run on the same local server. But the xml output from the api seems to give different result to the visual result in the web gui. My core nlp version is 4.5.3

AngledLuffa commented 6 hours ago

Gotcha. I'll stop being dismissive and take a look tomorrow

On Thu, Oct 17, 2024 at 11:47 PM Mercurial @.***> wrote:

Hi, this is an offline corenlp that I'm running locally. Please refer to issue #1356 https://github.com/stanfordnlp/CoreNLP/issues/1356 As I said I'm running the same query on the same server. 1 via webgui (local) and 1 via api. Both are being run on the same local server. But the xml output from the api seems to give different result to the visual result in the web gui. My core nlp version is 4.5.3

— Reply to this email directly, view it on GitHub https://github.com/stanfordnlp/CoreNLP/issues/1467#issuecomment-2421563253, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2AYWNK3JVPBBLXNZSNKADZ4CVG7AVCNFSM6AAAAABQFGXVFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRRGU3DGMRVGM . You are receiving this because you commented.Message ID: @.***>