Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -162,7 +162,7 @@ def initialize_csv():
|
|
| 162 |
"""Initialize CSV file with proper UTF-8 encoding for Urdu support"""
|
| 163 |
if not os.path.exists(CSV_FILE):
|
| 164 |
df = pd.DataFrame(columns=[
|
| 165 |
-
"ID", "Timestamp", "
|
| 166 |
])
|
| 167 |
df.to_csv(CSV_FILE, index=False, encoding='utf-8-sig', quoting=csv.QUOTE_ALL)
|
| 168 |
|
|
@@ -211,7 +211,7 @@ def load_logs(limit=50):
|
|
| 211 |
return df.tail(limit).iloc[::-1].reset_index(drop=True)
|
| 212 |
else:
|
| 213 |
return pd.DataFrame(columns=[
|
| 214 |
-
"ID", "Timestamp", "
|
| 215 |
])
|
| 216 |
except Exception as e:
|
| 217 |
print(f"Error loading logs: {e}")
|
|
|
|
| 162 |
"""Initialize CSV file with proper UTF-8 encoding for Urdu support"""
|
| 163 |
if not os.path.exists(CSV_FILE):
|
| 164 |
df = pd.DataFrame(columns=[
|
| 165 |
+
"ID", "Timestamp", "Text", "Language", "Sentiment", "Confidence"
|
| 166 |
])
|
| 167 |
df.to_csv(CSV_FILE, index=False, encoding='utf-8-sig', quoting=csv.QUOTE_ALL)
|
| 168 |
|
|
|
|
| 211 |
return df.tail(limit).iloc[::-1].reset_index(drop=True)
|
| 212 |
else:
|
| 213 |
return pd.DataFrame(columns=[
|
| 214 |
+
"ID", "Timestamp", "Text", "Language", "Sentiment", "Confidence"
|
| 215 |
])
|
| 216 |
except Exception as e:
|
| 217 |
print(f"Error loading logs: {e}")
|