from traning_zone.classe_prediction.prediction_classe import * import streamlit as st import plotly.express as px import warnings warnings.filterwarnings("ignore") import matplotlib.pyplot as plt import seaborn as sns sns.set() sns.set(rc={'figure.figsize':(14.7,10.27)}) st.title("Classification") inputs = st.text_input("Input :" , value= "150ML SECHE VERNIS VITRY", key = "input") if inputs != None : X = pd.DataFrame({"X" : [inputs]}) X = X.X pred = PredictionV(X) data = pred.prediction("spacy_spacy") "Input : ", data.item_desc[0] "Pred hyper class : " names = list(data["hyper classe"][0].keys()) values = list(data["hyper classe"][0].values()) df = pd.DataFrame({"class_desc_fr": names, "score": values}) fig = px.histogram(df, y = "class_desc_fr", x = "score", orientation="h") st.plotly_chart(fig) "Pred classe : " names = list(data.classe[0].keys()) values = list(data.classe[0].values()) df = pd.DataFrame({"class_desc_fr": names, "score": values}) fig = px.histogram(df, y = "class_desc_fr", x = "score", orientation="h") st.plotly_chart(fig)