Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,8 +17,11 @@ DATA_FILE = os.path.join("data", DATA_FILENAME)
|
|
| 17 |
|
| 18 |
# cloning the dataset repo
|
| 19 |
repo = Repository( local_dir="data", clone_from=DATASET_REPO_URL, repo_type="dataset", use_auth_token= auth_token)
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
| 22 |
#data = pd.read_csv("test.csv")
|
| 23 |
#for line in data:
|
| 24 |
st.sidebar.markdown(
|
|
@@ -27,6 +30,10 @@ st.sidebar.markdown(
|
|
| 27 |
This app is demo how to use the space to provide user interface for the data annotation/tagging. The data resides in repo_type 'dataset'.
|
| 28 |
"""
|
| 29 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
# st.write(line)
|
| 31 |
|
| 32 |
title = st.text_input('Movie title', 'Life of Brian')
|
|
@@ -38,7 +45,7 @@ if st.button('Submit'):
|
|
| 38 |
# data.to_csv('test.csv', index= False)
|
| 39 |
|
| 40 |
|
| 41 |
-
st.write(df)
|
| 42 |
# st.write('data/test.csv')
|
| 43 |
# iterate over files in
|
| 44 |
# that directory
|
|
|
|
| 17 |
|
| 18 |
# cloning the dataset repo
|
| 19 |
repo = Repository( local_dir="data", clone_from=DATASET_REPO_URL, repo_type="dataset", use_auth_token= auth_token)
|
| 20 |
+
import json
|
| 21 |
+
file_name = 'paralist.json'
|
| 22 |
+
with open('/content/data/{}'.format(file_name), 'r', encoding="utf8") as json_file:
|
| 23 |
+
paraList = json.load(json_file)
|
| 24 |
+
keys = paraList.keys()
|
| 25 |
#data = pd.read_csv("test.csv")
|
| 26 |
#for line in data:
|
| 27 |
st.sidebar.markdown(
|
|
|
|
| 30 |
This app is demo how to use the space to provide user interface for the data annotation/tagging. The data resides in repo_type 'dataset'.
|
| 31 |
"""
|
| 32 |
)
|
| 33 |
+
|
| 34 |
+
if keys is not None:
|
| 35 |
+
topic = st.sidebar.selectbox(
|
| 36 |
+
label="Choose dataset topic to load", options=keys )
|
| 37 |
# st.write(line)
|
| 38 |
|
| 39 |
title = st.text_input('Movie title', 'Life of Brian')
|
|
|
|
| 45 |
# data.to_csv('test.csv', index= False)
|
| 46 |
|
| 47 |
|
| 48 |
+
#st.write(df)
|
| 49 |
# st.write('data/test.csv')
|
| 50 |
# iterate over files in
|
| 51 |
# that directory
|