Natural Language Processing vs. Logic.

Post on 13-May-2022

7 views 0 download

Transcript of Natural Language Processing vs. Logic.

NaturalLanguageProcessingvs.Logic.Islogicusefulinthecomputa8onal

interpreta8onoflanguage?

DanCristeadcristea@info.uaic.ro

Communica8onthroughlanguage

MFOI–VadulluiVodă,29July2016

Communica8onthroughlanguage

thought

MFOI–VadulluiVodă,29July2016

Communica8onthroughlanguage

thought

MFOI–VadulluiVodă,29July2016

emo8on

Communica8onthroughlanguage

thought

MFOI–VadulluiVodă,29July2016

emo8on

Communica8onthroughlanguage

thought

MFOI–VadulluiVodă,29July2016

emo8on

Communica8onthroughlanguage

thought

MFOI–VadulluiVodă,29July2016

emo8on

Communica8onthroughlanguage

thought

thought

MFOI–VadulluiVodă,29July2016

emo8on

Communica8onthroughlanguage

thought

thought

MFOI–VadulluiVodă,29July2016

emo8on

emo8on

LogicandNL

•  Logic:theexpressionofrigour•  ChallengeoflogicalformalismsinNL:codeanylanguageexpressioninlogicalform

•  Usefulness:clearoutambigui8es

•  Skep8cs:towhatextendcanamessagebeencodedinlogic?

MFOI–VadulluiVodă,29July2016

Thelogicoflanguagecommunica8on…twohorses…–  theemiUerisaman,livesinEnglandin1926,aworkerofthefield–  thereceiveristhisman’smaster

è–  bothemiUerandreceiverhaveacommonknowledgeonthewordhorse–  theemiUerknowsthatthereceiverhasthesamemeaningashimselfonhorse–  theemiUerintendstomakethereceiverbuildtherepresenta8on:

S={x⏐horse(x)}^card(S)=2,where:card(S):thecardinalofthesetS,horse(x):aqualifyingfunc8onasser8ngthatxbelongstoaclassofobjects

sharingtheseman8cpropertythatiscurrentlydenominatedinEnglishbythewordhorse,andthatthepragma8ccontextinwhichtheexpressionisuUered

clearlyseparatesthedifferentmeaningsthatthisEnglishwordmayencode.MFOI–VadulluiVodă,29July2016

Whenislogicofhelp…

MFOI–VadulluiVodă,29July2016

Chunkslevel:Genera8veLexiconandQualiaStructures

•  meaningofwordsdecomposedon4coordinates:– Formal(F):encodingtaxonomicinforma8onaboutthelexicalitem(theis-arela8on);

– Cons4tu4ve(C):encodinginforma8ononthepartsandcons8tu8onofanobject(part-oformade-ofrela8on);

– Telic(T):encodinginforma8ononpurposeandfunc8on(theused-fororfunc4ons-asrela8on);

– Agen4ve(A):encodinginforma8onabouttheoriginoftheobject(thecreated-byrela8on)

MFOI–VadulluiVodă,29July2016

J.Pustejovsky.TheGenera4veLexicon.Cambridge,MA:MITPress,1995.

QualiaStructures

•  Representmeaningofcomposi8onsofwords–  largecar(F=vehicle),– brokencar(C=motor),– speedycar(T=drive),–  Italiancar(A=madeinItaly)

MFOI–VadulluiVodă,29July2016

Whatskep8csgrump?

•  Howtomastertheenormousrangeofpossiblecombina8ons?

•  Haslikesthesamemeaning?– Helikesmysister.vs.Helikesvanillaicecream.

MFOI–VadulluiVodă,29July2016

Discourselevel:meaningofsequencesofsentencesMariadroppedtheeggfromherhand.Shecleanedthefloor.

MFOI–VadulluiVodă,29July2016

Tolinksentenceswemakeinferences

Mariadroppedtheeggfromherhand.

MFOI–VadulluiVodă,29July2016

Tolinksentenceswemakeinferences

Mariadroppedtheeggfromherhand.

MFOI–VadulluiVodă,29July2016

Tolinksentenceswemakeinferences

Mariadroppedtheeggfromherhand.

MFOI–VadulluiVodă,29July2016

Tolinksentenceswemakeinferences

Mariadroppedtheeggfromherhand.

MFOI–VadulluiVodă,29July2016

Tolinksentenceswemakeinferences

Mariadroppedtheeggfromherhand.

MFOI–VadulluiVodă,29July2016

Tolinksentenceswemakeinferences

Shecleanedthefloor.Mariadroppedtheeggfromherhand.

MFOI–VadulluiVodă,29July2016

Tolinksentenceswemakeinferences

Shecleanedthefloor.Mariadroppedtheeggfromherhand.

MFOI–VadulluiVodă,29July2016

Tolinksentenceswemakeinferences

Shecleanedthefloor.Mariadroppedtheeggfromherhand.

MFOI–VadulluiVodă,29July2016

Tolinksentenceswemakeinferences

Shecleanedthefloor.Mariadroppedtheeggfromherhand.

MFOI–VadulluiVodă,29July2016

Tolinksentenceswemakeinferences

Shecleanedthefloor.Mariadroppedtheeggfromherhand.

MFOI–VadulluiVodă,29July2016

Tolinksentenceswemakeinferences

Shecleanedthefloor.Mariadroppedtheeggfromherhand.

MFOI–VadulluiVodă,29July2016

Tolinksentenceswemakeinferences

Shecleanedthefloor.Mariadroppedtheeggfromherhand.

MFOI–VadulluiVodă,29July2016

Tolinksentenceswemakeinferences

Shecleanedthefloor.Mariadroppedtheeggfromherhand.

MFOI–VadulluiVodă,29July2016

Tolinksentenceswemakeinferences

Mariadroppedtheeggfromherhand.drops(AG:Maria,OB:egg)=>falls(REC:egg)=>touches(AG:egg,OB:X)

Qualia.Formal(egg)=container;Qualia.Cons8tu8ve(egg)={eggshell(fragile),liquid}

=>breaks(REC:eggshell)=>leaks(REC:liquid,ON:X)=>perceives(AG:Maria,OB:dirty(X))

Shecleanedthefloor.=>cleans(AG:Maria,OB:floor)=>perceives(AG:Maria,OB:dirty(floor))

MFOI–VadulluiVodă,29July2016

Tolinksentenceswemakeinferences

ShecleanedthefloorMariadroppedtheeggfromherhand.

MFOI–VadulluiVodă,29July2016

Tolinksentenceswemakeinferences

Mariadroppedtheeggfromherhand.Sheturnedthelighton.

MFOI–VadulluiVodă,29July2016

Discourselevel:variabilityinlanguage

Meaning

Language Ambiguity

Variability

MFOI–VadulluiVodă,29July2016

Discourselevel:variabilityinlanguage

•  Reducethedistancebetweenformandmeaningare:Informa8onRetrieval(IE),TextualEntailment(TE)andQues8onAnswering(QA)

MFOI–VadulluiVodă,29July2016

TextualEntailment

•  Texttentailshypothesish(t⇒h)ifhumansreadingtwillinferthathismostlikelytrue

Atrueentailment•  t:…ashootoutattheGuadalajaraairportinMay,1993,thatkilledCardinalJuanJesusPosadasOcampoandsixothers.

•  h:CardinalJuanJesusPosadasOcampodiedin1993.

MFOI–VadulluiVodă,29July2016

TextualEntailment

…andofafalseone•  t:ReganaTendedaceremonyinWashingtontocommemoratethelandingsinNormandy.

•  h:WashingtonislocatedinNormandy.

MFOI–VadulluiVodă,29July2016

Howisentailmentchecked?

•  t:PhilanthropicGoldingInc.cameintoexistenceinJanuary2004.Oneyeara[eritsfounda4onthecompanydeclaredbankruptcy.

•  h:PhilanthropicGoldingInc.bankruptedinJanuary2005.

MFOI–VadulluiVodă,29July2016

Howisentailmentchecked?

•  Launchapipelineofprocesses,attheendofwhichthesentencesofbothtandhareexpressedinasymbolicformthatallowsclosecomparison.

MFOI–VadulluiVodă,29July2016

Howisentailmentchecked?

PhilanthropicGoldingInc.cameintoexistenceinJanuary2004.

•  Step1:tokenisa8on(notshown),part-of-speechtagging(notshown),chunkingnounphrasesandclashingmul8-wordexpressions.<NPid=”n1”>PhilanthropicGoldingInc.</NP><MWEid=”m1”>cameintoexistence</MWE>

MFOI–VadulluiVodă,29July2016

Howisentailmentchecked?

•  Step2:recogni8onofen8tymen8ons,of8meexpressionsandresolu8onofanaphora.<COREF-LISTid=”ent1”TYPE=“ENTITY”REF-LIST=”n1”/>

PhilanthropicGoldingInc.isanameden8ty

<TIMEX38d=”t1”type=”DATE”value=”2004-01”>January2004</TIMEX3>

January2004isatemporalexpression

MFOI–VadulluiVodă,29July2016

Howisentailmentchecked?

•  Step3:func8onaldependencyparsing;hereweshowaUniversalDependency(UD)coding

MFOI–VadulluiVodă,29July2016

Howisentailmentchecked?

•  Step4:8meanalysis,inwhichEVENTandTLINKelements,formalizingtheeventsandtheirtemporalrela8ons,aregenerated.<EVENTeid=”ev1”VB=”m1”AG=”ent1”/>

ThecamingintoexistenceofPhilanthropicGoldingInc.isanevent

<TLINKeventID="ev1"relatedToTime="t1"relType="BEGINS"/>

ThemomentofthiseventistheonecodedbythetemporalexpressionJanuary2004

MFOI–VadulluiVodă,29July2016

Howisentailmentchecked?•  Step5:equivalentstructures(transforma8ons)andcomputa8onoftransi8veclosuresoftemporalrela8ons:equivalenceoftheexpressions:XcomesintoexistenceandUNKNOWNfoundsXè<EVENTeid=”ev2”VB=”found”AG=”UNKNOWN”OB=”ent1”/>

ThecamingintoexistenceofPhilanthropicGoldingInc.canequallybeexpressedbyafoundingeventinwhichPGIhastheobjectrole.

<TLINKeventID="ev2"relatedToTime="t1"relType="BEGINS"/>ThemomentofthiseventistheonecodedbythetemporalexpressionJanuary

2004

MFOI–VadulluiVodă,29July2016

Howisentailmentchecked?

Oneyeara[eritsfounda4onthecompanydeclaredbankruptcy.

•  Step1:NP-chunking<NPid=”n3”><NPid=”n2”>its</NP>founda4on</NP><NPid=”n4”>thecompany</NP><NPid=”n5”>bankruptcy</NP>

MFOI–VadulluiVodă,29July2016

Howisentailmentchecked?

•  Step2:NER,TimexandAR<TIMEX38d=”t2”type=”DURATION”value=”P1Y”>oneyear</TIMEX3>

oneyearisatemporalexpression<COREF-LISTid=”ent1”TYPE=”ENTITY”REF-LIST=”n1n2n4”/>

itsandthecompanyarecoreferen8alwithPhilanthropicGoldingInc.

<COREF-LISTid=”eve1”TYPE=”EVENT”REF-LIST=”ev1ev2n3”/>itsfounda4onisrecognisedasaneventcoreferen8alwiththefoundingof

PhilanthropicGoldingInc.

<COREF-LISTid=”eve2”TYPE=”EVENT”REF-LIST=”n5”/>banckrupcyisrecognisedasanevent

MFOI–VadulluiVodă,29July2016

Howisentailmentchecked?

•  Step3:UD

MFOI–VadulluiVodă,29July2016

Howisentailmentchecked?

•  Step4:EVENTandTLINKelements<EVENTeid=”e3”POS=”VERB”CLASS=”REPORTING”AG=”ent1”OB=”eve2”>declared</EVENT><EVENTeid=”e4”POS=”NOUN”CLASS=”OCCURRENCE”AG=”ent1”>bankruptcy</EVENT>

BothactsofdeclaringbankruptcyandofbankruptcyitselfinvolvingPhilanthropicGoldingInc.arerecognisedasevents.

<TLINKeventID="e3"relatedToTime="t2"relType="AFTER"/><SLINKeventID="e3"subordinatedEvent="e4"relType="FACTIVE"/>Thedeclaringbankruptcyeventtakesplaceoneyearayerthefounda8on

event.

MFOI–VadulluiVodă,29July2016

Howisentailmentchecked?

•  Step5:theTimeClosuretool<TIMEX38d=”t4”type=”DATE”value=”2005-01-xx”/><TLINKeventID="e4"relatedToTime="t4"relType="DURING"/>

ThedeclaringbankruptcyeventtakesinJanuary2005.

MFOI–VadulluiVodă,29July2016

Howisentailmentchecked?PhilanthropicGoldingInc.bankruptedinJanuary2005.

•  Asimilarprocessingchainproduces:<EVENTeid=”e5”POS=”VERB”AG=”ent1”>bankrupted</EVENT>

AneventofbankruptcyinwhichisinvolvedPhilanthropicGoldingInc.

<TIMEX38d=”t5”type=”DATE”value=”2005-01-xx”>January2005</TIMEX3><TLINKeventID="e5"relatedToTime="t5"relType="DURING"/>

ThemomentofthiseventisJanuary2005.

Otherformalisms

•  NaturalLogic:TreestructuredRecursiveNeuralNetworkscanlearntoiden8fylogicalrela8onshipssuchasentailmentandcontradic8on…

MFOI–VadulluiVodă,29July2016

Andwhenlogicisofnouse?...

MFOI–VadulluiVodă,29July2016

Doublenega8on

•  DoubleNega?onlanguages(amongwhichstandardvarie8esofGermanicandScandinavian):–  twonega8veelementscanceleachotherout

resul8nginaposi8vereading:Pauldidn’tseenobody.=Paulsawsomebody.“Thereisanindividualx,suchthatPaulsawx.”

A.Falaus.RomanianN-wordsasNega4veQuan4fiers,WorkingPapersinLinguis8cs,31stAnnualPennLinguis8csColloquium,Univ.Pennsylvania,2008.

MFOI–VadulluiVodă,29July2016

Doublenega8on

•  Nega?veConcordlanguages(amongwhichRomanianandItalian):– mul8pleoccurrencesofnega8onareinterpretedasoneseman8cnega8on:Pauln-avăzutpenimeni.=Pauldidn’tseeanybody.“Itisnotthecasethatthereisanindividualx,suchthatPaulsawx.”

MFOI–VadulluiVodă,29July2016

Linearposi8onambivalence

•  Associa8onsnoun+adjec8vevs.adjec8ve+nounhavedifferentmeanings

femeiasingură=>thewomanalonesingurafemeie=>theonlywoman

A.Cornilescu.Thelineariza4onoftheRomanianadjec4vesandthestructureoftheRomanianDP,inTorckD.andWetzlesL.(eds),RomanceLanguages

andLinguis8cTheory,2006",JohnBenjamins,2009.

MFOI–VadulluiVodă,29July2016

Linearposi8onambivalence

today10yearsago

mașinalui(cea)vechevechealuimașină

MFOI–VadulluiVodă,29July2016

Linearposi8onambivalence…

•  …doesnotapplytoanyadjec8ve:certainmodifiersmakesenseonlywhensituatedinthepre-posi8onwithrespecttothemodifiednounbiet(poor,pi4ful)isnotacceptedunlessitprecedesthenoun:bietom(poorman),butnot:ombiet M.-D.Vulchanova.Modifica4onintheBalkannominalexpression:Anaccountof

the(A)NA–AN(A)ordercontract.InMar8neCoeneandYvesD’hulst(eds):FromNPtoDP:Thesyntaxandseman8csofnounphrases,JohnBenjamin,2003.

MFOI–VadulluiVodă,29July2016

Linearposi8on

•  Theintersec8on-basedcomposi8oncontradicted:–  ifX(adj)andY(noun),thenXY(orYX):•  setofobjectsYthathavethepropertyX•  intersec8onbetweenthesetofobjectshavingthepropertyXandthesetofobjectsY

è poormen:intersec8onbetweenthesetofthingswhicharepoorandthesetofmen

è s8ll,bieţiioameni:subsetofthesetofmenwhichareinapi8ful/miserablestate

MFOI–VadulluiVodă,29July2016

Contextsandthemistofpragma8cs

•  Textualcontext:sensefixedbythecontext•  Disambigua8oncomputedsta8s8cally…

GoogleTranslate

MFOI–VadulluiVodă,29July2016

Textualcontextandwordsenses

•  LogiclackspowerHowwouldalogicalsolu8onwork?Andifoneexists,whatwouldbethecostofthesuppor8velexical-seman8cresourcestogeneraliseit?

MFOI–VadulluiVodă,29July2016

Thewoodlanguage•  Wordsinducedifferentreac8onsinhumans:

herehumorous(contrarytotheinten8on)“SăluptămpentrupropăţireaneamuluişiaducereaRomânieipecelemaiînalteculmidecivilizaţiemul8lateraldezvoltată.”(approx.Let’sfighttothriveours4rpsandbringRomaniaonthehighestpeaksofmul4laterallydevelopedciviliza4on.)R.Zafiu.Limbadelemn(Thewoodlanguage).InDilemaveche,Nr.314/

18-24februarie,2010.

Thewoodlanguage

“Pusas�elînlumină,ancoratînsinergiafaptelor,recursullauniversalitatenueludeazămeandreleconcretului.”(approx.Thusputinlight,anchoredinthesynergyoffacts,theappealtouniversalitydoesnotcircumventthemeandersoftheconcrete.)

aUributedtoIonIliescu

MFOI–VadulluiVodă,29July2016

Styleinliterature

•  Humansperceiveco-occurrenceofwordsasproducingverysugges8veimages“constelațiaochilormei”(theconstella4onofmyeyes)“a8ngicuauzul”(approx.yourhearingtouches)“nisipuridefiară”(beastsands)NichitaStănescu,Autoportretîn4mpdeveghe(Autoportraitduringwatch

8me)

MFOI–VadulluiVodă,29July2016

Styleinliterature

•  Seizingemo8onsincurredbysentenceslikethefollowinginlogicalexpressions?"It’senoughformetobesurethatyouandIexistatthismoment.”

GabrielGarciaMarquez:OneHundredYearsofSolitude

MFOI–VadulluiVodă,29July2016

Styleinliterature

•  Formaliseinlogicaltermsametonymicsenseofanexpression?“lipindu-sederăcoareatoculuiuşii”(approx.s4ckingtothechillofthedoorframe)

GabrielGarciaMarquez:OneHundredYearsofSolitude

Atouchedobjectisreplacedwithasensa8onthattheagentborrowsfromthatobject.

MFOI–VadulluiVodă,29July2016

Styleinliterature

•  Lookforlogicalequivalentofmetaphoricallanguage:“Temângâicudegetelemuiateînamin8ri.”(Icaressyouwithmyfingersdippedinmemories)

MFOI–VadulluiVodă,29July2016

Styleinliterature

•  Confrontedwiththeextraordinarydiversityofsugges8onsthatwordscanconvey,logicseemstomefaint,forceless,impuissant.

•  Howcouldsuchpoe8calexpressionsbeencodedinlogicalconstruc8ons?

MFOI–VadulluiVodă,29July2016

Andthesolu8onis?

•  Logicprovessuccessfulinrepresen8ngmanylanguageaspects.

•  Thereshouldbealimitwheretheambi8ontoexpressnaturallanguageinlogicalformhastostopbecauseitreachesaninsurmountablelimit.

MFOI–VadulluiVodă,29July2016

Andthesolu8onis?•  4categoriesofthinkersontherela8onshipbetweenlanguageandlogic–  thelogicpurists:everythingcanbeexpressedinlogical(symbolic)forms

–  thesta8s8cal-neuralpurists:everythingcanbeexpressedbysta8s8cs/neuralformalisms

–  theskep8cals:languagecanneverbeinterpretedtotally,neitherbysymbolicnorsta8s8calmeans

–  themoderates,dirtyworkers:onlyacombina8onbetweenthetwoparadigmscanhelp,andthisonlytoacertainlimit

MFOI–VadulluiVodă,29July2016

Insteadofconclusions

•  Theirlackofconfidenceinlogicasauniversalmachineryforprocessinglanguagecomesfromobserva8onsoftheinabilityoflogictosupportexhaus8velytheprocessinginfrastructuresoflanguage.

•  Theydon’tbelievethateachsentence,oreachsequenceofsentences,shouldbetransformedintoatheoremthatnecessitatesaproof.

MFOI–VadulluiVodă,29July2016

Insteadofconclusions

•  Reasoning,thatpartoflanguageusethatnecessitatesvoli8onalconnec8onsinordertodecipherinforma8on,tofindexplicitlinks,withoutwhichunderstandingwouldbeimpossible–yes.

•  Primaryprocessesthatenabletheuseoflanguagetoexpressemo8ons,thereforethatallowcogni8onbasedonlanguage–no.

MFOI–VadulluiVodă,29July2016

Thankyou!

MFOI–VadulluiVodă,29July2016