Skip to content

Hypotetical electric company's mail classifier. Project made to practice with Docker with FastAPI and MySQL.

Notifications You must be signed in to change notification settings

sandiumenge/mail-classifier-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Definition

This project is a mail classifier for an hypotetical energy company. It reads the mails from the users and distributs them in different classes depending on the content using a zero-shot classifier, in this case the facebook bart as it is a small and fast which can work really good with the complexity of the task.

It reads the data from a SQL file in a Docker file with the bart model.

I made this project to practice the Docker initialization, joining SQL databases and LLM models making it callable and scalable.

Endpoint: /classify-email

Method: POST

Parameters (sent in the body as JSON text):

{ 
  "client_id": integer, 
  "fecha_envio": string, 
  "email_body": string 
} 

Response

If the client has no outstanding debts

Response code: 200

Response body (in JSON format):

{ 
  "success": boolean,
  "prediction": string 
} 

If the client has outstanding debts

Response code: 200

Response body (in JSON format):

{ 
  "success": false,
  "reason": "The client has outstanding debts"
} 

Description: The /classify-email endpoint accepts requests with the POST method. It expects three parameters in the request body: client_id, which must be an integer; fecha_envio, which represents the date and time of sending in datetime format (format YYYY-MM-dd hh:mm:ss); and email_body, which is a string containing the body of the email to classify. If the request is successfully processed, the endpoint will return a status code 200 and a JSON object with a field named prediction, which will contain a string with the prediction, along with a field success, a boolean with the value true.

If the client is listed as having outstanding debts, the endpoint will return a status code 200 and a JSON object with a success field set to false and a reason field with the message "The client has outstanding debts".

About

Hypotetical electric company's mail classifier. Project made to practice with Docker with FastAPI and MySQL.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published