my accuracy is 52%,even though my(jokes) csv file is same as sample file.I have remove all the commas and still accuracy is same
Chuck Norris challenge, Accuracy is 52%
Hey @Shubham-Dogra-657103664634145, could you plz share your ipynb/py file by uploading it on google drive and sharing the link, or by saving it on cb.lk/ide.
Hey @Shubham-Dogra-657103664634145, first of all you need not to replace , with " ". Backend checks , as well, means is actual joke contains comma than your file should also contain comma.
You have to use csv writer, to handle this problem,
import requests
import json
import csv
url="http://api.icndb.com/jokes"
r= requests.get(url)
data=r.content.decode("UTF-8")
data=json.loads(data)
# print(data)
with open("jokes.csv","w") as f:
csvwriter = csv.writer(f)
header_string=["ID","Joke"]
csvwriter.writerow(header_string)
for i in range(473):
if data["value"][i]["joke"]:
id=str(data["value"][i]["id"])
joke=data["value"][i]["joke"]
csvwriter.writerow([id,joke])
Here is the code for that. Hope this resolved your doubt.
Plz mark it as resolved in my doubts section.