Skip to content

🌩 Relation Extraction Prompts

Abstract

This section covers the prompts for "Relation Extraction" task.

Relation extraction (RE) is a natural language processing (NLP) task that aims to extract the entities and classify the semantic relationships between entities within a given text. For relation extraction, you can write a prompt like this

Prompt

You are a medical expert and good at English. Perform relation extraction on the given text containing 
medical entities.

Text: The patient was diagnosed with diabetes and prescribed metformin to control blood sugar levels.

Format: Present the extracted medical entities and their relationships as a table with the columns entity-1, 
entity-2, relationship.

Extracted medical entities and relationships:

Output

Entity-1 Entity-2 Relationship
Patient Diabetes Diagnosed with
Diabetes Blood sugar levels Affects
Metformin Blood sugar levels Controls
Physician Metformin Prescribed