JoBeer commited on
Commit
562e111
·
1 Parent(s): ff8b6b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -21,14 +21,19 @@ def predict(name, description):
21
  definition1 = corpus.iloc[output[0][0].get('corpus_id'),1]
22
  IRDI1 = corpus.iloc[output[0][0].get('corpus_id'),4]
23
  score1 = output[0][0].get('score')
 
 
 
 
 
24
 
25
 
26
- return preferedName1, definition1, IRDI1, score1
27
 
28
  interface = gr.Interface(fn = predict,
29
  inputs = [gr.Textbox(label="Name:", placeholder="z.B. GTIN", lines=1), gr.Textbox(label="Description:", placeholder="z.B. Globel Trade Item Number", lines=1)],
30
  #outputs = [gr.Textbox(label = 'preferedName'),gr.Textbox(label = 'definition'), gr.Textbox(label = 'IDRI'),gr.Textbox(label = 'score')],
31
- outputs = [gr.Dataframe(row_count = (1, "fixed"), col_count=(4, "fixed"), label="Predictions", headers=["Failures"])]
32
  examples = [['GTIN', 'Globel Trade Item Number'], ['Global Trade Item Number', 'the identification number from the GS1 system with which the trading units can be uniquely identified worldwide'],
33
  ['Device type', 'describing a set of common specific characteristics in products or goods'], ['Item type','the type of product, an item can be assigned to'],
34
  ['Nominal power','power being consumed by or dissipated within an electric component as a variable'], ['Power consumption', 'power that is typically taken from the auxiliary power supply when the device is operating normally']], theme = 'huggingface',
 
21
  definition1 = corpus.iloc[output[0][0].get('corpus_id'),1]
22
  IRDI1 = corpus.iloc[output[0][0].get('corpus_id'),4]
23
  score1 = output[0][0].get('score')
24
+
25
+ preferedName2 = corpus.iloc[output[0][1].get('corpus_id'),2]
26
+ definition2 = corpus.iloc[output[0][1].get('corpus_id'),1]
27
+ IRDI2 = corpus.iloc[output[0][1].get('corpus_id'),4]
28
+ score2 = output[0][1].get('score')
29
 
30
 
31
+ return preferedName1, definition1, IRDI1, score1, preferedName2, definition2, IRDI1, score2
32
 
33
  interface = gr.Interface(fn = predict,
34
  inputs = [gr.Textbox(label="Name:", placeholder="z.B. GTIN", lines=1), gr.Textbox(label="Description:", placeholder="z.B. Globel Trade Item Number", lines=1)],
35
  #outputs = [gr.Textbox(label = 'preferedName'),gr.Textbox(label = 'definition'), gr.Textbox(label = 'IDRI'),gr.Textbox(label = 'score')],
36
+ outputs = [gr.Dataframe(row_count = (2, "fixed"), col_count=(4, "fixed"), label="Predictions", headers=["Failures"])]
37
  examples = [['GTIN', 'Globel Trade Item Number'], ['Global Trade Item Number', 'the identification number from the GS1 system with which the trading units can be uniquely identified worldwide'],
38
  ['Device type', 'describing a set of common specific characteristics in products or goods'], ['Item type','the type of product, an item can be assigned to'],
39
  ['Nominal power','power being consumed by or dissipated within an electric component as a variable'], ['Power consumption', 'power that is typically taken from the auxiliary power supply when the device is operating normally']], theme = 'huggingface',