Skip to content

Commit cab4c5a

Browse files
authored
Merge pull request #78 from machine-intelligence-laboratory/release/v0-8-0
TopicNet v0.8.0
2 parents 15e6e30 + 1d00530 commit cab4c5a

File tree

97 files changed

+7758
-4066
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+7758
-4066
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
build/
33
dist/
44

5+
topicnet/dataset_manager/*__internals
6+
topicnet/tests/test_data/*__internals

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cache:
55
- $HOME/.ccache
66

77
python:
8-
- "3.6"
8+
- "3.7"
99

1010
env:
1111
global:
@@ -31,8 +31,8 @@ install:
3131

3232
script:
3333
- cd topicnet
34-
- py.test . --timeout=60 --cov
34+
- py.test tests -k "not tests/test_pipeline.py" --timeout=45 --reruns 3 --reruns-delay 3 --cov
35+
# TODO: - py.test tests --timeout=45 --reruns 3 --reruns-delay 3 --cov
3536

3637
after_success:
3738
- codecov
38-

README.md

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h1 align="center">TopicNet</h2>
1+
<h1 align="center">TopicNet</h1>
22
<img align="right" height="15%" width="15%" src="https://avatars3.githubusercontent.com/u/49844788?s=200&v=4" style="max-width:100%;">
33

44
<div align="center">
@@ -31,9 +31,9 @@ It aims at automating model training routine freeing more time for artistic proc
3131

3232
Consider using TopicNet if:
3333

34-
* you want to explore BigARTM functionality without writing an overhead.
35-
* you need help with rapid solution prototyping.
36-
* you want to build a good topic model quickly (out-of-box, with default parameters).
34+
* you want to explore BigARTM functionality without writing an overhead;
35+
* you need help with rapid solution prototyping;
36+
* you want to build a good topic model quickly (out-of-box, with default parameters);
3737
* you have an ARTM model at hand and you want to explore it's topics.
3838

3939
`TopicNet` provides an infrastructure for your prototyping with the help of `Experiment` class and helps to observe results of your actions via [`viewers`](topicnet/viewers) module.
@@ -351,7 +351,20 @@ parameters:[
351351
]
352352
```
353353

354+
# Contribution
355+
356+
If you find a bug, or if you would like the library to have some new features — you are welcome to contact us or create an issue or a pull request!
357+
358+
It also worth noting that TopicNet library is always open to improvements in several areas:
359+
360+
* New custom regularizers.
361+
* New topic model scores.
362+
* New topic models or recipes to train topic models for a particular task/with some special properties.
363+
* New datasets (so as to make them available for everyone to download and conduct experiments with topic models).
364+
365+
354366
# Citing TopicNet
367+
355368
When citing `topicnet` in academic papers and theses, please use this BibTeX entry:
356369

357370
```

docs/cooking_machine/config_parser.html

+273-121
Large diffs are not rendered by default.

docs/cooking_machine/cubes/base_cube.html

+42-26
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
6-
<meta name="generator" content="pdoc 0.6.3" />
6+
<meta name="generator" content="pdoc 0.8.1" />
77
<title>topicnet.cooking_machine.cubes.base_cube API documentation</title>
88
<meta name="description" content="" />
99
<link href='https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.0/normalize.min.css' rel='stylesheet'>
1010
<link href='https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/8.0.0/sanitize.min.css' rel='stylesheet'>
1111
<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css" rel="stylesheet">
12-
<style>.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{font-weight:bold}#index h4 + ul{margin-bottom:.6em}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase;cursor:pointer}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
13-
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
12+
<style>.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
13+
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
1414
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
1515
</head>
1616
<body>
@@ -21,7 +21,9 @@ <h1 class="title">Module <code>topicnet.cooking_machine.cubes.base_cube</code></
2121
</header>
2222
<section id="section-intro">
2323
<details class="source">
24-
<summary>Source code</summary>
24+
<summary>
25+
<span>Expand source code</span>
26+
</summary>
2527
<pre><code class="python">import os
2628
from tqdm import tqdm
2729
import warnings
@@ -384,7 +386,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
384386
<span>def <span class="ident">check_experiment_existence</span></span>(<span>topic_model)</span>
385387
</code></dt>
386388
<dd>
387-
<section class="desc"><p>Checks if topic_model has experiment.</p>
389+
<div class="desc"><p>Checks if topic_model has experiment.</p>
388390
<h2 id="parameters">Parameters</h2>
389391
<dl>
390392
<dt><strong><code>topic_model</code></strong> :&ensp;<code>TopicModel</code></dt>
@@ -394,9 +396,11 @@ <h2 id="returns">Returns</h2>
394396
<dl>
395397
<dt><code>bool</code></dt>
396398
<dd>True if experiment exists, in other case False.</dd>
397-
</dl></section>
399+
</dl></div>
398400
<details class="source">
399-
<summary>Source code</summary>
401+
<summary>
402+
<span>Expand source code</span>
403+
</summary>
400404
<pre><code class="python">def check_experiment_existence(topic_model):
401405
&#34;&#34;&#34;
402406
Checks if topic_model has experiment.
@@ -421,9 +425,11 @@ <h2 id="returns">Returns</h2>
421425
<span>def <span class="ident">get_from_queue_till_fail</span></span>(<span>queue, error_message='')</span>
422426
</code></dt>
423427
<dd>
424-
<section class="desc"></section>
428+
<div class="desc"></div>
425429
<details class="source">
426-
<summary>Source code</summary>
430+
<summary>
431+
<span>Expand source code</span>
432+
</summary>
427433
<pre><code class="python">def get_from_queue_till_fail(queue, error_message=&#39;&#39;,):
428434
return queue.get()</code></pre>
429435
</details>
@@ -432,9 +438,11 @@ <h2 id="returns">Returns</h2>
432438
<span>def <span class="ident">put_to_queue</span></span>(<span>queue, puttable)</span>
433439
</code></dt>
434440
<dd>
435-
<section class="desc"></section>
441+
<div class="desc"></div>
436442
<details class="source">
437-
<summary>Source code</summary>
443+
<summary>
444+
<span>Expand source code</span>
445+
</summary>
438446
<pre><code class="python">def put_to_queue(queue, puttable):
439447
queue.put(puttable)</code></pre>
440448
</details>
@@ -443,9 +451,11 @@ <h2 id="returns">Returns</h2>
443451
<span>def <span class="ident">retrieve_score_for_strategy</span></span>(<span>score_name=None)</span>
444452
</code></dt>
445453
<dd>
446-
<section class="desc"></section>
454+
<div class="desc"></div>
447455
<details class="source">
448-
<summary>Source code</summary>
456+
<summary>
457+
<span>Expand source code</span>
458+
</summary>
449459
<pre><code class="python">def retrieve_score_for_strategy(score_name=None):
450460
if not score_name:
451461
score_name = &#39;PerplexityScore@all&#39;
@@ -468,7 +478,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
468478
<span>(</span><span>num_iter, action=None, reg_search='grid', strategy=None, tracked_score_function=None, verbose=False, separate_thread=True)</span>
469479
</code></dt>
470480
<dd>
471-
<section class="desc"><p>Abstract class for all cubes.</p>
481+
<div class="desc"><p>Abstract class for all cubes.</p>
472482
<p>Initialize stage.
473483
Checks params and update .parameters attribute.</p>
474484
<h2 id="parameters">Parameters</h2>
@@ -489,9 +499,11 @@ <h2 id="parameters">Parameters</h2>
489499
<dd>visualization flag</dd>
490500
<dt><strong><code>separate_thread</code></strong> :&ensp;<code>bool</code></dt>
491501
<dd>will train models inside a separate thread if True</dd>
492-
</dl></section>
502+
</dl></div>
493503
<details class="source">
494-
<summary>Source code</summary>
504+
<summary>
505+
<span>Expand source code</span>
506+
</summary>
495507
<pre><code class="python">class BaseCube:
496508
&#34;&#34;&#34;
497509
Abstract class for all cubes.
@@ -785,32 +797,34 @@ <h2 id="parameters">Parameters</h2>
785797
</details>
786798
<h3>Subclasses</h3>
787799
<ul class="hlist">
788-
<li><a title="topicnet.cooking_machine.cubes.regularizer_cube.RegularizersModifierCube" href="regularizer_cube.html#topicnet.cooking_machine.cubes.regularizer_cube.RegularizersModifierCube">RegularizersModifierCube</a></li>
789800
<li><a title="topicnet.cooking_machine.cubes.controller_cube.RegularizationControllerCube" href="controller_cube.html#topicnet.cooking_machine.cubes.controller_cube.RegularizationControllerCube">RegularizationControllerCube</a></li>
790801
<li><a title="topicnet.cooking_machine.cubes.cube_creator.CubeCreator" href="cube_creator.html#topicnet.cooking_machine.cubes.cube_creator.CubeCreator">CubeCreator</a></li>
802+
<li><a title="topicnet.cooking_machine.cubes.regularizer_cube.RegularizersModifierCube" href="regularizer_cube.html#topicnet.cooking_machine.cubes.regularizer_cube.RegularizersModifierCube">RegularizersModifierCube</a></li>
791803
</ul>
792804
<h3>Methods</h3>
793805
<dl>
794806
<dt id="topicnet.cooking_machine.cubes.base_cube.BaseCube.apply"><code class="name flex">
795807
<span>def <span class="ident">apply</span></span>(<span>self, topic_model, one_cube_parameter, dictionary=None, model_id=None)</span>
796808
</code></dt>
797809
<dd>
798-
<section class="desc"><p>"apply" method changes topic_model in way that is defined by one_cube_parameter.</p>
810+
<div class="desc"><p>"apply" method changes topic_model in way that is defined by one_cube_parameter.</p>
799811
<h2 id="parameters">Parameters</h2>
800812
<dl>
801813
<dt><strong><code>topic_model</code></strong> :&ensp;<code>TopicModel</code></dt>
802814
<dd>topic model</dd>
803-
<dt><strong><code>one_cube_parameter</code></strong> :&ensp;optional</dt>
815+
<dt><strong><code>one_cube_parameter</code></strong> :&ensp;<code>optional</code></dt>
804816
<dd>parameters of one experiment</dd>
805817
<dt><strong><code>dictionary</code></strong> :&ensp;<code>dict</code></dt>
806818
<dd>dictionary so that the it can be used
807819
on the basis of the model (Default value = None)</dd>
808820
<dt><strong><code>model_id</code></strong> :&ensp;<code>str</code></dt>
809821
<dd>id of created model if necessary (Default value = None)</dd>
810822
</dl>
811-
<h2 id="returns">Returns</h2></section>
823+
<h2 id="returns">Returns</h2></div>
812824
<details class="source">
813-
<summary>Source code</summary>
825+
<summary>
826+
<span>Expand source code</span>
827+
</summary>
814828
<pre><code class="python">def apply(self, topic_model, one_cube_parameter, dictionary=None, model_id=None):
815829
&#34;&#34;&#34;
816830
&#34;apply&#34; method changes topic_model in way that is defined by one_cube_parameter.
@@ -838,15 +852,17 @@ <h2 id="returns">Returns</h2></section>
838852
<span>def <span class="ident">get_jsonable_from_parameters</span></span>(<span>self)</span>
839853
</code></dt>
840854
<dd>
841-
<section class="desc"><p>Transform self.parameters to something that can be downloaded as json.</p>
855+
<div class="desc"><p>Transform self.parameters to something that can be downloaded as json.</p>
842856
<h2 id="parameters">Parameters</h2>
843857
<h2 id="returns">Returns</h2>
844858
<dl>
845-
<dt>optional</dt>
859+
<dt><code>optional</code></dt>
846860
<dd>something jsonable</dd>
847-
</dl></section>
861+
</dl></div>
848862
<details class="source">
849-
<summary>Source code</summary>
863+
<summary>
864+
<span>Expand source code</span>
865+
</summary>
850866
<pre><code class="python">def get_jsonable_from_parameters(self):
851867
&#34;&#34;&#34;
852868
Transform self.parameters to something that can be downloaded as json.
@@ -902,7 +918,7 @@ <h4><code><a title="topicnet.cooking_machine.cubes.base_cube.BaseCube" href="#to
902918
</nav>
903919
</main>
904920
<footer id="footer">
905-
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.6.3</a>.</p>
921+
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.8.1</a>.</p>
906922
</footer>
907923
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
908924
<script>hljs.initHighlightingOnLoad()</script>

0 commit comments

Comments
 (0)