Spaces:
Running
Running
Update app.py
Browse filesadd copy option
app.py
CHANGED
|
@@ -29,7 +29,7 @@ def greet(opinion, judges_l):
|
|
| 29 |
chunks = chunk_data(remove_citations(opinion))["text"].to_list()
|
| 30 |
result = average_text(chunks, pipe, judges_l)
|
| 31 |
|
| 32 |
-
return result[0]
|
| 33 |
|
| 34 |
|
| 35 |
def set_input(drop):
|
|
@@ -76,6 +76,7 @@ with gr.Blocks() as demo:
|
|
| 76 |
op_level = gr.outputs.Label(
|
| 77 |
num_top_classes=9, label="Predicted author of opinion"
|
| 78 |
)
|
|
|
|
| 79 |
|
| 80 |
year.release(
|
| 81 |
update_year,
|
|
@@ -92,7 +93,7 @@ with gr.Blocks() as demo:
|
|
| 92 |
greet_btn.click(
|
| 93 |
fn=greet,
|
| 94 |
inputs=[opinion, exc_judg],
|
| 95 |
-
outputs=[op_level],
|
| 96 |
)
|
| 97 |
|
| 98 |
clear_btn.click(
|
|
|
|
| 29 |
chunks = chunk_data(remove_citations(opinion))["text"].to_list()
|
| 30 |
result = average_text(chunks, pipe, judges_l)
|
| 31 |
|
| 32 |
+
return result[0], {k: round(v * 100, 2) for k, v in result[0].items()}
|
| 33 |
|
| 34 |
|
| 35 |
def set_input(drop):
|
|
|
|
| 76 |
op_level = gr.outputs.Label(
|
| 77 |
num_top_classes=9, label="Predicted author of opinion"
|
| 78 |
)
|
| 79 |
+
output_textbox = gr.Textbox(label="Output Text", show_copy_button=True)
|
| 80 |
|
| 81 |
year.release(
|
| 82 |
update_year,
|
|
|
|
| 93 |
greet_btn.click(
|
| 94 |
fn=greet,
|
| 95 |
inputs=[opinion, exc_judg],
|
| 96 |
+
outputs=[op_level, output_textbox],
|
| 97 |
)
|
| 98 |
|
| 99 |
clear_btn.click(
|