"... a microservice should perform a related set of operations on a well-circumscribed set of resources, should be independently deployed and operated, and should be designed to be readily incorporated with other external services."
- SaaS book, Chapter 3.4
The main application, built with React, is deployed on GCloud Storage and is accessible via a Google Storage domain. This React application interacts with a microservice, developed in Rails, which is deployed on GCloud Run.
"Perform a related set of operations": Each service has a distinct role—Rails handles API calls, React manages the frontend
"Independently deployed and operated": Rails is deployed on GCloud Run, and React is deployed on GCloud Storage, each to be deployed independently via 2 different auto-deploy Github Actions
"Readily incorporated with other external services": Rails connects to the React frontend via APIs, which are also RESTful.
Data_Processor Cloud Function
This cloud function classifies user-uploaded feedback into the appropriate product, subproduct, and feedback category while performing sentiment analysis. The processed data is then stored in the app's database.
The data_processing function standardizes data from various sources and formats through a processing pipeline. It uses three levels of fine-tuned models for classification and sentiment analysis. The process_data() method is triggered by a file upload to the jbaaam_upload bucket, which generates a Pub/Sub event to activate the cloud function. This function utilizes fine-tuned models, built on the Gemini base model or Flash model, accessed via the Gemini API.
This diagram illustrates the function pipeline for processing and classifying one of the five DBS feedback sources: Social Media
We fine-tuned and distilled the models using manually categorized data into predefined categories. Additionally, we employed few-shot prompt engineering to enhance the results.
Structure of prompt engineering we used for the system instruction
Prompt:
Categorize customer feedback into the most relevant feedback category for the product. Output should be a single category.
INSTRUCTIONS:
Identify the product from the feedback.
Match the feedback to a category from the list.
Be specific (e.g., 'UI/UX' for interface issues).
Output only the category.
EXAMPLES:
Input:
"Digibank App: Unable to update my mail addresses because system doesn't allow me to key in numbers."
Output:
Technical/System Related
Input:
"PayLah!: so many ads blocking the screen."
Output:
Advertisement
Input:
"The above question should allow us to choose more options instead of one option."
Output:
Others
Actionable Cloud Function
This cloud function generates actionable tasks based on the user’s specified time, source, and product for deeper analysis. The app sends an HTTPS request with parameters such as source, date range, and product, which triggers the generate_actions function. This function then invokes a fine-tuned language model via the Gemini API.
The function retrieves classified data from the Analytics table based on the received filters. This dataframe is then analyzed by the models, and the results are posted to the Actionable table in the database.