blazingbunny commited on
Commit
253188c
·
1 Parent(s): 7a38a78

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -20
app.py CHANGED
@@ -1,22 +1,12 @@
1
- import streamlit as st
2
- from google.cloud import language_v1
3
- import os
4
-
5
- # Read API key if stored as an env variable
6
- api_key = os.environ.get("GOOGLE_API_KEY")
7
-
8
- # Your existing function
9
  def sample_analyze_entities(text_content):
10
  st.write("Debug: Entered sample_analyze_entities")
11
- # Your existing code here.
12
- pass
13
-
14
- # Streamlit UI
15
- st.title('Google Cloud NLP Entity Analyzer')
16
- user_input = st.text_area('Enter text to analyze', '')
17
-
18
- if st.button('Analyze'):
19
- st.write("Debug: Analyze button clicked")
20
- if user_input:
21
- st.write(f"Debug: User input received: {user_input}")
22
- sample_analyze_entities(user_input)
 
 
 
 
 
 
 
 
 
1
  def sample_analyze_entities(text_content):
2
  st.write("Debug: Entered sample_analyze_entities")
3
+ try:
4
+ # Your existing code to analyze entities goes here.
5
+ # For example, making an API call:
6
+ st.write("Debug: Making API call...")
7
+ # response = your_api_call_here(text_content)
8
+ st.write("Debug: API call completed.")
9
+ # Process the response and display output
10
+ # st.write(response)
11
+ except Exception as e:
12
+ st.write(f"Debug: An error occurred: {e}")