Link for full documentation: Google Doc
pip install -r requirements.txt
With Docker:
- Ensure docker engine is running then in a terminal, go to DataMiners directory and run:
docker compose up
Then the app will be live at: http://localhost:5000/
With Flask Locally:
- Go to DataMiners directory in a terminal and run:
Python FlaskAPI.py
Then the app will be live at: http://127.0.0.1:5000/
In both the above cases, to get the response without UI, run below given code in a python terminal or simply put the endpoint like below in any browser (customise your endpoint with your specific input):
"http://127.0.0.1:5000/predict?company=Amazon&country=USA&url=https://www.amazon.com/&image=y"
Code:
import requests
response = requests.get("http://127.0.0.1:5000/predict?company=Amazon&country=USA&url=https://www.amazon.com/&image=")
Note : the endpoint without an url input and with choice of no image output will look like this:
"http://127.0.0.1:5000/predict?company=Amazon&country=USA&url=&image="
For Multiple inputs:
- If more than one inputs at once are needed to be called then
BatchAPICall.pycan be used which takes a dataframe of inputs as its input. Sample input data is present atdata/unicorn-company-list-with_URLs.csv
🚧 An .env file containing all the api keys is required in the source directory to run the code