Spaces:
Sleeping
Sleeping
Commit
·
4ed41bd
1
Parent(s):
23d1451
Update app.py
Browse files
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 |
-
|
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
|
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,
|