|
import gradio as gr |
|
|
|
|
|
def process_submit(semantic, zeroshot, keywords_options, abstract): |
|
return f"Test" |
|
|
|
|
|
semantic_models = ['all-mpnet-base-v2', 'msmarco-distilbert-dot-v5', 'distilbert-base-uncased', 'all-MiniLM-L6-v2', 'all-MiniLM-L12-v2', 'microsoft/mpnet-base'] |
|
zeroshot_models = ['facebook/bart-large-mnli'] |
|
extract_keywords_options = ['TF_IDF', 'Spacy Frequency', 'NLTK Frequency', 'NLTK RAKE'] |
|
|
|
with gr.Blocks() as iface: |
|
with gr.Row(): |
|
with gr.Column(scale=7): |
|
with gr.Row(): |
|
cmb_box_1 = gr.Dropdown(choices=semantic_models, label="Select a semantic model", value='all-mpnet-base-v2') |
|
cmb_box_2 = gr.Dropdown(choices=zeroshot_models, label="Select a zeroshot model", value='facebook/bart-large-mnli') |
|
|
|
txt_box_1 = gr.Textbox(lines=10, placeholder="Write here the patent abstract...", label="Patent Abstract") |
|
btn_submit = gr.Button("Submit") |
|
|
|
with gr.Column(scale=3): |
|
with gr.Row(): |
|
cmb_box_3 = gr.Dropdown(choices=extract_keywords_options, label="Extract keywords method", value='TF_IDF') |
|
output_text = gr.Text(label="Result") |
|
|
|
btn_submit.click( |
|
fn=process_submit, |
|
inputs=[cmb_box_1, cmb_box_2, cmb_box_3, txt_box_1], |
|
outputs=output_text |
|
) |
|
|
|
|
|
if __name__ == "__main__": |
|
iface.launch(show_api=False) |
|
|