A Machine Learning Inference API using MCP server architecture for sentiment analysis.
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Start the FastAPI backend:
cd backend
uvicorn main:app --reload
- Start the Streamlit frontend:
cd frontend
streamlit run app.py
- POST
/predict
: Predict sentiment for given text- Request body:
{"text": "your text here"}
- Response:
{"sentiment": "positive" | "negative"}
- Request body:
- FastAPI for backend API
- Streamlit for frontend UI
- Scikit-learn for ML model
- Joblib for model persistence