Skip to content

diaa-shalaby/GET-request-wtih-DB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTP endpoint sentiment analysis

A simple HTTP endpoint in Python using Flask that predicts sentiment for a given sentence (sentiment analysis). The service authenticates the user (found in users_DB.txt), give the opportunity to select a model and return one of the 3 sentiments: “happy”, “neutral”, or “unhappy”.

GET request handler for the route /predict.

  • Input: /predict?username=dwight&model=happy&sentence=i-am-very-happy

  • Output: minimal json response: { “predicted_sentiment”: "happy" }

  • Input: /predict?username=john&model=length-based&sentence=i-am-very-happy-but-my-sentence-is-long

  • Output: minimal json response: { “predicted_sentiment”: "unhappy" }

SQL Impressions and Conversions DB

In programmatic advertising, ads (commonly referred to as impressions) are shown on websites with the help of DSPs (Demand Side Platforms). These platforms want to make sure that they are showing the right impressions to the right users in order to generate as many conversions as possible. Conversion is an event that occurs when a user lands on the advertiser's website. Put simply - when a user opens a website which contains some space for an ad, a request is sent to our servers where choose the right impression, which we serve to the user. We also store the request data in a table called impressions. If a user clicks on the ad and lands on the advertiser's website we store this event in a table called conversions. For each conversion there exists at least one impression, but not all impressions have a conversion.

About

Simple http get request with an api created with flask. In addition to a small sql DB to test some queries.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages