Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,32 +18,32 @@ def data_pre_processing(file_responses):
|
|
18 |
for col in columns:
|
19 |
file_responses[col] = pd.to_numeric(file_responses[col], errors='coerce').fillna(0)
|
20 |
|
21 |
-
# Calculate the Total Allocation
|
22 |
-
file_responses['Total Allocation'] = file_responses[columns].sum(axis=1)
|
23 |
|
24 |
-
# Convert the Tax Payment column to numeric
|
25 |
-
tax_payment_col = '''How much was your latest Tax payment (in U$D) ?
|
26 |
|
27 |
-
Please try to be as accurate as possible:
|
28 |
-
Eg.: If your last tax amount was INR 25,785/-; then convert it in U$D and enter only the amount as: 310.
|
29 |
|
30 |
-
If you have never paid tax, consider putting in a realistic donation amount which wish to contribute towards helping yourself obtain the desired relief.'''
|
31 |
|
32 |
-
file_responses[tax_payment_col] = pd.to_numeric(file_responses[tax_payment_col], errors='coerce').fillna(0)
|
33 |
|
34 |
-
# Calculate Financial Token Weights
|
35 |
-
for i, col in enumerate(columns, start=1):
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
|
40 |
return file_responses
|
41 |
except Exception as e:
|
42 |
return str(e)
|
43 |
|
44 |
def nlp_pipeline(original_df):
|
45 |
-
|
46 |
-
return
|
47 |
|
48 |
def process_excel(file):
|
49 |
try:
|
|
|
18 |
for col in columns:
|
19 |
file_responses[col] = pd.to_numeric(file_responses[col], errors='coerce').fillna(0)
|
20 |
|
21 |
+
# # Calculate the Total Allocation
|
22 |
+
# file_responses['Total Allocation'] = file_responses[columns].sum(axis=1)
|
23 |
|
24 |
+
# # Convert the Tax Payment column to numeric
|
25 |
+
# tax_payment_col = '''How much was your latest Tax payment (in U$D) ?
|
26 |
|
27 |
+
# Please try to be as accurate as possible:
|
28 |
+
# Eg.: If your last tax amount was INR 25,785/-; then convert it in U$D and enter only the amount as: 310.
|
29 |
|
30 |
+
# If you have never paid tax, consider putting in a realistic donation amount which wish to contribute towards helping yourself obtain the desired relief.'''
|
31 |
|
32 |
+
# file_responses[tax_payment_col] = pd.to_numeric(file_responses[tax_payment_col], errors='coerce').fillna(0)
|
33 |
|
34 |
+
# # Calculate Financial Token Weights
|
35 |
+
# for i, col in enumerate(columns, start=1):
|
36 |
+
# file_responses[f'Financial Token Weight for Problem {i}'] = (
|
37 |
+
# file_responses[tax_payment_col] * file_responses[col] / file_responses['Total Allocation']
|
38 |
+
# ).fillna(0)
|
39 |
|
40 |
return file_responses
|
41 |
except Exception as e:
|
42 |
return str(e)
|
43 |
|
44 |
def nlp_pipeline(original_df):
|
45 |
+
processed_df = data_pre_processing(original_df)
|
46 |
+
return processed_df
|
47 |
|
48 |
def process_excel(file):
|
49 |
try:
|