raphaelmansuy/thoughtdense

Incomplete prompt: `ENTITY_CONSTRAINTS` is not added to the final prompt before passing to LLM.

nkilm opened this issue · 0 comments

Description

ENTITY_CONSTRAINTS is not included in the final prompt, perhaps you forgot to include it?

thoughtdense/cod.py

Lines 20 to 27 in a58e223

ENTITY_CONSTRAINTS = """
A Missing Entity is:
- Relevant: to the main story
- Specific: descriptive yet concise (5 words or fewer)
- Novel: not in the previous summary
- Faithful: present in the Article
- Anywhere: located anywhere in the Article
"""

In get_prompt() function, we are not proving the definition for Missing Entity.

We can modify the get_prompt() as follows,

def gen_prompt(document: str) -> str:
    """
    Generate the CoD prompt for a document.
    """
    prompt = (
        f"Article: {{{document}}}\n"
        "You will generate increasingly concise, entity-dense summaries of "
        "the above Article.\n"
        f"{VERBOSITY_GUIDELINES}\n"
        f"{FUSION_INSTRUCTIONS}\n"
        'Step 1. Identify 1-3 informative Entities (";" delimited) from the '
        "Article which are missing from the previously generated summary.\n"
        "Step 2. Write a new, denser summary of identical length which covers "
        "every entity and detail from the previous summary plus the Missing "
        "Entities.\n"
+		f"{ENTITY_CONSTRAINTS}"
        f"{VERBOSITY_GUIDELINES}\n"
        f"{RESULT_FORMAT}\n"

    )
    return prompt