Spaces:
Running
on
Zero
Running
on
Zero
Commit
Β·
36ed904
1
Parent(s):
162dd72
Refactor feedback logging setup and add expert checkbox for paper matches
Browse files
app.py
CHANGED
@@ -599,10 +599,8 @@ def create_interface():
|
|
599 |
paper_feedback = gr.Radio(
|
600 |
["π Good Match", "π Poor Match"], label="Is this paper a good match?", visible=False
|
601 |
)
|
602 |
-
|
603 |
-
|
604 |
-
visible=False
|
605 |
-
)
|
606 |
flag_paper_btn = gr.Button("Submit Paper Feedback", visible=False)
|
607 |
|
608 |
with gr.Column(scale=1):
|
@@ -625,12 +623,20 @@ def create_interface():
|
|
625 |
)
|
626 |
flag_analysis_btn = gr.Button("Submit Analysis Feedback", visible=False)
|
627 |
|
628 |
-
# Set up
|
629 |
data_path = "/data" if persistent_storage else "./data"
|
630 |
-
os.makedirs(data_path + "/flagged_analyses", exist_ok=True)
|
631 |
os.makedirs(data_path + "/flagged_paper_matches", exist_ok=True)
|
632 |
-
|
633 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
634 |
|
635 |
# Show feedback component
|
636 |
def show_feedback():
|
|
|
599 |
paper_feedback = gr.Radio(
|
600 |
["π Good Match", "π Poor Match"], label="Is this paper a good match?", visible=False
|
601 |
)
|
602 |
+
paper_expert = gr.Checkbox(label="I am an expert in this field", value=False, visible=False)
|
603 |
+
paper_comment = gr.Textbox(label="Additional feedback on this paper match (optional)", visible=False)
|
|
|
|
|
604 |
flag_paper_btn = gr.Button("Submit Paper Feedback", visible=False)
|
605 |
|
606 |
with gr.Column(scale=1):
|
|
|
623 |
)
|
624 |
flag_analysis_btn = gr.Button("Submit Analysis Feedback", visible=False)
|
625 |
|
626 |
+
# Set up logging directories
|
627 |
data_path = "/data" if persistent_storage else "./data"
|
|
|
628 |
os.makedirs(data_path + "/flagged_paper_matches", exist_ok=True)
|
629 |
+
os.makedirs(data_path + "/flagged_analyses", exist_ok=True)
|
630 |
+
|
631 |
+
# Set up loggers
|
632 |
+
paper_match_logger.setup(
|
633 |
+
[abstract_input, paper_details_output, paper_feedback, paper_expert, paper_comment],
|
634 |
+
data_path + "/flagged_paper_matches",
|
635 |
+
)
|
636 |
+
analysis_logger.setup(
|
637 |
+
[paper_details_output, analysis_output, analysis_feedback, analysis_comment],
|
638 |
+
data_path + "/flagged_analyses",
|
639 |
+
)
|
640 |
|
641 |
# Show feedback component
|
642 |
def show_feedback():
|