Hamda commited on
Commit
69a6814
·
1 Parent(s): 365710f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -6
app.py CHANGED
@@ -17,6 +17,7 @@ model = AutoModelForMaskedLM.from_pretrained("Hamda/test-1-finetuned-AraBART")
17
 
18
  #@st.cache
19
  if (st.button('بحث', disabled=False)):
 
20
  def next_word(text, pipe):
21
  res_dict= {
22
  'الكلمة المقترحة':[],
@@ -34,8 +35,10 @@ if (st.button('بحث', disabled=False)):
34
  df = pd.DataFrame.from_dict(dict_next_words)
35
  df.reset_index(drop=True, inplace=True)
36
  st.dataframe(df)
37
-
38
- if (st.button('استعمال الرسم البياني', disabled=False)):
 
 
39
 
40
  VocMap = './voc.csv'
41
  ScoreMap = './BM25.csv'
@@ -78,8 +81,6 @@ if (st.button('استعمال الرسم البياني', disabled=False)):
78
  key = df3.loc[nc].values[0]
79
  tmt[key] = score
80
  return tmt
81
-
82
-
83
  tmt = compute_score(L, id_list)
84
  exp_terms = []
85
  t_li = tmt.values()
@@ -97,9 +98,17 @@ if (st.button('استعمال الرسم البياني', disabled=False)):
97
  res_df = pd.DataFrame.from_dict(dict_res)
98
  res_df.index += 1
99
  st.dataframe(res_df)
 
100
  b = time()
 
101
  exec_time = (b-a)
102
- st.write(f'{len(id_list)} :عدد الكلمات في المدخل')
103
- st.write(f'{exec_time} :الوقت المستغرق باستعمال الرسم البياني')
 
 
 
 
 
 
104
 
105
  #st.table(df)
 
17
 
18
  #@st.cache
19
  if (st.button('بحث', disabled=False)):
20
+ start = time()
21
  def next_word(text, pipe):
22
  res_dict= {
23
  'الكلمة المقترحة':[],
 
35
  df = pd.DataFrame.from_dict(dict_next_words)
36
  df.reset_index(drop=True, inplace=True)
37
  st.dataframe(df)
38
+ finish = time()
39
+
40
+ if (st.checkbox('الاستعانة بالرسم البياني', value=False)):
41
+ #if (st.button('استعمال الرسم البياني', disabled=False)):
42
 
43
  VocMap = './voc.csv'
44
  ScoreMap = './BM25.csv'
 
81
  key = df3.loc[nc].values[0]
82
  tmt[key] = score
83
  return tmt
 
 
84
  tmt = compute_score(L, id_list)
85
  exp_terms = []
86
  t_li = tmt.values()
 
98
  res_df = pd.DataFrame.from_dict(dict_res)
99
  res_df.index += 1
100
  st.dataframe(res_df)
101
+
102
  b = time()
103
+
104
  exec_time = (b-a)
105
+ exec_time = (finish-start)
106
+
107
+ st.write(f'كلمات {len(id_list) } :عدد الكلمات في المدخل')
108
+
109
+ st.write(f'ثانية {str(exec_time)[:2] } :الوقت المستغرق باستعمال النموذج اللغوي')
110
+ if (st.checkbox('الاستعانة بالرسم البياني', value=False)):
111
+ st.write(f'ثانية {str(exec_time)[:2] } :الوقت المستغرق باستعمال الرسم البياني')
112
+
113
 
114
  #st.table(df)