Spaces:
Build error
Build error
Update app.py
Browse files45 unmodified lines46474849505152535455565758596061626364656667686970717273747576777845 unmodified linestopic = st.sidebar.selectbox(label="Choose dataset topic to load", options=keys )with st.container():if topic is not None:subtopics = list(paraList[topic].keys())#st.write(subtopics)val = np.random.randint(0,len(subtopics)-1)tag = subtopics[val]st.write(tag)idx = np.random.randint(0,3)st.write(idx)c1, c2, c3 = st.columns([3, 1, 1])with c1:st.header('Text')st.write(paraList[topic][tag][idx]['textsegment'])with c2:st.header('Tag')st.text(tag)with c3:st.header('Feedback')feedback = Nonefeedback = st.selectbox('0 If Tag is not a good keyword for text, 5 for prefect match',(0,1,2,3,4,5))if feedback:st.write(feedback)# if st.button('Submit'):# paraList[topic][choice][idx]['annotation'].append(feedback)# with open('data/{}'.format(file_name), 'r', encoding="utf8") as json_file:45 unmodified lines464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919245 unmodified linestopic = st.sidebar.selectbox(label="Choose dataset topic to load", options=keys )#with st.container():with st.form():if topic is not None:subtopics = list(paraList[topic].keys())#st.write(subtopics)val = np.random.randint(0,len(subtopics)-1)tag = subtopics[val]st.write(tag)idx = np.random.randint(0,3)st.write(idx)st.markdown("Text")st.write(paraList[topic][tag][idx]['textsegment'])st.markdown("Tag")st.write(tag)feedback = st.selectbox('0 If Tag is not a good keyword for text, 5 for prefect match',(0,1,2,3,4,5))submitted = st.form_submit_button("Submit")if submitted:st.write(feedback)#c1, c2, c3 = st.columns([3, 1, 1])#with c1:# st.header('Text')# st.write(paraList[topic][tag][idx]['textsegment'])#with c2:# st.header('Tag')# st.text(tag)#with c3:# st.header('Feedback')# feedback = None# feedback = st.selectbox('0 If Tag is not a good keyword for text, 5 for prefect match',(0,1,2,3,4,5))#if feedback:# st.write(feedback)# if st.button('Submit'):# paraList[topic][choice][idx]['annotation'].append(feedback)# with open('data/{}'.format(file_name), 'r', encoding="utf8") as json_file:
app.py+35-21