human
I am working on the file "Putting your model in production.ipynb".
The first task is:
File: weibo_classification_resource.py
Can you write Python program for it?
 ... Write me a the Python program you requested?
assistant
#Here is the Python program you requested.

from flask_restful import Resource
from flask import jsonify, request
from flask import Response

class WeiboClassificationResource(Resource):
    def get(self):
        return jsonify(hello='world!')
    
    def post(self):
        json_data = request.get_json(force=True)
        posts = json_data['user_posts']

        if posts[0] == 'fake':
            res_text = 'fake user!'
        else:
            res_text = 'real_user'

        return jsonify(classification_result=res_text)    

# 1.    
# GET http://localhost:5000/classify_user

# 2.
# POST http://localhost:5000/classify_user    
# JSON:     
#{
#    "user_posts": ["user post 1", "user post 2"]
#}