Spaces:
Runtime error
Runtime error
polinaeterna
commited on
Commit
·
c0e4fc0
1
Parent(s):
406f549
add plot
Browse files
app.py
CHANGED
|
@@ -51,7 +51,7 @@ def run_quality_check(dataset, column, n_samples):
|
|
| 51 |
predictions = predict(texts[:n_samples])
|
| 52 |
counts = pd.DataFrame({"quality": predictions}).value_counts().to_frame()
|
| 53 |
counts.reset_index(inplace=True)
|
| 54 |
-
return counts
|
| 55 |
|
| 56 |
|
| 57 |
with gr.Blocks() as demo:
|
|
@@ -83,9 +83,8 @@ with gr.Blocks() as demo:
|
|
| 83 |
text_column = gr.Textbox(placeholder="text", label="Text colum name to check (data must be non-nested, raw texts!)")
|
| 84 |
n_samples = gr.Number(label="Num first samples to run check")
|
| 85 |
gr_check_btn = gr.Button("Check Dataset")
|
| 86 |
-
|
| 87 |
-
df = gr.DataFrame()
|
| 88 |
-
gr_check_btn.click(run_quality_check, inputs=[dataset_name, text_column, n_samples], outputs=[
|
| 89 |
-
# gr.BarPlot(df)
|
| 90 |
|
| 91 |
demo.launch()
|
|
|
|
| 51 |
predictions = predict(texts[:n_samples])
|
| 52 |
counts = pd.DataFrame({"quality": predictions}).value_counts().to_frame()
|
| 53 |
counts.reset_index(inplace=True)
|
| 54 |
+
return gr.BarPlot(counts, x="quality", y="count")
|
| 55 |
|
| 56 |
|
| 57 |
with gr.Blocks() as demo:
|
|
|
|
| 83 |
text_column = gr.Textbox(placeholder="text", label="Text colum name to check (data must be non-nested, raw texts!)")
|
| 84 |
n_samples = gr.Number(label="Num first samples to run check")
|
| 85 |
gr_check_btn = gr.Button("Check Dataset")
|
| 86 |
+
plot = gr.BarPlot()
|
| 87 |
+
# df = gr.DataFrame(visible=False)
|
| 88 |
+
gr_check_btn.click(run_quality_check, inputs=[dataset_name, text_column, n_samples], outputs=[plot])
|
|
|
|
| 89 |
|
| 90 |
demo.launch()
|