realambuj commited on
Commit
618042c
1 Parent(s): 4d05807

Upload 6 files

Browse files
Files changed (6) hide show
  1. .gitattributes +2 -0
  2. Agenerator.sav +3 -0
  3. Qgenerator.sav +3 -0
  4. app.py +2 -46
  5. pic.png +0 -0
  6. requirements.txt +6 -0
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ Agenerator.sav filter=lfs diff=lfs merge=lfs -text
37
+ Qgenerator.sav filter=lfs diff=lfs merge=lfs -text
Agenerator.sav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8a33e08b2ac5d97ff165fd464bee2d384c47bb28f28b8e7341ac3690ecbac47
3
+ size 431429256
Qgenerator.sav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8253861cd69693eee8907a19ac4c2615defde0a19384ba8106ce5fdd4b71c717
3
+ size 575694661
app.py CHANGED
@@ -6,49 +6,6 @@ from transformers import pipeline
6
  from lmqg import TransformersQG
7
 
8
  #util func starts here
9
- dummyData = [
10
- {
11
- "question": "When was the foundation of Gojoseon believed to have occurred?",
12
- "answer": "The foundation of Gojoseon is believed to have occurred in 2333 BC by the mythic king Dangun."
13
- },
14
- {
15
- "question": "Which dynasty ruled Korea after the unification of the Three Kingdoms under Unified Silla in AD 668?",
16
- "answer": "Korea was subsequently ruled by the Goryeo dynasty (918–1392) and the Joseon dynasty (1392–1897)."
17
- },
18
- {
19
- "question": "In 1897, what proclamation did King Gojong make, leading to the annexation of Korea by the Empire of Japan in 1910?",
20
- "answer": "King Gojong proclaimed the Korean Empire in 1897, which was later annexed by the Empire of Japan in 1910."
21
- },
22
- {
23
- "question": "How was Korea divided after World War II in 1945?",
24
- "answer": "After World War II in 1945, Korea was divided into two zones along the 38th parallel, with the north occupied by the Soviet Union and the south occupied by the United States."
25
- },
26
- {
27
- "question": "What event marked the beginning of the Korean War in 1950?",
28
- "answer": "The Korean War began when North Korean forces invaded South Korea in 1950."
29
- },
30
- {
31
- "question": "What agreement brought about a ceasefire in the Korean War in 1953, establishing a demilitarized zone (DMZ)?",
32
- "answer": "The Korean Armistice Agreement brought about a ceasefire in 1953 and established a demilitarized zone (DMZ)."
33
- },
34
- {
35
- "question": "Which philosophy did North Korea's first leader, Kim Il Sung, promote as the state ideology, purging pro-Soviet and pro-Chinese elements?",
36
- "answer": "Kim Il Sung promoted his personal philosophy of Juche as the state ideology, purging both pro-Soviet and pro-Chinese elements."
37
- },
38
- {
39
- "question": "What contributed to North Korea's international isolation in the 1980s?",
40
- "answer": "North Korea's international isolation sharply accelerated from the 1980s onwards as the Cold War came to an end."
41
- },
42
- {
43
- "question": "How did the fall of the Soviet Union in 1991 impact North Korea's economy?",
44
- "answer": "The fall of the Soviet Union in 1991 brought about a sharp decline in the North Korean economy."
45
- },
46
- {
47
- "question": "What significant event occurred in North Korea from 1994 to 1998, resulting in a large number of casualties?",
48
- "answer": "From 1994 to 1998, North Korea suffered a famine that resulted in the deaths of between 240,000 and 420,000 people."
49
- }
50
- ]
51
-
52
 
53
  def break_paragraph_into_parts(paragraph, max_length):
54
  sentences = paragraph.split(". ") # Assuming that the sentences end with a period and a space
@@ -91,7 +48,6 @@ def util(NumQues,Input):
91
  generatedAnswers.append(gen_answer['answer'])
92
 
93
  for i in range(len(generatedAnswers)):
94
- entry = dummyData[i]
95
  code = f'Ques: "{generatedQuestions[i]}"\nAns: "{generatedAnswers[i]}"'
96
  st.code(code, language='python')
97
 
@@ -112,7 +68,7 @@ with st.sidebar:
112
  st.image('Pic.png')
113
  st.title("Final Year Project")
114
  st.divider()
115
- code = '''Team Members CSE(20-37):
116
  \nPrateek Niket BT20CSE211 \nSmriti Singh BT20CSE156 \nAmbuj Raj BT20CSE054 \nSrishti Pandey BT20CSE068'''
117
  st.code(code, language='JAVA')
118
  code = '''Mentored By: \nDr. Amol Bhopale'''
@@ -134,7 +90,7 @@ with tab2:
134
  flag='file'
135
 
136
  NumQues = st.slider('No. of Questions to Generate: ', 1, 5, 1)
137
- print(NumQues)
138
 
139
  if st.button('Generate',type="primary"):
140
  with st.spinner('Question Answer pair Generation in Progress....'):
 
6
  from lmqg import TransformersQG
7
 
8
  #util func starts here
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  def break_paragraph_into_parts(paragraph, max_length):
11
  sentences = paragraph.split(". ") # Assuming that the sentences end with a period and a space
 
48
  generatedAnswers.append(gen_answer['answer'])
49
 
50
  for i in range(len(generatedAnswers)):
 
51
  code = f'Ques: "{generatedQuestions[i]}"\nAns: "{generatedAnswers[i]}"'
52
  st.code(code, language='python')
53
 
 
68
  st.image('Pic.png')
69
  st.title("Final Year Project")
70
  st.divider()
71
+ code = '''Team Members CSE(20-37):
72
  \nPrateek Niket BT20CSE211 \nSmriti Singh BT20CSE156 \nAmbuj Raj BT20CSE054 \nSrishti Pandey BT20CSE068'''
73
  st.code(code, language='JAVA')
74
  code = '''Mentored By: \nDr. Amol Bhopale'''
 
90
  flag='file'
91
 
92
  NumQues = st.slider('No. of Questions to Generate: ', 1, 5, 1)
93
+
94
 
95
  if st.button('Generate',type="primary"):
96
  with st.spinner('Question Answer pair Generation in Progress....'):
pic.png ADDED
requirements.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ streamlit
2
+ joblib
3
+ transformers
4
+ lmqg
5
+ tensorflow
6
+ torch