Spaces:
Runtime error
Runtime error
Fix QA mapping
Browse files29 unmodified lines3031323334353621 unmodified lines58596061626364651 unmodified line6768697071727374117 unmodified lines19219319419519619715 unmodified lines21321421521621721821922022122222322422522622722822923023123223323423523623723863 unmodified lines30230330430530630730829 unmodified lines"summarization": 8,}supported_tasks = list(TASK_TO_ID.keys())###########21 unmodified linesst.experimental_set_query_params(**{"dataset": [selected_dataset]})# TODO: In general this will be a list of multiple configs => need to generalise logic heremetadata = get_metadata(selected_dataset)if metadata is None:st.warning("No evaluation metadata found. Please configure the evaluation job below.")1 unmodified line## Select taskselected_task = st.selectbox("Select a task",supported_tasks,index=supported_tasks.index(metadata[0]["task_id"]) if metadata is not None else 0,)### Select configconfigs = get_dataset_config_names(selected_dataset)117 unmodified linescol_mapping[target_col] = "target"elif selected_task == "extractive_question_answering":with col1:st.markdown("`context` column")st.text("")15 unmodified linescontext_col = st.selectbox("This column should contain the question's context",col_names,index=col_names.index(get_key(metadata[0]["col_mapping"], "context")) if metadata is not None else 0,)question_col = st.selectbox("This column should contain the question to be answered, given the context",col_names,index=col_names.index(get_key(metadata[0]["col_mapping"], "question")) if metadata is not None else 0,)answers_text_col = st.selectbox("This column should contain example answers to the question, extracted from the context",col_names,index=col_names.index(get_key(metadata[0]["col_mapping"], "answers.text"))if metadata is not Noneelse 0,)answers_start_col = st.selectbox("This column should contain the indices in the context of the first character of each answers.text",col_names,index=col_names.index(get_key(metadata[0]["col_mapping"], "answers.answer_start"))if metadata is not Noneelse 0,)col_mapping[context_col] = "context"col_mapping[question_col] = "question"63 unmodified linesf"""Evaluation takes appoximately 1 hour to complete, so grab a β or π΅ while you wait:* π Click [here](https://huggingface.co/spaces/huggingface/leaderboards) to view the results from your submission""")else:29 unmodified lines3031323334353621 unmodified lines58596061626364651 unmodified line6768697071727374117 unmodified lines19219319419519619719819915 unmodified lines21521621721821922022122222322422522622722822923023123223323423523663 unmodified lines30030130230330430530629 unmodified lines"summarization": 8,}SUPPORTED_TASKS = list(TASK_TO_ID.keys())###########21 unmodified linesst.experimental_set_query_params(**{"dataset": [selected_dataset]})metadata = get_metadata(selected_dataset)print(metadata)if metadata is None:st.warning("No evaluation metadata found. Please configure the evaluation job below.")1 unmodified line## Select taskselected_task = st.selectbox("Select a task",SUPPORTED_TASKS,index=SUPPORTED_TASKS.index(metadata[0]["task_id"]) if metadata is not None else 0,)### Select configconfigs = get_dataset_config_names(selected_dataset)117 unmodified linescol_mapping[target_col] = "target"elif selected_task == "extractive_question_answering":col_mapping = metadata[0]["col_mapping"]col_mapping = {k.replace("-", "."): v.replace("-", ".") for k, v in col_mapping.items()}with col1:st.markdown("`context` column")st.text("")15 unmodified linescontext_col = st.selectbox("This column should contain the question's context",col_names,index=col_names.index(get_key(col_mapping, "context")) if metadata is not None else 0,)question_col = st.selectbox("This column should contain the question to be answered, given the context",col_names,index=col_names.index(get_key(col_mapping, "question")) if metadata is not None else 0,)answers_text_col = st.selectbox("This column should contain example answers to the question, extracted from the context",col_names,index=col_names.index(get_key(col_mapping, "answers.text")) if metadata is not None else 0,)answers_start_col = st.selectbox("This column should contain the indices in the context of the first character of each answers.text",col_names,index=col_names.index(get_key(col_mapping, "answers.answer_start")) if metadata is not None else 0,)col_mapping[context_col] = "context"col_mapping[question_col] = "question"63 unmodified linesf"""Evaluation takes appoximately 1 hour to complete, so grab a β or π΅ while you wait:* π Click [here](https://huggingface.co/spaces/autoevaluate/leaderboards) to view the results from your submission""")else:
app.py+11-13