aftersix commited on
Commit
8217825
1 Parent(s): f5411b0

fixed loop issue

Browse files
Files changed (1) hide show
  1. app.py +41 -45
app.py CHANGED
@@ -3,19 +3,13 @@ import streamlit as st
3
  from st_aggrid import AgGrid
4
  import pandas as pd
5
 
6
- #from transformers import pipeline
7
-
8
- #pipe = pipeline(model="facebook/bart-large-mnli")
9
- #pipe("I have a problem with my iphone that needs to be resolved asap!",
10
- #candidate_labels=["urgent", "not urgent", "phone", "tablet", "computer"],
11
- #)
12
  import csv
13
  prompts = []
14
  questions = []
15
  details = []
16
  with open('auditorytext.csv', newline='') as csvfile:
17
  reader = csv.DictReader(csvfile)
18
- x=1
19
  for row in reader:
20
  #print(row['\ufeffno'], row['question'],x)
21
  questions.insert(x,row['question'])
@@ -59,45 +53,45 @@ def main():
59
  3. ***Get Results*** - Get your assessment results and resources to use with your child.</br> """,unsafe_allow_html=True)
60
  with st.expander('Skills Identification'):
61
  st.markdown('Check the box to answer "yes" to each question')
62
- assessment[1] = st.checkbox('Does your child respond to a familiar voice?')
63
- assessment[2] = st.checkbox('Does your child listen to somebody speaking?')
64
- assessment[3] = st.checkbox('When somebody is speaking, does your child turn their head towards the speaker?')
65
- assessment[4] = st.checkbox('Is your child interested in toys producing sounds or music?')
66
- assessment[5] = st.checkbox('Does your child look for a speaker they cannot see?')
67
- assessment[6] = st.checkbox('Does your child listen when the radio/CD/tape player is turned on?')
68
- assessment[7] = st.checkbox('Does your child respond to distant sounds?')
69
- assessment[8] = st.checkbox('Does your child stop crying when you speak to them without them seeing you?')
70
- assessment[9] = st.checkbox('Does your child respond with alarm when hearing an angry voice?')
71
- assessment[10] = st.checkbox('Does your child "recognize" acoustic rituals?')
72
- assessment[11] = st.checkbox('Does your child look for sound sources located at the left, right, or back?')
73
- assessment[12] = st.checkbox('Does your child react to their name?')
74
- assessment[13] = st.checkbox('Does your child look for sound sources located above or below?')
75
- assessment[14] = st.checkbox('When your child is sad or moody, can they be calmed down or influenced by music?')
76
- assessment[15] = st.checkbox('Does your child listen on the telephone and do they seem to recognize that somebody is talking?')
77
- assessment[16] = st.checkbox(' Does your child respond to music with rhythmical movements?')
78
- assessment[17] = st.checkbox(' Does your child know that a certain sound is related to a certain object or event?')
79
- assessment[18] = st.checkbox(' Does your child appropriately respond to short and simple remarks?')
80
- assessment[19] = st.checkbox('Does your child respond to "no" by typically interrupting their current activity?')
81
- assessment[20] = st.checkbox('Does your child know family members names?')
82
- assessment[21] = st.checkbox(' Does your child imitate sound when asked?')
83
- assessment[22] = st.checkbox(' Does your child follow simple commands?')
84
- assessment[23] = st.checkbox(' Does your child understand simple questions?')
85
- assessment[24] = st.checkbox('Does your child bring items when asked?')
86
- assessment[25] = st.checkbox('Does your child imitate sounds or words you say? ')
87
- assessment[26] = st.checkbox('Does your child produce the right sound to a toy?')
88
  assessment[26] = st.checkbox('Does your child know that certain sounds go with certain animals?')
89
- assessment[28] = st.checkbox('Does your child imitate environmental sounds?')
90
- assessment[29] = st.checkbox('Does your child correctly repeat a sequence of short and long syllables you have said?')
91
- assessment[30] = st.checkbox('Does your child select the right object from a number of objects when asked?')
92
- assessment[31] = st.checkbox('Does your child try to sing along when hearing a song?')
93
- assessment[32] = st.checkbox('Does your child repeat certain words when asked?')
94
- assessment[33] = st.checkbox('Does your child like being read to?')
95
- assessment[34] = st.checkbox('Does your child follow complex commands?')
96
- assessment[35] = st.checkbox('Does your child try to sing along with familiar songs?')
97
 
98
  with st.expander('Tell us more about how your child responds to sound'):
99
  x=0
100
- while x < 36:
101
  if assessment[x]!=False:
102
  input = st.text_input(prompts[x])
103
  details.insert(x,input)
@@ -118,14 +112,16 @@ def main():
118
  #define sequence
119
  sequence_labels=["DETECTION", "DISCRIMINATION", "IDENTIFICATION", "CLASSIFICATION"]
120
  x=0
121
- while x < 36:
 
122
  if details[x] != "none":
123
  st.markdown(questions[x])
124
  st.markdown("**"+details[x]+"**")
125
  sequence = details[x]
 
126
  output = classifier(sequence, sequence_labels)
127
- st.markdown("For this skill, your child's auditory skill level is: " + str(output['labels'][0] + "the best resource to use to work on your child's language development is: " + str(output['labels'][0]) + " resource. "))
128
- x=x+1
129
  #run main
130
  if __name__ == '__main__':
131
  main()
 
3
  from st_aggrid import AgGrid
4
  import pandas as pd
5
 
 
 
 
 
 
 
6
  import csv
7
  prompts = []
8
  questions = []
9
  details = []
10
  with open('auditorytext.csv', newline='') as csvfile:
11
  reader = csv.DictReader(csvfile)
12
+ x=0
13
  for row in reader:
14
  #print(row['\ufeffno'], row['question'],x)
15
  questions.insert(x,row['question'])
 
53
  3. ***Get Results*** - Get your assessment results and resources to use with your child.</br> """,unsafe_allow_html=True)
