forked from karpathy/researchpooler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo2.py
36 lines (27 loc) · 1.05 KB
/
demo2.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
"""
Some examples of fun things that can be done using the current 'API'
"""
from repool_util import loadPubs, openPDFs
def demo2():
"""
You unexpectedly became very interested in Deep Belief Networks. As a first
stab at some background reading, you want to:
1. Find all NIPS publications with Deep in title
2. open them in the browser
Pre-requisites:
- Assumes 'pubs_nips' exists. This can be obtained by running
nips_download_parse.py or by downloading it from site.
(https://sites.google.com/site/researchpooler/home)
Side-effects:
- will use os call to open a pdf with default program
"""
print "loading the NIPS publications dataset..."
pubs = loadPubs('pubs_nips')
# get urls that correspond to publications with deep in title
p = [x['pdf'] for x in pubs if 'deep' in x['title'].lower()]
if len(p)>5:
print "oops too many (%d) results! Only opening random 5." % (len(p),)
p=p[:5]
openPDFs(p)
if __name__ == '__main__':
demo2()