1 / 29

Izmit, June 16, 2012

Izmit, June 16, 2012. Man-Machine Communication Parsing and Semantic analysis of Natural Language. Zygmunt Vetulani. Adam Mickiewicz University in Poznań Dept of Computer Linguistics and Artificial Intelligence vetulani@amu.edu.pl.

ornice
Télécharger la présentation

Izmit, June 16, 2012

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Izmit, June 16, 2012 Man-Machine Communication Parsing and Semanticanalysis of Natural Language Zygmunt Vetulani Adam Mickiewicz UniversityinPoznań Dept of Computer Linguistics and ArtificialIntelligence vetulani@amu.edu.pl

  2. Parsing and Semanticanalysis of Natural Language Izmit, June 12, 2014

  3. Parsing and Semanticanalysis of Natural Language Formal Language Terminal symbols: Polish (Turksh ?) words Non-terminal symbols : grammarcategorysymbols (S, Sb, Ob,...) Initial symbol : S Contextfreerules(rewrittingrules, productionrules): orderedpairs <LS,RS>, where LS is a single non-terminal symbol, RS is a finitesequence of terminal and/or non-terminal symbols Notation: instead<LS,RS> we use to write LS RS The re-writingoperationconsists in replacement od the non-terminal symbol LS by the sequence PS for somerule LS PS Contextfreegrammarisanarbitrary set of context-freerules Izmit, June 12, 2014

  4. Derivation: P */G W : „W is the result of a finiteiteration of the rewritingoperations (first applied to P) on the basis of the context-freerewritingrules from G: By the„languagedefined by thegrammar G” we meanthefollowing set L(G): L(G) =df{W: for S being the initial symbol S */G W, whereW is a sequence of terminal symbols} IDEA: ConsiderPolish (Turkish etc.) as formallanguage(seeMontague) Computational PROBLEM : Findsuch a grammarthat: L(G) = the set of all correct sentences of Polish (similar for Turkish, English, …) Izmit, June 12, 2014

  5. Parsing and Semanticanalysis of Natural Language For the CF grammarsthereexisteffectiveparsingalgorithms BUT some (rare) natural languagesare not context-free. (as e.g. one of the Swiss-German dialects (by Zürich), whereconstructionslike NP1NP2NP3NP4NP5V1V2V3V4V5 areinuse. In (Gazdar & Mellish, 1989), p. 134, one canfind an example(in Englishtranscription) wherethesentencewiththemeaningequivallent to Claudia watched Helmut (who) letEva to help Hans make Ulrikework will have the surface form as follows Claudia Helmut Eva Hans Ulrikewatchedlet help make work. Izmit, June 12, 2014

  6. Parsing and Semanticanalysis of Natural Language Anexample of a CF grammar for a small fragment of Polish: a grammar for the sentence „Ala owns a nice cat” ("Ala ma ładnego kota") (and someother). S Sb Pred Sb NG NGName NGAdjNoun NGNGConectiveNG PredVerbNG Verb "ma" Verb "miał" Verb "miała”. Name "Ala" Name "Olek" Adj "ładnego" Adj "złego" Noun "kota" Noun "psa" Connective "oraz " Connective ”i " S stands for „sentence” Sb stands for „subject” NGstands for „noungroup” Predstands for „predicationphrase” Izmit, June 12, 2014

  7. Parsing and Semanticanalysis of Natural Language DCG notation ( DCG – DefiniteClauseGrammar) The DCG notationallowstheusage of parametersincombinationwiththe non-terminal and terminal symbols. Thesesymbolsmustopenspecial argument positions for parameters Nonterminalsymbols with parameters (arguments) areterms in which argument positionsareoccupied by theseparameters (constantsorvariables). Example : definition of a „sentence” inthe DCG notation : S  Sb(Number,Number,nominative) Pred(Number,Gender) Pred(Number,Gender) Verb(Number,Gender) NG(_,_,accusative) ... Izmit, June 12, 2014

  8. Parsing and Semanticanalysis of Natural Language Translatinggrammars to PROLOG CF grammarsmay be „translated” to PROLOG using the method of differencelists Bydifference list we mean a pair of twolists, thesecond of themisthen-thtail of the first one. Let (A,B) be a difference list. Thenwhatremainsfrom A afterthesubstraction of B iscalleddifferencedetermined by (A,B). For the non-terminal symbol K and the difference list (A,B) the predicateK(A,B) may be interpreted as follows: ”thecategory K isattributed to thedifferencedetermined by thedifference list (A,B)” Izmit, June 12, 2014

  9. Parsing and Semanticanalysis of Natural Language Thecontextfreerule C  A B may be interpreted as follows„thegiven list is of category C ifitsbeginningis of thecategory A and therestis of thecategory B”. In terms of differencelists we maysayit as follows : „ifthedifference (X0,X1) is of thecategory A, and thedifference (X1,X2) is of thecategory B, thenthedifference (X0,X2) is of thecategory C". Thislaststatementisexpressedin PROLOG as follows: c(X0,X2) :- a(X0,X1), b(X1,X2). TheruleCA t Bwhere t is a terminal symbol (or a sequence of terminal symbols) may be expressedin PROLOG as follows: c(X0,X2) :- a(X0,[t|X1]), b(X1,X2). The terminal ruleC tis to be translatedinto PROLOG as: c([t|X],X). Izmit, June 12, 2014

  10. Parsing and Semanticanalysis of Natural Language The CF rule K  t0 M0t1M1...tnMntn+1 wheretiis a sequence of terminal symbolsmay be translatedinto PROLOGU as: k([t0|X0],Xn+1) :- m0(X0,[t1|X1]) , m1(X1,[t2|X2]) , ... , mn(Xn,[tn+1|Xn+1]) Thetranslationoperationmay be extended to contextdependingrules of thefollowing form Kt t0 M0t1M1...tnMntn+1 In thiscasethe correct translation will be: k([t0|X0],[t|Xn+1]) :- m0(X0,[t1|X1]) , m1(X1,[t2|X2]) , ... , mn(Xn,[tn+1|Xn+1]) (In thisnotation [t|X] stands for concatenation of the list t withthe list X. ) Izmit, June 12, 2014

  11. Parsing and Semanticanalysis of Natural Language Letusnotice, thatthefollowingis a conditionalstatementaboutsequences of wordsinterms of relations (predicates) associatingcategories to differencelists. Itispossible to generalisethisformalisationconsideringcategorysymbols as parametersdenotingrelations(ratherthenpredicatesymbols). For thispurpose we introduce a general relationsegment.We thentranslate S SbPred into segment(s,X0,X2) :- segment(sb,X0,X1),segment(pred,X1,X2). We may of courseimposefurtherconstraints on the composition of largerfragments from the smallerones (as parts). E.g. theclause: segment(s,X0,X2) :- segment(sb,L,R,X0,X1),segment(pred,L,R,X1,X2). may be considered as thePROLOG translation of theCF-likeparametrizedrule S Sb(L,R) Pred(L,R) Izmit, June 12, 2014

  12. Conversion program (in PROLOG) of CF rulesinto PROLOG (according: Gazdar, Mellish, p. 114) konwersja((LSwe->PSwe),(LSwy:-PSwy)) :- LSwy=..[LSwe,S0,SN], dodzmienne(PSwe,S0,SN,PSwy). dodzmienne((PSwe1,PSwe2),S0,SN,PSwy) :- !, dodzmienne(PSwe1,S0,S1,PSwy1), dodzmienne(PSwe2,S1,SN,PSwy2), kombinacja(PSwy1,PSwy2,PSwy). dodzmienne(PSwe,S0,SN,true) :- islist(PSwe),!, append(PSwe,SN,S0). dodzmienne(PSwe,S0,SN,PSwy) :- atom(PSwe), PSwy=..[PSwe,S0,SN]. kombinacja(true,PSwy2,PSwy2):-!. kombinacja(PSwy1,true,PSwy1):-!. kombinacja(PSwy1,PSwy2,(PSwy1,PSwy2)). Izmit, June 12, 2014

  13. islist([]). islist([_|_]). %conversion of CF rules to Prolog konw_gram(G,P):-islist(G),konw_gram0(G,P). konw_gram0([],[]):-!. konw_gram0([R|G],[C|P]):-konwersja(R,C),konw_gram0(G,P). % conversion with the tnstalationprocedure (in PROLOG), whereassertz_progperforms the asert of the translatedclauses install_gram(G):-konw_gram(G,P),assertz_prog(P). assertz_prog(P):-islist(G),assertz_prog0(P). assertz_prog0([]):-!. assertz_prog0([C|P]):-assertz(C),assertz_prog0(P). Notice: the aboveconversionprocedureissimplified and the producedcodemay not behavecorrectlybecause of the „left-recursion” (itmayneed to be correctedmanually) Izmit, June 12, 2014

  14. PROLOG translation of thegrammar"Ala-ma-kota" into a RECOGNIZER s(X0,X2) :- sb(X0,X1), pred(X1,X2). sb(X0,X1) :- ng(X0,X1). ng(X0,X1) :- name(X0,X1). ng(X0,X1) :- noun(X0,X1). ng(X0,X2):- adj(X0,X1), noun(X1,X2). ng(X0,X2):- adj(X0,X1), name(X1,X2). ng(X0,X2):- ng(X0,["oraz"|X1]), ng(X1,X2). %left-recursion in „ng” pred(X0,X2):- verb(X0,X1), ng(X1,X2). verb(["ma"|X0],X0). verb(["miała"|X0],X0). verb(["kupił"|X0],X0). verb(["zobaczył"|X0],X0). verb(["zobaczyła"|X0],X0). adj(["ładna"|X0],X0). adj(["ładnego"|X0],X0). adj(["zły"|X0],X0). adj(["zła"|X0],X0). adj(["złego"|X0],X0). name(["ala"|X0],X0). name(["alę"|X0],X0). name(["olek"|X0],X0). name(["olka"|X0],X0). noun(["kot"|X0],X0). noun(["kota"|X0],X0). noun(["pies"|X0],X0). noun(["psa"|X0],X0). ........... Izmit, June 12, 2014

  15. Left-recursionsolving ng(X0,X1) :- ng0(X0,X1). ng(X0,X1) :- ng1(X0,X1). ng0(X0,X1) :- name(X0,X1). ng0(X0,X1) :- noun(X0,X1). ng0(X0,X2):- adj(X0,X1), noun(X1,X2). ng0(X0,X2):- adj(X0,X1), name(X1,X2). ng1(X0,X2):- ng0(X0,["oraz"|X1]), ng(X1,X2). %left-recursioneliminated pred(X0,X2):- verb(X0,X1), ng(X1,X2). %Conjunction ng1(X0,X3):- ng0(X0,X1]), connective(X1,X2), ng(X2,X3). connective(["i"|X0],X0). connective(["oraz"|X0],X0). connective(["lub"|X0],X0). connective([","|X0],X0). Izmit, June 12, 2014

  16. PROLOG translation of the grammar "Ala-ma-kota" into a PARSER s(sentence(A,B),X0,X2) :- sb(A,X0,X1),pred(B,X1,X2). pred(predicate_group(A,B),X0,X2):- verb(A,X0,X1), ng(B,X1,X2). sb(subject(A),X0,X1) :- ng(A,X0,X1). ng(noun_gr_simple(A),X0,X1) :- ng0(A,X0,X1). ng(noun_gr_comp(A),X0,X1) :- ng1(A,X0,X1). ng0(name(A),X0,X1) :- name(A,X0,X1). ng0(noun(A),X0,X1) :- noun(A,X0,X1). ng0(adj_noun(A,B),X0,X2):- adj(A,X0,X1), noun(B,X1,X2). ng0(adj_name(A,B),X0,X2):- adj(A,X0,X1), name(B,X1,X2). ng1(noun_gr_con(A,B,C),X0,X3):- ng0(A,X0,X1]), connective(B,X1,X2), ng(C,X2,X3). Izmit, June 12, 2014

  17. verb(verb(['mieć',3,sing,_,present]),["ma"|X0],X0). verb(verb(['mieć',3,sing,masc.prze]),["miał"|X0],X0). verb(verb(['mieć',3,sing,fem,past]),["miała"|X0],X0). verb(verb(['kupić',3,sing,masc.prze]),["kupił"|X0],X0). verb(verb(['zobaczyć',3,sing,masc.prze]),["zobaczył"|X0],X0). verb(verb(['zobaczyć',3,sing,fem,past]),["zobaczyła"|X0],X0). adj(adjective(['ładny',nom,sing,fem]),["ładna"|X0],X0). adj(adjective(['ładny',gen,sing,fem]),["ładnej"|X0],X0). adj(adjective(['ładny',acc,sing,fem]),["ładną"|X0],X0). adj(adjective(['ładny',nom,sing,m]),["ładny"|X0],X0). adj(adjective(['ładny',gen,sing,m]),["ładnego"|X0],X0). adj(adjective(['ładny',acc,sing,m]),["ładnego"|X0],X0). adj(adjective(['zły',nom,sing,m]),["zły"|X0],X0). adj(adjective(['zły',nom,sing,fem]),["zła"|X0],X0). adj(adjective(['zły',gen,sing,m]),["złego"|X0],X0). adj(adjective(['zły',acc,sing,m]),["złego"|X0],X0). name(name(['Ala',nom,sing,fem]),["ala"|X0],X0). name(name(['Ala',nom,acc,fem]),["alę"|X0],X0). name(name(['Olek',nom,sing,m]),["olek"|X0],X0). name(name(['Olek',acc,sing,m]),["olka"|X0],X0). noun(noun(['kot',nom,sing,m]),["kot"|X0],X0). noun(noun(['kot',acc,sing,m]),["kota"|X0],X0). noun(noun(['pies',nom,sing,m]),["pies"|X0],X0). noun(noun(['pies',acc,sing,m]),["psa"|X0],X0). connective(connective(['i']),["i"|X0],X0). connective(connective(['oraz']),["oraz"|X0],X0). connective(connective(['lub']),["lub"|X0],X0). connective(connective(['przecinek']),[","|X0],X0). Izmit, June 12, 2014

  18. Parsing and Semanticanalysis of Natural Language Parsingof a sentence"Ala ma ładnego kota" Prolog question: ?- s(T,['ala', 'ma', 'ładnego', 'kota'],[ ]). Answer: T=sentence(subject(noun_gr_simple(name(['Ala',nom,sing,fem]))),predicate_group(verb(['mieć',3,sing,_,present]),noun_gr_simple(adj_noun(adjective(['ładny',gen,sing,m])),noun(['kot',acc,sing,m] )) )) Notice: modification of a DCG resultedwith a self-parsinggrammar. Izmit, June 12, 2014

  19. Parsing and Semanticanalysis of Natural Language A self-parsinggrammarmay be extended to a semanticgrammarthrough a modification of syntacticproductionruleswithsemanticevaluationprocedures. Therule structure(...) :- substructure_a(...), substructure_b(...). will be transformed to structure(..., Structure_meaning)):- substructure_a(...,Substructure_meaning_a), substructure_b(...,Substructure_meaning_b), semantics(Substructure_meaning_a,Substructure_meaning_b,Structure_meaning). ‘semantics’ performsmeaningcomposition Examplebelow: application to „Ala ma kota” Izmit, June 12, 2014

  20. Semanticanalysis inDCG Assumption: semanticrepresentation of an affirmativesentence (=semanticcontent) providesinformationwhichsupportwhat the sentence tell usabout the world („world”=database) Remark: Answeringquestions „czy...?” consists in application of a semanticprocedurewhichcalculates the semanticcontent of the affirmativetextfollowing the questionword „czy” („whether”) Izmit, June 12, 2014

  21. Semanticanalysis inDCG An example of a „worlddescription” in PROLOG owns(ala,kot1). owns(ala,kot2). owns(ola,kot1). owns(ola,pies1). cats(kot1). cats(kot2). dogs(pies1). beatiful(kot1). Izmit, June 12, 2014

  22. Semanticanalysis inDCG TheAla-ma-kotagrammarwithsemantics % semantics of anaffirmativesentencereports on how the sentenceisvalidated in the world s(sentence(A,B),S,X0,X2) :- sb(A,S1,X0,X1),sb(B,S2,X1,X2),semantics(sentence,S1,S2,S). go(predicate_group(A,B),S,X0,X2):- verb(A,S1,X0,X1), ng(B,S2,X1,X2), semantics(predicate_group,S1,S2,S). sb(subject(A),S,X0,X1) :- ng(A,S,X0,X1). ng(noun_gr_simple(A),S,X0,X1) :- ng0(A,S,X0,X1). ng(noun_gr_comp(A),S,X0,X1) :- ng1(A,S,X0,X1). ng0(name(A),S,X0,X1) :- name(A,S1,X0,X1),semantics(name,S1,S). ng0(noun(A),S,X0,X1) :- noun(A,S1,X0,X1),semantics(rz,S1,S). ng0(adj_noun(adjective([F1|C]),noun([F2|C])),S,X0,X2):- adj(adjective([F1|C]),S1,X0,X1), noun(noun([F2|C]),S2,X1,X2), semantics(adj_noun,S1,S2,S). ng0(adj_name(adjective([F1|C]),prop_name([F2|C])),S,X0,X2):- adj(adjective([F1|C]),S1,X0,X1), name(prop_name([F2|C]),S2,X1,X2), semantics(adj_name,S1,S2,S). ng1(gr_noun_conn(A,B,C),S,X0,X3):- ng0(A,S1,X0,X1), connective(B,S2,X1,X2), ng(C,S3,X2,X3), semantics(noun_comp,S1,S2,S3,S). Izmit, June 12, 2014

  23. Semanticanalysis inDCG Ala-ma-kotadictionary verb(verb(['miecx',3,sing,_,present]),owns,['ma'|X0],X0). verb(verb(['miecx',3,sing,masc.prze]),owns,['mialx'|X0],X0). verb(verb(['miecx',3,sing,fem,past]),owns,['mialxa'|X0],X0). verb(verb(['miecx',3,mn,_,present]),owns,['majax'|X0],X0). przym(adjective(['lxadny',nom,sing,fem]),beatiful,['lxadna'|X0],X0). adj(adjective(['lxadny',gen,sing,fem]),beatiful,['lxadnej'|X0],X0). adj(adjective(['lxadny',acc,sing,fem]),beatiful,['zxadnax'|X0],X0). adj(adjective(['lxadny',nom,sing,m]),beatiful,['lxadny'|X0],X0). adj(adjective(['lxadny',gen,sing,m]),beatiful,['lxadnego'|X0],X0). adj(adjective(['lxadny',acc,sing,m]),beatiful,['lxadnego'|X0],X0). name(prop_name(['Ala',nom,sing,fem]),ala,[’Ala'|X0],X0). name(prop_name(['Ala',nom,acc,fem]),ala,[’Alex'|X0],X0). name(prop_name(['Ola',nom,sing,fem]),ola,[’Ola'|X0],X0). name(prop_name(['Ola',acc,sing,fem]),ola,[’Olex'|X0],X0). zaimek_pytajny(zaim_pyt([’kogo',acc,sing,m]),kogo,['kogo'|X0],X0). noun(noun(['kot',nom,sing,m]),cats,['kot'|X0],X0). noun(noun(['kot',acc,sing,m]),cats,['kota'|X0],X0). noun(noun(['pies',nom,sing,m]),dogs,['pies'|X0],X0). noun(noun(['pies',acc,sing,m]),dogs,['psa'|X0],X0). spojnik(connective(['i']),i,['i'|X0],X0). connective(connective(['oraz']),i,['oraz'|X0],X0). Izmit, June 12, 2014

  24. Semanticanalysis inDCG Semantic and auxiliaryprocedures: semantics(adj_noun,S1,S2,S) :- ekstensja_konceptu(S1,E1),ekstensja_konceptu(S2,E2), przekroj(E2,E1,S). semantics(name_z_prz,S1,S2,S) :- ekstensja_konceptu(S1,E1), ekstensja_nazwy(S2,E2), przekroj(E2,E1,S). semantics(rz,S,E) :- ekstensja_konceptu(S,E). semantics(name,S,E) :- ekstensja_nazwy(S,E). semantics(noun_comp,S1,i,S3,S) :- suma_zbiorow(S1,S3,S). semantics(predicate_group,S1,S2,[S1,S2]). semantics(sentence,S1,[S2,S3],S):-lista_faktow(S2,S1,S3,S). semantics(sentence,[ala],[owns,[kot1,kot2]],S) ekstensja_konceptu(S,E):- T=..[S,X], setof(X,T,E). ekstensja_nazwy(S,[S]). lista_faktow(P,D1,D2,F) :- T=..[P,X,Y],setof(T,(nal-do(X,D1),nal-do(Y,D2),T), F). lista_faktow(owns,[ala],[kot1,kot2],F) suma_zbiorow(X,Y,Z) :- append(X,Y,Z0),bez_powtorzen(Z0,Z). nal-do(E,[E|_]). nal-do(E,[_|X]):-nal-do(E,X). Izmit, June 12, 2014

  25. Semanticanalysis inDCG Example of a query: ?- s(X,Y,[‘Ala’,’i’,’Ola’,’mają’,’kota’],[ ]). Answer: X=sentence(subject(noun_gr_comp(gr_noun_connective(name(prop_name([‘Ala’,nom,sing,fem])),connective([i]),noun_gr_simple(name(name([‘Ola’,nom,sing,fem])))))),predicate_group(verb([miecx,3,mn,_0458,past]),noun_gr_simple(noun(noun([kot,acc,sing,m]))))) Y= [owns(ala,kot1),owns(ala,kot2),owns(ola,kot1)] Izmit, June 12, 2014

  26. Semanticanalysis inDCG The 2-run analysis of a sentence. The first run (N=0) isnon-deterministic, thesecond run (N=1) isdeterministic, as itiscontrolled by thesyntactictreecalculatedatthe first run (X). ?- s(0,X,_,[‘Ala’,’i’,’Ola’,’mają’,’kota’],[ ]), s(1,X,Y,[‘Ala’,’i’,’Ola’,’mają’,’kota’],[ ]). Answer: X=sentence(subject(noun_gr_comp(gr_noun_connective(name(prop_name([‘Ala’,nom,sing,fem])),connective([i]),noun_gr_simple(name(prop_name([‘Ola’,nom,sing,fem])))))),predicate_group(verb([miecx,3,mn,_0458,past]),noun_gr_simple(noun(noun([kot,acc,sing,m]))))) Y= [owns(ala,kot1),owns(ala,kot2),owns(ola,kot1)] Izmit, June 12, 2014

  27. Semanticanalysis inDCG Transformaction to a 2-runs grammar (addition of the variable N with values 0 or 1) s(N,sentence(A,B),S,X0,X2) :- sb(N,A,S1,X0,X1),sb(N,B,S2,X1,X2),semantics(N,sentence,S1,S2,S). question_about_subject(A,B),S,X0,X2) :- interrogative_subject_phrase(N,A,S1,X0,X1),sb(N,B,S2,X1,X2),semantics(N,pyt_o_podmiot,S1,S2,S). sb(N,predicate_group(A,B),S,X0,X2):- verb(A,S1,X0,X1), ng(B,S2,X1,X2), semantics(N,predicate_group,S1,S2,S). sb(N,subject(A),S,X0,X1) :- ng(N,A,S,X0,X1). ng(N,noun_gr_simple(A),S,X0,X1) :- ng0(N,A,S,X0,X1). ng(N,noun_gr_comp(A),S,X0,X1) :- ng1(N,A,S,X0,X1). ng0(N,name(A),S,X0,X1) :- name(A,S1,X0,X1),semantics(N,name,S1,S). ng0(N,noun(A),S,X0,X1) :- noun(A,S1,X0,X1),semantics(N,rz,S1,S). ng0(N,adj_noun(adjective([F1|C]),noun([F2|C])),S,X0,X2):- adj(adjective([F1|C]),S1,X0,X1), noun(noun([F2|C]),S2,X1,X2), semantics(N,adj_noun,S1,S2,S). ng0(N,adj_name(adjective([F1|C]),prop_name([F2|C])),S,X0,X2):- adj(adjective([F1|C]),S1,X0,X1), name(prop_name([F2|C]),S2,X1,X2), semantics(N,adj_name,S1,S2,S). ng1(N,gr_noun_connective(A,B,C),S,X0,X3):- ng0(N,A,S1,X0,X1), connective(B,S2,X1,X2), ng(N,C,S3,X2,X3), semantics(N,noun_comp,S1,S2,S3,S). Izmit, June 12, 2014

  28. Semanticanalysis inDCG Transformation of thesemanticprocedures: semantics(0,_,_,_). semantics(0,_,_,_,_). semantics(0,_,_,_,_,_). semantics(1,adj_noun,S1,S2,S) :- ekstensja_konceptu(S1,E1),ekstensja_konceptu(S2,E2), przekroj(E2,E1,S). semantics(1,name_z_prz,S1,S2,S) :- ekstensja_konceptu(S1,E1), ekstensja_nazwy(S2,E2), przekroj(E2,E1,S). semantics(1,rz,S,E) :- ekstensja_konceptu(S,E). semantics(1,name,S,E) :- ekstensja_nazwy(S,E). semantics(1,noun_comp,S1,i,S3,S) :- suma_zbiorow(S1,S3,S). semantics(1,predicate_group,S1,S2,[S1,S2]). semantics(1,sentence,S1,[S2,S3],S):-lista_faktow(S2,S1,S3,S). Izmit, June 12, 2014

  29. Furtherexercices: • takeintoaccountaccord and governmentconstraintswithin a sentence • processing of ‘czy’-questions • processing of questionsaboutsubject and complements Izmit, June 12, 2014

More Related