Ali-C137 commited on
Commit
a42af65
·
1 Parent(s): 57036fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -31
app.py CHANGED
@@ -25,7 +25,7 @@ DATA_REPO = "M-A-D/DarijaBridge"
25
  api = hf.HfApi()
26
  access_token_write = "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"
27
  login(token=access_token_write)
28
- repo_id = "M-A-D/dar-en-space-test"
29
 
30
  st.set_page_config(layout="wide")
31
 
@@ -165,7 +165,7 @@ class ParquetScheduler(CommitScheduler):
165
 
166
 
167
  # Define the ParquetScheduler instance with your repo details
168
- scheduler = ParquetScheduler(repo_id=repo_id)
169
 
170
 
171
  # Function to append new translation data to the ParquetScheduler
@@ -183,7 +183,7 @@ def append_translation_data(original, translation, translated, corrected=False):
183
 
184
  # Load data
185
  def load_data():
186
- return pd.DataFrame(load_dataset(DATA_REPO,download_mode="force_redownload",split='test'))
187
 
188
  #def save_data(data):
189
  # data.to_csv(DATA_PATH, index=False)
@@ -205,22 +205,25 @@ def skip_correction():
205
  st.session_state.orig_sentence = "No more sentences to be corrected"
206
  st.session_state.orig_translation = "No more sentences to be corrected"
207
 
208
- st.title("""
209
- Darija Translation Corpus Collection
210
 
211
- **What This Space Is For:**
212
- - **Translating Darija to English:** Add your translations here.
213
- - **Correcting Translations:** Review and correct existing translations.
214
- - **Using GPT-4 for Auto-Translation:** Try auto-translating Darija sentences.
215
- - **Helping Develop Darija Language Resources:** Your translations make a difference.
216
 
217
- **How to Contribute:**
218
- - **Choose a Tab:** Translation, Correction, or Auto-Translate.
219
- - **Add or Correct Translations:** Use text areas to enter translations.
220
- - **Save Your Work:** Click 'Save' to submit.
221
 
222
- **Every Contribution Counts! Let's make Darija GREAT!**
223
- """)
 
 
 
224
 
225
  if "data" not in st.session_state:
226
  st.session_state.data = load_data()
@@ -251,24 +254,24 @@ if "user_translation" not in st.session_state:
251
  # st.subheader("About")
252
  # st.markdown("""This is app is designed to collect Darija translation corpus.""")
253
 
254
- # with st.sidebar:
255
- # st.subheader("About")
256
- # st.markdown("""
257
- # ### Darija Translation Corpus Collection
258
 
259
- # **What This Space Is For:**
260
- # - **Translating Darija to English:** Add your translations here.
261
- # - **Correcting Translations:** Review and correct existing translations.
262
- # - **Using GPT-4 for Auto-Translation:** Try auto-translating Darija sentences.
263
- # - **Helping Develop Darija Language Resources:** Your translations make a difference.
264
 
265
- # **How to Contribute:**
266
- # - **Choose a Tab:** Translation, Correction, or Auto-Translate.
267
- # - **Add or Correct Translations:** Use text areas to enter translations.
268
- # - **Save Your Work:** Click 'Save' to submit.
269
 
270
- # **Every Contribution Counts! Let's make Darija GREAT!**
271
- # """)
272
 
273
  tab1, tab2, tab3 = st.tabs(["Translation", "Correction", "Auto-Translate"])
274
 
 
25
  api = hf.HfApi()
26
  access_token_write = "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"
27
  login(token=access_token_write)
28
+ # repo_id = "M-A-D/dar-en-space-test"
29
 
30
  st.set_page_config(layout="wide")
31
 
 
165
 
166
 
167
  # Define the ParquetScheduler instance with your repo details
168
+ scheduler = ParquetScheduler(repo_id=DATA_REPO)
169
 
170
 
171
  # Function to append new translation data to the ParquetScheduler
 
183
 
184
  # Load data
185
  def load_data():
186
+ return pd.DataFrame(load_dataset(DATA_REPO,download_mode="force_redownload",split='train'))
187
 
188
  #def save_data(data):
189
  # data.to_csv(DATA_PATH, index=False)
 
205
  st.session_state.orig_sentence = "No more sentences to be corrected"
206
  st.session_state.orig_translation = "No more sentences to be corrected"
207
 
208
+ # st.title("""
209
+ # Darija Translation Corpus Collection
210
 
211
+ # **What This Space Is For:**
212
+ # - **Translating Darija to English:** Add your translations here.
213
+ # - **Correcting Translations:** Review and correct existing translations.
214
+ # - **Using GPT-4 for Auto-Translation:** Try auto-translating Darija sentences.
215
+ # - **Helping Develop Darija Language Resources:** Your translations make a difference.
216
 
217
+ # **How to Contribute:**
218
+ # - **Choose a Tab:** Translation, Correction, or Auto-Translate.
219
+ # - **Add or Correct Translations:** Use text areas to enter translations.
220
+ # - **Save Your Work:** Click 'Save' to submit.
221
 
222
+ # **Every Contribution Counts! Let's make Darija GREAT!**
223
+ # """)
224
+
225
+ st.title("""Darija Translation Corpus Collection""")
226
+
227
 
228
  if "data" not in st.session_state:
229
  st.session_state.data = load_data()
 
254
  # st.subheader("About")
255
  # st.markdown("""This is app is designed to collect Darija translation corpus.""")
256
 
257
+ with st.sidebar:
258
+ st.subheader("About")
259
+ st.markdown("""
260
+ ### Darija Translation Corpus Collection
261
 
262
+ **What This Space Is For:**
263
+ - **Translating Darija to English:** Add your translations here.
264
+ - **Correcting Translations:** Review and correct existing translations.
265
+ - **Using GPT-4 for Auto-Translation:** Try auto-translating Darija sentences.
266
+ - **Helping Develop Darija Language Resources:** Your translations make a difference.
267
 
268
+ **How to Contribute:**
269
+ - **Choose a Tab:** Translation, Correction, or Auto-Translate.
270
+ - **Add or Correct Translations:** Use text areas to enter translations.
271
+ - **Save Your Work:** Click 'Save' to submit.
272
 
273
+ **Every Contribution Counts! Let's make Darija GREAT!**
274
+ """)
275
 
276
  tab1, tab2, tab3 = st.tabs(["Translation", "Correction", "Auto-Translate"])
277