NYP AI: NLP & Deployment is held in conjunction with Nanyang Polytechnic's Tech In SIT initiative, a collaboration between the 4 special interest groups in NYP SIT.  On the 22nd of December, NYP AI hosted our Artificial Intelligence event: NLP & Deployment. This is aimed at Year 1 students who want to discover their interests in the Tech landscape.

GitHub - NYP-AI/Learning-Materials: A Public Repository containing all of NYP AI’s past event materials
A Public Repository containing all of NYP AI’s past event materials - GitHub - NYP-AI/Learning-Materials: A Public Repository containing all of NYP AI’s past event materials
Learning NLP: Creating own clickbait classifier & Deployment

Our end product was simple: A Flask application that performed two functions
1. Clickbait Classification using our own trained model
2. Sentiment Analysis using HuggingFace APIs

Sentiment Analysis on Flask
Clickbait Classifier on Flask

Training our Clickbait Classifier

To start off, we covered Text Preprocessing techniques, notably the Count Vectorizer. This was followed by an introduction to the Logistic Regression classification algorithm.

Count Vectorizer
Using the Logistic Regression Algorithm

Imagine the inefficiency if we have to train our model every time we want to make a prediction... To provide persistence, we utilized Pickle to save our CountVectorizer & Logistic Regression instances.

Pickle for persistency :)

Moving on to Deployment, we utilized the Flask web framework. We utilized our trained model to make backend predictions.

Using API Endpoints

Using HuggingFace's API Hub, we were able to tap into state-of-the-art Models, without having to train them on our own.

HuggingFace's Sentiment Analysis API

Using the Requests library, we are able to interface with the API in python

One way for AI to provide value is through exposure in Web Applications. After obtaining our two AI tools - Our trained model & API, we implemented both of them onto a website via Flask, hence allowing anyone to utilize these built solutions.

Afterthoughts

NYP AI: NLP & Deployment

Thanks to all participants who made it - we hope you've learnt something new :)
A shoutout to the 3 other Interest Groups involved in Tech Week 2021
NYP Infosec: https://nypinfosec.blogspot.com/p/about-us.html
NYP DSC: https://discord.gg/jWqkPB9PBn
NYP LIT: https://nyp-lit.github.io/

Until then!

~ NYP AI