-> General Info
-> Technologies
-> Getting Started
-> Authors
Project Purpose : work done for miniproject evaluation GEU Semester-4
./model-training-&-testing : contains the dataset csv files, jupyter notebook and pickle files. The jupyter notebook is used for Data Visualization, Data Cleaning and Model Training, Testing & Exporting (for using it in our Web-App)
./web-app : contains the files for Flask Application (deployed on Heroku server - link to App).
The project is created using :
- Python 3.8.8
- Flask 1.1.2
- HTML5 and CSS
- Bootstrap v5.0
- Heroku
Clone the repo on local machine:
$ git clone https://github.com/BasuDevTyagi10/offensive-tweet-detection.git
$ cd "offensive-tweet-detection"
It is better to use Anaconda Navigator (Anaconda Documentation - Installation) for handling such (and further mentioned) tasks of creating virtual environments, installing packages, IDEs, Applications, etc.
For performing the mentioned operations manually (without Anaconda) :
Install virtualenv
module to create isolated virtual environments.
$ pip install virtualenv
To create a Virtual Environment for Python 2.x do the following
$ virtualenv myenv
For a Python 3 virtual environment type –
$ python3 -m venv myenv
To activate the virtual environment -
On Windows, run:
$ myenv\Scripts\activate.bat
The following packages will be required to be installed for running the 4thSemProject.ipynb
jupyter notebook:
jupyterlab
, pandas-profiling
, pandas
, matplotlib
, unidecode
, wordcloud
, plotly
and scikit-learn
And the following for running the Flask web-app in development mode on localhost (Port:5000):
flask
, pandas
and unidecode
Install the above mentioned packages in your virtual environment using Anaconda, and without it by:
run the below command after you're in your virtual environment
(myenv)$ pip install jupyterlab pandas-profiling pandas matplotlib unidecode wordcloud plotly scikit-learn
Once installed, launch JupyterLab with:
(myenv)$ cd model-training-&-testing
(myenv)$ jupyter-lab
Open the 4thSemProject.ipynb
jupyter notebook and Run All the Cells.
The notebook will create 3 files, clean_traindata.csv
, trained_model.pickle
and vectorizer.pickle
.
Move trained_model.pickle
and vectorizer.pickle
to the web-app
directory.
Windows:
(myenv)$ move trained_model.pickle ../web-app
(myenv)$ move vectorizer.pickle ../web-app
Switch to web-app
directory
(myenv)$ cd ../web-app
run the below command:
(myenv)$ python app.py
to run the app in the development mode.
Open http://localhost:5000 to view it in the browser.
- Basudev Tyagi - Initial work - BasuDevTyagi10