import plotly.express as px
from dash.dependencies import Input, Output
import plotly.graph_objects as go
import plotly.figure_factory as ff
from statsmodels.graphics.gofplots import qqplot

import pandas as pd
import numpy as np

app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])

corpus = Corpus()  # khởi tạo
dirr = "resources/vn_express.txt"  # chọn đường dẫn corpus
corpus.read(dirr)  # đọc đường dẫn
corpus.preprocess()  # Tiền xử lí
corpus.read_word2vec()  # Đọc model word2vec để tìm từ đồng nghĩa
corpus.read_ner()  # Đọc dữ liệu đã xử lí tên thực thể và từ loại


def genResult(res):
    result = [
        html.P(children=sen,
               style={
                   'backgroundColor': 'white',
                   'borderBottom': '2px solid #4F2992',
                   'margin': '30px',
                   'padding': '10px'
               }) for sen in res
    ]
    res.append(html.Br())
    return result