Send Close Add comments: (status displays here)
Got it!  This site "creationpie.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.  Note: This appears on each machine/browser from which this site is accessed.
Sentence diagrams and parsing
by RS  admin@creationpie.com : 1024 x 640


1. Sentence diagrams and parsing
There are many parts of speech in what is called grammar.

2. Sentence diagrams and parsing
Sentence diagrams are a graphical way to show the semantic and syntactic structure of a sentence.
Due to differences in human opinion, speech, etc., there are many ambiguities that arise in the parsing of text. This can be the result of intentional ambiguity, deception, jokes, etc.

Information sign More: Word and parsing ambiguity

3. Sentence diagram ambiguity
Some people think that a sentence diagram will help understand the meaning. There is no magic in a sentence diagram.
Seldom can a fixed grammar create a sentence diagram. Even then, each POS (Part of Speech), with inflections, needs to be decided.

Thus, a sentence diagram is usually created by deciding what the parse should be and then creating a visual representation as a sentence diagram.

4. Stanford NLP
Language processing experts such as Chris Manning, director of the of Stanford Artificial Intelligence Laboratory (SAIL), claim a limit of about 94% on the accuracy with which computers can identify the proper POS of a word in a sentence using NLP (Natural Language Processing), computational linguistics, etc.
 
Why is there a limit on the accuracy computers can attain on part of speech identification?



Information sign More: Philippians 3:5-8 not by works

5. Stanford parser
The leading NLP group is at Stanford University, at https://www-nlp.stanford.edu. Their software is summarized and available from http://www-nlp.stanford.edu/software/index.shtml.

Here is an example sentence and the parse output from the Standford parser. This article contains a discussion of the history of commercial and academic efforts to automate patent classifications.…
(ROOT (S (NP (DT This) (NN article)) (VP (VBZ contains) (S (NP (NP (DT a) (NN discussion)) (PP (IN of) (NP (NP (DT the) (NN history)) (PP (IN of) (NP (UCP (JJ commercial) (CC and) (JJ academic)) (NNS efforts)))))) (VP (TO to) (VP (VB automate) (NP (NN patent) (NNS classifications)))))) (. .))) det(article-2, This-1) nsubj(contains-3, article-2) root(ROOT-0, contains-3) det(discussion-5, a-4) nsubj(automate-15, discussion-5) det(history-8, the-7) prep_of(discussion-5, history-8) amod(efforts-13, commercial-10) conj_and(commercial-10, academic-12) amod(efforts-13, academic-12) prep_of(history-8, efforts-13) aux(automate-15, to-14) xcomp(contains-3, automate-15) nn(classifications-17, patent-16) dobj(automate-15, classifications-17) (ROOT (S (NP (PRP It)) (ADVP (RB also)) (VP (VBZ suggests) (NP (NP (JJ new) (NNS approaches)) (PRN (-LRB- -LRB-) (VP (VBG adding) (NP (JJ additional) (JJ structured) (NN language)) (PP (TO to) (NP (DT the) (NN text)))) (-RRB- -RRB-)) (SBAR (WHNP (WDT that)) (S (PRN (-LRB- -LRB-) (S (NP (PRP it)) (VP (VBZ asserts))) (-RRB- -RRB-)) (VP (VBP lead) (PP (TO to) (NP (ADJP (RB statistically) (JJ meaningful)) (NNS improvements)))))))) (. .))) nsubj(suggests-3, It-1) advmod(suggests-3, also-2) root(ROOT-0, suggests-3) amod(approaches-5, new-4) dobj(suggests-3, approaches-5) nsubj(lead-20, approaches-5) dep(approaches-5, adding-7) amod(language-10, additional-8) amod(language-10, structured-9) dobj(adding-7, language-10) det(text-13, the-12) prep_to(adding-7, text-13) nsubj(asserts-18, it-17) parataxis(lead-20, asserts-18) rcmod(approaches-5, lead-20) advmod(meaningful-23, statistically-22) amod(improvements-24, meaningful-23) prep_to(lead-20, improvements-24)


