jflo commited on
Commit
fbfd45b
·
1 Parent(s): 1f620d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -48,14 +48,15 @@ def predict(last_name,n_predictions=3):
48
  for i in range(n_predictions):
49
  value = topv[0]
50
  category_index = topi[0][i].item()
51
- top_3_countries += f'{all_categories[category_index]}: {round(value[i].item()*100,2)}%'
52
  top_3_countries += '\n'
53
  return top_3_countries
54
 
55
  demo = gr.Interface(predict,
56
  inputs = "text",
57
- outputs = "text",
58
- description="Classify name into language of origin. Returns top 3 languages of origin"
 
59
  )
60
 
61
  demo.launch(inline=False)
 
48
  for i in range(n_predictions):
49
  value = topv[0]
50
  category_index = topi[0][i].item()
51
+ top_3_countries += f'{all_categories[category_index]}: {round(value[i].item()*100,2)}% confident'
52
  top_3_countries += '\n'
53
  return top_3_countries
54
 
55
  demo = gr.Interface(predict,
56
  inputs = "text",
57
+ outputs = "text",
58
+ title = "Classify Name :)"
59
+ description="Classifies name into one of 18 language of origin. Returns top 3 languages of origin"
60
  )
61
 
62
  demo.launch(inline=False)