Sunil Surendra Singh
First commit
769af1a
raw
history blame
990 Bytes
"""Application entry point, global configuration, application structure"""
from config import app_config
import data
import utils
import tab_about
import tab_ner
import tab_emotions as tab_emotions
import tab_summarization
import streamlit as st
def init():
### setup app-wide configuration
utils.setup_app(app_config)
### load data only once and cache it
nlp = data.load_lang_model(app_config.spacy_lang_model)
data.load_nltk_punkt()
df = data.load_emotions_data(app_config.emotions_data_file)
### initialize session state
### setup app tab structure
about, ner, summarization, sentiment = utils.create_tabs(
["ABOUT πŸ‘‹", "NER & POS πŸ”", "TEXT SUMMARIZATION πŸ“", "TEXT CLASSIFICATION πŸ“‘"]
)
with about:
tab_about.render()
with ner:
tab_ner.render(nlp)
with summarization:
tab_summarization.render()
with sentiment:
tab_emotions.render(df)
if __name__ == "__main__":
init()