AI Glossary / Natural language and speech / Advanced
Bracketed notation
Definition
Bracketed notation represents a hierarchical structure as text by placing each unit and its contents inside matching brackets or parentheses. In natural-language constituency parsing, it records a parse tree's labels, nesting, and word order without drawing the tree. It is a representation of a proposed analysis, not an algorithm that discovers that analysis.
What it means
A sentence contains words, but its grammatical organization also depends on which words belong together. Bracketed notation makes those groupings explicit. A noun phrase can contain another phrase, and a verb phrase can contain both a verb and its object. Nesting shows these relationships more clearly than a flat list of word tags.
Different brackets can encode the same tree if the format conventions agree. Labels such as NP and VP usually mean noun phrase and verb phrase, but a project must document its actual label inventory. The notation itself does not decide which linguistic theory or annotation scheme is correct.
How it works
In a common format, an opening parenthesis is followed by a node label, then its children, and finally a closing parenthesis. Children can be words or further parenthesized nodes. A reader works inward to identify substructures and outward to see which larger structure contains them.
A program can recover this organization by tracking currently open nodes. Each opening delimiter starts a node; each closing delimiter finishes the most recently opened unfinished node. The result must also follow the format's rules for labels, terminal tokens, and escaping characters.
Checking delimiter balance is only one test. A structurally readable tree can still have incorrect word order, unsuitable labels, or a linguistically mistaken attachment. Validation should distinguish successful reading of the notation from agreement with the intended analysis.
Three practical examples
- A parser exports sentence analyses as bracketed trees so another application can identify complete noun phrases rather than isolated nouns.
- An annotation team stores proposed and corrected structures in a treebank. Reviewers compare the nesting to find attachment disagreements even when every word is identical.
- A grammar lesson presents a compact tree beside an ordinary sentence. Learners expand its nested phrases into a diagram and check that the diagram preserves the original grouping.
Think of it this way
Imagine nested folders written on one line. A folder's opening marker begins its contents, and its closing marker ends them. Moving an item outside a folder changes its parent even if the item keeps its name. Bracketed trees work similarly, although their labels describe linguistic units rather than storage locations.
Worked example
Use the original sentence “Mira inspected crates with cameras”, with punctuation omitted for this exercise. Consider two simplified analyses using S for sentence, NP for noun phrase, VP for verb phrase, V for verb, PP for prepositional phrase, and P for preposition. Direct words under NP are a deliberate simplification; this is not a full treebank annotation.
Analysis A is:
(S (NP Mira) (VP (V inspected) (NP crates) (PP (P with) (NP cameras))))
Analysis B is:
(S (NP Mira) (VP (V inspected) (NP (NP crates) (PP (P with) (NP cameras)))))
Reading the leaves from left to right gives the same five words in both cases. In A, the PP is a child of VP and a sibling of the object NP. This supports an interpretation in which cameras are used for the inspection. In B, the PP belongs inside the larger object NP, supporting an interpretation involving crates associated with cameras.
Number token positions from zero: Mira is 0, inspected 1, crates 2, with 3, and cameras 4. Write spans as [start,end), excluding the end position. Both analyses contain the PP span [3,5). B additionally contains an NP spanning [2,5), whereas A's object NP spans only [2,3).
A therefore has eight labeled nodes and B has nine; B adds the outer object NP. These counts include all labeled nodes shown, including V and P, but exclude the five word leaves. Both are balanced representations. Neither balance nor identical leaves tells us which interpretation a particular conversation intended.
Illustrative case study
Fictional example: ClauseLens develops a tool for reviewing equipment descriptions. Its import process strips brackets to verify that the text matches the source sentence. That check succeeds even when an annotation mistakenly attaches an equipment phrase to an action instead of an object.
The team adds a structural comparison that reports each labeled phrase and its token span, and reviewers inspect differences against the surrounding description. They keep the original text check because missing words remain a separate problem. The scenario illustrates why preserving text and preserving structure require different checks; it does not claim that every attachment can be resolved without human judgment.
Common misconceptions and mistakes
Matching bracket counts alone do not prove proper nesting or a valid tree. Even a valid tree serialization does not prove a correct grammatical analysis. Another mistake is treating parentheses as part of the sentence when they are actually structural delimiters.
Formatting changes, such as indentation or extra spaces permitted by the reader, need not alter a tree. Moving a closing delimiter can alter it substantially. Finally, a constituency tree is not automatically a dependency tree: translating between representations requires additional rules and can lose distinctions.
Business use
Bracketed notation is useful when linguistic analyses must be stored, exchanged, reviewed, or reproduced. Specify the accepted format, tokenizer, labels, and handling of literal bracket characters. For imports, compare recovered words and structures with expected results. For parser evaluation, state which nodes count, since including or excluding punctuation, roots, and part-of-speech nodes changes what is measured.
People also ask
Is it the same as a parse tree?
It can encode a parse tree; a diagram and a bracketed string can represent the same structure.
Does it remove ambiguity?
One tree makes one analysis explicit. A sentence may still have several plausible trees.
Must it use square brackets?
No. Parentheses are also common, provided the reader and writer use compatible conventions.
Check your understanding
Why do A and B have identical words but different analyses?
Answer: The PP has a different parent, changing its attachment.
Does the PP span [3,5) differ between them?
Answer: No. Its words stay the same; its place in the hierarchy changes.
What extra phrase appears in B?
Answer: The larger NP covering crates with cameras, span [2,5).
Related terms
- Constituency parsing
- Parse tree
- Noun phrase
- Verb phrase
- Syntactic ambiguity
- Treebank
- Context-free grammar
- dependency parsing
Learn next
Practice converting a bracketed tree into a diagram and back without changing any node or leaf. Then compare labeled spans between alternative analyses and learn the annotation conventions of a specific treebank before interpreting its more detailed tags.
More in Natural language and speech
- Bitext word alignment - Definition: Bitext word alignment identifies corresponding words or tokens in two texts that express substantially the same content in different languages.
- Bound pronoun - A bound pronoun is a pronoun interpreted as a variable whose value depends on a binding expression, often a quantified noun phrase.
- Boundary tones - Boundary tones are tonal events associated with the edges of prosodic phrases in speech.
- Bridging inference - A bridging inference connects new information in a text to information already available by supplying an unstated relationship.
- Brill tagger - Definition: A Brill tagger is a part-of-speech tagging system that begins with an initial set of word labels and applies an ordered sequence of learned...
- Byte-pair encoding - Byte-pair encoding, or BPE, is a method that repeatedly merges frequent adjacent symbol pairs into larger symbols.
Sources
Jurafsky and Martin, Speech and Language Processing, chapter 19, sections 19.2–19.3: https://web.stanford.edu/~jurafsky/slp3/19.pdf NLTK, Tree documentation, bracketed string reading, labels, and leaves: https://www.nltk.org/api/nltk.tree.tree.html
Previous: Boykov-Kolmogorov Next: Bradley-Terry Model