Factool / factool /utils /prompts /claim_extraction.yaml
EQ3A2A's picture
Upload folder using huggingface_hub
d195d4f
knowledge_qa:
system: |-
You are a brilliant assistant.
user: |-
You are given a piece of text that includes knowledge claims. A claim is a statement that asserts something as true or false, which can be verified by humans. Your task is to accurately identify and extract every claim stated in the provided text. Then, resolve any coreference (pronouns or other referring expressions) in the claim for clarity. Each claim should be concise (less than 15 words) and self-contained.
Your response MUST be a list of dictionaries. Each dictionary should contains the key "claim", which correspond to the extracted claim (with all coreferences resolved).
You MUST only respond in the format as described below. DO NOT RESPOND WITH ANYTHING ELSE. ADDING ANY OTHER EXTRA NOTES THAT VIOLATE THE RESPONSE FORMAT IS BANNED. START YOUR RESPONSE WITH '['.
[response format]:
[
{{
"claim": "Ensure that the claim is fewer than 15 words and conveys a complete idea. Resolve any coreference (pronouns or other referring expressions) in the claim for clarity",
}},
...
]
Here are two examples:
[text]: Tomas Berdych defeated Gael Monfis 6-1, 6-4 on Saturday. The sixth-seed reaches Monte Carlo Masters final for the first time . Berdych will face either Rafael Nadal or Novak Djokovic in the final.
[response]: [{{"claim": "Tomas Berdych defeated Gael Monfis 6-1, 6-4"}}, {{"claim": "Tomas Berdych defeated Gael Monfis 6-1, 6-4 on Saturday"}}, {{"claim": "Tomas Berdych reaches Monte Carlo Masters final"}}, {{"claim": "Tomas Berdych is the sixth-seed"}}, {{"claim": "Tomas Berdych reaches Monte Carlo Masters final for the first time"}}, {{"claim": "Berdych will face either Rafael Nadal or Novak Djokovic"}}, {{"claim": "Berdych will face either Rafael Nadal or Novak Djokovic in the final"}}]
[text]: Tinder only displays the last 34 photos - but users can easily see more. Firm also said it had improved its mutual friends feature.
[response]: [{{"claim": "Tinder only displays the last photos"}}, {{"claim": "Tinder only displays the last 34 photos"}}, {{"claim": "Tinder users can easily see more photos"}}, {{"claim": "Tinder said it had improved its feature"}}, {{"claim": "Tinder said it had improved its mutual friends feature"}}]
Now complete the following:
[text]: {input}
[response]:
math:
system: |-
You are a helpful assistant.
user: |-
You are given a math problem and a potential solution to the math problem. Your task is to identify all the math calculations that involve arithmetic operations between known real numbers within the potential solution. However, do not include math calculations that contains variable(s).
Your response MUST be a list of dictionaries. Each dictionary should contains 2 key - "math_calculation" and "calculated_answer", which correspond to the extracted math calculation, and the calculated answer within the potential solution.
You MUST only respond in the format as described below. DO NOT RESPOND WITH ANYTHING ELSE. ADDING ANY OTHER EXTRA NOTES THAT VIOLATE THE RESPONSE FORMAT IS BANNED. START YOUR RESPONSE WITH '['.
[response format]:
[
{{
"math_calculation": "Extracted math calculation involving real numbers within the potential solution. Do not include math calculataions that contains variable(s). Do not include units such as $, %, etc.",
"calculated_answer": "The calculated answer for the extracted math calculation."
}},
...
]
Here are two examples:
[math problem]: What is the area of a circle with a diameter of 10 inches?
[potential solution]: To find the area, we first calculate the radius as the diameter divided by 2, so the radius is 10/2 = 5 inches. Then, we use the formula for the area of a circle, which is πr^2. Plugging in the radius we get, Area = π*5^2 = 78.54 square inches.
[response]: [{{"math_calculation": "10 / 2", "calculated_answer": "5"}}, {{"math_calculation": "π * 5^2", "calculated_answer": "78.54"}}]
[math problem]: A store originally sold a shirt for $45. They are offering a 20% discount on the shirt. How much will the shirt cost now?
[potential solution]: The discount on the shirt is calculated as 20% of $45, which is 0.20 * 45 = $9. The new price of the shirt after the discount is $45 - $9 = $36.
[response]: [{{"math_calculation": "0.20 * 45", "calculated_answer": "9"}}, {{"math_calculation": "45 - 9","calculated_answer": "36"}}]
Now complete the following:
[math problem]: {input_question}
[potential solution]: {input_solution}
[response]:
scientific:
system: |-
You are a brilliant assistant.
user: |-
You are given a piece of text that mentions some scientific literature. Your task is to accurately find all papers mentioned in the text and identify the title, author(s), and publication year for each paper.
The response should be a list of dictionaries, with each dictionary having keys "paper_title", "paper_author(s)", and "paper_pub_year", which correspond to the title of the paper, the authors of the paper, and the publication year of the paper.
The following is the given text
[text]: {input}
You MUST only respond in the format as described below. DO NOT RESPOND WITH ANYTHING ELSE. ADDING ANY OTHER EXTRA NOTES THAT VIOLATE THE RESPONSE FORMAT IS BANNED. START YOUR RESPONSE WITH '['.
[response format]:
[
{{
"paper_title": "Title of the paper.",
"paper_author(s)": "Author(s) of the paper.",
"paper_pub_year": "Year of the paper published."
}},
...
]