Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
|
|
3 |
import pandas as pd
|
4 |
from io import StringIO
|
5 |
|
6 |
-
def predict_and_download(positive_csv_file, unlabelled_csv_file, n
|
7 |
selected_paper_info = oneclass.select_top_n_papers(n, positive_csv_file, unlabelled_csv_file)
|
8 |
|
9 |
# Create a StringIO object to store CSV data
|
@@ -16,15 +16,13 @@ def predict_and_download(positive_csv_file, unlabelled_csv_file, n, text):
|
|
16 |
csv_content = csv_buffer.getvalue()
|
17 |
|
18 |
|
19 |
-
|
20 |
-
|
21 |
# Return selected_paper_info and CSV content
|
22 |
-
return selected_paper_info,
|
23 |
|
24 |
# Create the interface
|
25 |
iface = gr.Interface(
|
26 |
fn=predict_and_download,
|
27 |
-
inputs=["file", "file", "number"
|
28 |
outputs=[gr.DataFrame(label="Selected Papers"), gr.DownloadButton(label="Download CSV")],
|
29 |
title="Paper Prediction",
|
30 |
description="Enter text and upload CSV files for labelled and unlabelled data.",
|
|
|
3 |
import pandas as pd
|
4 |
from io import StringIO
|
5 |
|
6 |
+
def predict_and_download(positive_csv_file, unlabelled_csv_file, n):
|
7 |
selected_paper_info = oneclass.select_top_n_papers(n, positive_csv_file, unlabelled_csv_file)
|
8 |
|
9 |
# Create a StringIO object to store CSV data
|
|
|
16 |
csv_content = csv_buffer.getvalue()
|
17 |
|
18 |
|
|
|
|
|
19 |
# Return selected_paper_info and CSV content
|
20 |
+
return selected_paper_info, csv_buffer
|
21 |
|
22 |
# Create the interface
|
23 |
iface = gr.Interface(
|
24 |
fn=predict_and_download,
|
25 |
+
inputs=["file", "file", "number"],
|
26 |
outputs=[gr.DataFrame(label="Selected Papers"), gr.DownloadButton(label="Download CSV")],
|
27 |
title="Paper Prediction",
|
28 |
description="Enter text and upload CSV files for labelled and unlabelled data.",
|