Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -46,33 +46,47 @@ if keys is not None:
|
|
46 |
topic = st.sidebar.selectbox(label="Choose dataset topic to load", options=keys )
|
47 |
|
48 |
|
49 |
-
with st.container():
|
50 |
|
51 |
-
|
52 |
-
|
|
|
|
|
53 |
#st.write(subtopics)
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
-
c1, c2, c3 = st.columns([3, 1, 1])
|
62 |
-
with c1:
|
63 |
-
|
64 |
-
|
65 |
|
66 |
-
with c2:
|
67 |
-
|
68 |
-
|
69 |
|
70 |
-
with c3:
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
if feedback:
|
75 |
-
|
76 |
# if st.button('Submit'):
|
77 |
# paraList[topic][choice][idx]['annotation'].append(feedback)
|
78 |
# with open('data/{}'.format(file_name), 'r', encoding="utf8") as json_file:
|
|
|
46 |
topic = st.sidebar.selectbox(label="Choose dataset topic to load", options=keys )
|
47 |
|
48 |
|
49 |
+
#with st.container():
|
50 |
|
51 |
+
|
52 |
+
with st.form():
|
53 |
+
if topic is not None:
|
54 |
+
subtopics = list(paraList[topic].keys())
|
55 |
#st.write(subtopics)
|
56 |
+
val = np.random.randint(0,len(subtopics)-1)
|
57 |
+
tag = subtopics[val]
|
58 |
+
st.write(tag)
|
59 |
|
60 |
+
idx = np.random.randint(0,3)
|
61 |
+
st.write(idx)
|
62 |
+
|
63 |
+
st.markdown("Text")
|
64 |
+
st.write(paraList[topic][tag][idx]['textsegment'])
|
65 |
+
|
66 |
+
st.markdown("Tag")
|
67 |
+
st.write(tag)
|
68 |
+
|
69 |
+
feedback = st.selectbox('0 If Tag is not a good keyword for text, 5 for prefect match',(0,1,2,3,4,5))
|
70 |
+
submitted = st.form_submit_button("Submit")
|
71 |
+
if submitted:
|
72 |
+
st.write(feedback)
|
73 |
+
|
74 |
|
75 |
+
#c1, c2, c3 = st.columns([3, 1, 1])
|
76 |
+
#with c1:
|
77 |
+
# st.header('Text')
|
78 |
+
# st.write(paraList[topic][tag][idx]['textsegment'])
|
79 |
|
80 |
+
#with c2:
|
81 |
+
# st.header('Tag')
|
82 |
+
# st.text(tag)
|
83 |
|
84 |
+
#with c3:
|
85 |
+
# st.header('Feedback')
|
86 |
+
# feedback = None
|
87 |
+
# feedback = st.selectbox('0 If Tag is not a good keyword for text, 5 for prefect match',(0,1,2,3,4,5))
|
88 |
+
#if feedback:
|
89 |
+
# st.write(feedback)
|
90 |
# if st.button('Submit'):
|
91 |
# paraList[topic][choice][idx]['annotation'].append(feedback)
|
92 |
# with open('data/{}'.format(file_name), 'r', encoding="utf8") as json_file:
|