File size: 905 Bytes
a8dd778
5be38f4
8d40605
36d5ea9
9bfa7c3
bc2efbf
65d72f1
2674ee7
08e727f
3802c1d
 
 
34911e2
 
 
 
a8c4201
 
c167d6e
 
 
b79aeff
 
 
 
dc0ae1b
 
 
bbecac7
 
 
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
import streamlit as st
import yaml

from models import predict_model


def visualize():
    st.write('# Summarization  UI')
    st.markdown(
        '''
        *For additional questions and inquiries, please contact **Gagan Bhatia** via [LinkedIn](
        https://www.linkedin.com/in/gbhatia30/) or [Github](https://github.com/gagan3012).*
        ''')

    text = st.text_area("Enter text here")
    if st.button("Generate Summary"):
        with st.spinner("Connecting the Dots..."):
            sumtext = predict_model(text=text)
        st.write("# Generated Summary:")
        st.write("{}".format(sumtext))
        with open("reports/visualization_metrics.txt", "w") as file1:
            file1.writelines(text)
            file1.writelines(sumtext)


if __name__ == "__main__":
    with open("params.yml") as f:
        params = yaml.safe_load(f)

    if params['visualise']:
        visualize()