CesarLeblanc commited on
Commit
4270278
1 Parent(s): bb9c09b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,6 +1,5 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
- from datasets import load_dataset
4
  import requests
5
  from bs4 import BeautifulSoup
6
  import random
@@ -84,7 +83,8 @@ def classification(text, typology, confidence):
84
  def masking(text):
85
  text = gbif_normalization(text)
86
  masked_text = text + ', [MASK]'
87
- new_species = mask_model(masked_text)[0]
 
88
  text = f"The last species from this vegetation plot is probably {new_species}."
89
  image = return_species_image(new_species)
90
  return text, image
 
1
  import gradio as gr
2
  from transformers import pipeline
 
3
  import requests
4
  from bs4 import BeautifulSoup
5
  import random
 
83
  def masking(text):
84
  text = gbif_normalization(text)
85
  masked_text = text + ', [MASK]'
86
+ pred = mask_model(masked_text)[0]
87
+ new_species = pred['token_str']
88
  text = f"The last species from this vegetation plot is probably {new_species}."
89
  image = return_species_image(new_species)
90
  return text, image