Delete app.py
Browse files
app.py
DELETED
|
@@ -1,42 +0,0 @@
|
|
| 1 |
-
import json
|
| 2 |
-
import pandas as pd
|
| 3 |
-
from ui.gradio_interface import demo
|
| 4 |
-
|
| 5 |
-
#for adding bank name to the cards in the graph
|
| 6 |
-
eligibility_df = pd.read_csv("cards_eligibility_updated.csv")
|
| 7 |
-
card_to_bank = dict(zip(eligibility_df['Name'], eligibility_df['Bank']))
|
| 8 |
-
|
| 9 |
-
# Loading credit card data
|
| 10 |
-
df = pd.read_csv("credit_card_data_updated.csv")
|
| 11 |
-
card_descriptions = dict(zip(df["name"], df["description"]))
|
| 12 |
-
|
| 13 |
-
# Loading all 55 cards for comparison feature
|
| 14 |
-
df_all_cards = pd.read_csv("credit_card_data_updated.csv")
|
| 15 |
-
all_card_names = df_all_cards["name"].tolist()
|
| 16 |
-
all_card_lookup = dict(zip(df_all_cards["name"], df_all_cards["description"]))
|
| 17 |
-
|
| 18 |
-
with open('for_graph_construction_(expanded labels).json') as f:
|
| 19 |
-
card_feature_data = json.load(f)
|
| 20 |
-
|
| 21 |
-
card_features_lookup = {
|
| 22 |
-
card['card_name']: set(card['features'])
|
| 23 |
-
for card in card_feature_data
|
| 24 |
-
}
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
#function for the chatbot functionality
|
| 28 |
-
eligibility_lookup = {}
|
| 29 |
-
for _, row in eligibility_df.iterrows():
|
| 30 |
-
card_name = row["Name"].strip()
|
| 31 |
-
eligibility_info = f"""
|
| 32 |
-
- Bank: {row['Bank']}
|
| 33 |
-
- Age: {row['Minimum Age']} to {row['Maximum Age']}
|
| 34 |
-
- Minimum Income: {row['Minimum Income (LPA)']} LPA
|
| 35 |
-
- Minimum Credit Score: {row['Minimum Credit Score']}
|
| 36 |
-
- Joining Fee: ₹{row['Joining fee']}
|
| 37 |
-
- Annual Fee: ₹{row['Annual fee']}
|
| 38 |
-
"""
|
| 39 |
-
eligibility_lookup[card_name] = eligibility_info.strip()
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
demo.launch(share=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|