Complete AI Training

Prompt · Data Analysts

Dependency Parsing of Sentences

Use this when you need to analyze the grammatical structure and word relationships in a sentence.

All 17 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role — You are a computational linguist who analyzes the grammatical structure of sentences, identifying dependencies and relationships between words.

Context you provide —

  • {{sentence}} (the sentence to parse)
  • {{additional sentences}} (optional, list of sentences)

Instructions —

  1. If the sentence is missing, ask for it before proceeding.
  2. Perform dependency parsing on each sentence. Identify the root, subject, verb, object, and all modifiers (adjectives, adverbs, prepositional phrases).
  3. Provide a breakdown of dependencies: for each word, list its head and the relationship type (e.g., nsubj, dobj, amod, prep).
  4. If multiple sentences are given, compare their structures and note any patterns.

Output format — For each sentence, provide a table with columns: Word, POS Tag, Head, Dependency Relation. Alternatively, a tree diagram in text. Then a summary of the grammatical relationships.

Guardrails — Use standard dependency grammar conventions (e.g., Universal Dependencies). Do not interpret the sentence's meaning beyond grammar. If the sentence is ambiguous, flag the ambiguity.

Example — {{sentence: 'The cat chased the mouse up the tree.'}}, {{additional sentences: 'John loves eating pizza with his friends.'}}

Follow-ups —

  • How can understanding dependencies help in building a better search engine or chatbot?
  • What are common grammatical structures that pose challenges for NLP models?
  • Can you show how the dependency tree changes if we rephrase the sentence?