Skip to content

API based on flask using machine learning to detect spam comments. Use the URL for POST request

License

Notifications You must be signed in to change notification settings

arnab7070/spampred

Repository files navigation

Spam Predictor API

A minimal Flask web application.

Getting Started

These instructions will help you get your API up and running.

Prerequisites

  • Node.js installed
  • npm (Node Package Manager) installed
  • axios library installed (you can install it using npm install axios)

Example

const axios = require('axios');

async function makePrediction(commentText) {
  try {
    const response = await axios.post('https://flask-production-b980.up.railway.app/predict', {'comment': commentText});
    const responseData = response.data;
    console.log('Prediction:', responseData);
  } catch (error) {
    console.error('Error making prediction:', error.message);
  }
}

// Example usage
const commentText = 'This is a sample comment.';
makePrediction(commentText);

API Documentation


Document the available endpoints, request parameters, and response format

Endpoint:

  • POST /predict

Request Body:

  • comment (string): The text comment for prediction.

Response:

  • result (bool): The prediction result.
    {
      "result": true
    }

For a step-by-step guide to deploying on Railway, see this post, or click the button below.

Deploy on Railway

About

API based on flask using machine learning to detect spam comments. Use the URL for POST request

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published