diff --git a/README.md b/README.md index 1e811ab..401d07f 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,140 @@ -# Instaknown +# InstaKnow -#### Flutter App Build usig machine Learning model which shows sentiments of instagram user by analysing their captions. +### [`Front-end By @ketanchoyal`](https://github.com/ketanchoyal) +### [`Back-end By @namas191297`](https://github.com/namas191297) -#### I've used Provider + Get_it for State Management. -### MVVM(Model-View-(View)Model) Architecture. +# Front-end Application -# Screenshots +Flutter application that allows user to analyze sentiments of other users based on their captions. This application uses a Machine Learning NLP approach to analyze captions and provide positive, negative and neutral scores as the output. -## HomeScreen +The flutter application uses ```Provider``` + ```Get_it``` for State Management. -HomeScreen + MVVM(Model-View-(View)Model) Architecture has been used. -## App UI Demo + ### `Note: In About Page url for server can be changed (because of free version URL may change after some time)` -UI Demo +## Screenshots +### HomeScreen -## Public Profile Analyzer +![Home_Screen](https://github.com/ketanchoyal/InstaKnow/raw/master/Screenshots/homeScreenDemo.gif) -Public +### App UI Demo -## Private Profile Analyzer +![App_UI](https://github.com/ketanchoyal/InstaKnow/raw/master/Screenshots/UIDemo.gif) -Private \ No newline at end of file +### Public Profile Analyzer + +![Analyzer](https://github.com/ketanchoyal/InstaKnow/raw/master/Screenshots/public.png) + +### Private Profile Analyzer + +![PAnalyzer](https://github.com/ketanchoyal/InstaKnow/raw/master/Screenshots/private.png) + +### Example + +![Example](https://github.com/ketanchoyal/InstaKnow/raw/master/Screenshots/example.png) + +# Back-end + +InstaKnow is an open-source mobile application that allows you to analyse the sentiments of public and private profiles based on their post captions. + +This repository is the backend/REST API for the application, where all requests from the application are received in the form of a JSON object. After the sentiment analysis is done, and the sentiments are evaluated, these results are sent in the form of JSON back to the application, where they are displayed. + +The backend has been made in python, where the REST API is served as a Flask web-application. The web-application can be hosted temporarily using ngrok or any other viable option. + +The ML implementation is that of NLP (Natural Language Processing), where the captions are analysed using the ```Vader Sentiment Analysis``` library. Scores are received in the form of positive, negative, neutral and compound values, after which their mean is sent back to the front-end application where they are displayed. + +Public profiles do not require any authentication although if you want to view the sentiments of a private profile, you must provide credentials for an account that can access that private profile (follows it) for authenticated access in order to extract the captions. + +## JSON + +As mentioned above, this repo is a REST API that communicates using JSON objects. + +**JavaScript Object Notation (JSON)** is an open-standard file format that uses human-readable text to transmit data objects consisting of attribute?value pairs and array data types (or any other serializable value). It is a very common data format, with a diverse range of applications. Such as serving as replacement for XML in AJAX systems. + +An example: + +```json +{ + "squadName": "Super hero squad", + "homeTown": "Metro City", + "formed": 2016, + "secretBase": "Super tower", + "active": true +} +``` + +## Data Format + +The format in which data is transferred can be seen as follows: + +### Application to Server : + +* Public profile + +```json +{ + "type":"Public", + "login_id":"some_public_username" +} +``` + +* Private profile + +```json +{ + "type":"Private", + "login_id":"some_private_username", + "login_username":"username_for_authentication", + "password":"password_for_authentication" +} +``` + +### Server to Application: + +* Success: + +```json +{ + "type":"Success", + "Value":result, + "Picture":profile_picture_link, + "Name":full_name_of_profile +} +``` + +* Fail: + +```json +{ + "type":"Fail", + "Value":error_message, +} +``` + +## Installation and Execution + +Download or clone the repository in a directory and cd into folder containing the file ```app.py```. + +* Set the FLASK environment variable FLASK_APP to the name of the python file as follows in the terminal (for Windows): + + +```python +set FLASK_APP=app.py +``` + +* Run the flask app using the following command: + +```python +flask run +``` + +## Prospective Changes + +* Adding encryption to ensure user security while analyzing private profiles + +* Analysis based on comments of other followers on the user's posts +* Permanent deployment as a web-service on platforms like AWS instead of using ngrok. + +* Checking policies and ensuring that publishing this application to the playstore/appstore should not cause instagram policy-violation due to web-scraping. diff --git a/Screenshots/example.png b/Screenshots/example.png index 3dea132..df96819 100644 Binary files a/Screenshots/example.png and b/Screenshots/example.png differ diff --git a/Screenshots/private.png b/Screenshots/private.png index 73460b6..44bd645 100644 Binary files a/Screenshots/private.png and b/Screenshots/private.png differ diff --git a/Screenshots/public.png b/Screenshots/public.png index 72b61d0..8117b99 100644 Binary files a/Screenshots/public.png and b/Screenshots/public.png differ