-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
566 lines (484 loc) · 30.4 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
import streamlit as st
from model import (aug_bert, aug_w2v, back_translate, random_sentence, aug_GPT,
farasa_pos_output, display_similarity_table, similarity_checker)
from helper import (translate_user_text_input, models_data,
get_df_data, download_all_outputs)
## ----------------------------------------------- Page Config --------------------------------------------- ##
st.set_page_config(
page_title="Data Augmentation",
page_icon='📈'
)
# Read the models.json to see which all models to be run. Change the flags to run only certain models. (1 = ON; 0 = OFF)
data = models_data('./data/models.json')
## --------------------------------------------- End of Page Config ---------------------------------------- ##
## ------------------------------------------------- Introduction ------------------------------------------ ##
st.title("Data augmentation - Web Interface")
st.markdown(
"""
Welcome to our data augmentation web interface.
### What is Data Augmentation?
It is a set of techniques used in data analysis to increase the amount of
data by adding slightly modified copies of already existing data or newly
created synthetic data from existing data. Read more [here](https://en.wikipedia.org/wiki/Data_augmentation).
We are using twelve machine learning models to do data augmentation on Arabic text:
* AraBERT (Machine Learning Model)
* QARiB (Machine Learning Model)
* XLM-RoBERTa (Machine Learning Model)
* AraBART (Machine Learning Model)
* CAMeLBERT-Mix NER (Machine Learning Model)
* Arabic BERT (Large) (Machine Learning Model)
* ARBERT (Machine Learning Model)
* MARBERTv2 (Machine Learning Model)
* AraELECTRA (Machine Learning Model)
* AraGPT2 (Machine Learning Model)
* Word-to-Vector (W2V) Augmentation
* Back Translation
"""
)
## --------------------------------------- End of Introduction --------------------------------------------- ##
## ----------------------------------------------- Sidebar ------------------------------------------------- ##
with st.sidebar:
# Display choices of data augmentation techniques in the sidebar
st.write("Choose the data augmentation techniques below 👇")
col1, col2 = st.columns(2)
with col1:
data['arabert'] = st.checkbox('AraBERT', value=True)
data['qarib_bert'] = st.checkbox('QARiB')
data['xlm-roberta-bert'] = st.checkbox('XLM-RoBERTa', value=True)
data['arabart'] = st.checkbox('AraBART')
data['camelbert'] = st.checkbox('CAMeLBERT', value=True)
data['bert-large-arabic'] = st.checkbox('Arabic BERT (Large)')
data['ubc-arbert'] = st.checkbox('ARBERT', value=True)
with col2:
data['ubc-marbertv2'] = st.checkbox('MARBERTv2', value=True)
data['araelectra'] = st.checkbox('AraELECTRA', value=True)
data['aragpt2'] = st.checkbox('AraGPT2')
data['aravec'] = st.checkbox('Word-to-Vector')
data['back-translation'] = st.checkbox(
'Back Translation', value=True)
## -------------------------------------------- End of Sidebar --------------------------------------------- ##
## ---------------------------------------- 'Test the App' ------------------------------------------------- ##
test_app_container = st.container()
with test_app_container:
st.markdown("# Test out our app here :blush::")
st.markdown("Write a sentence you want to augment below (in the text field) and choose the augmentation techniques in the sidebar.")
# test_text = "وبذلك تشتد المنافسة بين فايبر وبرنامج سكايب الذي يقدم خدمات مماثلة" # text to be used for testing purposes only
text_input_container = st.empty()
translated_input_container = st.empty()
farasa_pos_container = st.empty()
user_text_input = text_input_container.text_input("Enter your text here (AR):",
placeholder="وبذلك تشتد المنافسة بين فايبر وبرنامج سكايب الذي يقدم خدمات مماثلة")
random_sentence_container = st.empty()
random_sentence_checkbox = random_sentence_container.checkbox(
"Use a Random Sentence (AR)?")
if random_sentence_checkbox:
# Radio buttons to allow the user to choose MSA or Dialectal Arabic
msa_or_dialectal_radio_button = random_sentence_container.radio(
"Choose the type of Arabic sentence used for the random sentence:",
('Modern Standard Arabic (MSA)', 'Dialectal Arabic'), horizontal=True,
)
if msa_or_dialectal_radio_button == 'Modern Standard Arabic (MSA)':
# Run the code below if MSA Arabic is choosen
st.markdown("""<span style="color:#b0b3b8">*We are using a dataset from WikiNewsTruth from 2013 and 2014 to give a random news title with Modern Standard Arabic for augmentation.*</span>""",
unsafe_allow_html=True)
random_sentence_generator = st.checkbox(
'Use a Random MSA Sentence?')
if random_sentence_generator:
text_input_container.empty()
user_text_input = random_sentence('./data/WikiNewsTruth.txt')
text_input_container.text_input(
"Enter your text here (AR):", value=user_text_input)
st.markdown("""
<span style="color:#b0b3b8">*Note: If you want to generate a new sentence, STOP the running, uncheck and recheck the 'Use a Random Sentence (AR)?' checkbox.*</span>""",
unsafe_allow_html=True
)
else:
# Run the code below if Dialectal Arabic is choosen
st.markdown("""<span style="color:#b0b3b8">*We are using the ArSAS Training dataset (16k tweets) to generate some random tweets with Dialectal Arabic for augmentation.*</span>""",
unsafe_allow_html=True)
random_sentence_generator = st.checkbox(
'Use a Random Dialectal Arabic Sentence?')
if random_sentence_generator:
text_input_container.empty()
user_text_input = random_sentence(
'./data/ArSAS-train-clean.txt')
text_input_container.text_input(
"Enter your text here (AR):", value=user_text_input)
st.markdown("""
<span style="color:#b0b3b8">*Note: If you want to generate a new sentence, STOP the running, uncheck and recheck the 'Use a Random Sentence (AR)?' checkbox.*</span>""",
unsafe_allow_html=True
)
if user_text_input:
# Farasa 'Parts of Speech tagger' output
try:
farasa_pos_container.markdown(f"""*<span style="color:#AAFF00">Parts of Speech:</span>* {farasa_pos_output(user_text_input)}""",
unsafe_allow_html=True)
except:
# 'Except' case when Farasa API is not functional (and not returning any output)
st.error(
"We are facing issues with the Farasa API. Please try again later.")
st.stop()
# Translate the sentence from arabic to english for the user
translated_input_container.markdown(f"""*<span style="color:#AAFF00">Translated sentence (EN):</span>* {translate_user_text_input("Helsinki-NLP/opus-mt-ar-en", user_text_input)}""",
unsafe_allow_html=True)
st.sidebar.write("--------------------------")
st.sidebar.markdown(f"""*<span style="color:#AAFF00">Original Sentence:</span>* <br /> {user_text_input}""",
unsafe_allow_html=True)
model_text_data = models_data('./data/models_data.json')
# List of all dataframes of augmented text (for export to csv)
list_of_dataframes = []
## ---------------------------- aubmindlab/bert-large-arabertv2 ----------------------- ##
if data['arabert']:
bert_container = st.container()
with bert_container:
# Details of Arabert for the user
st.markdown(model_text_data["arabert"]["header"])
st.markdown(model_text_data["arabert"]["text"])
# Augment sentences with Arabert
sentences_bert = aug_bert(model_text_data["arabert"]["url"],
user_text_input,
model_text_data["arabert"]["name"]
)
try:
# Generate List of similarity score for each augmented sentence and average similarity scores
similarity_list, average_similarity = similarity_checker(
sentences_bert, user_text_input)
list_of_dataframes.append(get_df_data(
sentences_bert, similarity_list))
# Show Arabert results to the user
with st.expander(model_text_data["arabert"]["results"]):
st.markdown(
f"Average Similarity: {average_similarity:.6f}")
display_similarity_table(
sentences_bert, similarity_list, model_text_data["arabert"]["name"])
st.markdown(
model_text_data["common"]["word-info-expander"])
except:
st.warning(
f"""No results generated by the model {model_text_data["arabert"]["name"]}. Try perhaps with another sentence.""")
## -------------------------- qarib/bert-base-qarib ----------------------------------- ##
if data['qarib-bert']:
qarib_bert_container = st.container()
with qarib_bert_container:
# Details of Qarib for the user
st.markdown(model_text_data["qarib-bert"]["header"])
st.markdown(model_text_data["qarib-bert"]["text"])
# Augment sentences with Qarib
sentences_qarib_bert = aug_bert(model_text_data["qarib-bert"]["url"],
user_text_input,
model_text_data["qarib-bert"]["name"]
)
try:
# Generate List of similarity score for each augmented sentence and average similarity scores
similarity_list, average_similarity = similarity_checker(
sentences_qarib_bert, user_text_input)
list_of_dataframes.append(get_df_data(
sentences_qarib_bert, similarity_list))
# Show Qarib results to the user
with st.expander(model_text_data["qarib-bert"]["results"]):
st.markdown(
f"Average Similarity: {average_similarity:.6f}")
display_similarity_table(
sentences_qarib_bert, similarity_list, model_text_data["qarib-bert"]["name"])
st.markdown(
model_text_data["common"]["word-info-expander"])
except:
st.warning(
f"""No results generated by the model {model_text_data["qarib-bert"]["name"]}. Try perhaps with another sentence.""")
## ----------------------------- xlm-roberta-base ------------------------------------- ##
if data['xlm-roberta-bert']:
xlm_bert_container = st.container()
with xlm_bert_container:
# Details of XLM-RoBERTa for the user
st.markdown(model_text_data["xlm-roberta-bert"]["header"])
st.markdown(model_text_data["xlm-roberta-bert"]["text"])
# Augment sentences with XLM-RoBERTa
sentences_xlm_bert = aug_bert(model_text_data["xlm-roberta-bert"]["url"],
user_text_input,
model_text_data["xlm-roberta-bert"]["name"]
)
try:
# Generate List of similarity score for each augmented sentence and average similarity scores
similarity_list, average_similarity = similarity_checker(
sentences_xlm_bert, user_text_input)
list_of_dataframes.append(get_df_data(
sentences_xlm_bert, similarity_list))
# Show results of XLM-RoBERTa to the user
with st.expander(model_text_data["xlm-roberta-bert"]["results"]):
st.markdown(
f"Average Similarity: {average_similarity:.6f}")
display_similarity_table(
sentences_xlm_bert, similarity_list, model_text_data["xlm-roberta-bert"]["name"])
st.markdown(
model_text_data["common"]["word-info-expander"])
except:
st.warning(
f"""No results generated by the model {model_text_data["xlm-roberta-bert"]["name"]}. Try perhaps with another sentence.""")
## ----------------------------- moussaKam/AraBART ------------------------------------ ##
if data['arabart']:
arabart_bert_container = st.container()
with arabart_bert_container:
# Details about Arabart for the user
st.markdown(model_text_data["arabart"]["header"])
st.markdown(model_text_data["arabart"]["text"])
# Augment sentences with Arabart
sentences_arabart_bert = aug_bert(model_text_data["arabart"]["url"],
user_text_input,
model_text_data["arabart"]["name"]
)
try:
# Generate List of similarity score for each augmented sentence and average similarity scores
similarity_list, average_similarity = similarity_checker(
sentences_arabart_bert, user_text_input)
list_of_dataframes.append(get_df_data(
sentences_arabart_bert, similarity_list))
# Display Arabart results for the user
with st.expander(model_text_data["arabart"]["results"]):
st.markdown(
f"Average Similarity: {average_similarity:.6f}")
display_similarity_table(
sentences_arabart_bert, similarity_list, model_text_data["arabart"]["name"])
st.markdown(
model_text_data["common"]["word-info-expander"])
except:
st.warning(
f"""No results generated by the model {model_text_data["arabart"]["name"]}. Try perhaps with another sentence.""")
## ---------------------- CAMeL-Lab/bert-base-arabic-camelbert-mix -------------------- ##
if data['camelbert']:
camelbert_bert_container = st.container()
with camelbert_bert_container:
# Camelbert details for the user
st.markdown(model_text_data["camelbert"]["header"])
st.markdown(model_text_data["camelbert"]["text"])
# Augment sentences with Camelbert
sentences_camelbert_bert = aug_bert(model_text_data["camelbert"]["url"],
user_text_input,
model_text_data["camelbert"]["name"]
)
try:
# Generate List of similarity score for each augmented sentence and average similarity scores
similarity_list, average_similarity = similarity_checker(
sentences_camelbert_bert, user_text_input)
list_of_dataframes.append(get_df_data(
sentences_camelbert_bert, similarity_list))
# Display Camelbert results for the user
with st.expander(model_text_data["camelbert"]["results"]):
st.markdown(
f"Average Similarity: {average_similarity:.6f}")
display_similarity_table(
sentences_camelbert_bert, similarity_list, model_text_data["camelbert"]["name"])
st.markdown(
model_text_data["common"]["word-info-expander"])
except:
st.warning(
f"""No results generated by the model {model_text_data["camelbert"]["name"]}. Try perhaps with another sentence.""")
## --------------------------- asafaya/bert-large-arabic ------------------------------ ##
if data['bert-large-arabic']:
large_arabic_bert_container = st.container()
with large_arabic_bert_container:
# Bert Large Arabic Details for the user.
st.markdown(model_text_data["bert-large-arabic"]["header"])
st.markdown(model_text_data["bert-large-arabic"]["text"])
# Augment sentences with Bert Large Arabic
sentences_large_arabic_bert = aug_bert(model_text_data["bert-large-arabic"]["url"],
user_text_input,
model_text_data["bert-large-arabic"]["name"]
)
try:
# Generate List of similarity score for each augmented sentence and average similarity scores
similarity_list, average_similarity = similarity_checker(
sentences_large_arabic_bert, user_text_input)
list_of_dataframes.append(get_df_data(
sentences_large_arabic_bert, similarity_list))
# Display results of Bert Large Arabic to the user
with st.expander(model_text_data["bert-large-arabic"]["results"]):
st.markdown(
f"Average Similarity: {average_similarity:.6f}")
display_similarity_table(
sentences_large_arabic_bert, similarity_list, model_text_data["bert-large-arabic"]["name"])
st.markdown(
model_text_data["common"]["word-info-expander"])
except:
st.warning(
f"""No results generated by the model {model_text_data["bert-large-arabic"]["name"]}. Try perhaps with another sentence.""")
## --------------------------------- UBC-NLP/ARBERT ----------------------------------- ##
if data['ubc-arbert']:
ubc_arbert_bert_container = st.container()
with ubc_arbert_bert_container:
# UBC-Arbert details for the user.
st.markdown(model_text_data["ubc-arbert"]["header"])
st.markdown(model_text_data["ubc-arbert"]["text"])
# Augment sentences with UBC Arbert
sentences_ubc_arbert_bert = aug_bert(model_text_data["ubc-arbert"]["url"],
user_text_input,
model_text_data["ubc-arbert"]["name"]
)
try:
# Generate List of similarity score for each augmented sentence and average similarity scores
similarity_list, average_similarity = similarity_checker(
sentences_ubc_arbert_bert, user_text_input)
list_of_dataframes.append(get_df_data(
sentences_ubc_arbert_bert, similarity_list))
# Display results of UBC-Arbert to the user.
with st.expander(model_text_data["ubc-arbert"]["results"]):
st.markdown(
f"Average Similarity: {average_similarity:.6f}")
display_similarity_table(
sentences_ubc_arbert_bert, similarity_list, model_text_data["ubc-arbert"]["name"])
st.markdown(
model_text_data["common"]["word-info-expander"])
except:
st.warning(
f"""No results generated by the model {model_text_data["ubc-arbert"]["name"]}. Try perhaps with another sentence.""")
## --------------------------------- UBC-NLP/MARBERTv2 -------------------------------- ##
if data['ubc-marbertv2']:
ubc_marbertv2_bert_container = st.container()
with ubc_marbertv2_bert_container:
# Show details of UBC-Marbertv2 to the user
st.markdown(model_text_data["ubc-marbertv2"]["header"])
st.markdown(model_text_data["ubc-marbertv2"]["text"])
# Augment sentences with UBC-MarbertV2
sentences_ubc_marbertv2_bert = aug_bert(model_text_data["ubc-marbertv2"]["url"],
user_text_input,
model_text_data["ubc-marbertv2"]["name"]
)
try:
# Generate List of similarity score for each augmented sentence and average similarity scores
similarity_list, average_similarity = similarity_checker(
sentences_ubc_marbertv2_bert, user_text_input)
list_of_dataframes.append(get_df_data(
sentences_ubc_marbertv2_bert, similarity_list))
# Display results of UBC-MarbertV2 to the user
with st.expander(model_text_data["ubc-marbertv2"]["results"]):
st.markdown(
f"Average Similarity: {average_similarity:.6f}")
display_similarity_table(
sentences_ubc_marbertv2_bert, similarity_list, model_text_data["ubc-marbertv2"]["name"])
st.markdown(
model_text_data["common"]["word-info-expander"])
except:
st.warning(
f"""No results generated by the model {model_text_data["ubc-marbertv2"]["name"]}. Try perhaps with another sentence.""")
## ------------------------ aubmindlab/araelectra-base-generator ---------------------- ##
if data['araelectra']:
araelectra_bert_container = st.container()
with araelectra_bert_container:
# Show Araelectra details to the user
st.markdown(model_text_data["araelectra"]["header"])
st.markdown(model_text_data["araelectra"]["text"])
# Augment sentences with Araelectra
sentences_araelectra_bert = aug_bert(model_text_data["araelectra"]["url"],
user_text_input,
model_text_data["araelectra"]["name"]
)
try:
# Generate List of similarity score for each augmented sentence and average similarity scores
similarity_list, average_similarity = similarity_checker(
sentences_araelectra_bert, user_text_input)
list_of_dataframes.append(get_df_data(
sentences_araelectra_bert, similarity_list))
# Display Araelectra results to the user
with st.expander(model_text_data["araelectra"]["results"]):
st.markdown(
f"Average Similarity: {average_similarity:.6f}")
display_similarity_table(
sentences_araelectra_bert, similarity_list, model_text_data["araelectra"]["name"])
st.markdown(
model_text_data["common"]["word-info-expander"])
except:
st.warning(
f"""No results generated by the model {model_text_data["araelectra"]["name"]}. Try perhaps with another sentence.""")
## ------------------------------------- araGPT2 -------------------------------------- ##
if data['aragpt2']:
gpt2_container = st.container()
with gpt2_container:
# Show AraGPT2 details to the user
st.markdown(model_text_data["aragpt2"]["header"])
st.markdown(model_text_data["aragpt2"]["text"])
# Augment sentences with AraGPT2
sentences_gpt = aug_GPT(
model_text_data["aragpt2"]["url"], user_text_input)
try:
# Generate List of similarity score for each augmented sentence and average similarity scores
similarity_list, average_similarity = similarity_checker(
sentences_gpt, user_text_input)
list_of_dataframes.append(
get_df_data(sentences_gpt, similarity_list))
# Display results of AraGPT2 to the user
with st.expander(model_text_data["aragpt2"]["results"]):
st.markdown(
f"Average Similarity: {average_similarity:.6f}")
display_similarity_table(
sentences_gpt, similarity_list, model_text_data["aragpt2"]["name"])
st.markdown(
model_text_data["common"]["word-info-expander"])
except:
st.warning(
f"""No results generated by the model {model_text_data["aragpt2"]["name"]}. Try perhaps with another sentence.""")
## ------------------------------------- AraVec --------------------------------------- ##
if data['aravec']:
w2v_container = st.container()
with w2v_container:
# Show details of Aravec model to the user
st.markdown(model_text_data["aravec"]["header"])
st.markdown(model_text_data["aravec"]["text"])
# Augment sentences with aravec using different models
sentences_w2v = aug_w2v(
'./data/full_grams_cbow_100_twitter.mdl', 'glove-twitter-25', user_text_input, "Aravec")
try:
# Generate List of similarity score for each augmented sentence and average similarity scores
similarity_list, average_similarity = similarity_checker(
sentences_w2v, user_text_input)
list_of_dataframes.append(
get_df_data(sentences_w2v, similarity_list))
# Display results of Aravec to the user
with st.expander(model_text_data["aravec"]["results"]):
st.markdown(
f"Average Similarity: {average_similarity:.6f}")
display_similarity_table(
sentences_w2v, similarity_list, model_text_data["aravec"]["name"])
st.markdown(
model_text_data["common"]["word-info-expander"])
except:
st.warning(
f"""No results generated by the model {model_text_data["aravec"]["name"]}. Try perhaps with another sentence.""")
## ------------------------------------- Back- Translation ---------------------------- ##
if data['back-translation']:
back_translation_container = st.container()
with back_translation_container:
# Show details of Back translation to the user
st.markdown(
model_text_data["back-translation"]["header"])
available_languages = ['ar-en', 'ar-fr', 'ar-tr', 'ar-ru',
'ar-pl', 'ar-it', 'ar-es', 'ar-el', 'ar-de', 'ar-he']
back_translated_sentences = []
st.markdown(model_text_data["back-translation"]["text"])
st.markdown(
model_text_data["back-translation"]["text-2"])
# Augment sentences with back translation
back_translated_sentences = back_translate(
user_text_input)
try:
# Generate List of similarity score for each augmented sentence and average similarity scores
similarity_list, average_similarity = similarity_checker(
back_translated_sentences, user_text_input)
list_of_dataframes.append(get_df_data(
back_translated_sentences, similarity_list))
# Display results of Back translation to the user
with st.expander(model_text_data["back-translation"]["results"]):
st.markdown(
f"Average Similarity: {average_similarity:.6f}")
display_similarity_table(
back_translated_sentences, similarity_list, model_text_data["back-translation"]["name"])
st.markdown(
model_text_data["back-translation"]["results-info"])
except:
st.warning(
f"""No results generated by the models of {model_text_data["back-translation"]["name"]}. Try perhaps with another sentence.""")
## ----------------------- Download All Outputs to CSV -------------------------------- ##
if len(list_of_dataframes) > 0:
# Download Button for exporting outputs to csv file
st.write("----------------------------")
st.markdown("### Download all outputs as *one* CSV File?")
download_all_outputs(list_of_dataframes)
## ---------------------------------------- End of 'Test the App' ------------------------------------------ ##