Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

A RESTful API that embeds classification with confidence of textual suicidal thoughts, conducted on a previously compiled transformer model, utilizing Python

Notifications You must be signed in to change notification settings

tariqshaban/suicide-detection-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Embedding a Suicide Text Classification Model into Restful APIs

This is a supplementary submission of final paper for the CIS737 course.

It contains the code necessary to host a local restful API that utilizes a transformer model to predict incoming request values.

The model has the following hyperparameters:

  • Sampling fraction, set to 1
  • Validation ratio, set to 0.01
  • Test ratio, set to 0.005
  • Batch size, set to 2 (Due to computational limitation)
  • Number of epochs, set to 300
  • Early stopping value, set to 30
  • Early stopping delta value, set to 0.001

The returned values are:

  • The predicted label (suicide/non-suicide)
  • The confidence in the prediction

Getting Started

Clone the project from GitHub

$ git clone https://github.com/tariqshaban/suicide-detection-server.git

It is encouraged to refer to Flask documentation.

You may need to configure the Python interpreter (depending on the used IDE).

You may encounter problems concerning CORS policy when the client and server are on the same machine.

No further configuration is required.

Note: The model architecture located at assets/model/tf_model.h5 is stored as a GitHub LFS; you may need to download the file separately.


About

A RESTful API that embeds classification with confidence of textual suicidal thoughts, conducted on a previously compiled transformer model, utilizing Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages