File size: 950 Bytes
562f935
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st
from model import Abstractive_Summarization_Model


# initialize model object
# @st.cache
def load_model():
    return Abstractive_Summarization_Model()

# Main app engine
if __name__ == "__main__":
    # display title and description
    st.title("AI Text Summarizer")
    st.header("Get AI generated paraphrased summaries of text!")
    st.write("You might need to wait a couple of seconds for the model to load because i'm using a tiny cpu 🥲")
    st.write("email me at darveenvijayan.27@gmail.com")

    #load model
    ASM = load_model()

    # display topic input slot
    text = st.text_input("Paste a paragraph of text in the text box below and hit ENTER!", "")

    # display article paragraph
    article_paragraph = st.empty()

    if text:
        # load wikipedia summary of topic

        summary = ASM.summarize(text)

        # display article summary in paragraph
        article_paragraph.markdown(summary)