A paragraph is a sequence of sentences.
Paragraph Representation Theory
The Quantization Standard Method in the first-order logic is limited to a single sentence, but some quantifiers can be expanded to more than two sentences.
See the following example:
(54&own(Angus, x)&bite(x, Irene))
The objective of Discourse RepresentationTheory (DRT) is to provide a way to process this and other semantic phenomena that seem to be the features of a paragraph.
DRS (discourse representation structure, DRS) Section representation structure
:
>>> Drs1 = dp. parse (>>>
You can view the visual effect:
>>>drs1.draw()
& Dog (y) & own (x, y ))
The DRT expression has the DRS join operator, which is expressed as +.
>>>drs2 = dp.parse(>>>+>>>
One DRS is embedded into another DRS. This is the way in which the full name quantifiers are processed.
>>>drs3 = dp.parse(>>>-> exists y.(ankle(y) &bite(x,y)))
If DRS contains conditions in the PRO (x) format, replace the resolve_anaphora () method with x = [...] format conditions, where [...] is a possible first-line word linked list.
>>>drs4 = dp.parse(>>>drs5 = dp.parse(>>>drs6 = drs4 +>>>>>>= [x,y,z]), irene(z), bite(u,z)])
The existing mechanism of DRS processing and processing λ abstraction is compatible.
Det[NUM=sg,SEM=<\P Q.([x],[])+ P(x)+ Q(x)>]-> =sg,SEM=<\P Q.exists x.(P(x)&Q(x))>]->
For example, a dog:
(NP[NUM=, SEM=<\Q.(([x],[dog(x)])+ Q(x))>, SEM=<\PQ.((([x],[])+ P(x))+ Q(x))>=, SEM=<\x.([],[dog(x)])>=, SEM=<\x.([],[dog(x)])>]dog)))))
We can use the DRT Parsing Method to parse sentences:
>>> nltk >>>parser= load_parser(, logic_parser=>>>trees = parser.nbest_parse(>>> trees[0].node[
Paragraph Processing
A paragraph is a sentence sequence, s1, s2, s3... The paragraph line is the sequential s1-ri of reading ,... Sn-f.
>>>dt =nltk.DiscourseTester([,>>>-r0: exists x.(student(x)&-r0: all x.(student(x)-> person(x))
We can add sentences and delete sentences at any time. Setting consistchk = True can check the reading sequence that can be received to check the consistency of the module:
>>>dt.add_sentence(,consistchk=, , -r0: exists x.(student(x)&-r0: all x.(student(x) ->-r0: -exists x.(person(x)&>>>dt.retract_sentence(,verbose= a person
We use informchk = True to check whether the new sentence.
>>>dt.add_sentence(,informchk=under reading