umang018 commited on
Commit
e895c07
·
verified ·
1 Parent(s): b521c82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -22,7 +22,7 @@ emotion_labels = ["admiration", "amusement", "anger", "annoyance", "approval",
22
  "neutral"]
23
 
24
  # Function to classify emotions in batches
25
- def classify_emotions_in_batches(texts, batch_size=1024):
26
  results = []
27
  start_time = time.time()
28
  for i in range(0, len(texts), batch_size):
@@ -53,7 +53,7 @@ if st.button("Run Inference"):
53
  # Apply emotion classification to the email content
54
  with st.spinner('Running inference...'):
55
  email_texts = enron_data['body'].tolist()
56
- enron_data['emotion'] = classify_emotions_in_batches(email_texts, batch_size=1024)
57
 
58
  # Save the results to a CSV file
59
  enron_data.to_csv("enron_emails_with_emotions.csv", index=False)
 
22
  "neutral"]
23
 
24
  # Function to classify emotions in batches
25
+ def classify_emotions_in_batches(texts, batch_size=32):
26
  results = []
27
  start_time = time.time()
28
  for i in range(0, len(texts), batch_size):
 
53
  # Apply emotion classification to the email content
54
  with st.spinner('Running inference...'):
55
  email_texts = enron_data['body'].tolist()
56
+ enron_data['emotion'] = classify_emotions_in_batches(email_texts, batch_size=32)
57
 
58
  # Save the results to a CSV file
59
  enron_data.to_csv("enron_emails_with_emotions.csv", index=False)