tseronni commited on
Commit
4299d62
·
1 Parent(s): 90776ae
Files changed (1) hide show
  1. app.py +7 -17
app.py CHANGED
@@ -1,33 +1,23 @@
1
  import gradio as gr
2
 
3
 
4
- def preenche_descricao(exemplo):
5
- return exemplo
6
-
7
-
8
- def processa_submissao(descricao, categoria):
9
  return f"Test"
10
 
11
 
12
- exemplos_descricao = [
13
- "DESC1...",
14
- "DESC2"
15
- ]
16
-
17
-
18
- categorias = ["Tecnologia", "Química", "Farmacêutica", "Mecânica", "Outro"]
19
-
20
 
21
  iface = gr.Interface(
22
- fn=processa_submissao,
23
  inputs=[
24
- gr.Dropdown(choices=categorias, label="Categoria da Patente"),
25
- gr.Textbox(lines=10, placeholder="Digite a descrição da patente aqui...", label="Descrição da Patente")
 
26
  ],
27
  outputs="text"
28
  )
29
 
30
- iface.cache_examples(exemplos_descricao, preenche_descricao)
31
 
32
  if __name__ == "__main__":
33
  iface.launch(show_api=False)
 
1
  import gradio as gr
2
 
3
 
4
+ def process_submit(semantic, zeroshot, abstract):
 
 
 
 
5
  return f"Test"
6
 
7
 
8
+ semantic_models = ['all-mpnet-base-v2', 'msmarco-distilbert-dot-v5', 'distilbert-base-uncased', 'all-MiniLM-L6-v2', 'all-MiniLM-L12-v2', 'microsoft/mpnet-base']
9
+ zeroshot_models = ['facebook/bart-large-mnli']
 
 
 
 
 
 
10
 
11
  iface = gr.Interface(
12
+ fn=process_submit,
13
  inputs=[
14
+ gr.Dropdown(choices=semantic_models, label="Select a semantic model", value='all-mpnet-base-v2'),
15
+ gr.Dropdown(choices=zeroshot_models, label="Select a zeroshot model", value='facebook/bart-large-mnli'),
16
+ gr.Textbox(lines=10, placeholder="Write here the patent abstract...", label="Patent Abstract")
17
  ],
18
  outputs="text"
19
  )
20
 
 
21
 
22
  if __name__ == "__main__":
23
  iface.launch(show_api=False)