entity_resolution_prompt.py

Overview

This file defines a single constant string, ENTITY_RESOLUTION_PROMPT, which serves as a templated prompt for use in natural language processing (NLP) tasks related to entity resolution. Entity resolution involves determining whether two references (e.g., product names, place names) refer to the same real-world entity.

The prompt is designed to instruct an AI or language model to:

This prompt is highly structured and includes:

The file is intended for use as a prompt template in an AI-driven entity resolution pipeline or system, where it can be programmatically filled and passed to a language model for inference.


Contents

Constant

ENTITY_RESOLUTION_PROMPT

from entity_resolution_prompt import ENTITY_RESOLUTION_PROMPT

record_delimiter = "\n"
entity_index_delimiter = "#"
resolution_result_delimiter = "~"
input_text = '''name of Product A is : "laptop", name of Product B is :"notebook"
name of Product A is : "chair", name of Product B is :"table"'''

# Fill in the placeholders
prompt = ENTITY_RESOLUTION_PROMPT.format(
    record_delimiter=record_delimiter,
    entity_index_delimiter=entity_index_delimiter,
    resolution_result_delimiter=resolution_result_delimiter,
    input_text=input_text
)

print(prompt)

This example shows how to dynamically insert the delimiters and input text into the prompt before sending it to a language model.


Implementation Details


Interaction with Other System Components


Visual Diagram

The following Mermaid class diagram represents the structure and relationships within this file:

classDiagram
    class entity_resolution_prompt.py {
        <<constant>>
        +ENTITY_RESOLUTION_PROMPT: str
    }

Note: This file contains only a single constant, so the diagram is simple, showing the constant as the main artifact.


Summary


If you need further details about how to integrate this prompt in your system or examples of prompt usage in code, please let me know!