-
Notifications
You must be signed in to change notification settings - Fork 0
/
conferences.py
77 lines (59 loc) · 1.69 KB
/
conferences.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# -*- coding: utf-8 -*-
"""conferences.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1eJWlDY_Cxx8lLmdHlUdByRsnngrBSb4C
"""
#begin by importing the Requests module
import requests
#making a request from url
r=requests.get("https://o136z8hk40.execute-api.us-east-1.amazonaws.com/dev/get-list-of-conferences")
#reading content of server's response
content=r.json()
print(content)
#getting keys in the API
for key,values in content.items():
print(key)
#getting values of keys
print(content['paid'])
"""#Conference Details[Paid]"""
paidList=[]
paidInfo=content['paid']
for i in paidInfo:
entry=[i['confName'],
i['confStartDate'],
None if i['city']=="" else i['city'],
None if i['state']=="" else i['state'],
None if i['country']=="" else i['country'],
i['entryType'],
i['confUrl']]
paidList.append(entry)
srNo=1
for i in paidList:
print(srNo,i)
srNo+=1
"""Finding and Printing Exact Duplicates"""
tempList=[]
duplicatesList=[]
for i in paidList:
if i not in tempList:
tempList.append(i)
else:
duplicatesList.append(i)
srNo=1
for i in duplicatesList:
print(srNo,i)
srNo+=1
"""Finding and Printing Symantic Duplicates"""
!pip install fuzzywuzzy
!pip install python-Levenshtein
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
for infoList1 in paidInfo:
conference1=infoList1['confName']
for infoList2 in paidInfo:
conference2=infoList2['confName']
fuzzymatch=fuzz.ratio(conference1,conference2)
if fuzzymatch>=71 and fuzzymatch!=100:
print("Semantic", (conference1,conference2))
"""# END"""