Skip to content

Commit

Permalink
update requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
timini committed Apr 16, 2016
1 parent f0218fd commit 2faafdc
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 40 deletions.
2 changes: 1 addition & 1 deletion data/01 API Wrangling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {
"collapsed": false
},
Expand Down
98 changes: 59 additions & 39 deletions data/LDA Topic modelling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {
"collapsed": true
"collapsed": false
},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/tim/Workspace/projects/hansard/data/venv/lib/python3.4/site-packages/numpy/lib/utils.py:99: DeprecationWarning: `scipy.sparse.sparsetools` is deprecated!\n",
"scipy.sparse.sparsetools is a private module for scipy.sparse, and should not be used.\n",
" warnings.warn(depdoc, DeprecationWarning)\n"
]
}
],
"source": [
"from gensim import corpora, models, similarities\n",
"import logging\n",
Expand All @@ -19,7 +29,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {
"collapsed": false
},
Expand All @@ -28,37 +38,59 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Dictionary(70996 unique tokens: ['coalowners', 'surd', 'branchof', 'carnal', 'proemium']...)\n",
"Dictionary(70996 unique tokens: ['allu', 'rum', 'nilly', 'belly', 'freely']...)\n",
"MmCorpus(315358 documents, 45481 features, 29827150 non-zero entries)\n",
"LdaModel(num_terms=45481, num_topics=100, decay=0.5, chunksize=2000)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/tim/Workspace/projects/hansard/data/venv/lib/python3.4/site-packages/IPython/core/formatters.py:92: DeprecationWarning: DisplayFormatter._ipython_display_formatter_default is deprecated: use @default decorator instead.\n",
" def _ipython_display_formatter_default(self):\n",
"/home/tim/Workspace/projects/hansard/data/venv/lib/python3.4/site-packages/IPython/core/formatters.py:98: DeprecationWarning: DisplayFormatter._formatters_default is deprecated: use @default decorator instead.\n",
" def _formatters_default(self):\n",
"/home/tim/Workspace/projects/hansard/data/venv/lib/python3.4/site-packages/IPython/core/formatters.py:677: DeprecationWarning: PlainTextFormatter._deferred_printers_default is deprecated: use @default decorator instead.\n",
" def _deferred_printers_default(self):\n",
"/home/tim/Workspace/projects/hansard/data/venv/lib/python3.4/site-packages/IPython/core/formatters.py:669: DeprecationWarning: PlainTextFormatter._singleton_printers_default is deprecated: use @default decorator instead.\n",
" def _singleton_printers_default(self):\n",
"/home/tim/Workspace/projects/hansard/data/venv/lib/python3.4/site-packages/IPython/core/formatters.py:672: DeprecationWarning: PlainTextFormatter._type_printers_default is deprecated: use @default decorator instead.\n",
" def _type_printers_default(self):\n",
"/home/tim/Workspace/projects/hansard/data/venv/lib/python3.4/site-packages/IPython/core/formatters.py:669: DeprecationWarning: PlainTextFormatter._singleton_printers_default is deprecated: use @default decorator instead.\n",
" def _singleton_printers_default(self):\n",
"/home/tim/Workspace/projects/hansard/data/venv/lib/python3.4/site-packages/IPython/core/formatters.py:672: DeprecationWarning: PlainTextFormatter._type_printers_default is deprecated: use @default decorator instead.\n",
" def _type_printers_default(self):\n",
"/home/tim/Workspace/projects/hansard/data/venv/lib/python3.4/site-packages/IPython/core/formatters.py:677: DeprecationWarning: PlainTextFormatter._deferred_printers_default is deprecated: use @default decorator instead.\n",
" def _deferred_printers_default(self):\n"
]
},
{
"data": {
"text/plain": [
"[(18,\n",
" '0.036*31976 + 0.011*22699 + 0.010*28431 + 0.010*38433 + 0.009*18689 + 0.009*30381 + 0.009*7153 + 0.008*32032 + 0.008*26206 + 0.008*42742'),\n",
"[(20,\n",
" '0.026*5365 + 0.020*13779 + 0.016*42900 + 0.014*36661 + 0.014*41226 + 0.013*25029 + 0.011*7062 + 0.011*22699 + 0.009*271 + 0.008*35992'),\n",
" (33,\n",
" '0.134*18562 + 0.022*9143 + 0.018*41226 + 0.014*33774 + 0.011*30224 + 0.009*935 + 0.009*39896 + 0.009*28405 + 0.008*25029 + 0.007*34427'),\n",
" (84,\n",
" '0.069*35243 + 0.030*31268 + 0.026*21210 + 0.025*16276 + 0.024*13852 + 0.018*40028 + 0.017*30233 + 0.015*7939 + 0.013*33492 + 0.013*9340'),\n",
" (16,\n",
" '0.124*29293 + 0.015*39896 + 0.014*42900 + 0.014*17682 + 0.013*18616 + 0.011*11925 + 0.010*27729 + 0.010*37183 + 0.010*7756 + 0.008*2257'),\n",
" (71,\n",
" '0.065*634 + 0.062*18562 + 0.055*25049 + 0.018*39896 + 0.018*45132 + 0.012*29433 + 0.010*16745 + 0.009*44007 + 0.007*12491 + 0.007*8643'),\n",
" (87,\n",
" '0.016*38433 + 0.013*935 + 0.012*36661 + 0.010*5152 + 0.010*22699 + 0.010*34810 + 0.008*999 + 0.008*28254 + 0.008*40389 + 0.008*2257'),\n",
" (90,\n",
" '0.036*5848 + 0.030*29343 + 0.027*42009 + 0.023*32039 + 0.023*28912 + 0.021*25029 + 0.015*11321 + 0.013*15676 + 0.011*33297 + 0.009*5679'),\n",
" (22,\n",
" '0.030*3245 + 0.029*15207 + 0.026*37237 + 0.026*15442 + 0.020*34692 + 0.017*44979 + 0.013*7645 + 0.013*33155 + 0.012*8548 + 0.012*20519'),\n",
" (99,\n",
" '0.055*29005 + 0.023*28173 + 0.016*18007 + 0.014*31891 + 0.012*42701 + 0.012*38872 + 0.011*43360 + 0.011*24154 + 0.009*37156 + 0.008*45411'),\n",
" (80,\n",
" '0.035*22699 + 0.025*21781 + 0.024*31976 + 0.022*12492 + 0.014*19891 + 0.013*2994 + 0.011*35992 + 0.010*7153 + 0.009*3678 + 0.009*26124'),\n",
" (70,\n",
" '0.041*389 + 0.030*28978 + 0.020*30498 + 0.020*27094 + 0.019*25469 + 0.018*10519 + 0.014*3606 + 0.012*43205 + 0.011*21568 + 0.011*16772'),\n",
" (94,\n",
" '0.111*41226 + 0.032*11169 + 0.022*28904 + 0.013*41683 + 0.013*29729 + 0.011*40980 + 0.008*10162 + 0.007*935 + 0.007*36433 + 0.005*5150'),\n",
" (48,\n",
" '0.014*13052 + 0.013*25029 + 0.010*20586 + 0.009*36779 + 0.008*38433 + 0.007*11511 + 0.007*935 + 0.006*22699 + 0.006*39195 + 0.006*6203'),\n",
" (2,\n",
" '0.197*33740 + 0.144*26389 + 0.018*293 + 0.011*39896 + 0.010*10162 + 0.007*41226 + 0.007*2257 + 0.007*34739 + 0.007*36433 + 0.006*33666'),\n",
" (6,\n",
" '0.026*4246 + 0.022*42900 + 0.021*15783 + 0.016*24983 + 0.015*20068 + 0.012*7553 + 0.012*19969 + 0.012*24518 + 0.011*19902 + 0.011*8176'),\n",
" (84,\n",
" '0.069*35243 + 0.030*31268 + 0.026*21210 + 0.025*16276 + 0.024*13852 + 0.018*40028 + 0.017*30233 + 0.015*7939 + 0.013*33492 + 0.013*9340'),\n",
" (19,\n",
" '0.053*31912 + 0.034*25547 + 0.025*9643 + 0.017*35943 + 0.016*24147 + 0.016*28243 + 0.014*38433 + 0.012*44050 + 0.012*25416 + 0.012*24164')]"
" '0.111*41226 + 0.032*11169 + 0.022*28904 + 0.013*41683 + 0.013*29729 + 0.011*40980 + 0.008*10162 + 0.007*935 + 0.007*36433 + 0.005*5150')]"
]
},
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -75,32 +107,20 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [
{
"ename": "ImportError",
"evalue": "No module named 'pyLDAvis'",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-3-57ef38871ca1>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mpyLDAvis\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mgensim\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[0mpyLDAvis\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mgensim\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mprepare\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mlda_model\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcorpus\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdictionary\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mImportError\u001b[0m: No module named 'pyLDAvis'"
]
}
],
"outputs": [],
"source": [
"import pyLDAvis.gensim\n",
"\n",
"pyLDAvis.gensim.prepare(lda_model, corpus, dictionary)"
"pyLDAvis.gensim.prepare(lda, corpus, dictionary)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": null,
"metadata": {
"collapsed": true
},
Expand Down
2 changes: 2 additions & 0 deletions data/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Jinja2==2.8
MarkupSafe==0.23
Pygments==2.1.3
backports-abc==0.4
beautifulsoup4==4.4.1
boto==2.39.0
bs4==0.0.1
bz2file==0.98
contextlib2==0.5.1
cycler==0.10.0
Expand Down

0 comments on commit 2faafdc

Please sign in to comment.