Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ if (st.button('استعمال الرسم البياني', disabled=False)):
|
|
40 |
VocMap = './voc.csv'
|
41 |
ScoreMap = './BM25.csv'
|
42 |
|
43 |
-
|
44 |
def reading_df(path1, path2):
|
45 |
df_voc = pd.read_csv(path1, delimiter='\t')
|
46 |
df_graph = pd.read_csv(path2, delimiter='\t')
|
@@ -51,12 +51,12 @@ if (st.button('استعمال الرسم البياني', disabled=False)):
|
|
51 |
|
52 |
df3, df_g, df_in = reading_df(VocMap, ScoreMap)
|
53 |
|
54 |
-
|
55 |
def Query2id(voc, query):
|
56 |
return [voc.index[voc['word'] == word].values[0] for word in query.split()]
|
57 |
|
58 |
id_list = Query2id(df3, sent)
|
59 |
-
|
60 |
def setQueriesVoc(df, id_list):
|
61 |
res = []
|
62 |
for e in id_list:
|
|
|
40 |
VocMap = './voc.csv'
|
41 |
ScoreMap = './BM25.csv'
|
42 |
|
43 |
+
#@st.cache
|
44 |
def reading_df(path1, path2):
|
45 |
df_voc = pd.read_csv(path1, delimiter='\t')
|
46 |
df_graph = pd.read_csv(path2, delimiter='\t')
|
|
|
51 |
|
52 |
df3, df_g, df_in = reading_df(VocMap, ScoreMap)
|
53 |
|
54 |
+
#@st.cache
|
55 |
def Query2id(voc, query):
|
56 |
return [voc.index[voc['word'] == word].values[0] for word in query.split()]
|
57 |
|
58 |
id_list = Query2id(df3, sent)
|
59 |
+
#@st.cache
|
60 |
def setQueriesVoc(df, id_list):
|
61 |
res = []
|
62 |
for e in id_list:
|