Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -16,8 +16,8 @@ st.sidebar.write(
|
|
16 |
|
17 |
# User Input Section
|
18 |
st.sidebar.header("User Inputs")
|
19 |
-
patent_area = st.text_input(
|
20 |
-
stakeholder = st.text_input(
|
21 |
|
22 |
# Advanced Options
|
23 |
st.sidebar.header("Advanced Options")
|
@@ -123,7 +123,6 @@ crew = Crew(
|
|
123 |
)
|
124 |
|
125 |
# PDF Report Generation
|
126 |
-
|
127 |
def generate_pdf_report(result, charts=None, table_data=None, metadata=None):
|
128 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".pdf") as temp_pdf:
|
129 |
pdf = FPDF()
|
@@ -158,7 +157,6 @@ def generate_pdf_report(result, charts=None, table_data=None, metadata=None):
|
|
158 |
return temp_pdf.name
|
159 |
|
160 |
# Data Validation
|
161 |
-
|
162 |
def validate_analyst_output(analyst_output):
|
163 |
if not analyst_output:
|
164 |
st.warning("No data available for analysis.")
|
@@ -173,7 +171,6 @@ def validate_analyst_output(analyst_output):
|
|
173 |
return analyst_output
|
174 |
|
175 |
# Visualization and Table Display
|
176 |
-
|
177 |
def create_visualizations(analyst_output):
|
178 |
chart_paths = []
|
179 |
validated_data = validate_analyst_output(analyst_output)
|
@@ -199,7 +196,6 @@ def display_table(analyst_output):
|
|
199 |
return table_data
|
200 |
|
201 |
# Main Execution Block
|
202 |
-
|
203 |
if st.button("Generate Patent Insights"):
|
204 |
with st.spinner('Processing...'):
|
205 |
try:
|
@@ -237,4 +233,4 @@ if st.button("Generate Patent Insights"):
|
|
237 |
st.download_button("Download Report", data=report_file, file_name="Patent_Report.pdf")
|
238 |
|
239 |
except Exception as e:
|
240 |
-
st.error(f"An error occurred during execution: {e}")
|
|
|
16 |
|
17 |
# User Input Section
|
18 |
st.sidebar.header("User Inputs")
|
19 |
+
patent_area = st.text_input("Enter Patent Technology Area", value="Transparent Antennas for Windshields")
|
20 |
+
stakeholder = st.text_input("Enter Stakeholder", value="Patent Attorneys")
|
21 |
|
22 |
# Advanced Options
|
23 |
st.sidebar.header("Advanced Options")
|
|
|
123 |
)
|
124 |
|
125 |
# PDF Report Generation
|
|
|
126 |
def generate_pdf_report(result, charts=None, table_data=None, metadata=None):
|
127 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".pdf") as temp_pdf:
|
128 |
pdf = FPDF()
|
|
|
157 |
return temp_pdf.name
|
158 |
|
159 |
# Data Validation
|
|
|
160 |
def validate_analyst_output(analyst_output):
|
161 |
if not analyst_output:
|
162 |
st.warning("No data available for analysis.")
|
|
|
171 |
return analyst_output
|
172 |
|
173 |
# Visualization and Table Display
|
|
|
174 |
def create_visualizations(analyst_output):
|
175 |
chart_paths = []
|
176 |
validated_data = validate_analyst_output(analyst_output)
|
|
|
196 |
return table_data
|
197 |
|
198 |
# Main Execution Block
|
|
|
199 |
if st.button("Generate Patent Insights"):
|
200 |
with st.spinner('Processing...'):
|
201 |
try:
|
|
|
233 |
st.download_button("Download Report", data=report_file, file_name="Patent_Report.pdf")
|
234 |
|
235 |
except Exception as e:
|
236 |
+
st.error(f"An error occurred during execution: {e}")
|