Skip to main content

Memotions Machine Learning API

· 2 min read
Indi Kusuma
DevOps Engineer @ Facebook

Machine Learning Service for the Memotions Application. This service provides APIs for accessing the Memotions machine learning models, the handling integration between machine learning models and the application's features.

API Description

This API is built with FastAPI and served using Uvicorn. The service listens for Pub/Sub events to trigger its execution. Its primary task is to predict emotions from user journals and generate feedback based on them. We use a model developed by our ML team to predict the emotions, and a fine-tuned model with Vertex AI to generate the feedback. The results are then published to a Pub/Sub event.

Tech Stack

  • FastApi
  • Tensorflow
  • Pubsub
  • Cloud Storage
  • Vertex AI

Documentation

You can access the full API documentation here:
Memotions ML API Docs

Getting Started

  1. Clone the Repository
git clone https://github.com/memotions/ml-service.git
cd ml-service/
  1. Create .env file
cp .env.example .env
vi .env
# add environment variables
  1. Install Dependencies
pip install -r requirements.txt
  1. Run the Server
# change host to localhost if want to try in your local
uvicorn app.main:app --host 0.0.0.0 --port 8000 --log-config logging_config.json