Skip to content

Commit

Permalink
notebook edits
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhusson committed Dec 18, 2016
1 parent 9532e7c commit 15787bd
Show file tree
Hide file tree
Showing 2 changed files with 300 additions and 63 deletions.
85 changes: 64 additions & 21 deletions notebooks/1_candidate_generation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"source": [
"from snorkel.models import Sentence\n",
"\n",
"sentences = session.query(Sentence).limit(10000).all()"
"sentences = session.query(Sentence).limit(200000).all()"
]
},
{
Expand All @@ -57,7 +57,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -208,11 +208,11 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[========================================] 100% ] 0%\n",
"\n",
"CPU times: user 46.4 s, sys: 5.86 s, total: 52.3 s\n",
"Wall time: 1min 1s\n",
"Number of candidates: 36\n"
"\n",
"CPU times: user 9min 18s, sys: 12.2 s, total: 9min 30s\n",
"Wall time: 11min 17s\n",
"Number of candidates: 139\n"
]
}
],
Expand Down Expand Up @@ -249,24 +249,14 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"StromStrat(Span(\"stromatolites\", parent=12144, chars=[117,129], words=[18,18]), Span(\"Rae Group\", parent=12144, chars=[138,146], words=[21,22]))\n"
]
}
],
"outputs": [],
"source": [
"from snorkel.models import CandidateSet\n",
"c = session.query(CandidateSet).filter(CandidateSet.name == 'Candidate Set').one()\n",
"c=c.candidates[-5]\n",
"print c"
"c = session.query(CandidateSet).filter(CandidateSet.name == 'Candidate Set').one()\n"
]
},
{
Expand All @@ -284,7 +274,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 6,
"metadata": {
"collapsed": false,
"scrolled": true
Expand Down Expand Up @@ -644,7 +634,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 7,
"metadata": {
"collapsed": false
},
Expand All @@ -653,6 +643,47 @@
"sv"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"StromStrat(Span(\"stromatolitic\", parent=12007, chars=[41,53], words=[7,7]), Span(\"Reynolds Point Formation\", parent=12007, chars=[78,101], words=[12,14]))"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sv.get_selected()"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Sentence(Document 54b43244e138239d8684934a, 47, u'Additional work , carried out in the summer of 1975 , has shown that elongate stromatolites are also present in the overlying Reynolds Point Formation .')\n"
]
}
],
"source": [
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -746,6 +777,18 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.11"
},
"widgets": {
"state": {
"805e1e8d6ca24bf982841aa75c864a05": {
"views": [
{
"cell_index": 24
}
]
}
},
"version": "1.2.0"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 15787bd

Please sign in to comment.