Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -79,21 +79,21 @@ async def analyze(data: ReviewInput, x_api_key: str = Header(None)):
|
|
79 |
try:
|
80 |
# Smart summary logic based on verbosity and intelligence
|
81 |
if data.verbosity.lower() == "brief":
|
82 |
-
summary = summarize_review(data.text)
|
83 |
else:
|
84 |
summary = smart_summarize(data.text, n_clusters=2 if data.intelligence else 1)
|
85 |
|
86 |
sentiment = sentiment_pipeline(data.text)[0]
|
87 |
-
emotion = "joy"
|
88 |
|
89 |
# Auto-detection logic
|
90 |
-
industry
|
91 |
-
product_category
|
92 |
device = "Web"
|
93 |
|
94 |
follow_up_response = None
|
95 |
if data.follow_up:
|
96 |
-
follow_up_response = answer_followup(data.text, data.follow_up)
|
97 |
|
98 |
return {
|
99 |
"summary": summary,
|
|
|
79 |
try:
|
80 |
# Smart summary logic based on verbosity and intelligence
|
81 |
if data.verbosity.lower() == "brief":
|
82 |
+
summary = summarize_review(data.text, max_len=40, min_len=8)
|
83 |
else:
|
84 |
summary = smart_summarize(data.text, n_clusters=2 if data.intelligence else 1)
|
85 |
|
86 |
sentiment = sentiment_pipeline(data.text)[0]
|
87 |
+
emotion = "joy"
|
88 |
|
89 |
# Auto-detection logic
|
90 |
+
industry: auto_fill(data.industry, detect_industry(data.text)),
|
91 |
+
product_category: auto_fill(data.product_category, detect_product_category(data.text)),
|
92 |
device = "Web"
|
93 |
|
94 |
follow_up_response = None
|
95 |
if data.follow_up:
|
96 |
+
follow_up_response = answer_followup(data.text, data.follow_up, data.verbosity)
|
97 |
|
98 |
return {
|
99 |
"summary": summary,
|