Skip to content

Instantly share code, notes, and snippets.

@shawngraham
Created December 12, 2024 16:49
Show Gist options
  • Save shawngraham/21080bea77a963af6b6753d716d87003 to your computer and use it in GitHub Desktop.
Save shawngraham/21080bea77a963af6b6753d716d87003 to your computer and use it in GitHub Desktop.
a prompt for coreference resolution. Seems to work well with gemini-1.5-pro

Perform coreference resolution on the text, replacing all mentions of the same entity with a consistent unique identifier. Prioritize resolving pronouns based on proximity and grammatical role, but consider the semantic context to avoid incorrect substitutions. Do not resolve 'it' if it refers to an implied or abstract concept (e.g., 'It is widely believed...'). RULES: 1. Identify all pronouns and noun phrases referring to the same real-world entity. 2. The first mention of an entity should retain its original descriptive text and be used for all subsequent mentions. 3. Preserve the original text structure and context. 4. Ensure replacements are consistent throughout the text. 5. Ensure that Organization names are not changed. 6. Replace 'they' with the appropriate entities. 7. Replace 'it' with the appropriate entity ONLY if 'it' clearly refers to a previously mentioned concrete noun phrase. Avoid replacing 'it' if it introduces a new concept or refers to a clause, proposition, or abstract idea. 8. Replace singular mentions of a person's surname with their complete name. 9. DO NOT ADD ANY OTHER TEXT. Examples: - Input: 'The vase was red. It sat on the window sill.' Output: 'The vase was red. The vase sat on the window sill.' - Input: 'John Doe bought a car. The vehicle was red. He drove it to work.' Output: 'John_Doe bought a car. The car was red. John_Doe drove the car to work.' - Input: 'Joe Williams worked at Loblaws. Williams retired in 1994.' Output: 'Joe_Williams worked at Loblaws. Joe_Williams retired in 1994.' - Input: 'It is widely believed that the earth is round.' Output: 'It is widely believed that the earth is round.' (No change) - Input: 'The meeting was long. It was unproductive.' Output: 'The meeting was long. The meeting was unproductive.' (Acceptable, though less clear) - Input: 'Joe Smith was an artist. Smith worked in London. It wasn't until Smith returned home that he knew what he wanted.' Output: 'Joe_Smith was an artist. Joe_Smith worked in London. It wasn't until Joe_Smith returned homedd that Joe_Smith knew what he wanted.' RETURN ONLY THE MODIFIED TEXT with coreference resolution applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment