GithubHelp home page GithubHelp logo

kovvalsky / prove_sick_nl Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 67.97 MB

Prove Ducth NLI problems of SICK-NL with LangPro

License: MIT License

Prolog 97.59% Python 0.04% Perl 1.20% Euphoria 1.17%
dutch dutch-language nli natural-language-inference textual-entailment tableau-prover natural-logic theorem-prover theorem-proving neural-proof-net

prove_sick_nl's People

Contributors

konstantinoskokos avatar kovvalsky avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

prove_sick_nl's Issues

Light verb construction

For EN there is a tableau rule that accounts for light verb constructions: SICK-253 a hiker does a dance ==> a hiker dances
(a_hiker do c1) AND (c1 IS dance) ==> a_hiker dance
image
note: a_hiker is due to using the strong NP alignment that treats shared pharses as constants (makes proofs shorter).

For NL this rules is not working because derivation relation for dans and dansen couldn't be found (yet?) in ODWN.
image

Proper treatment of enkele as a_few

9448: 
P:trg: Geen enkele hond springt in de schaduw van sommige bomen
  src: No dog is jumping in the shade of some trees
H:trg: Een hond springt in de schaduw van enkele bomen
  src: A dog is jumping in the shade of some trees

Lexical relations depending on Dutch-specific morphology

2911: C-(N)-[CONTRADICTION]
P:trg: Een vrouw doet make-up op
src: A woman is putting on makeup
H:trg: Er is geen vrouw die make-up opdoet
src: There is no woman putting on makeup

4650: C-(N)-[CONTRADICTION]
P:trg: Een man snijdt een dik touw door met een zwaard
src: A man is cutting a thick rope with a sword
H:trg: Er is geen man die een touw doorsnijdt met een zwaard
src: There is no man cutting a rope with a sword

4006: E-(N)-[ENTAILMENT]
P:trg: Een man beklimt een touw
src: A man is climbing a rope
H:trg: De man klimt een touw op
src: The man is climbing up a rope

4011: E-(N)-[ENTAILMENT]
P:trg: Een man beklimt een touw
src: A man is climbing a rope
H:trg: Een man klimt een touw op
src: A man is climbing up a rope

In ODWN, `staan` entails `zitten`

In ODWN, staan entails zitten

WNProlog/wn_s.pl:s('eng-30-01546111-v', _, 'staan', 'v', 1, _).
WNProlog/wn_s.pl:s('eng-30-01546111-v', _, 'stellen', 'v', 9, _).
WNProlog/wn_s.pl:s('eng-30-01546111-v', _, 'de kat sturen', 'v', 1, _). % this is also weird as it means "not to show up"

WNProlog/wn_hyp.pl:hyp('eng-30-01546111-v', 'eng-30-02655135-v').

WNProlog/wn_s.pl:s('eng-30-02655135-v', _, 'zijn', 'v', 2, _).
WNProlog/wn_s.pl:s('eng-30-02655135-v', _, 'ophouden', 'v', 4, _).
WNProlog/wn_s.pl:s('eng-30-02655135-v', _, 'bevinden', 'v', 3, _).
WNProlog/wn_s.pl:s('eng-30-02655135-v', _, 'zitten', 'v', 2, _).
WNProlog/wn_s.pl:s('eng-30-02655135-v', _, 'uithangen', 'v', 1, _).
WNProlog/wn_s.pl:s('eng-30-02655135-v', _, 'pozen', 'v', 1, _).
WNProlog/wn_s.pl:s('eng-30-02655135-v', _, 'toeven', 'v', 1, _).
WNProlog/wn_s.pl:s('eng-30-02655135-v', _, 'verkeren', 'v', 2, _).
WNProlog/wn_s.pl:s('eng-30-02655135-v', _, 'verwijlen', 'v', 1, _).
WNProlog/wn_s.pl:s('eng-30-02655135-v', _, 'wezen', 'v', 2, _).
WNProlog/wn_s.pl:s('eng-30-02655135-v', _, 'vertoeven', 'v', 1, _).

And wrongly proves these problems:

6099: E-[NEUTRAL]
P:trg: Een man staat naast een grote en kleurrijke vogelkooi
src: A man is standing beside a large and colorful birdcage
H:trg: De man zit naast een vogelkooi
src: The man is sitting next to a birdcage


6549: E-[NEUTRAL]
P:trg: Een kleine jongen staat in het bos
src: A small boy is standing in the forest
H:trg: Een kleine jongen zit in het bos
src: A small boy is sitting in the forest


7196: E-[NEUTRAL]
P:trg: Een man staat op een stoep
src: A man is standing on a sidewalk
H:trg: Een man zit op een stoep
src: A man is sitting on a sidewalk


7375: E-[NEUTRAL]
P:trg: Een man staat op de top van de rotsen met wolken erachter
src: A man is standing on the top of the rocks with clouds behind them
H:trg: Een persoon zit op een bergtop
src: A person is sitting on a mountain top

Spacy lemmas are poor

This is an easy problem to prove but the lemma fluiten (nl_core_news_lg) is a culprit.

5310 no
(3209):[5310]p Er is geen meisje dat fluit speelt
(3208):[5310]h Een meisje speelt fluit

image

`ontX` vs `X`

It seems some bug that ontvouwen entails vouwen.
Is it originally coming from ODWN? or is it a bug in the integration?

word_hyp(_, ontvouwen, vouwen, Num, SN1, SN2, Path).
Num = '2',
SN1 = SN2, SN2 = 2,
Path = ['eng-30-01277974-v'] ;

Conversion or parsing issue?

I want to make sure from where the wrong analysis come:

image

My alpino run returns this tree which doesn't have the issue:
image

ODWN says `kat` isa `hond`, seriously?

% in WNProlog/wn_s.pl:
s('eng-30-02084071-n', _, 'hond', 'n', 1, _).
s('odwn-10-104754060-n', _, 'kat', 'n', 1, _).
s('eng-30-01318894-n', _, 'huisdier', 'n', 1, _).
% in WNProlog/wn_hyp.pl:
hyp('eng-30-02084071-n', 'eng-30-01318894-n').
hyp('eng-30-01318894-n', 'eng-30-02084071-n').
hyp('odwn-10-104754060-n', 'eng-30-01318894-n').

Because of this, the following 6 neutral problems are wrongly proved as entailment:

5663: E-[NEUTRAL]
--
P:trg: De kat likt een fles
src: The cat is licking a bottle
H:trg: De hond likt een fles
src: The dog is licking a bottle


7890: E-[NEUTRAL]
--
P:trg: Twee witte katten spelen met een bruine hond en een bal
src: Two white cats are playing with a brown dog and a ball
H:trg: Twee witte honden spelen met een bruine hond en een bal
src: Two white dogs are playing with a brown dog and a ball


8173: E-[NEUTRAL]
--
P:trg: Een grote bruine kat springt over een rode hindernis
src: A large brown cat is jumping over a red hurdle
H:trg: Een grote bruine hond springt over een rode hindernis
src: A large brown dog is jumping over a red hurdle


9167: E-[NEUTRAL]
--
P:trg: Een bruine en witte kat springt op de stoep
src: A brown and white cat is jumping on the sidewalk
H:trg: Een bruine en witte hond springt op de stoep
src: A brown and white dog is jumping on the sidewalk


9185: E-[NEUTRAL]
--
P:trg: Een gele kat zit achter een bal aan
src: A yellow cat is chasing a ball
H:trg: Een gele hond zit achter een bal aan
src: A yellow dog is chasing a ball


9697: E-[NEUTRAL]
--
P:trg: Een vrouw laat een kleine kat zien aan een kind
src: A woman is showing a small cat to an infant
H:trg: Een vrouw laat een kleine hond aan een kind zien
src: A woman is showing a small dog to an infant

Determiners immediately attached to head nouns

Now there is a rule that digs Det from np-Mods and attaches at the top of NP.

(1) Mod1 @ (...(ModN @ (Det @ N))...) ===> Det @ (Mod1 @ (...(ModN @ N)...))

Caution: this is very close to the existing rule
(2) DetMod @ (Det @ N) ===> (DetMod @ Det) @ N that is responsible for not (all dogs) ===> (not all) dogs. These two rules are very close for instances like almost (all dogs) ===> (almost all) dogs where almost easily gets same JJ pos.
Currently, (2) is used only for DetMod with RB pos.

image

Originally posted by @kovvalsky in #2 (comment)

Different trees for the same constructions

There’ is an Expletive

Constructions like there is no man exercising or Er is geen man aan het sporten (from 3897p) get different analysis depending on what parser is used.

CCGbank-based analysis:

ccg(407,
 ba(s:dcl,
  t(np:thr, 'There', 'there', 'EX', 'I-NP', 'O'),
  fa(s:dcl\np:thr,
   t((s:dcl\np:thr)/np, 'is', 'be', 'VBZ', 'I-VP', 'O'),
   fa(np,
    t(np/n, 'no', 'no', 'DT', 'I-NP', 'O'),
    ba(n,
     t(n, 'man', 'man', 'NN', 'I-NP', 'O'),
     lx(n\n, s:ng\np,
      t(s:ng\np, 'exercising', 'exercise', 'VBG', 'I-VP', 'O'))))))).

