-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:librairy/muheqa
- Loading branch information
Showing
23 changed files
with
549 additions
and
33,018 deletions.
There are no files selected for viewing
File renamed without changes.
5,163 changes: 0 additions & 5,163 deletions
5,163
application/datasets/LC-QuAD_2.0/data/LC-Quad_Dataset.csv
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import streamlit as st | ||
from utils import dbManager | ||
from utils import parseDatasets | ||
|
||
dbDirection = "mongodb://localhost:27017" | ||
|
||
def main(): | ||
|
||
#Subtitulo de la seccion de gestion de conjuntos de datos | ||
st.subheader('Dataset Management') | ||
|
||
#Texto del cuerpo de la pagina web | ||
st.markdown(""" | ||
You may upload your dataset below. For it to be processed and uploaded to our database, please follow these guidelines: | ||
- 1. Upload your dataset either on .CSV or .JSON format. | ||
- 2. JSONs may be on JSON lines or JSON array format. | ||
- 3. Answers should be on the "answer" column/key, and Questions on the "question" column/key. | ||
- 4. If your Answer is verbalized, you shall name its key/column "verbalized_answer", and format it with the answer between brackets, i.e. "Fernando Alonso was born in [Oviedo]." | ||
""", unsafe_allow_html=True) | ||
|
||
inputBuffer = st.file_uploader("Upload an Image", type=["csv","json"]) | ||
|
||
if inputBuffer: | ||
try: | ||
db = dbManager.DbManager(dbDirection) | ||
filename = inputBuffer.name | ||
splitFilename = filename.split(".") | ||
datasetDict = parseDatasets.parseDataset(inputBuffer, isCsv=(splitFilename[1] == "csv")) | ||
datasetName = splitFilename[0].lower() | ||
if datasetDict: | ||
db.importDataset(datasetDict, datasetName) | ||
if datasetName in db.getCollections(): | ||
st.success("β¨ Your dataset has been registered on our database!") | ||
st.write("A dataset with name ", datasetName, "and length ", len(datasetDict), " questions has been registered on MongoDB") | ||
else: | ||
st.error("We could not upload your dataset on our database. Please contact the administrator.") | ||
else: | ||
st.error("Your dataset could not be processed correctly. Please revise the format or contact the administrator") | ||
except Exception as e: | ||
st.exception(e) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.