6. Stanford tagger
Here is the output from the Stanford POS Tagger, a "maximum-entropy (CMM) part-of-speech (POS) tagger for English, Arabic, Chinese, French, and German, in Java ".
This_DT article_NN contains_VBZ a_DT discussion_NN of_IN the_DT history_NN of_IN commercial_JJ and_CC academic_JJ efforts_NNS to_TO automate_VB patent_NN classifications_NNS ._. It_PRP also_RB suggests_VBZ new_JJ approaches_NNS -LRB-_-LRB- adding_VBG additional_JJ structured_JJ language_NN to_TO the_DT text_NN -RRB-_-RRB- that_WDT -LRB-_-LRB- it_PRP asserts_VBZ -RRB-_-RRB- lead_NN to_TO statistically_RB meaningful_JJ improvements_NNS ._.



Information sign More: Natural Language Parsing examples

7. NLTK
The NLTK (Natural Language Tool Kit) is available for natural language parsing.

"NLTK is a leading platform for building Python programs to work with human language data. It provides easy-to-use interfaces to over 50 corpora and lexical resources such as WordNet, along with a suite of text processing libraries for classification, tokenization, stemming, tagging, parsing, and semantic reasoning." https://nltk.org

8. Example parse
Here is an example sentence and the parse tree from NLTK. NLTK parse tree


Information sign More: Natural Language Parsing examples

9. Simple parsing ambiguity example
Expression tree for (2 * 3) + 5 Expression tree for 2 * ( 3 + 5 )
1. Default precedence. 2. Non-default precedence
What is the value of the expression 2*3+5?

Math people tend to think in terms of text and parentheses.

Computer people tend to think in terms of trees without parentheses.

Changing the root changes the implicit parentheses.


A syntax tree, similar to a sentence diagram does not help decide the meaning since the syntax tree depicts the meaning as decided by the precedence rules. The usual mathematical rule is that multiplication is done first and then addition. Natural language does not have such default rules.

Without rules on operator precedence, the value is ambiguous. Mathematics tends to use parentheses to disambiguate. Computer science tends to use trees since trees are used internally for computational ordering. The parentheses disappear inside the computer. Here are two ways to parse 2*3+5.


10. Distribution
A property is "distributive" if it can be applied to both operands.

Expression tree for 2 * ( 3 + 5 ) Expression tree for (2 * 3) + (2 * 5)
2. Non-default precedence 2. Multiplication distributed

The same can happen in natural language.

11. Example
Concrete syntax:
good food and drink

The word "good" is an adjective that describes "food" and/or "drink". A textual way to show the abstract syntax tree is with parentheses. Here are two ways to parse the phrase. The second form can be distributed.

Abstract syntax:
1. (good food) and drink 2. good (food and drink) 2. (good food) and (good drink)

The first way is the usual way. Does this mean that the "drink" is "not good"? The phrase does not say. That part is ambiguous. The context of the phrase may change the parsing and the meaning. ... more to be added ...

12. Revelation 17:4
Verse routeRevelation 17:4 And the woman was arrayed in purple and scarlet colour, and decked with gold and precious stones and pearls, having a golden cup in her hand full of abominations and filthiness of her fornication: [kjv]
Verse routeκαι η γυνη ην περιβεβλημενη πορφυρουν και κοκκινον και κεχρυσωμενη χρυσιω και λιθω τιμιω και μαργαριταις εχουσα ποτηριον χρυσουν εν τη χειρι αυτης γεμον βδελυγματων και τα ακαθαρτα της πορνειας αυτης [gnt]

In some, but not all, cases the inflections in Greek can help disambiguate a parse.

Concrete syntax:

precious stones and pearls

Abstract syntax:

1. (precious stones) and pearls 2. precious (stones and pearls) 2. (precious stones) and (precious pearls)