Lassy-based analysis:
image

PMB-based analysis:

image

Some sentences from Alpino don't get syntactic terms

For example:

238p: Er zijn geen kinderen die spelen en wachten
434p: Het meisje met de helm op rijdt op een fiets
9176p: Geen enkel persoon is aan het wandelen

have no terms in SICK_NL/parses/alpino.pl while alpino is able to parse them.

image
image
image

Issues with OpenDutchWordNet

✔️ A hypernymy loop in ODWN

In ODWN:

s('eng-30-13920835-n', _, 'staat', 'n', 1, _).
s('eng-30-13920835-n', _, 'gesteldheid', 'n', 1, _).
s('eng-30-13920835-n', _, 'conditie', 'n', 4, _).

s('eng-30-00024720-n', _, 'kwaliteit', 'n', 3, _).
s('eng-30-00024720-n', _, 'boel', 'n', 2, _).
s('eng-30-00024720-n', _, 'situatie', 'n', 1, _).
s('eng-30-00024720-n', _, 'hoedanigheid', 'n', 2, _).
s('eng-30-00024720-n', _, 'bedoening', 'n', 2, _).

hyp('eng-30-13920835-n', 'eng-30-00024720-n').
hyp('eng-30-00024720-n', 'eng-30-13920835-n').

In Princeton WN3.0 there is no such loop:

s(100024720,1,'state',n,2,39).

s(113920835,1,'condition',n,1,72).
s(113920835,2,'status',n,2,1).

hyp(113920835,100024720).

✔️ Solved by banning synset revisiting during the transitive traversal.

Label-correct but poor proves

These are the proves that correctly predict SICK-labels but from a semantic point of view they are not the good ones

Wrong, inconsistent PP-attachments

[1839] ENTAILMENT
Alpino attachments
(1158):[1839]p [Het meisje, dat klein is, kamt haar haar voorzichtig] [in een paardenstaart]
(1159):[1839]h Het meisje, dat klein is, kamt [[haar haar] in een paardenstaart]

Use alpino's decomposition of compunds

In English open compounds are decomposed while in Dutch they are treated as a single lexical entry.
Alpino provides a decomposition of such compounds:
root="vloer_oefening" sense="vloer_oefening" word="vloeroefeningen"
root="water_scooter" sense="water_scooter" word="waterscooter"
1412: root="hout_blok" sense="hout_blok" word="houtblokken"

No eta-reduction applied

It seems after fixing the terms one might still need to do beta-eta reduction.
npn_robbert tree for the premise.

>> (5164):[8400]p Er is geen man die gitaar speelt naast een drummer
   (5162):[8400]h Een man speelt gitaar naast een drummer

image

Translations that change the course of proofs

trekking | hiking --> wandelen

TRIAL-3181 🇳🇱
Een man is aan het wandelen in het bos
NEUTRAL CONTRADICTION
De man is niet aan het wandelen in het bos

TRIAL-3181 🇬🇧
A man is trekking in the woods
NEUTRAL
The man is not hiking in the woods

Even 🇬🇧 version has an arguable label (if not wrong) but 🇳🇱 is clearly wrong after both trekking and hiking are translated as wandelen.

Wrong trees (only SICK-trial part)

✔️ Coordination of two N types

De vrouw hakt wat brood en gebakken varkensvlees

both npn and alpino trees are weird.

image

This is fixed with a rule Coord @ abst(X1,NP1) @ abst(X2,NP2) @ Det ---> Coord @ NP1[X1=Det] @ NP2[X2=Det]
The result:

image

Spacy POS tags are poor

zijn is identified as a pronoun by the POS tagger.

image

Note that learning POS tagging and supertagging simultaneously with multi-task learning could improve both taggings.
There are several works that indicate this.

Wrong Alpino parses

Alpino tree for 4893 Kinderen in zwempakken spelen in het water
Same issue with 4894 Kinderen in zwempak spelen niet in het water

POS tags of the MWE units are also weird.

image

Lexical information not enough to detect verbs in passive constructions

While in CCG banks and parsers the verb forms in passive constrictions and perfect tenses are distinguishable via :pss feature, that is not the case for Dutch trees obtained from Lassy. Bith :pss and :pt are marked as :pt (for `PPART``).
https://www.let.rug.nl/vannoord/alp/Alpino/adt.html

This makes a tableau rule insufficient that uses pss to rearrange the argument list of a verb.

(840):[1333]p De vrouw meet de andere vrouw
(841):[1333]h Een vrouw wordt gemeten door een andere vrouw

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.