Commit
·
68988c7
1
Parent(s):
4ed41bd
Update app.py
Browse files
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 = ["PERSON", "ORGANIZATION", "EVENT"]
|
8 |
-
|
9 |
-
selected_types = st.multiselect('Select entity types to show:', entity_types_to_show)
|
10 |
|
11 |
# Header and intro
|
12 |
st.title("Google Cloud NLP Entity Analyzer")
|
@@ -35,7 +31,6 @@ def sample_analyze_entities(text_content, your_query=""):
|
|
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,
|
|
|
3 |
from google.oauth2 import service_account
|
4 |
from google.cloud import language_v1
|
5 |
|
|
|
|
|
|
|
|
|
6 |
|
7 |
# Header and intro
|
8 |
st.title("Google Cloud NLP Entity Analyzer")
|
|
|
31 |
entities_list = []
|
32 |
for entity in response.entities:
|
33 |
entity_type_name = language_v1.Entity.Type(entity.type_).name
|
|
|
34 |
entity_details = {
|
35 |
"Name": entity.name,
|
36 |
"Type": entity_type_name,
|