Spaces:
Sleeping
Sleeping
Upload 7 files
Browse files
HF_SPACE_INSTRUCTIONS.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OpenFinancial Chatbot - HF Space Trainer
|
| 2 |
+
|
| 3 |
+
This is a self-contained training script designed to run in a Hugging Face Space.
|
| 4 |
+
|
| 5 |
+
## 🚀 Quick Setup Instructions
|
| 6 |
+
|
| 7 |
+
### 1. Create a New HF Space
|
| 8 |
+
1. Go to https://huggingface.co/new-space
|
| 9 |
+
2. Choose **Gradio** as the SDK
|
| 10 |
+
3. Set hardware to **CPU Basic** (free) or **T4 GPU** (paid)
|
| 11 |
+
4. Name it something like `openfinancial-trainer`
|
| 12 |
+
|
| 13 |
+
### 2. Upload Files to Your Space
|
| 14 |
+
Upload these files to your HF Space:
|
| 15 |
+
- `hf_space_trainer.py` → rename to `app.py`
|
| 16 |
+
- `requirements_hf_space.txt` → rename to `requirements.txt`
|
| 17 |
+
- Your training CSV files (from the `trainingData` folder)
|
| 18 |
+
|
| 19 |
+
### 3. Training Data Format
|
| 20 |
+
Your CSV should have columns like:
|
| 21 |
+
- `Question` and `Answer`, OR
|
| 22 |
+
- `Input` and `Output`, OR
|
| 23 |
+
- `Prompt` and `Response`
|
| 24 |
+
|
| 25 |
+
The script will automatically detect the column names.
|
| 26 |
+
|
| 27 |
+
### 4. Start Training
|
| 28 |
+
1. Wait for the space to build (2-3 minutes)
|
| 29 |
+
2. Click **"🚀 Start Training"**
|
| 30 |
+
3. Monitor progress in real-time
|
| 31 |
+
4. Training takes 15-30 minutes on CPU, 5-10 minutes on GPU
|
| 32 |
+
|
| 33 |
+
### 5. Download Your Model
|
| 34 |
+
After training completes:
|
| 35 |
+
1. Go to your space's **Files** tab
|
| 36 |
+
2. Download the entire `trained_model` folder
|
| 37 |
+
3. Copy it to your local project
|
| 38 |
+
|
| 39 |
+
## 🎯 What This Does
|
| 40 |
+
- Loads your training data automatically
|
| 41 |
+
- Trains TinyLlama model for financial Q&A
|
| 42 |
+
- Saves model locally in the space
|
| 43 |
+
- Provides simple web interface
|
| 44 |
+
- Works on both CPU and GPU
|
| 45 |
+
|
| 46 |
+
## 💡 Pro Tips
|
| 47 |
+
- **Free Option**: Use CPU Basic (slower but free)
|
| 48 |
+
- **Fast Option**: Use T4 GPU (~$0.60/hour, much faster)
|
| 49 |
+
- **Multiple Files**: Script tries common CSV names automatically
|
| 50 |
+
- **Resume Training**: Refresh status to see if training completed
|
| 51 |
+
|
| 52 |
+
## 📁 Expected Output
|
| 53 |
+
After training, you'll have a `trained_model` folder containing:
|
| 54 |
+
- `config.json` - Model configuration
|
| 55 |
+
- `pytorch_model.bin` - Trained weights
|
| 56 |
+
- `tokenizer.json` - Tokenizer files
|
| 57 |
+
- Other supporting files
|
| 58 |
+
|
| 59 |
+
Copy this folder to your local backend directory and use it with your chatbot!
|
hf_space_trainer.py
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
OpenFinancial Chatbot - Hugging Face Space Trainer
|
| 4 |
+
==================================================
|
| 5 |
+
|
| 6 |
+
This script is designed to run directly in a Hugging Face Space.
|
| 7 |
+
Upload this file along with your training data to a HF Space and it will:
|
| 8 |
+
1. Load your training data automatically
|
| 9 |
+
2. Train the model using available hardware (GPU/CPU)
|
| 10 |
+
3. Save the trained model to the space's file system
|
| 11 |
+
4. Provide a simple interface to monitor progress
|
| 12 |
+
|
| 13 |
+
Instructions:
|
| 14 |
+
1. Create a new HF Space (Gradio SDK)
|
| 15 |
+
2. Upload this file as app.py
|
| 16 |
+
3. Upload your training CSV files to the space
|
| 17 |
+
4. The space will automatically start training when it loads
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
import os
|
| 21 |
+
import json
|
| 22 |
+
import time
|
| 23 |
+
import pandas as pd
|
| 24 |
+
from datasets import Dataset
|
| 25 |
+
from transformers import (
|
| 26 |
+
AutoModelForCausalLM,
|
| 27 |
+
AutoTokenizer,
|
| 28 |
+
Trainer,
|
| 29 |
+
TrainingArguments,
|
| 30 |
+
DataCollatorForLanguageModeling
|
| 31 |
+
)
|
| 32 |
+
import torch
|
| 33 |
+
from huggingface_hub import login
|
| 34 |
+
import gradio as gr
|
| 35 |
+
|
| 36 |
+
# Configuration
|
| 37 |
+
BASE_MODEL = "TinyLlama/TinyLlama-1.1B-Chat-v1.0"
|
| 38 |
+
OUTPUT_MODEL_DIR = "./trained_model"
|
| 39 |
+
TRAINING_DATA_FILES = ["trainingData.csv", "training_data.csv", "data.csv"] # Try multiple names
|
| 40 |
+
|
| 41 |
+
def find_training_data():
|
| 42 |
+
"""Find training data files in the space"""
|
| 43 |
+
print("🔍 Looking for training data files...")
|
| 44 |
+
|
| 45 |
+
# Check for CSV files
|
| 46 |
+
for filename in TRAINING_DATA_FILES:
|
| 47 |
+
if os.path.exists(filename):
|
| 48 |
+
print(f"✅ Found training data: {filename}")
|
| 49 |
+
return filename
|
| 50 |
+
|
| 51 |
+
# Check all CSV files in current directory
|
| 52 |
+
csv_files = [f for f in os.listdir('.') if f.endswith('.csv')]
|
| 53 |
+
if csv_files:
|
| 54 |
+
print(f"✅ Found CSV files: {csv_files}")
|
| 55 |
+
return csv_files[0] # Use the first one
|
| 56 |
+
|
| 57 |
+
print("❌ No training data found. Please upload a CSV file with 'Question' and 'Answer' columns.")
|
| 58 |
+
return None
|
| 59 |
+
|
| 60 |
+
def load_training_data(filename):
|
| 61 |
+
"""Load and prepare training data"""
|
| 62 |
+
print(f"📊 Loading training data from {filename}...")
|
| 63 |
+
|
| 64 |
+
try:
|
| 65 |
+
# Read CSV file
|
| 66 |
+
df = pd.read_csv(filename)
|
| 67 |
+
print(f"Raw data shape: {df.shape}")
|
| 68 |
+
|
| 69 |
+
# Check for required columns (flexible naming)
|
| 70 |
+
question_cols = [col for col in df.columns if 'question' in col.lower() or 'prompt' in col.lower() or 'input' in col.lower()]
|
| 71 |
+
answer_cols = [col for col in df.columns if 'answer' in col.lower() or 'response' in col.lower() or 'output' in col.lower()]
|
| 72 |
+
|
| 73 |
+
if not question_cols or not answer_cols:
|
| 74 |
+
print(f"Available columns: {list(df.columns)}")
|
| 75 |
+
raise ValueError("Could not find Question/Answer columns")
|
| 76 |
+
|
| 77 |
+
question_col = question_cols[0]
|
| 78 |
+
answer_col = answer_cols[0]
|
| 79 |
+
|
| 80 |
+
print(f"Using columns: {question_col} -> {answer_col}")
|
| 81 |
+
|
| 82 |
+
# Create training format
|
| 83 |
+
training_data = []
|
| 84 |
+
for _, row in df.iterrows():
|
| 85 |
+
question = str(row[question_col]).strip()
|
| 86 |
+
answer = str(row[answer_col]).strip()
|
| 87 |
+
|
| 88 |
+
if question and answer and question != 'nan' and answer != 'nan':
|
| 89 |
+
# Format as conversation
|
| 90 |
+
text = f"### Question: {question}\n### Answer: {answer}<|endoftext|>"
|
| 91 |
+
training_data.append({"text": text})
|
| 92 |
+
|
| 93 |
+
print(f"✅ Processed {len(training_data)} valid training examples")
|
| 94 |
+
return training_data
|
| 95 |
+
|
| 96 |
+
except Exception as e:
|
| 97 |
+
print(f"❌ Error loading data: {e}")
|
| 98 |
+
return None
|
| 99 |
+
|
| 100 |
+
def train_model(training_data):
|
| 101 |
+
"""Train the model with the provided data"""
|
| 102 |
+
print("🚀 Starting model training...")
|
| 103 |
+
|
| 104 |
+
# Check hardware
|
| 105 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 106 |
+
print(f"💻 Using device: {device}")
|
| 107 |
+
if torch.cuda.is_available():
|
| 108 |
+
print(f"🔥 GPU: {torch.cuda.get_device_name(0)}")
|
| 109 |
+
|
| 110 |
+
# Create dataset
|
| 111 |
+
dataset = Dataset.from_list(training_data)
|
| 112 |
+
print(f"📊 Dataset size: {len(dataset)} examples")
|
| 113 |
+
|
| 114 |
+
# Load tokenizer and model
|
| 115 |
+
print("🔧 Loading model and tokenizer...")
|
| 116 |
+
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
|
| 117 |
+
if tokenizer.pad_token is None:
|
| 118 |
+
tokenizer.pad_token = tokenizer.eos_token
|
| 119 |
+
|
| 120 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 121 |
+
BASE_MODEL,
|
| 122 |
+
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
|
| 123 |
+
device_map="auto" if torch.cuda.is_available() else None
|
| 124 |
+
)
|
| 125 |
+
|
| 126 |
+
# Tokenize dataset
|
| 127 |
+
print("🔄 Tokenizing dataset...")
|
| 128 |
+
def tokenize_function(examples):
|
| 129 |
+
return tokenizer(
|
| 130 |
+
examples["text"],
|
| 131 |
+
truncation=True,
|
| 132 |
+
padding=False,
|
| 133 |
+
max_length=512
|
| 134 |
+
)
|
| 135 |
+
|
| 136 |
+
tokenized_dataset = dataset.map(
|
| 137 |
+
tokenize_function,
|
| 138 |
+
batched=True,
|
| 139 |
+
remove_columns=["text"]
|
| 140 |
+
)
|
| 141 |
+
|
| 142 |
+
# Training arguments
|
| 143 |
+
batch_size = 4 if torch.cuda.is_available() else 2
|
| 144 |
+
gradient_steps = 4 if torch.cuda.is_available() else 8
|
| 145 |
+
|
| 146 |
+
training_args = TrainingArguments(
|
| 147 |
+
output_dir="./results",
|
| 148 |
+
num_train_epochs=3,
|
| 149 |
+
per_device_train_batch_size=batch_size,
|
| 150 |
+
gradient_accumulation_steps=gradient_steps,
|
| 151 |
+
warmup_steps=50,
|
| 152 |
+
learning_rate=2e-5,
|
| 153 |
+
logging_steps=10,
|
| 154 |
+
save_steps=500,
|
| 155 |
+
save_total_limit=2,
|
| 156 |
+
remove_unused_columns=False,
|
| 157 |
+
dataloader_num_workers=0, # Avoid multiprocessing issues
|
| 158 |
+
fp16=torch.cuda.is_available(),
|
| 159 |
+
report_to=None, # Disable wandb
|
| 160 |
+
)
|
| 161 |
+
|
| 162 |
+
# Data collator
|
| 163 |
+
data_collator = DataCollatorForLanguageModeling(
|
| 164 |
+
tokenizer=tokenizer,
|
| 165 |
+
mlm=False,
|
| 166 |
+
)
|
| 167 |
+
|
| 168 |
+
# Create trainer
|
| 169 |
+
print("⚙️ Initializing trainer...")
|
| 170 |
+
trainer = Trainer(
|
| 171 |
+
model=model,
|
| 172 |
+
args=training_args,
|
| 173 |
+
train_dataset=tokenized_dataset,
|
| 174 |
+
data_collator=data_collator,
|
| 175 |
+
tokenizer=tokenizer,
|
| 176 |
+
)
|
| 177 |
+
|
| 178 |
+
# Train the model
|
| 179 |
+
print("🔥 Starting training...")
|
| 180 |
+
start_time = time.time()
|
| 181 |
+
|
| 182 |
+
try:
|
| 183 |
+
trainer.train()
|
| 184 |
+
|
| 185 |
+
end_time = time.time()
|
| 186 |
+
training_duration = (end_time - start_time) / 60
|
| 187 |
+
|
| 188 |
+
# Save the model
|
| 189 |
+
print("💾 Saving trained model...")
|
| 190 |
+
trainer.save_model(OUTPUT_MODEL_DIR)
|
| 191 |
+
tokenizer.save_pretrained(OUTPUT_MODEL_DIR)
|
| 192 |
+
|
| 193 |
+
# Create a completion marker
|
| 194 |
+
with open("training_complete.txt", "w") as f:
|
| 195 |
+
f.write(f"Training completed successfully!\nDuration: {training_duration:.1f} minutes\nModel saved to: {OUTPUT_MODEL_DIR}")
|
| 196 |
+
|
| 197 |
+
return f"✅ Training completed in {training_duration:.1f} minutes!\n\nModel saved to: {OUTPUT_MODEL_DIR}\n\nYou can now download the trained_model folder."
|
| 198 |
+
|
| 199 |
+
except Exception as e:
|
| 200 |
+
error_msg = f"❌ Training failed: {str(e)}"
|
| 201 |
+
print(error_msg)
|
| 202 |
+
|
| 203 |
+
# Create error marker
|
| 204 |
+
with open("training_error.txt", "w") as f:
|
| 205 |
+
f.write(error_msg)
|
| 206 |
+
|
| 207 |
+
return error_msg
|
| 208 |
+
|
| 209 |
+
def create_interface():
|
| 210 |
+
"""Create Gradio interface"""
|
| 211 |
+
|
| 212 |
+
# Check for existing status
|
| 213 |
+
initial_status = "🚀 Ready to start training..."
|
| 214 |
+
|
| 215 |
+
if os.path.exists("training_complete.txt"):
|
| 216 |
+
with open("training_complete.txt", "r") as f:
|
| 217 |
+
initial_status = f.read()
|
| 218 |
+
elif os.path.exists("training_error.txt"):
|
| 219 |
+
with open("training_error.txt", "r") as f:
|
| 220 |
+
initial_status = f.read()
|
| 221 |
+
|
| 222 |
+
with gr.Blocks(title="OpenFinancial Chatbot Trainer") as demo:
|
| 223 |
+
gr.Markdown("# 🤖 OpenFinancial Chatbot - Cloud Trainer")
|
| 224 |
+
gr.Markdown("Upload your training CSV file and click 'Start Training' to begin.")
|
| 225 |
+
|
| 226 |
+
status_output = gr.Textbox(
|
| 227 |
+
label="Training Status",
|
| 228 |
+
value=initial_status,
|
| 229 |
+
lines=10,
|
| 230 |
+
max_lines=20
|
| 231 |
+
)
|
| 232 |
+
|
| 233 |
+
with gr.Row():
|
| 234 |
+
start_btn = gr.Button("🚀 Start Training", variant="primary")
|
| 235 |
+
refresh_btn = gr.Button("🔄 Refresh Status", variant="secondary")
|
| 236 |
+
|
| 237 |
+
# File download section
|
| 238 |
+
gr.Markdown("## 📥 Download Trained Model")
|
| 239 |
+
download_info = gr.Markdown("After training completes, download the files below:")
|
| 240 |
+
|
| 241 |
+
def start_training():
|
| 242 |
+
# Find and load data
|
| 243 |
+
data_file = find_training_data()
|
| 244 |
+
if not data_file:
|
| 245 |
+
return "❌ No training data found. Please upload a CSV file with Question and Answer columns."
|
| 246 |
+
|
| 247 |
+
training_data = load_training_data(data_file)
|
| 248 |
+
if not training_data:
|
| 249 |
+
return "❌ Failed to load training data. Check the CSV format."
|
| 250 |
+
|
| 251 |
+
# Start training
|
| 252 |
+
return train_model(training_data)
|
| 253 |
+
|
| 254 |
+
def refresh_status():
|
| 255 |
+
if os.path.exists("training_complete.txt"):
|
| 256 |
+
with open("training_complete.txt", "r") as f:
|
| 257 |
+
return f.read()
|
| 258 |
+
elif os.path.exists("training_error.txt"):
|
| 259 |
+
with open("training_error.txt", "r") as f:
|
| 260 |
+
return f.read()
|
| 261 |
+
else:
|
| 262 |
+
return "🚀 Ready to start training..."
|
| 263 |
+
|
| 264 |
+
start_btn.click(start_training, outputs=status_output)
|
| 265 |
+
refresh_btn.click(refresh_status, outputs=status_output)
|
| 266 |
+
|
| 267 |
+
return demo
|
| 268 |
+
|
| 269 |
+
if __name__ == "__main__":
|
| 270 |
+
print("🤖 OpenFinancial Chatbot - HF Space Trainer")
|
| 271 |
+
print("=" * 50)
|
| 272 |
+
|
| 273 |
+
# Auto-login if token is available
|
| 274 |
+
if "HF_TOKEN" in os.environ:
|
| 275 |
+
try:
|
| 276 |
+
login(token=os.environ["HF_TOKEN"])
|
| 277 |
+
print("✅ Hugging Face authentication successful")
|
| 278 |
+
except:
|
| 279 |
+
print("⚠️ HF authentication failed (optional)")
|
| 280 |
+
|
| 281 |
+
# Launch interface
|
| 282 |
+
interface = create_interface()
|
| 283 |
+
interface.launch()
|
requirements_hf_space.txt
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
torch>=2.0.0
|
| 2 |
+
transformers>=4.35.0
|
| 3 |
+
datasets>=2.14.0
|
| 4 |
+
pandas>=1.5.0
|
| 5 |
+
gradio>=3.50.0
|
| 6 |
+
huggingface_hub>=0.17.0
|
| 7 |
+
accelerate>=0.20.0
|
trainingData/customer_service_conversations.csv
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Question,Answer
|
| 2 |
+
What's my current account balance?,I can help you check your account balance. Please provide your account number and I'll look that up for you right away.
|
| 3 |
+
Can you tell me my recent transactions?,I'd be happy to review your recent transactions. Let me pull up your account activity for the past 30 days.
|
| 4 |
+
Why was I charged a fee on my account?,I can help explain any fees on your account. Let me review your account details to identify the specific charge and provide an explanation.
|
| 5 |
+
How do I set up direct deposit?,Setting up direct deposit is easy! You'll need to provide your employer with your routing number and account number. I can help you find those details.
|
| 6 |
+
"My card was declined, why?","Card declines can happen for several reasons including insufficient funds, security holds, or expired cards. Let me check your account to determine the cause."
|
| 7 |
+
"I lost my debit card, what should I do?","I'm sorry to hear about your lost card. For your security, I'll immediately place a hold on the card and order you a replacement. Your new card will arrive in 3-5 business days."
|
| 8 |
+
My card is not working at ATMs,"That's frustrating! ATM issues can be related to card damage, magnetic strip problems, or network issues. Let me troubleshoot this with you and if needed, order a replacement card."
|
| 9 |
+
Can you increase my credit limit?,I can help you request a credit limit increase. This typically requires a review of your account history and current financial situation. Would you like me to start that process?
|
| 10 |
+
I don't recognize this charge on my statement,"I understand your concern about unrecognized charges. Let me review the transaction details with you and if it's fraudulent, we can dispute it immediately."
|
| 11 |
+
I was double charged for a purchase,Double charges are definitely frustrating. Let me look at the transaction details and initiate a dispute to get this resolved for you quickly.
|
| 12 |
+
A merchant charged me incorrectly,I can help you dispute an incorrect merchant charge. Let me gather some details about the transaction and we'll work on getting this corrected.
|
| 13 |
+
How do I open a savings account?,Opening a savings account is straightforward! I can walk you through the process and help you choose the best savings option for your needs. What are your savings goals?
|
| 14 |
+
Can I close my checking account?,"Yes, you can close your checking account. I'll need to verify your identity and ensure there are no pending transactions. Is there anything specific prompting this closure?"
|
| 15 |
+
How do I add someone to my account?,Adding an authorized user to your account requires both parties to be present with valid identification. I can schedule an appointment or provide you with the required forms.
|
| 16 |
+
What documents do I need to open an account?,"To open an account, you'll typically need a government-issued photo ID, Social Security number, and proof of address. Some accounts may have additional requirements."
|
| 17 |
+
I forgot my online banking password,"No problem! I can help you reset your online banking password. For security, I'll need to verify your identity first. Do you have your account number available?"
|
| 18 |
+
How do I set up mobile deposits?,Mobile deposit is a convenient feature! I'll walk you through downloading our app and setting up the mobile deposit function. You'll be able to deposit checks by taking photos.
|
| 19 |
+
My online banking is locked,Account lockouts usually happen after multiple incorrect login attempts for security. I can unlock your account after verifying your identity and help you reset your login credentials.
|
| 20 |
+
Can you help me navigate the mobile app?,Absolutely! I'd be happy to guide you through our mobile app features. What specific function are you trying to access?
|
| 21 |
+
What are your current mortgage rates?,"Our mortgage rates vary based on loan type, term, and your credit profile. Current rates start around X%. I can connect you with a loan specialist for a personalized quote."
|
| 22 |
+
How do I apply for a personal loan?,"Applying for a personal loan is simple! You can apply online, by phone, or in person. I'll need some financial information to get you pre-qualified. What's the loan for?"
|
| 23 |
+
When is my loan payment due?,Let me check your loan account details to confirm your payment due date and amount. I can also help you set up automatic payments if you're interested.
|
| 24 |
+
Can I make an extra payment on my loan?,"Yes, you can absolutely make extra payments! Additional payments typically go toward principal, which can save you interest over time. Would you like me to process a payment now?"
|
| 25 |
+
Do you offer investment accounts?,"Yes, we offer various investment options including IRAs, brokerage accounts, and managed portfolios. I can connect you with our investment specialists to discuss your goals."
|
| 26 |
+
What's the minimum to open an investment account?,"Minimum investment requirements vary by account type. Some accounts have no minimum while others may require $1,000 or more. What type of investing are you considering?"
|
| 27 |
+
How do I transfer my 401k?,401k rollovers are common when changing jobs. I can help you start the process and ensure it's done correctly to avoid penalties. Do you have your previous employer's plan information?
|
| 28 |
+
What are your business hours?,"Our customer service is available Monday through Friday 8 AM to 8 PM, and Saturday 9 AM to 5 PM. Online banking and our mobile app are available 24/7."
|
| 29 |
+
Where is the nearest branch?,I can help you locate the nearest branch. What's your current location or zip code? I can also provide branch hours and services available.
|
| 30 |
+
Do you have notary services?,"Yes, most of our branches offer notary services for customers. I recommend calling ahead to ensure a notary is available when you visit."
|
| 31 |
+
How do I update my address?,"Updating your address is important for account security. I can help you update it now over the phone, or you can do it through online banking or by visiting a branch."
|
| 32 |
+
Can you mail me a new checkbook?,Of course! I can order a new checkbook for you right now. It typically takes 7-10 business days to arrive. Would you like standard checks or a specific design?
|
| 33 |
+
I think someone has my account information,That's a serious concern and I'm glad you called immediately. Let me secure your account right now and walk you through the steps to protect your finances.
|
| 34 |
+
How do I report fraudulent activity?,Thank you for reporting this quickly. I'll immediately flag the suspicious activity and start the fraud investigation process. Your account security is our top priority.
|
| 35 |
+
Is it safe to use my card online?,"Online card usage can be safe when you follow best practices. Use secure websites, avoid public Wi-Fi for banking, and monitor your accounts regularly. We also offer fraud monitoring services."
|
| 36 |
+
What fees do you charge?,Our fee schedule varies by account type and services. I can review your specific account fees and help you understand how to minimize them. Would you like me to go through your account?
|
| 37 |
+
Can you waive this overdraft fee?,I understand overdraft fees can be frustrating. Let me review your account history and see what options are available. Many times we can work with customers on fee adjustments.
|
| 38 |
+
Why was I charged a monthly maintenance fee?,"Monthly maintenance fees are typically charged when account requirements aren't met, such as minimum balance or direct deposit requirements. Let me check your specific account terms."
|
trainingData/financial_conversations.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
trainingData/financial_qa_conversations.csv
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Question,Answer
|
| 2 |
+
What is compound interest?,Compound interest is interest earned on both the original principal and previously earned interest. It's often called 'interest on interest' and can significantly boost your savings over time.
|
| 3 |
+
How much should I save for retirement?,"Financial experts typically recommend saving 10-15% of your income for retirement. The exact amount depends on your age, current savings, and retirement goals. Starting early gives compound interest more time to work."
|
| 4 |
+
What's the difference between a Roth and traditional IRA?,Traditional IRAs offer tax deductions now but you pay taxes in retirement. Roth IRAs use after-tax dollars now but withdrawals in retirement are tax-free. Your current vs. expected future tax rate helps determine the best choice.
|
| 5 |
+
Should I pay off debt or invest?,"Generally, pay off high-interest debt (like credit cards) first since the guaranteed return of eliminating interest often beats potential investment returns. For low-interest debt, you might consider investing while making minimum payments."
|
| 6 |
+
What is dollar-cost averaging?,Dollar-cost averaging means investing a fixed amount regularly regardless of market conditions. This strategy can reduce the impact of market volatility by purchasing more shares when prices are low and fewer when prices are high.
|
| 7 |
+
How do I build an emergency fund?,"Start by saving $1,000 as a starter emergency fund, then work toward 3-6 months of expenses. Keep it in a high-yield savings account that's easily accessible but separate from your regular checking account."
|
| 8 |
+
What credit score do I need to buy a house?,"Most conventional loans require a credit score of 620 or higher, though FHA loans may accept scores as low as 580. Higher scores typically qualify for better interest rates and terms."
|
| 9 |
+
How can I improve my credit score?,"Pay all bills on time, keep credit utilization below 30%, don't close old credit cards, and check your credit report for errors. Payment history and credit utilization are the most important factors."
|
| 10 |
+
What is diversification in investing?,"Diversification means spreading investments across different asset types, sectors, and geographic regions to reduce risk. The idea is that different investments perform well at different times, smoothing overall returns."
|
| 11 |
+
When should I refinance my mortgage?,"Consider refinancing when rates drop significantly below your current rate, when your credit has improved, or when you want to change loan terms. Factor in closing costs to determine if it makes financial sense."
|
trainingData/trainingData.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|