Skip to content

Moukuh/Sentiment-Analysis--FastAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Suicidal Intention Prediction

This project predicts whether a tweet indicates suicidal intention. It uses a machine learning model(Support Vector Classification) trained on a dataset of tweets that have been labeled as either suicidal or not suicidal.

The Dataset is contains twitter contents.

Dataset link: https://raw.githubusercontent.com/laxmimerit/twitter-suicidal-intention-dataset/master/twitter-suicidal_data.csv

Requirements

  • Python 3.6 or later
  • NumPy
  • Pandas
  • Scikit-learn
  • FastAPI
  • Pydantic

Installation

To install the project, run the following command:

pip install -r requirements.txt

Usage

To use the project,

  • First run the main.py file.
  • Visit FastAPI/SwaggerUI page: http://127.0.0.1:8000/docs
  • Click on "Try it out" button on the POST/predict Predict Label section
  • Replace the "string" with any of your tweet or any sentence
  • On the response section it will display whether prediction 1 or 0

This is how it will look:

Input string:
Screenshot 2023-06-11 at 4 03 10 PM
Response:
Screenshot 2023-06-11 at 4 03 32 PM

Metrics scores

Screenshot 2023-06-11 at 4 08 53 PM

Contributing

Contributions are welcome! Please open an issue or pull request if you have any ideas for improvements.

License

This project is licensed under the MIT License.

About

Predicting whether a given text contains self-harm content and serving it using FastAPI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors