blazingbunny commited on
Commit
6a4daaf
·
1 Parent(s): 66601cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -3,10 +3,6 @@ import streamlit as st
3
  from google.oauth2 import service_account
4
  from google.cloud import language_v1
5
 
6
- # Adding checkbox options for entity types
7
- entity_types_to_show = [
8
- "UNKNOWN", "PERSON", "LOCATION", "ORGANIZATION", "EVENT", "WORK_OF_ART", "CONSUMER_GOOD", "OTHER"
9
- ]
10
  selected_types = st.multiselect('Select entity types to show:', entity_types_to_show)
11
 
12
  # Header and intro
@@ -36,7 +32,7 @@ def sample_analyze_entities(text_content, your_query=""):
36
  entities_list = []
37
  for entity in response.entities:
38
  entity_type_name = language_v1.Entity.Type(entity.type_).name
39
- if not selected_types or entity_type_name in selected_types:
40
  entity_details = {
41
  "Name": entity.name,
42
  "Type": entity_type_name,
 
3
  from google.oauth2 import service_account
4
  from google.cloud import language_v1
5
 
 
 
 
 
6
  selected_types = st.multiselect('Select entity types to show:', entity_types_to_show)
7
 
8
  # Header and intro
 
32
  entities_list = []
33
  for entity in response.entities:
34
  entity_type_name = language_v1.Entity.Type(entity.type_).name
35
+ if entity_type_name in ["PERSON", "LOCATION", "ORGANIZATION", "EVENT"]:
36
  entity_details = {
37
  "Name": entity.name,
38
  "Type": entity_type_name,