blazingbunny commited on
Commit
4ed41bd
·
1 Parent(s): 23d1451

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -4,9 +4,8 @@ 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 +35,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,
 
4
  from google.cloud import language_v1
5
 
6
  # Adding checkbox options for entity types
7
+ entity_types_to_show = ["PERSON", "ORGANIZATION", "EVENT"]
8
+
 
9
  selected_types = st.multiselect('Select entity types to show:', entity_types_to_show)
10
 
11
  # Header and intro
 
35
  entities_list = []
36
  for entity in response.entities:
37
  entity_type_name = language_v1.Entity.Type(entity.type_).name
38
+ if entity_type_name in ["PERSON", "ORGANIZATION", "EVENT"]:
39
  entity_details = {
40
  "Name": entity.name,
41
  "Type": entity_type_name,