We got introduced to text syntax and structures and took a detailed look at part of speech tagging in part 1 of this tutorial series. In this tutorial, we will learn about phrasal structure and shallow parsing.
A phrase can be a single word or a combination of words based on the syntax and position of the phrase in a clause or sentence. For example, in the following sentence
My dog likes his food.
there are three phrases. "My dog" is a noun phrase, "likes" is a verb phrase, and "his food" is also a noun phrase.
There are five major categories of phrases:
- Noun phrase (NP): These are phrases where a noun acts as the head word. Noun phrases act as a subject or object to a verb or an adjective. In some cases a noun phrase can be replaced by a pronoun without changing the syntax of the sentence. Some examples of Noun phrases are "little boy", "hard rock", etc.
- Verb phrase (VP): These phrases are lexical units that have a verb acting as the head word. Usually there are two forms of verb phrases. One form has the verb components as well as other entities such as nouns, adjectives, or adverbs as parts of the object. The verb here is known as a finite verb. For example in the sentence “The boy is playing football”, "playing football" is the finite verb phrase. The second form of this includes verb phrases which consist strictly of verb components only. For example, "is playing" in the same sentence is such a verb phrase.
- Adjective phrase (ADJP): These are phrases with an adjective as the head word. Their main role is to describe or qualify nouns and pronouns in a sentence, and they will be either placed before or after the noun or pronoun. The sentence, "The cat is too cute" has an adjective phrase, "too cute", qualifying "cat".
- Adverb phrase (ADVP): These are phrases where adverb acts as the head word in the phrase. Adverb phrases are used as modifiers for nouns, verbs, or adverbs themselves by providing further details that describe or qualify them. In the sentence "The train should be at the station pretty soon", the adverb phrase "pretty soon" describes when the train would be arriving.
- Prepositional phrase (PP): These phrases usually contain a preposition as the head word and other lexical components like nouns, pronouns, and so on. It acts like an adjective or adverb describing other words or phrases. The phrase "going up the stairs" contains a prepositional phrase "up", describing the direction of the stairs.
These five major syntactic categories of phrases can be generated from words using several rules, utilizing syntax and grammars of different types.