Update app.py
Browse files
app.py
CHANGED
@@ -65,19 +65,21 @@ if (st.button('استعمال الرسم البياني', disabled=False)):
|
|
65 |
return list(set(res))
|
66 |
|
67 |
L = setQueriesVoc(df_in, id_list)
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
|
|
|
|
81 |
exp_terms = []
|
82 |
t_li = tmt.values()
|
83 |
tmexp = sorted(tmt.items(), key=lambda x: x[1], reverse=True)
|
|
|
65 |
return list(set(res))
|
66 |
|
67 |
L = setQueriesVoc(df_in, id_list)
|
68 |
+
@st.cache
|
69 |
+
def compute_score(L, id_list)
|
70 |
+
for nc in L:
|
71 |
+
score = 0.0
|
72 |
+
temp = []
|
73 |
+
for ni in id_list:
|
74 |
+
try:
|
75 |
+
score = score + df_g.loc[(ni, nc),'score']
|
76 |
+
except KeyError:
|
77 |
+
continue
|
78 |
+
key = df3.loc[nc].values[0]
|
79 |
+
tmt[key] = score
|
80 |
+
return tmt
|
81 |
+
|
82 |
+
tmt = compute_score(L, id_list)
|
83 |
exp_terms = []
|
84 |
t_li = tmt.values()
|
85 |
tmexp = sorted(tmt.items(), key=lambda x: x[1], reverse=True)
|