Update app.py
Browse files
app.py
CHANGED
@@ -69,15 +69,23 @@ for nc in L:
|
|
69 |
continue
|
70 |
key = df3.loc[nc].values[0]
|
71 |
tmt[key] = score
|
|
|
|
|
72 |
exp_terms = []
|
|
|
73 |
tmexp = sorted(tmt.items(), key=lambda x: x[1], reverse=True)
|
74 |
i = 0
|
|
|
75 |
for key, value in tmexp:
|
76 |
-
|
|
|
|
|
77 |
i+=1
|
78 |
if (i==10):
|
79 |
break
|
80 |
-
|
81 |
-
|
82 |
|
|
|
|
|
83 |
#st.table(df)
|
|
|
69 |
continue
|
70 |
key = df3.loc[nc].values[0]
|
71 |
tmt[key] = score
|
72 |
+
|
73 |
+
|
74 |
exp_terms = []
|
75 |
+
t_li = tmt.values()
|
76 |
tmexp = sorted(tmt.items(), key=lambda x: x[1], reverse=True)
|
77 |
i = 0
|
78 |
+
dict_res = {'word':[], 'score':[]}
|
79 |
for key, value in tmexp:
|
80 |
+
new_score=((value-min(t_li))/(max(t_li)-min(t_li)))-0.0001
|
81 |
+
dict_res['score'].append(str(new_score)[:6])
|
82 |
+
dict_res['word'].append(key)
|
83 |
i+=1
|
84 |
if (i==10):
|
85 |
break
|
86 |
+
res_df = pd.DataFrame.from_dict(dict_res)
|
87 |
+
res_df.index += 1
|
88 |
|
89 |
+
st.dataframe(df)
|
90 |
+
st.dataframe(res_df)
|
91 |
#st.table(df)
|