[1] What is the dataset?
https://abcd2.projectabcd.com/api/getinfo.php?id=50
If you change id at the end of the URL, you will get different JSON data.
https://abcd2.projectabcd.com/api/getinfo.php?id=100
You can always get this data by looping through the IDs from 1 to 1000 (just assume that the database has 1000 IDs).
This is a standard python code to get the data using APIs.
This is your dataset. You are only interested in some data.
[2] Example of a typical (one) dataset
id":50,
"name":"Mother Teresa",
"description":"Agnes Gonxhe Bojaxhiu, known to the world as 'Mother Teresa' was a famous Albanian-Indian nun, who founded the Missionaries of Charity. She lived in India most of her life helping the poor and weak. She became a nun at a very young age. She was admired all over the world for her charitable work, including feeding the hungry, and looking after the sick.\r\n",
"did_you_know":"Mother Teresa won the Nobel Peace Prize for her charitable contributions to society.",
"category":"dresses, regional, religious, author",
"type":"girl (Specific)",
"state_name":"Kolkata",
"key_words":"Nun",
"image_url":"Slide50.PNG",
"status":"proposed",
"notes":"book1",
"book":"book1"
[3] Assume that you are providing a CHATBOT for www.projectabcd.com
(Stretch goal: Embedding chatbot on the website is a stretch goal)
(Target / committed goal: A standalone chatbot - desktop application or a web application (ideal) - is to answer some questions in the context of these Project ABCD)
--> What kind of questions the users / visitors can ask?
--> What kind of questions would you ask?
--> How NLP / ML can be used to answer those questions through the chatbog? Primarily, you will be making use of the data given to you (description and did_you_know?)
[4] What tools can you use?
https://botpress.com/blog/open-source-chatbots
-- Using Flicker or Google Drive or GitHub or Botpress host to host your chatbot.
--> Embed that chatbot link on www.projectabcd.com (3 or 4 lines of JavaScript code to connect to the chatbot you built)
[5] How to get the dataset from APIs?
API_BASE_URL = "https://abcd2.projectabcd.com/api/getinfo.php?id="
specify the IDs
all_ids = [743,711,476,523,677,701, 710, 711, 712, 713, 714, 715]
all_ids = range(1, 1001)
def fetch_data_from_api(ids):
data_list = []
for id in ids:
url = API_BASE_URL + str(id)
headers = {
"Accept": "application/json",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
data_list.append(response.json()['data'])
else:
print(f"Failed to get data from the API for ID {id}. Status code:", response.status_code)
return data_list
fetch the data
abcd_data = fetch_data_from_api(all_ids)