Update app.py
Browse files
app.py
CHANGED
|
@@ -54,7 +54,7 @@ def sentiment(sent: str):
|
|
| 54 |
batch = { k:v.to(device) for k, v in batch.items() }
|
| 55 |
outputs = model_topic(**batch)
|
| 56 |
pred_topic = list(set([topic_tags[i] for i in cvt2cls(outputs["tags"][0])]))
|
| 57 |
-
return {"sentiment": pred_sent, "topic": pred_topic}
|
| 58 |
|
| 59 |
|
| 60 |
def flip_image(x):
|
|
@@ -64,12 +64,12 @@ def flip_image(x):
|
|
| 64 |
with gr.Blocks() as demo:
|
| 65 |
gr.Markdown("Demo projects Review Company and Resume parser phase 1.")
|
| 66 |
with gr.Tab("Review Company"):
|
| 67 |
-
text_input = gr.Textbox()
|
| 68 |
-
text_output = gr.Textbox()
|
| 69 |
text_button = gr.Button("Predict")
|
| 70 |
with gr.Tab("Extract infomation from resume"):
|
| 71 |
with gr.Row():
|
| 72 |
-
image_input = gr.
|
| 73 |
image_output = gr.Image()
|
| 74 |
image_button = gr.Button("Predict")
|
| 75 |
|
|
|
|
| 54 |
batch = { k:v.to(device) for k, v in batch.items() }
|
| 55 |
outputs = model_topic(**batch)
|
| 56 |
pred_topic = list(set([topic_tags[i] for i in cvt2cls(outputs["tags"][0])]))
|
| 57 |
+
return str({"sentiment": pred_sent, "topic": pred_topic})
|
| 58 |
|
| 59 |
|
| 60 |
def flip_image(x):
|
|
|
|
| 64 |
with gr.Blocks() as demo:
|
| 65 |
gr.Markdown("Demo projects Review Company and Resume parser phase 1.")
|
| 66 |
with gr.Tab("Review Company"):
|
| 67 |
+
text_input = gr.Textbox(label="Input sentence:", placeholder="input here...")
|
| 68 |
+
text_output = gr.Textbox(label="Result:")
|
| 69 |
text_button = gr.Button("Predict")
|
| 70 |
with gr.Tab("Extract infomation from resume"):
|
| 71 |
with gr.Row():
|
| 72 |
+
image_input = gr.File(type="pdf")
|
| 73 |
image_output = gr.Image()
|
| 74 |
image_button = gr.Button("Predict")
|
| 75 |
|