nldemo commited on
Commit
84bfb61
·
1 Parent(s): ecc6e6c

Fix the output format of the analyze_text function

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -14,12 +14,12 @@ def analyze_text(text):
14
  char_count = len(text)
15
  avg_word_length = char_count / word_count
16
 
17
- return {
18
- "sentiment_score": round(sentiment, 2),
19
- "word_count": word_count,
20
- "character_count": char_count,
21
- "avg_word_length": round(avg_word_length, 2),
22
- }
23
 
24
  with gr.Blocks() as demo:
25
  gr.Markdown("# Text Analysis App")
 
14
  char_count = len(text)
15
  avg_word_length = char_count / word_count
16
 
17
+ return [
18
+ round(sentiment, 2),
19
+ word_count,
20
+ char_count,
21
+ round(avg_word_length, 2),
22
+ ]
23
 
24
  with gr.Blocks() as demo:
25
  gr.Markdown("# Text Analysis App")