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

# Original Prompt
# Question: What is (9 + 8) * 2? Answer:
5
6
7
8
def style_00(docs):

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

lintangsutawika's avatar
lintangsutawika committed
10

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
21
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
22

23
24
25
def style_03(docs):

    # Solve (9 + 8) * 2.
lintangsutawika's avatar
lintangsutawika committed
26
27
28
29
    return (
        docs["context"].replace("Question: What is", "Solve").replace(" Answer:", ".")
    )

30
31
32
33
34
35

def style_04(docs):

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

lintangsutawika's avatar
lintangsutawika committed
36

37
38
39
def style_05(docs):

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