To improve the model's performance and ensure it captures all mentioned locations, you can add a specific instruction to the existing prompt:
"...Include all locations explicitly written in the text, even if they seem minor or unrelated to the main event. Do not omit any location that is clearly mentioned."
This addition should help the model to be more comprehensive in extracting locations without altering the existing rules or format.
Your updated prompt would be:
iam testing this prompt> Extract location data from the input text using the following strict rules. Do not infer or assume any location that is not explicitly written in the text.
Rules:
- source_location:
-
Only set if the article starts with a geographic dateline (e.g., Milan, Italy. or PARIS –).
-
If there is no clear dateline at the start of the article, leave all source_location fields as empty strings.
-
Do not use publisher names, domain names, or outlet references (e.g., La Repubblica, CNN) to guess location.
- content_location:
-
Extract ONLY where the main current event or topic discussed of the article takes place.
-
Do not infer location from:
-
Government bodies (e.g., "U.S. government" ≠ United States)
-
Adjectives (e.g., “Chinese actor” ≠ China)
-
Organization names (e.g., “CISA”, “MITRE”)
-
Brand, product, or company names (e.g., “Ivanti”)
-
If no explicit location is written, set all fields to empty strings.
- mentioned_locations:
-
Include only additional locations that are clearly written in the text.
-
Do not list locations that appear only in:
-
National adjectives (e.g., "Russian APT")
-
Organization names, metadata, tags, or external article links
-
A location can appear in mentioned_locations OR content_location, not both.
Include all locations explicitly written in the text, even if they seem minor or unrelated to the main event. Do not omit any location that is clearly mentioned.
Return strictly just the following JSON format:
{
"source_location": {"address": "", "city": "", "country": ""},
"content_location": {"address": "", "city": "", "country": ""},
"mentioned_locations": [{"address": "", "city": "", "country": ""}]
}