54
  with st.expander('Skills Identification'):
55
  st.markdown('Check the box to answer "yes" to each question')
56
+ assessment[0] = st.checkbox('Does your child respond to a familiar voice?')
57
+ assessment[1] = st.checkbox('Does your child listen to somebody speaking?')
58
+ assessment[2] = st.checkbox('When somebody is speaking, does your child turn their head towards the speaker?')
59
+ assessment[3] = st.checkbox('Is your child interested in toys producing sounds or music?')
60
+ assessment[4] = st.checkbox('Does your child look for a speaker they cannot see?')
61
+ assessment[5] = st.checkbox('Does your child listen when the radio/CD/tape player is turned on?')
62
+ assessment[6] = st.checkbox('Does your child respond to distant sounds?')
63
+ assessment[7] = st.checkbox('Does your child stop crying when you speak to them without them seeing you?')
64
+ assessment[8] = st.checkbox('Does your child respond with alarm when hearing an angry voice?')
65
+ assessment[9] = st.checkbox('Does your child "recognize" acoustic rituals?')
66
+ assessment[10] = st.checkbox('Does your child look for sound sources located at the left, right, or back?')
67
+ assessment[11] = st.checkbox('Does your child react to their name?')
68
+ assessment[12] = st.checkbox('Does your child look for sound sources located above or below?')
69
+ assessment[13] = st.checkbox('When your child is sad or moody, can they be calmed down or influenced by music?')
70
+ assessment[14] = st.checkbox('Does your child listen on the telephone and do they seem to recognize that somebody is talking?')
71
+ assessment[15] = st.checkbox(' Does your child respond to music with rhythmical movements?')
72
+ assessment[16] = st.checkbox(' Does your child know that a certain sound is related to a certain object or event?')
73
+ assessment[17] = st.checkbox(' Does your child appropriately respond to short and simple remarks?')
74
+ assessment[18] = st.checkbox('Does your child respond to "no" by typically interrupting their current activity?')
75
+ assessment[19] = st.checkbox('Does your child know family members names?')
76
+ assessment[20] = st.checkbox(' Does your child imitate sound when asked?')
77
+ assessment[21] = st.checkbox(' Does your child follow simple commands?')
78
+ assessment[22] = st.checkbox(' Does your child understand simple questions?')
79
+ assessment[23] = st.checkbox('Does your child bring items when asked?')
80
+ assessment[24] = st.checkbox('Does your child imitate sounds or words you say? ')
81
+ assessment[25] = st.checkbox('Does your child produce the right sound to a toy?')
82
  assessment[26] = st.checkbox('Does your child know that certain sounds go with certain animals?')
83
+ assessment[27] = st.checkbox('Does your child imitate environmental sounds?')
84
+ assessment[28] = st.checkbox('Does your child correctly repeat a sequence of short and long syllables you have said?')
85
+ assessment[29] = st.checkbox('Does your child select the right object from a number of objects when asked?')
86
+ assessment[30] = st.checkbox('Does your child try to sing along when hearing a song?')
87
+ assessment[31] = st.checkbox('Does your child repeat certain words when asked?')
88
+ assessment[32] = st.checkbox('Does your child like being read to?')
89
+ assessment[33] = st.checkbox('Does your child follow complex commands?')
90
+ assessment[34] = st.checkbox('Does your child try to sing along with familiar songs?')
91
 
92
  with st.expander('Tell us more about how your child responds to sound'):
93
  x=0
94
+ while x < 35:
95
  if assessment[x]!=False:
96
  input = st.text_input(prompts[x])
97
  details.insert(x,input)
 
112
  #define sequence
113
  sequence_labels=["DETECTION", "DISCRIMINATION", "IDENTIFICATION", "CLASSIFICATION"]
114
  x=0
115
+ print('start loop')
116
+ while x < 35:
117
  if details[x] != "none":
118
  st.markdown(questions[x])
119
  st.markdown("**"+details[x]+"**")
120
  sequence = details[x]
121
+ print(details[x])
122
  output = classifier(sequence, sequence_labels)
123
+ st.markdown("For this skill, your child's auditory skill level is: " + str(output['labels'][0] + ", the best resource to use to work on your child's language development is: " + str(output['labels'][0]) + " resource. "))
124
+ x=x+1
125
  #run main
126
  if __name__ == '__main__':
127
  main()