giseldo's picture
primeira versao
c3ee309
raw
history blame
1.55 kB
import gradio as gr
import pickle
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import f_classif
import pandas as pd
# CLONE - Studio Dashboard: "default" and "Default Project" does not give clear information about Alloy and Project unless description is read.
# Steps To Reproduce: 1. On dashboard on studio 3.0, navigate to Develop tab. 2. Notice "default" and "Default Project" & "two-tabbed" and "Tabbed Application" names. Actual: User does not get clear information from names that one is alloy project and another one is Titanium project unless he reads the description below. Expected: Naming convention or icon corresponding must suggest type
def calcula(titulo, descricao):
with open("model/model_tawos_aloy.pkl", "rb") as file:
model = pickle.load(file)
context = titulo + descricao
d = {"context": [context]}
df = pd.DataFrame(data=d, columns=["context"])
vectorizer = TfidfVectorizer()
X = vectorizer.fit_transform(df["context"])
#X_new = SelectKBest(f_classif, k=50).fit_transfor(X)
story_points = model.predict(X)
return story_points
gr.Interface(fn=calcula,
inputs=[gr.Textbox(placeholder="Título", label="Título"),
gr.Textbox(lines=10, placeholder="Descrição", label="Descrição")],
outputs=[gr.Textbox(label="Story Points Estimado")],
title="Agile Task Story Point Estimator").launch()