Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import oneclass
|
2 |
+
import gradio as gr
|
3 |
+
import pandas as pd
|
4 |
+
|
5 |
+
def predict_and_download(positive_csv_file, unlabelled_csv_file, n, text):
|
6 |
+
selected_paper_info = oneclass.select_top_n_papers(n, positive_csv_file, unlabelled_csv_file)
|
7 |
+
|
8 |
+
return selected_paper_info
|
9 |
+
|
10 |
+
# Create the interface
|
11 |
+
iface = gr.Interface(
|
12 |
+
fn=predict_and_download,
|
13 |
+
inputs=["file", "file", "number", "textbox"],
|
14 |
+
outputs=[gr.DataFrame(label="Selected Papers")],
|
15 |
+
title="Paper Prediction",
|
16 |
+
description="Enter text and upload CSV files for labelled and unlabelled data.",
|
17 |
+
allow_flagging='never' # Disable flagging feature
|
18 |
+
)
|
19 |
+
|
20 |
+
iface.launch()
|