bumie-e commited on
Commit
7a152c6
·
1 Parent(s): e71ce8e

Adding app files and sample audios

Browse files
app.py ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from PIL import Image
3
+ import pandas as pd
4
+ import os
5
+ import json
6
+ import csv
7
+
8
+ st.header("Practice Section")
9
+
10
+ # Replace this with the directory containing the sample audio files
11
+ PRACTICE_AUDIO_DIR = 'sample_audios2/'
12
+
13
+ # Replace this with the excel file (converted to csv) that contains the answers.
14
+ practice_data = pd.read_csv('practice-quiz.csv')
15
+
16
+ for practice in practice_data.index:
17
+
18
+ ann_id = practice_data.loc[practice, 'naijavoices_audio_filename']
19
+ # st.write(f'## Practice Audio: {practice_data.loc[practice, "text"]}')
20
+ with st.expander(f'Click to view evaluation task'):
21
+ with st.form(key=f'practice-{ann_id}'):
22
+
23
+ st.caption(":red[Instruction: first read the transcript carefully. Then listen to the audio thoroughly (can listen multiple times), before proceeding to answer the following questions. While answering the questions, come back to listen to the audio again as needed.]")
24
+ st.write(f'## {practice_data.loc[practice, "text"]}')
25
+ path = os.path.join(PRACTICE_AUDIO_DIR+f'{practice_data.loc[practice, "language"]}', practice_data.loc[practice, 'naijavoices_audio_filename'])
26
+ print(path)
27
+ st.audio(path)
28
+
29
+ score = 0
30
+ min_score = 10
31
+
32
+ if practice_data.loc[practice, "Marker"] == 'Alignment':
33
+ alignment = st.radio(
34
+ "Select the option that best describes the alignment of the audio and transcript",
35
+ options=["Audio contains EXTRA words not in the transcript", "Audio is MISSING words that are in the transcript", "Audio is MISSING words AND includes EXTRA words", "No missing or extra words"],
36
+ index=None,
37
+ key=f'{ann_id}-alignment'
38
+ )
39
+
40
+ submit_practice_button = st.form_submit_button(label='Submit')
41
+ if submit_practice_button:
42
+
43
+ if alignment == practice_data.loc[practice, "correct_alignment"]:
44
+ feedback = "Alignment: ✅ Correct"
45
+ score +=1
46
+ else:
47
+ feedback = f"Alignment: ❌ Incorrect. Correct answer: {practice_data.loc[practice, 'correct_alignment']}"
48
+ st.write("### Feedback")
49
+ st.write(feedback)
50
+
51
+
52
+ elif practice_data.loc[practice, "Marker"] == 'Pronunciation':
53
+
54
+ pronunciation = st.radio(
55
+ "How accurate is the pronunciation?",
56
+ options=["1: Very Inaccurate", "2: Inaccurate", "3: Neutral", "4: Accurate", "5: Very Accurate"],
57
+ index=None,
58
+ key=f'{ann_id}-pronunciation'
59
+ )
60
+ submit_practice_button = st.form_submit_button(label='Submit')
61
+ if submit_practice_button:
62
+ if pronunciation == practice_data.loc[practice, "correct_pronunciation"]:
63
+ feedback = "Pronunciation: ✅ Correct"
64
+ score += 1
65
+ else:
66
+ feedback = f"Pronunciation: ❌ Incorrect. Correct answer: {practice_data.loc[practice, 'correct_pronunciation']}"
67
+ st.write("### Feedback")
68
+ st.write(feedback)
69
+
70
+ elif practice_data.loc[practice, "Marker"] == 'Naturalness':
71
+ naturalness = st.radio(
72
+ "How natural does the audio sound?",
73
+ options=["1: Very Unnatural", "2: Unnatural", "3: Neutral", "4: Natural", "5: Extremely Natural"],
74
+ index=None,
75
+ key=f'{ann_id}-naturalness'
76
+ )
77
+ submit_practice_button = st.form_submit_button(label='Submit')
78
+ if submit_practice_button:
79
+ if naturalness == practice_data.loc[practice, "correct_naturalness"]:
80
+ feedback = "Naturalness: ✅ Correct"
81
+ score += 1
82
+ else:
83
+ feedback = f"Naturalness: ❌ Incorrect. Correct answer: {practice_data.loc[practice, 'correct_naturalness']}"
84
+ st.write("### Feedback")
85
+ st.write(feedback)
86
+
87
+ elif practice_data.loc[practice, "Marker"] == 'Emotion':
88
+
89
+ emotion = st.radio(
90
+ "How expressive is the audio?",
91
+ options=["1: No Emotional Expressiveness", "2: Slightly Expressive", "3: Moderately Expressive", "4: Expressive", "5: Highly Expressive and Appropriate"],
92
+ index=None,
93
+ key=f'{ann_id}-emotion'
94
+ )
95
+
96
+ submit_practice_button = st.form_submit_button(label='Submit')
97
+ if submit_practice_button:
98
+ if emotion == practice_data.loc[practice, "correct_emotion"]:
99
+ feedback ="Emotion: ✅ Correct"
100
+ score += 1
101
+ else:
102
+ feedback = f"Emotion: ❌ Incorrect. Correct answer: {practice_data.loc[practice, 'correct_emotion']}"
103
+ st.write("### Feedback")
104
+ st.write(feedback)
105
+
106
+ # Check if the evaluator passes the practice
107
+ if score >= min_score:
108
+ st.write(f'✅ Practice Passed! Your Score: {score}/{len(practice_data)}')
109
+ passed_practice = True
110
+ else:
111
+ st.write(f'⚠️ Your score is {score}/{len(practice_data)}. Please retry the evaluations again before proceeding.')
112
+
113
+
practice-quiz.csv ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ id,generated_audio_filename,Edit,Marker,naijavoices_audio_filename,text,language,correct_alignment,correct_pronunciation,correct_naturalness,correct_emotion
2
+ ,,None,Alignment,20240301130259-42-1857-525921-adaku-chefuru-inye-okwa-akwa-u.wav,Adaku chefụrụ inye ọkwa akwa uwe myịrịmara ụlọ akwụkwọ ya dọkara adọka ka ọ kwachire ya.,igbo,No missing or extra words,,,
3
+ ,,Extra,Alignment,20240112090202-18-165-35812-nna-m-ji-hama-otu-n-ime-ngwaor.wav,"Nna m ji hama, otu n'ime ngwaọrụ eji akụ ihe kụba ntu",igbo,Audio contains EXTRA words not in the transcript,,,
4
+ ,,Missing,Alignment,20231231070219-8-472-156842-kedu-ihe--mere-iji-nweta-nsona.wav,Kedu ihe ị mere iji nweta nsonaazụ dọkara adọka pụtara ìhè?,igbo,Audio is MISSING words that are in the transcript,,,
5
+ ,,Missing and Extra,Alignment,20240323055056-199-3566-1297216-umu-ohuru-amuru-ohuru-choro-mm.wav,ụmụ ọhụrụ amụrụ inye ọkwa akwa ọhụrụ chọrọ mmiri ara ara ka ha dịrị ndụ ọ kwachire ya.,igbo,Audio is MISSING words AND includes EXTRA words,,,
6
+ ,,None,Alignment,20240326073553-173-2899-1137138-onye-nkuzi-anyi-kwuru-na-anyi.wav,onye nkuzi anyi kwuru na anyi kwesiri ina asa ahu opekata mpe ugboro ato kwa ubochi,igbo,No missing or extra words,,,
7
+ ,,Extra,Alignment,20231208135445-50-144-31532-a-na-agpta-ebubo-eboro-onye.wav,A na-agụpụta onye eboro ebubo.,igbo,Audio contains EXTRA words not in the transcript,,,
8
+ ,,Missing,Alignment,20231213160240-27-71-14080-maz-na-enwe-mmasi-n-akk-i.wav,Ụmụazị na-enwe mmasi n'akụkọ ifo ebubo eboro.,igbo,Audio is MISSING words that are in the transcript,,,
9
+ ,,Missing and Extra,Alignment,20231226194928-42-597-162804-onye-nche-l-akwkw-any-nwe.wav,Onye nche ụlọ anyị nwere ezigbo obiọma na-ebere.,igbo,Audio is MISSING words AND includes EXTRA words,,,
10
+ ,,None,Alignment,20240122135631-34-2029-550094-goomenti-kwuputara-ezumike-oha.wav,Gọọmentị kwupụtara ezumike ọha na ubochi Tuzdee o bula.,igbo,No missing or extra words,,,
11
+ ,,Extra,Alignment,20231206214604-22-43-7222-nneka-adgh-ime.wav,Nneka ime,igbo,Audio contains EXTRA words not in the transcript,,,
12
+ ,,Missing,Alignment,20240308165214-101-1076-330019-ebere-na-eri-nri-n-ite.wav,Ebere na-eri nri n’ite adịghị,igbo,Audio is MISSING words that are in the transcript,,,
13
+ ,,Missing and Extra,Alignment,20240229104336-109-1132-343338-ada-chiri-nwa-enwe-n-elu-ka-at.wav,nwa enwe n'elu ka atani na-ebere akwa ebubo eboro,igbo,Audio is MISSING words AND includes EXTRA words,,,
14
+ ,,None,Alignment,20240326121414-222-4144-793831-awon-itoju-tuntun-yoo-yipada-b.wav,Awọn itọju tuntun yoo yipada bi a ṣe ṣe pẹlu arun ọkan.,yoruba,No missing or extra words,,,
15
+ ,,Extra,Alignment,20240307023900-135-2181-577717-mo-ni-ewu-re-me-fa-te-le.wav,Mo ní ewúrẹ́ ,yoruba,Audio contains EXTRA words not in the transcript,,,
16
+ ,,Missing,Alignment,20240308135719-141-1550-402700-o-lo-saunpepa-lati-dan-oju-pat.wav,mẹ́fà tẹ́lẹ̀ Ó lo saunpépà láti dán ojú pátákó.,yoruba,Audio is MISSING words that are in the transcript,,,
17
+ ,,Missing and Extra,Alignment,20240203094429-131-1447-240113-ma-a-maa-fi-oju-si-iwe-tite.wav,Má a fi ojú sí ìwé títẹ̀ ọmọbinrin,yoruba,Audio is MISSING words AND includes EXTRA words,,,
18
+ ,,None,Alignment,20240112121748-130-1462-381431-baba-nigbagbogbo-favor-omobinr.wav,bàbá nigbagbogbo favor ọmọbinrin,yoruba,No missing or extra words,,,
19
+ ,,Extra,Alignment,20240113152156-131-1453-241620-obo-ma-nife-wiwo-eyan.wav,nifẹ wiwo ẹyan,yoruba,Audio contains EXTRA words not in the transcript,,,
20
+ ,,Missing,Alignment,20240321092536-233-4415-858836-emi-ni-mo-gun-iyan-ti-awon-ana.wav,Ọbọ ma ati Èmi ni mo gún iyán tí àwọn àná wa jẹ láàárọ̀ yìí .,yoruba,Audio is MISSING words that are in the transcript,,,
21
+ ,,Missing and Extra,Alignment,20240316090248-70-1724-444291-awon-itan-ade-rubani-ni-wo-n-n.wav,Àwọn ni wọ́n ń pè ní mérìíìírí láàárin àwọn Yorùbá tó kọja.,yoruba,Audio is MISSING words AND includes EXTRA words,,,
22
+ ,,None,Alignment,20240319043713-227-4271-824364-afonifoji-je-ile-pe-te-le.wav,Àfonífojì jẹ ilẹ́ pẹ̀tẹ́lẹ̀.,yoruba,No missing or extra words,,,
23
+ ,,Extra,Alignment,20240318234341-234-4445-866125-ogbeni-ajala-fi-e-sun-iko-sile.wav,Ọgbẹni Ajala fi ẹ̀ṣùn ikọ̀silẹ̀ ní ọṣù tó kọja.,yoruba,Audio contains EXTRA words not in the transcript,,,
24
+ ,,Missing,Alignment,20240323131429-215-3949-747084-olo-run-maa-n-gbo-adura.wav,Ọlọ́run máa ń gbó àdúrà fún iyawó rẹ̀,yoruba,Audio is MISSING words that are in the transcript,,,
25
+ ,,Missing and Extra,Alignment,20240122175329-70-2084-461303-se-o-maa-gba-eto-isejoba-ibile.wav,Ṣé o máa gba ètò ìbílẹ̀ láàyè ní abúlé rẹ láàárin àwọn Yorùbá?,yoruba,Audio is MISSING words AND includes EXTRA words,,,
26
+ ,,None,Alignment,20240322182009-259-5053-1011949-fesbuk-na-amfani-da-data.wav,fesbuk na amfani da data,hausa,No missing or extra words,,,
27
+ ,,Extra,Alignment,20240121172900-66-2293-488230-nace-maka-ka-tura-yaron-nan-ma.wav,Nace maka ka tura yaron nan!,hausa,Audio contains EXTRA words not in the transcript,,,
28
+ ,,Missing,Alignment,20240323072835-270-5336-1079890-bala-ya-bude-wani-shagon-sayar.wav,Bala ya bude wani shagon sayar da wayoyi makaranta.,hausa,Audio is MISSING words that are in the transcript,,,
29
+ ,,Missing and Extra,Alignment,20240321193009-269-5308-1073284-e-ma-aikatan-na-da-ha-in-kai.wav,"E, ma'aikatan na da kai ko na dindindin.",hausa,Audio is MISSING words AND includes EXTRA words,,,
30
+ ,,None,Alignment,20240111232934-65-1911-479858-dada-na-iya-zama-na-an-lokaci.wav,Dada na iya zama na ɗan lokaci kadan ko na dindindin.,hausa,No missing or extra words,,,
31
+ ,,Extra,Alignment,20240112134018-67-1866-469188-wani-kansila-ya-ginawa-wata-kw.wav,Wani kansila ya ginawa ɗakin gwaje-gwaje.,hausa,Audio contains EXTRA words not in the transcript,,,
32
+ ,,Missing,Alignment,20240218162107-154-2563-668567-a-shekara-ta-dubu-biyu-da-tala.wav,"A shekara ta dubu biyu da talatin, wuraren kwana na otal za su samar da fasaha mai tashe wata kwaleji sabon.",hausa,Audio is MISSING words that are in the transcript,,,
33
+ ,,Missing and Extra,Alignment,20240104115313-65-817-140246-ci-gaba-da-ganin-ku.wav,gaba da ganin ku zama.,hausa,Audio is MISSING words AND includes EXTRA words,,,
34
+ ,,None,Alignment,20240329120557-270-5866-1417132-jeka-ka-gina-gidan-ka.wav,Jeka ka gina gidan ka.,hausa,No missing or extra words,,,
35
+ ,,Extra,Alignment,20240117082346-157-1281-272642-a-da-famfas-ba-tsada.wav,A da famfas,hausa,Audio contains EXTRA words not in the transcript,,,
36
+ ,,Missing,Alignment,20240302083136-164-1320-281849-kawuna-ya-kashe-maku-an-ku-i-w.wav,Kawuna ya kashe ba tsada makuɗan kuɗi wajen gyaran mota.,hausa,Audio is MISSING words that are in the transcript,,,
37
+ ,,Missing and Extra,Alignment,20240109124500-68-973-255031-kin-san-tatsuniyar-da-kaka-tak.wav,Kin san da kaka take basu gidan gidan?,hausa,Audio is MISSING words AND includes EXTRA words,,,
38
+ ,,,Pronunciation,20240113124748-22-220-49131-o-nweghi-i-ke-iricha-piza-o-zu.wav,O nweghị ị́ké iricha pịza ọ zụtara ya ụnyaahụ.,igbo,,,,
39
+ ,,,Pronunciation,20240107182227-52-1799-376695-ee-m-ga-akwado-pati-lp.wav,Ee! M ga-akwado pati LP.,igbo,,,,
40
+ ,,,Pronunciation,20240215234709-106-1125-341760-n-otutu-obodo-otutu-n-ime-ulo.wav,"N'ọtụtụ obodo, ọtụtụ n'ime ụlọ akwụkwọ praịmarị bụ nke ndị mmadụ.",igbo,,,,
41
+ ,,,Naturalness,20240301110009-22-1977-537514-aga-m-agwa-ya-okwu-echi.wav,Aga m agwa ya okwu echi.,igbo,,,,
42
+ ,,,Naturalness,20240112110354-33-349-80086-i-choro-kaadi-ntuli-aka.wav,Ị chọrọ kaadị ntuli aka?,igbo,,,,
43
+ ,,,Naturalness,20240114072828-107-1938-531871-a-na-amu-asusu-o-bula-amu-tupu.wav,A na-amụ asụsụ ọ bụla amụ tupu asụwa ya.,igbo,,,,
44
+ ,,,Emotion,20240112102109-18-165-35910-i-na-akoro-ha-akuko-ifo.wav,Ị na-akọrọ ha akụkọ ifo?,igbo,,,,
45
+ ,,,Emotion,20231219164207-47-289-65711-a-ga-m-emepe-ahi-a-ngbanwe-ego.wav,A ga m emepe ahịa ngbanwe ego nke m n'arọ na-abịa.,igbo,,,,
46
+ ,,,Emotion,20240326103506-196-3480-1276651-i-maara-onye-okwa-nka-o-bula.wav,Ị maara onye ọkwá nkà ọ bụla?,igbo,,,,
47
+ ,,,Pronunciation,20240113132347-131-1453-241525-o-ti-wa-ni-mimo-pe-awon-olukop.wav,O ti wa ni mimo pe awọn olukopa ọkọ ofurufu ma wa ninu ọkọ ofurufu naa,yoruba,,,,
48
+ ,,,Pronunciation,20240304021449-141-1567-406683-mo-lo-ikora-eni-nijaanu-lakoko.wav,Mo lo ikora-eni-nijaanu lakoko awọn eré.,yoruba,,,,
49
+ ,,,Pronunciation,20240309132126-134-1523-396179-i-lo-so-di-o-o-gu-n-o-da-ra-fu.wav,ìlòsódì òògùn ò dára fún ago ara.,yoruba,,,,
50
+ ,,,Naturalness,20240227224855-132-2132-565923-ilu-bini-ti-won-ti-n-so-ede-fa.wav,"Ìlú Bìní tí wọn ti ń sọ èdè Faransé, jẹ́ ọ̀kan nínú àwọn ọmọ Yorùbá.",yoruba,,,,
51
+ ,,,Naturalness,20240210104710-130-2639-609899-a-o-sun-lo-ibugbe-talaka-nitor.wav,A o sún lo ibùgbé tálákà nitori a o lè sán ọwọ ilé tí o wọ́n.,yoruba,,,,
52
+ ,,,Naturalness,20231230185249-70-663-216187-a-ma--lo-r-l-n--f-s-mi.wav,A ma ń lo rúlà ní ọ́fìsì mi.,yoruba,,,,
53
+ ,,,Emotion,20240320095740-209-3816-715171-se-o-nlo-owu-fun-irun-re.wav,Ṣẹ o nlọ owú fún irùn rẹ?,yoruba,,,,
54
+ ,,,Emotion,20240306020702-132-1477-385209-omo-alake-ti-ki.wav,Ọmọ alakẹ tí ki,yoruba,,,,
55
+ ,,,Emotion,20240308153351-139-2257-595835-a-won-i-se-le-tu-n-le-bi-a-won.wav,Àwọn ìṣẹ̀lẹ̀ tún lè bí àwọn òwe tuntun lọ́jọ́ iwájú,yoruba,,,,
56
+ ,,,Pronunciation,20240112125638-67-1866-469130-yaron-da-aka-reno-da-kyau-shin.wav,Yaron da aka reno da kyau shine babban abin alfaharin iyaye,hausa,,,,
57
+ ,,,Pronunciation,20240304141707-164-2408-515797-tugo-ya-zagaya-yanar-gizo-sosa.wav,Tugo ya zagaya yanar gizo sosai da,hausa,,,,
58
+ ,,,Pronunciation,20240121115511-55-2438-518642-wane-irin-abun-sha-kuke-da-su.wav,Wane irin abun sha kuke da su a cikin wannan gidan giya?,hausa,,,,
59
+ ,,,Naturalness,20240117134055-67-1882-472839-za-ka-siyo-sabuwar-motar-kuwa.wav,Za ka siyo sabuwar motar kuwa?,hausa,,,,
60
+ ,,,Naturalness,20240112112416-64-1950-482478-ka-ba-ni-giya-biyar-halitta.wav,ka ba ni giya biyar halitta,hausa,,,,
61
+ ,,,Naturalness,20240204121303-161-2398-513605-akwai-wurin-sauka-da-tashin-ji.wav,Akwai wurin sauka da tashin jirage na cikin ƙasa da kuma na duniya,hausa,,,,
62
+ ,,,Emotion,20240328153436-263-5788-1398462-kuna-son-lokacin-da-abokin-tar.wav,Kuna son lokacin da abokin tarayya yana kishi?,hausa,,,,
63
+ ,,,Emotion,20240112081950-157-1376-295388-amaryar-ta-sa-lalle-jiya.wav,Amaryar ta sa lalle jiya,hausa,,,,
64
+ ,,,Emotion,20240322230610-260-5076-1017618-tun-kafin-ya-yi-aure-yake-addu.wav,Tun kafin ya yi aure yake addu'ar samun ƴaƴa masu yawa,hausa,,,,
sample_audios2/hausa/20240104115313-65-817-140246-ci-gaba-da-ganin-ku.wav ADDED
Binary file (9.2 kB). View file
 
sample_audios2/hausa/20240104151151-55-927-244046-ana-kiran-wurin-da-ake-aske-ga.wav ADDED
Binary file (77.9 kB). View file
 
sample_audios2/hausa/20240109124500-68-973-255031-kin-san-tatsuniyar-da-kaka-tak.wav ADDED
Binary file (50.7 kB). View file
 
sample_audios2/hausa/20240111232934-65-1911-479858-dada-na-iya-zama-na-an-lokaci.wav ADDED
Binary file (71.1 kB). View file
 
sample_audios2/igbo/20231206214604-22-43-7222-nneka-adgh-ime.wav ADDED
Binary file (29.3 kB). View file
 
sample_audios2/igbo/20231208135445-50-144-31532-a-na-agpta-ebubo-eboro-onye.wav ADDED
Binary file (53.3 kB). View file
 
sample_audios2/igbo/20231213160240-27-71-14080-maz-na-enwe-mmasi-n-akk-i.wav ADDED
Binary file (41.3 kB). View file
 
sample_audios2/igbo/20231215125814-29-231-51628-enwere-d-nudulu-d-iche-iche.wav ADDED
Binary file (25.2 kB). View file
 
sample_audios2/yoruba/20231230185249-70-663-216187-a-ma--lo-r-l-n--f-s-mi.wav ADDED
Binary file (52.7 kB). View file
 
sample_audios2/yoruba/20240108153843-133-1495-389368-b-l-ma-l-s--gangan-j--n--l-ti.wav ADDED
Binary file (105 kB). View file
 
sample_audios2/yoruba/20240112121748-130-1462-381431-baba-nigbagbogbo-favor-omobinr.wav ADDED
Binary file (14.4 kB). View file
 
sample_audios2/yoruba/20240112174301-131-1453-241497-inu-iya-agba-dun-lati-ri-omo-o.wav ADDED
Binary file (80.9 kB). View file