utils.py 802 Bytes
Newer Older
1
2
3
4
import re

# Original Prompt
# Question: What is (9 + 8) * 2? Answer:
5

lintangsutawika's avatar
format  
lintangsutawika committed
6
7

def style_00(docs):
8
9
    # What is (9 + 8) * 2?
    return docs["context"]
10

lintangsutawika's avatar
lintangsutawika committed
11

12
13
14
15
def style_01(docs):
    # What is (9 + 8) * 2?
    return docs["context"].replace("Question: ", "").replace(" Answer:", "")

lintangsutawika's avatar
lintangsutawika committed
16

17
18
19
20
def style_02(docs):
    # Q: What is (9 + 8) * 2? A:
    return docs["context"].replace("Question: ", "Q: ").replace(" Answer:", " A:")

lintangsutawika's avatar
lintangsutawika committed
21

22
23
def style_03(docs):
    # Solve (9 + 8) * 2.
lintangsutawika's avatar
lintangsutawika committed
24
25
26
27
    return (
        docs["context"].replace("Question: What is", "Solve").replace(" Answer:", ".")
    )

28
29
30
31
32

def style_04(docs):
    # (9 + 8) * 2 =
    return docs["context"].replace("Question: What is ", "").replace(" Answer:", " =")

lintangsutawika's avatar
lintangsutawika committed
33

34
35
def style_05(docs):
    # What is (9 + 8) * 2? Answer:
lintangsutawika's avatar
lintangsutawika committed
36
    return docs["context"].replace("Question: ", "")