-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_app.py
More file actions
63 lines (54 loc) · 1.89 KB
/
Copy pathrun_app.py
File metadata and controls
63 lines (54 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env python3
"""
Main application launcher for Health Insurance Claim Classifier
Choose between Streamlit (legacy) or Flask (new beautiful HTML UI)
"""
import sys
import subprocess
import os
def run_flask_app():
"""Run the Flask app with beautiful HTML UI"""
print("Starting Health Insurance Claim Classifier with Beautiful HTML UI...")
print("Open your browser to: http://localhost:5000")
print("Features: Claim Type Detection • Entity Extraction • Confidence Scores • JSON Export")
print("-" * 70)
try:
subprocess.run([sys.executable, "app_backend.py"], check=True)
except KeyboardInterrupt:
print("\nShutting down gracefully...")
except Exception as e:
print(f"Error starting Flask app: {e}")
def run_streamlit_app():
"""Run the Streamlit app (legacy)"""
print("Starting Health Insurance Claim Classifier with Streamlit UI (Legacy)...")
print("Open your browser to: http://localhost:8501")
print("-" * 70)
try:
subprocess.run([sys.executable, "-m", "streamlit", "run", "app.py"], check=True)
except KeyboardInterrupt:
print("\nShutting down gracefully...")
except Exception as e:
print(f"Error starting Streamlit app: {e}")
def main():
print(" Health Insurance Claim Classifier")
print("=" * 60)
print("Choose your interface:")
print("1. Beautiful HTML UI (Recommended)")
print("2. Streamlit UI (Legacy)")
print("3. Exit")
print("-" * 60)
while True:
choice = input("Enter your choice (1-3): ").strip()
if choice == "1":
run_flask_app()
break
elif choice == "2":
run_streamlit_app()
break
elif choice == "3":
print("Goodbye!")
break
else:
print("Invalid choice. Please enter 1, 2, or 3.")
if __name__ == "__main__":
main()