Adi016 commited on
Commit
9e9adbd
·
verified ·
1 Parent(s): a8398b9

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -28
app.py DELETED
@@ -1,28 +0,0 @@
1
- from flask import Flask, request, jsonify
2
- from flask_cors import CORS
3
- import classification
4
-
5
- app = Flask(__name__)
6
- CORS(app)
7
-
8
- @app.route('/api/classify', methods=['POST'])
9
- def classify_email():
10
- data = request.json
11
-
12
- if not data or ('subject' not in data and 'body' not in data):
13
- return jsonify({'error': 'Missing email content'}), 400
14
-
15
- subject = data.get('subject', '')
16
- body = data.get('body', '')
17
-
18
- email = f"""
19
- Subject: {subject}
20
- Body: {body}
21
- """
22
-
23
- result = classification.classify(email)
24
-
25
- return result
26
-
27
- if __name__ == '__main__':
28
- app.run(debug=True, port=5007)