File size: 1,922 Bytes
f48bfec
0177922
 
9ed5930
0177922
 
 
 
f48bfec
 
 
cc3c391
0177922
 
 
 
 
cc3c391
0177922
9ed5930
0177922
 
 
 
9ed5930
 
 
0177922
 
cc3c391
0177922
9ed5930
0177922
 
 
 
9ed5930
 
 
 
 
0177922
 
 
 
9ed5930
0177922
9ed5930
0177922
 
 
 
9ed5930
 
 
 
0177922
 
 
 
 
 
ada3289
0177922
e00aee9
f48bfec
 
0177922
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import streamlit as st
from transformers import pipeline, PegasusForConditionalGeneration, PegasusTokenizer
from fill_in_summary import FillInSummary
from paraphrase import PegasusParaphraser

def paraphrase(text):
    return text


st.title('Question Generator by Eddevs')

select = st.selectbox('Type',  ['Question Generator', 'Paraphrasing', 'Summarization', 'Fill in the blank'])

if select == "Summarization":
    with st.form("summarization"):
        # left_column, right_column = st.columns(2)
        # left_column.selectbox('Type',  ['Question Generator', 'Paraphrasing'])
        #st.selectbox('Model',  ['T5', 'GPT Neo-X'])

        text_input = st.text_area("Input Text")

        submitted = st.form_submit_button("Generate")

        if submitted:
            with st.spinner('Wait for it...'):
                result = FillInSummary().summarize(text_input)
            st.write(text_input)


if select == "Fill in the blank":
    with st.form("summarization"):
        text_input = st.text_area("Input Text")

        submitted = st.form_submit_button("Generate")

        if submitted:
            with st.spinner('Wait for it...'):
                fill = FillInSummary()
                result = fill.summarize(text_input)
                result = fill.blank_ne_out(result)
            st.write(result)


if select == "Paraphrasing":
    with st.form("paraphrasing"):
        # st.selectbox('Model',  ['T5', 'GPT Neo-X'])

        text_input = st.text_area("Input Text")

        submitted = st.form_submit_button("Generate")

        if submitted:
            with st.spinner('Wait for it...'):
                paraphrase_model = PegasusParaphraser()
                result = paraphrase_model.paraphrase(text_input)
            st.write(result)





#if st.button('Generate'):
    # st.write(input)
    #st.success("We have generated 105 Questions for you")
    # st.snow()
##else:
    ##nothing here