Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -90,9 +90,10 @@ plan = Task(
|
|
90 |
"1. Research recent trends in {topic} patent filings and innovation.\n"
|
91 |
"2. Identify key players and emerging technologies.\n"
|
92 |
"3. Provide recommendations for stakeholders on strategic directions.\n"
|
93 |
-
"4.
|
|
|
94 |
),
|
95 |
-
expected_output="A research document with structured insights and
|
96 |
agent=planner
|
97 |
)
|
98 |
|
@@ -100,20 +101,23 @@ write = Task(
|
|
100 |
description=(
|
101 |
"1. Use the Planner's and Analyst's outputs to craft a professional patent insights document.\n"
|
102 |
"2. Include key findings, visual aids, and actionable strategies.\n"
|
103 |
-
"3.
|
104 |
-
"4.
|
|
|
105 |
),
|
106 |
-
expected_output="A polished, stakeholder-ready patent insights document.",
|
107 |
agent=writer
|
108 |
)
|
109 |
|
110 |
analyse = Task(
|
111 |
description=(
|
112 |
"1. Perform statistical analysis of patent filing trends, innovation hot spots, and growth projections.\n"
|
113 |
-
"2.
|
114 |
-
"3.
|
|
|
|
|
115 |
),
|
116 |
-
expected_output="A detailed statistical analysis with actionable insights
|
117 |
agent=analyst
|
118 |
)
|
119 |
|
@@ -190,6 +194,12 @@ def create_visualizations(analyst_output):
|
|
190 |
pie_chart.write_image(temp_chart.name)
|
191 |
chart_paths.append(temp_chart.name)
|
192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
except Exception as e:
|
194 |
st.error(f"Error generating visualization: {e}")
|
195 |
return chart_paths
|
|
|
90 |
"1. Research recent trends in {topic} patent filings and innovation.\n"
|
91 |
"2. Identify key players and emerging technologies.\n"
|
92 |
"3. Provide recommendations for stakeholders on strategic directions.\n"
|
93 |
+
"4. Identify key statistics such as top regions, top players, and hot areas of innovation.\n"
|
94 |
+
"5. Limit the output to 500 words."
|
95 |
),
|
96 |
+
expected_output="A research document with structured insights, strategic recommendations, and key statistics.",
|
97 |
agent=planner
|
98 |
)
|
99 |
|
|
|
101 |
description=(
|
102 |
"1. Use the Planner's and Analyst's outputs to craft a professional patent insights document.\n"
|
103 |
"2. Include key findings, visual aids, and actionable strategies.\n"
|
104 |
+
"3. Suggest strategic directions and highlight untapped innovation areas.\n"
|
105 |
+
"4. Incorporate summarized tables for key statistics and example inventions.\n"
|
106 |
+
"5. Limit the document to 400 words."
|
107 |
),
|
108 |
+
expected_output="A polished, stakeholder-ready patent insights document with actionable recommendations.",
|
109 |
agent=writer
|
110 |
)
|
111 |
|
112 |
analyse = Task(
|
113 |
description=(
|
114 |
"1. Perform statistical analysis of patent filing trends, innovation hot spots, and growth projections.\n"
|
115 |
+
"2. Identify top regions, key players, and technology combinations.\n"
|
116 |
+
"3. Generate visualizations such as heatmaps and multi-line charts for trends.\n"
|
117 |
+
"4. Provide structured output with fields 'Category' and 'Values' for visualization.\n"
|
118 |
+
"5. Collaborate with the Planner and Writer to align on data needs."
|
119 |
),
|
120 |
+
expected_output="A detailed statistical analysis with actionable insights, heatmaps, and trends.",
|
121 |
agent=analyst
|
122 |
)
|
123 |
|
|
|
194 |
pie_chart.write_image(temp_chart.name)
|
195 |
chart_paths.append(temp_chart.name)
|
196 |
|
197 |
+
heatmap_chart = px.density_heatmap(data, x="Category", y="Values", title="Regional Patent Density")
|
198 |
+
st.plotly_chart(heatmap_chart)
|
199 |
+
with tempfile.NamedTemporaryFile(delete=False, suffix=".png") as temp_chart:
|
200 |
+
heatmap_chart.write_image(temp_chart.name)
|
201 |
+
chart_paths.append(temp_chart.name)
|
202 |
+
|
203 |
except Exception as e:
|
204 |
st.error(f"Error generating visualization: {e}")
|
205 |
return chart_paths
|