Spaces:
Sleeping
Sleeping
Commit
·
b25a065
1
Parent(s):
b130785
Update app.py
Browse files
app.py
CHANGED
@@ -17,14 +17,44 @@ for i in range(len(example_contexts)):
|
|
17 |
example_contexts[i]=re.sub(f'\n'," ", example_contexts[i])
|
18 |
# Recommended words for users to choose from
|
19 |
recommended_words = [
|
20 |
-
"
|
21 |
-
"
|
22 |
-
"
|
23 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
]
|
25 |
|
26 |
-
# Example contexts
|
27 |
-
|
28 |
# Function to generate questions and answers with configurable parameters
|
29 |
def generate_qa(context, recommended_word, temperature, top_p,num_seq, num_samples=3):
|
30 |
input_text = f"{recommended_word}: {context}"
|
|
|
17 |
example_contexts[i]=re.sub(f'\n'," ", example_contexts[i])
|
18 |
# Recommended words for users to choose from
|
19 |
recommended_words = [
|
20 |
+
"did",
|
21 |
+
"what",
|
22 |
+
"how",
|
23 |
+
"what was",
|
24 |
+
"was",
|
25 |
+
"when",
|
26 |
+
"who",
|
27 |
+
"what did",
|
28 |
+
"are",
|
29 |
+
"where",
|
30 |
+
"what is",
|
31 |
+
"why",
|
32 |
+
"",
|
33 |
+
"were",
|
34 |
+
"is",
|
35 |
+
"what were",
|
36 |
+
"which",
|
37 |
+
"what are",
|
38 |
+
"does",
|
39 |
+
"what does",
|
40 |
+
"has",
|
41 |
+
"can",
|
42 |
+
"do",
|
43 |
+
"in what",
|
44 |
+
"what can",
|
45 |
+
"what do",
|
46 |
+
"have",
|
47 |
+
"what has",
|
48 |
+
"had",
|
49 |
+
"on what",
|
50 |
+
"whom",
|
51 |
+
"for what",
|
52 |
+
"could",
|
53 |
+
"what have",
|
54 |
+
"what had",
|
55 |
+
"if"
|
56 |
]
|
57 |
|
|
|
|
|
58 |
# Function to generate questions and answers with configurable parameters
|
59 |
def generate_qa(context, recommended_word, temperature, top_p,num_seq, num_samples=3):
|
60 |
input_text = f"{recommended_word}: {context}"
|