blazingbunny commited on
Commit
067fbea
·
1 Parent(s): 0ca0300

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -55,8 +55,12 @@ def sample_analyze_entities(text_content):
55
  # Count the entities with 'mid' and either '/g/' or '/m/' in their metadata
56
  entity_count = count_entities(response.entities)
57
 
58
- st.write(f"We found {len(response.entities)} entities - We found {entity_count} Google Entities")
59
- st.write("---")
 
 
 
 
60
 
61
  for i, entity in enumerate(response.entities):
62
  st.write(f"Entity {i+1} of {len(response.entities)}")
 
55
  # Count the entities with 'mid' and either '/g/' or '/m/' in their metadata
56
  entity_count = count_entities(response.entities)
57
 
58
+ if entity_count == 0:
59
+ st.write(f"We found {len(response.entities)} entities - We found no Google Entities")
60
+ elif entity_count == 1:
61
+ st.write(f"We found {len(response.entities)} entities - We found 1 Google Entity")
62
+ else:
63
+ st.write(f"We found {len(response.entities)} entities - We found {entity_count} Google Entities")
64
 
65
  for i, entity in enumerate(response.entities):
66
  st.write(f"Entity {i+1} of {len(response.entities)}")