varshakolanu commited on
Commit
a5d1b4f
·
verified ·
1 Parent(s): 74d6484

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -59,6 +59,7 @@ def calculate_scores(work_completion, delay_reports, incident_logs):
59
  communication_score += work_completion.lower().count(keyword) * 5 + delay_reports.lower().count(keyword) * 5 + incident_logs.lower().count(keyword) * 5
60
  for keyword in communication_keywords_negative:
61
  communication_score -= delay_reports.lower().count(keyword) * 10
 
62
 
63
  # Basic Sentiment Analysis (Optional - Requires NLTK Download)
64
  analyzer = SentimentIntensityAnalyzer()
 
59
  communication_score += work_completion.lower().count(keyword) * 5 + delay_reports.lower().count(keyword) * 5 + incident_logs.lower().count(keyword) * 5
60
  for keyword in communication_keywords_negative:
61
  communication_score -= delay_reports.lower().count(keyword) * 10
62
+ communication_score = max(0.0, min(communication_score, 100.0))
63
 
64
  # Basic Sentiment Analysis (Optional - Requires NLTK Download)
65
  analyzer = SentimentIntensityAnalyzer()