giseldo commited on
Commit
4d76ff8
·
1 Parent(s): 762c8b1

ultima versao

Browse files
__pycache__/app.cpython-310.pyc CHANGED
Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ
 
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import gradio as gr
2
- import pickle
3
 
4
  from sklearn.feature_extraction.text import TfidfVectorizer
5
  from sklearn.feature_selection import SelectKBest
@@ -10,35 +10,47 @@ import pandas as pd
10
  titulo = """CLONE - Studio Dashboard: "default" and "Default Project" does not give clear information about Alloy and Project unless description is read."""
11
  descricao = """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"""
12
 
13
-
14
  titulo1 = """Ti.UI.Picker has no collection binding"""
15
  descricao1 = """h3. original discussion http://developer.appcelerator.com/question/145992/databinding-on-picker h3. problem Collection binding is not implemented for Ti.UI.Picker as it is for Ti.UI.TableView and other generic Titaniums views (View, Window, ScrollView, etc...). h3. solution Support collection binding on Ti.UI.Picker just as it is on TableView. It will need special handling as the Ti.UI.Picker requires custom parsing for columns and rows. Something like this should be how it would work for devs: {code:xml} <Alloy> <Collection src="book" /> <Window class="container"> <Picker dataCollection="book"> <PickerRow title="{title}" /> </Picker> </Window> </Alloy> {code}"""
16
 
17
-
18
- def calcula(titulo, descricao):
19
- with open("model/model_tawos_aloy.pkl", "rb") as file:
20
- model = pickle.load(file)
21
-
22
  context = titulo + descricao
23
  d = {"context": [context]}
24
  df = pd.DataFrame(data=d, columns=["context"])
 
 
 
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  vectorizer = TfidfVectorizer()
27
  X = vectorizer.fit_transform(df["context"])
28
-
29
  #X_new = SelectKBest(f_classif, k=50).fit_transfor(X)
30
-
31
  story_points = model.predict(X)
32
-
33
  return story_points
34
 
 
 
 
35
  demo = gr.Interface(fn=calcula,
36
  inputs=[gr.Textbox(placeholder="Título", label="Título"),
37
  gr.Textbox(lines=10, placeholder="Descrição", label="Descrição")],
38
- outputs=[gr.Textbox(label="Story Points Estimado")],
 
 
39
  title="Agile Task Story Point Estimator - TAWOS - Alloy",
40
  examples=[[titulo, descricao]]
41
  )
42
 
43
-
44
  demo.launch()
 
1
  import gradio as gr
2
+ from joblib import dump, load
3
 
4
  from sklearn.feature_extraction.text import TfidfVectorizer
5
  from sklearn.feature_selection import SelectKBest
 
10
  titulo = """CLONE - Studio Dashboard: "default" and "Default Project" does not give clear information about Alloy and Project unless description is read."""
11
  descricao = """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"""
12
 
 
13
  titulo1 = """Ti.UI.Picker has no collection binding"""
14
  descricao1 = """h3. original discussion http://developer.appcelerator.com/question/145992/databinding-on-picker h3. problem Collection binding is not implemented for Ti.UI.Picker as it is for Ti.UI.TableView and other generic Titaniums views (View, Window, ScrollView, etc...). h3. solution Support collection binding on Ti.UI.Picker just as it is on TableView. It will need special handling as the Ti.UI.Picker requires custom parsing for columns and rows. Something like this should be how it would work for devs: {code:xml} <Alloy> <Collection src="book" /> <Window class="container"> <Picker dataCollection="book"> <PickerRow title="{title}" /> </Picker> </Window> </Alloy> {code}"""
15
 
16
+ def calcula_MbR(titulo, descricao):
 
 
 
 
17
  context = titulo + descricao
18
  d = {"context": [context]}
19
  df = pd.DataFrame(data=d, columns=["context"])
20
+ model = load("model/model_tawos_aloy_mbr.pkl")
21
+ story_points_MbR = model.predict(df["context"])
22
+ return story_points_MbR
23
 
24
+ def calcula_sent(titulo, descricao):
25
+ model = load("model/model_tawos_aloy_mbr.pkl")
26
+ context = titulo + descricao
27
+ d = {"context": [context]}
28
+ df = pd.DataFrame(data=d, columns=["context"])
29
+ story_points = model.predict(df["context"])
30
+ return story_points
31
+
32
+ def calculaTFIDF(titulo, descricao):
33
+ model = load("model/model_tawos_aloy.pkl")
34
+ context = titulo + descricao
35
+ d = {"context": [context]}
36
+ df = pd.DataFrame(data=d, columns=["context"])
37
  vectorizer = TfidfVectorizer()
38
  X = vectorizer.fit_transform(df["context"])
 
39
  #X_new = SelectKBest(f_classif, k=50).fit_transfor(X)
 
40
  story_points = model.predict(X)
 
41
  return story_points
42
 
43
+ def calcula(titulo, descricao):
44
+ return 0, calcula_MbR(titulo, descricao), 0
45
+
46
  demo = gr.Interface(fn=calcula,
47
  inputs=[gr.Textbox(placeholder="Título", label="Título"),
48
  gr.Textbox(lines=10, placeholder="Descrição", label="Descrição")],
49
+ outputs=[gr.Textbox(label="Story Points Estimado MbR"),
50
+ gr.Textbox(label="Story Points Estimado NEOSP"),
51
+ gr.Textbox(label="Story Points Estimado TFIDF-SVM")],
52
  title="Agile Task Story Point Estimator - TAWOS - Alloy",
53
  examples=[[titulo, descricao]]
54
  )
55
 
 
56
  demo.launch()
model/model_tawos_aloy_mbr.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:78370715400e421619c699d1ac6b36b751eb479eaba46f024d70f12cc90fbfa2
3
+ size 383