|
1 | 1 | """ReAct prompts and fewshot examples."""
|
2 | 2 |
|
3 | 3 |
|
4 |
| -REACT_INSTRUCTION = """Solve a question answering task with interleaving Thought, Action, Observation steps. Thought can reason about the current situation, and Action can be three types: |
| 4 | +# ======================================================================== HOTPOTQA ======================================================================== # |
| 5 | + |
| 6 | + |
| 7 | +REACT_INSTRUCTION_HOTPOTQA = """Solve a question answering task with interleaving Thought, Action, Observation steps. Thought can reason about the current situation, and Action can be three types: |
5 | 8 | (1) Search[entity], which searches the exact entity on Wikipedia and returns the first paragraph if it exists. If not, it will return some similar entities to search.
|
6 | 9 | (2) Lookup[keyword], which returns the next sentence containing keyword in the last passage successfully found by Search.
|
7 | 10 | (3) Finish[answer], which returns the answer and finishes the task.
|
|
13 | 16 |
|
14 | 17 | Question: {question}{scratchpad}"""
|
15 | 18 |
|
16 |
| -REACT_WEBTHINK_SIMPLE6_FEWSHOT_EXAMPLES = """Question: What is the elevation range for the area that the eastern sector of the Colorado orogeny extends into? |
| 19 | +HOTPOTQA_FEWSHOT_EXAMPLES = """Question: What is the elevation range for the area that the eastern sector of the Colorado orogeny extends into? |
17 | 20 | Thought 1: I need to search Colorado orogeny, find the area that the eastern sector of the Colorado orogeny extends into, then find the elevation range of the area.
|
18 | 21 | Action 1: Search[Colorado orogeny]
|
19 | 22 | Observation 1: The Colorado orogeny was an episode of mountain building (an orogeny) in Colorado and surrounding areas.
|
|
74 | 77 | Observation 2: Leonid Anatolievich Levin is a Soviet-American mathematician and computer scientist.
|
75 | 78 | Thought 3: Leonid Levin is a mathematician and computer scientist. So Pavel Urysohn and Leonid Levin have the same type of work.
|
76 | 79 | Action 3: Finish[yes]"""
|
| 80 | + |
| 81 | + |
| 82 | +# ======================================================================== FEVER ======================================================================== # |
| 83 | + |
| 84 | + |
| 85 | +REACT_INSTRUCTION_FEVER = """Determine if there is Observation that SUPPORTS or REFUTES a Claim, or if there is NOT ENOUGH INFORMATION. and Action can be two types: |
| 86 | +(1) Search[entity], which searches the exact entity on Wikipedia and returns the first paragraph if it exists. If not, it will return some similar entities to search. |
| 87 | +(3) Finish[answer], which returns the answer and finishes the task. |
| 88 | +You have a maximum of {max_steps} steps. |
| 89 | +
|
| 90 | +Here are some examples: |
| 91 | +{examples} |
| 92 | +(END OF EXAMPLES) |
| 93 | +
|
| 94 | +Question: {question}{scratchpad}""" |
| 95 | + |
| 96 | +FEVER_FEWSHOT_EXAMPLES = """Claim: Nikolaj Coster-Waldau worked with the Fox Broadcasting Company. |
| 97 | +Thought 1: I need to search Nikolaj Coster-Waldau and find if he has worked with the Fox Broadcasting Company. |
| 98 | +Action 1: Search[Nikolaj Coster-Waldau] |
| 99 | +Observation 1: Nikolaj William Coster-Waldau (born 27 July 1970) is a Danish actor and producer. He graduated from the Danish National School of Performing Arts in Copenhagen in 1993,[1] and had his breakthrough role in Denmark with the film Nightwatch (1994). He played Jaime Lannister in the HBO fantasy drama series Game of Thrones, for which he received two Primetime Emmy Award nominations for Outstanding Supporting Actor in a Drama Series.. Coster-Waldau has appeared in numerous films in his native Denmark and Scandinavia, including Headhunters (2011) and A Thousand Times Good Night (2013). In the U.S, his debut film role was in the war film Black Hawk Down (2001), playing Medal of Honor recipient Gary Gordon.[2] He then played a detective in the short-lived Fox television series New Amsterdam (2008), and appeared in the 2009 Fox television film Virtuality, originally intended as a pilot. |
| 100 | +Thought 2: Because he "appeared in the 2009 Fox television film Virtuality", he should have worked with the Fox Broadcasting Company. |
| 101 | +Action 2: Finish[SUPPORTS] |
| 102 | +
|
| 103 | +Claim: Stranger Things is set in Bloomington, Indiana. |
| 104 | +Thought 1: I should search for Stranger Things, and see if it is set in Bloomington, Indiana. |
| 105 | +Action 1: Search[Stranger Things] |
| 106 | +Observation 1: Stranger Things is an American science fiction horror drama television series created by the Duffer Brothers. Set in the 1980s, primarily in the fictional town of Hawkins, Indiana, the series centers on a number of mysteries and supernatural events occurring around the town and their impact on an ensemble of child and adult characters. |
| 107 | +Thought 2: The observation says that it is set in a "fictional town of Hawkins, Indiana", so it is not set in Bloomington. |
| 108 | +Action 2: Finish[REFUTES] |
| 109 | +
|
| 110 | +Claim: Beautiful reached number two on the Billboard Hot 100 in 2003.? |
| 111 | +Thought 1: I need to search the song Beautiful and find if it reached number two on the Billboard Hot 100 in 2003. |
| 112 | +Action 1: Search[Beautiful] |
| 113 | +Observation 1: Could not find [Beautiful]. Similar: ['Beautiful', 'Beautiful, Beautiful', 'A Beautiful Mind (film)', 'Beautiful (Christina Aguilera song)', 'Life Is Beautiful']. |
| 114 | +Thought 2: From suggestions, I should search "Beautiful (Christina Aguilera song)" to find the song. |
| 115 | +Action 2: Search[Beautiful (Christina Aguilera song)] |
| 116 | +Observation 2: "Beautiful" is a song recorded by American singer Christina Aguilera for her fourth studio album, Stripped (2002). |
| 117 | +Thought 3: It does not mention Billboard, so I need to look up "Billboard Hot 100" to find if it reached number two on it in 2003. |
| 118 | +Action 3: Lookup[Billboard Hot 100] |
| 119 | +Observation 3: (Result 1 / 3) The song peaked at number two on the Billboard Hot 100 in the United States, where it was certified Gold for 500,000 units shipped. |
| 120 | +Thought 4: It only says the song peaked at number two on the Billboard Hot 100, but not if it was in 2003. I am not sure if this claim is true or not. |
| 121 | +Action 4: Finish[NOT ENOUGH INFO]""" |
0 commit comments