In this case, masculine "stone" is singular but translated as plural in the KJV (King James Version). The word "pearls" is masculine and plural. Thus, the first abstract syntax fits better.

13. Revelation 17:4 Parts of speech
Verse routeRevelation 17:4 And the woman was arrayed in purple and scarlet colour, and decked with gold and precious stones and pearls, having a golden cup in her hand full of abominations and filthiness of her fornication: [kjv]
Verse routeκαι η γυνη ην περιβεβλημενη πορφυρουν και κοκκινον και κεχρυσωμενη χρυσιω και λιθω τιμιω και μαργαριταις εχουσα ποτηριον χρυσουν εν τη χειρι αυτης γεμον βδελυγματων και τα ακαθαρτα της πορνειας αυτης [gnt]

Revelation 17:4
Strong Used Unique Word Part of speech
G2532 8954 8954 και conjunction
G3588 19706 981 η article nominative singular feminine
G1135 219 76 γυνη noun nominative singular feminine
G1510 2435 313 ην verb imperfect active indicative 3rd person singular
G4016 23 3 περιβεβλημενη verb perfect passive participle nominative singular feminine
G4210 4 4 πορφυρουν adjective accusative singular neuter
G2532 8954 8954 και conjunction
G2847 6 3 κοκκινον adjective accusative singular neuter
G2532 8954 8954 και conjunction
G5558 2 2 κεχρυσωμενη verb perfect passive participle nominative singular feminine
G5557 12 6 χρυσω noun dative singular masculine
G2532 8954 8954 και conjunction
G3037 60 10 λιθω noun dative singular masculine
G5093 13 4 τιμιω adjective dative singular masculine
G2532 8954 8954 και conjunction
G3135 9 2 μαργαριταις noun dative plural masculine
G2192 702 15 εχουσα verb present active participle nominative singular feminine
G4221 31 24 ποτηριον noun accusative singular neuter
G5552 18 6 χρυσουν adjective accusative singular neuter
G1722 2735 2735 εν preposition
G3588 19706 878 τη article dative singular feminine
G5495 175 20 χειρι noun dative singular feminine
G846 5547 166 αυτης personal pronoun genitive singular feminine
G1073 11 1 γεμων verb present active participle nominative singular masculine
G946 6 2 βδελυγματων noun genitive plural neuter
G2532 8954 8954 και conjunction
G3588 19706 826 τα article accusative plural neuter
G169 31 6 ακαθαρτα adjective accusative plural neuter
G3588 19706 1291 της article genitive singular feminine
G4202 24 11 πορνειας noun genitive singular feminine
G846 5547 166 αυτης personal pronoun genitive singular feminine

14. Revelation 17:4
 All 
KJV: And the woman was arrayed in purple and scarlet colour, and decked with gold and precious stones and pearls, having a golden cup in her hand full of abominations and filthiness of her fornication:
Greek: και η γυνη η ην περιβεβλημενη πορφυρα πορφυρουν και κοκκινω κοκκινον και κεχρυσωμενη χρυσω χρυσιω και λιθω τιμιω και μαργαριταις εχουσα χρυσουν ποτηριον χρυσουν εν τη χειρι αυτης γεμον βδελυγματων και ακαθαρτητος τα ακαθαρτα της πορνειας αυτης

15. Titus 3:3
Verse routeTitus 3:3 For we ourselves also were sometimes foolish, disobedient, deceived, serving divers lusts and pleasures, living in malice and envy, hateful, and hating one another. [kjv]
Verse routeημεν γαρ ποτε και ημεις ανοητοι απειθεις πλανωμενοι δουλευοντες επιθυμιαις και ηδοναις ποικιλαις εν κακια και φθονω διαγοντες στυγητοι μισουντες αλληλους [gnt]

The Greek does not appear to match the KJV translation. That is, the "divers" or "varied" appears to go with "pleasures" and not "lusts" or "desires". Another way to parse the sentence fragment is (by distribution) as follows.

16. End of page

by RS  admin@creationpie.com : 1024 x 640