Spaces:
Sleeping
Sleeping
Update app.py
Browse filescorrected the validation step
app.py
CHANGED
@@ -96,7 +96,10 @@ def summarize_ner(text): # I implemented the validation step here because the mo
|
|
96 |
"""
|
97 |
word_count = len(text.split())
|
98 |
if word_count <100:
|
99 |
-
return
|
|
|
|
|
|
|
100 |
else:
|
101 |
summarized = get_completion(text)
|
102 |
# remember I don't have to define a summarization function because the default mode is summarization
|
|
|
96 |
"""
|
97 |
word_count = len(text.split())
|
98 |
if word_count <100:
|
99 |
+
return {
|
100 |
+
"text": "⚠️ Please enter at least 100 words to use the summarizer.",
|
101 |
+
"entities": []
|
102 |
+
}
|
103 |
else:
|
104 |
summarized = get_completion(text)
|
105 |
# remember I don't have to define a summarization function because the default mode is summarization
|