instaknow
flutter app build for the machine learning model which shows sentiments of instagram user by analysing their captions.
front-end application
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.
the flutter application uses provider
+ get_it
for state management.
mvvm(model-view-(view)model) architecture has been used.
note: in about page url for server can be changed (because of free version url may change after some time)
screenshots for instaknow
homescreen
app ui demo
public profile analyzer
private profile analyzer
example for instaknow
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:
{
"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
{
"type":"public",
"login_id":"some_public_username"
}
- private profile
{
"type":"private",
"login_id":"some_private_username",
"login_username":"username_for_authentication",
"password":"password_for_authentication"
}
server to application:
- success:
{
"type":"success",
"value":result,
"picture":profile_picture_link,
"name":full_name_of_profile
}
- fail:
{
"type":"fail",
"value":error_message,
}
installation instaknow and execution
download or download 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):
set flask_app=app.py
- run the flask app using the following command:
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.
Comments are closed.