Skip to content

Commit

Permalink
Merge pull request #78 from machine-intelligence-laboratory/release/v…
Browse files Browse the repository at this point in the history
…0-8-0

TopicNet v0.8.0
  • Loading branch information
Alvant authored Jul 6, 2020
2 parents 15e6e30 + 1d00530 commit cab4c5a
Show file tree
Hide file tree
Showing 97 changed files with 7,758 additions and 4,066 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
build/
dist/

topicnet/dataset_manager/*__internals
topicnet/tests/test_data/*__internals
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cache:
- $HOME/.ccache

python:
- "3.6"
- "3.7"

env:
global:
Expand All @@ -31,8 +31,8 @@ install:

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

after_success:
- codecov

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

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

Consider using TopicNet if:

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

`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.
Expand Down Expand Up @@ -351,7 +351,20 @@ parameters:[
]
```

# Contribution

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!

It also worth noting that TopicNet library is always open to improvements in several areas:

* New custom regularizers.
* New topic model scores.
* New topic models or recipes to train topic models for a particular task/with some special properties.
* New datasets (so as to make them available for everyone to download and conduct experiments with topic models).


# Citing TopicNet

When citing `topicnet` in academic papers and theses, please use this BibTeX entry:

```
Expand Down
394 changes: 273 additions & 121 deletions docs/cooking_machine/config_parser.html

Large diffs are not rendered by default.

68 changes: 42 additions & 26 deletions docs/cooking_machine/cubes/base_cube.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.6.3" />
<meta name="generator" content="pdoc 0.8.1" />
<title>topicnet.cooking_machine.cubes.base_cube API documentation</title>
<meta name="description" content="" />
<link href='https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.0/normalize.min.css' rel='stylesheet'>
<link href='https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/8.0.0/sanitize.min.css' rel='stylesheet'>
<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css" rel="stylesheet">
<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>
<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>
<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>
<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>
<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>
</head>
<body>
Expand All @@ -21,7 +21,9 @@ <h1 class="title">Module <code>topicnet.cooking_machine.cubes.base_cube</code></
</header>
<section id="section-intro">
<details class="source">
<summary>Source code</summary>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">import os
from tqdm import tqdm
import warnings
Expand Down Expand Up @@ -384,7 +386,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
<span>def <span class="ident">check_experiment_existence</span></span>(<span>topic_model)</span>
</code></dt>
<dd>
<section class="desc"><p>Checks if topic_model has experiment.</p>
<div class="desc"><p>Checks if topic_model has experiment.</p>
<h2 id="parameters">Parameters</h2>
<dl>
<dt><strong><code>topic_model</code></strong> :&ensp;<code>TopicModel</code></dt>
Expand All @@ -394,9 +396,11 @@ <h2 id="returns">Returns</h2>
<dl>
<dt><code>bool</code></dt>
<dd>True if experiment exists, in other case False.</dd>
</dl></section>
</dl></div>
<details class="source">
<summary>Source code</summary>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def check_experiment_existence(topic_model):
&#34;&#34;&#34;
Checks if topic_model has experiment.
Expand All @@ -421,9 +425,11 @@ <h2 id="returns">Returns</h2>
<span>def <span class="ident">get_from_queue_till_fail</span></span>(<span>queue, error_message='')</span>
</code></dt>
<dd>
<section class="desc"></section>
<div class="desc"></div>
<details class="source">
<summary>Source code</summary>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def get_from_queue_till_fail(queue, error_message=&#39;&#39;,):
return queue.get()</code></pre>
</details>
Expand All @@ -432,9 +438,11 @@ <h2 id="returns">Returns</h2>
<span>def <span class="ident">put_to_queue</span></span>(<span>queue, puttable)</span>
</code></dt>
<dd>
<section class="desc"></section>
<div class="desc"></div>
<details class="source">
<summary>Source code</summary>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def put_to_queue(queue, puttable):
queue.put(puttable)</code></pre>
</details>
Expand All @@ -443,9 +451,11 @@ <h2 id="returns">Returns</h2>
<span>def <span class="ident">retrieve_score_for_strategy</span></span>(<span>score_name=None)</span>
</code></dt>
<dd>
<section class="desc"></section>
<div class="desc"></div>
<details class="source">
<summary>Source code</summary>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def retrieve_score_for_strategy(score_name=None):
if not score_name:
score_name = &#39;PerplexityScore@all&#39;
Expand All @@ -468,7 +478,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
<span>(</span><span>num_iter, action=None, reg_search='grid', strategy=None, tracked_score_function=None, verbose=False, separate_thread=True)</span>
</code></dt>
<dd>
<section class="desc"><p>Abstract class for all cubes.</p>
<div class="desc"><p>Abstract class for all cubes.</p>
<p>Initialize stage.
Checks params and update .parameters attribute.</p>
<h2 id="parameters">Parameters</h2>
Expand All @@ -489,9 +499,11 @@ <h2 id="parameters">Parameters</h2>
<dd>visualization flag</dd>
<dt><strong><code>separate_thread</code></strong> :&ensp;<code>bool</code></dt>
<dd>will train models inside a separate thread if True</dd>
</dl></section>
</dl></div>
<details class="source">
<summary>Source code</summary>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class BaseCube:
&#34;&#34;&#34;
Abstract class for all cubes.
Expand Down Expand Up @@ -785,32 +797,34 @@ <h2 id="parameters">Parameters</h2>
</details>
<h3>Subclasses</h3>
<ul class="hlist">
<li><a title="topicnet.cooking_machine.cubes.regularizer_cube.RegularizersModifierCube" href="regularizer_cube.html#topicnet.cooking_machine.cubes.regularizer_cube.RegularizersModifierCube">RegularizersModifierCube</a></li>
<li><a title="topicnet.cooking_machine.cubes.controller_cube.RegularizationControllerCube" href="controller_cube.html#topicnet.cooking_machine.cubes.controller_cube.RegularizationControllerCube">RegularizationControllerCube</a></li>
<li><a title="topicnet.cooking_machine.cubes.cube_creator.CubeCreator" href="cube_creator.html#topicnet.cooking_machine.cubes.cube_creator.CubeCreator">CubeCreator</a></li>
<li><a title="topicnet.cooking_machine.cubes.regularizer_cube.RegularizersModifierCube" href="regularizer_cube.html#topicnet.cooking_machine.cubes.regularizer_cube.RegularizersModifierCube">RegularizersModifierCube</a></li>
</ul>
<h3>Methods</h3>
<dl>
<dt id="topicnet.cooking_machine.cubes.base_cube.BaseCube.apply"><code class="name flex">
<span>def <span class="ident">apply</span></span>(<span>self, topic_model, one_cube_parameter, dictionary=None, model_id=None)</span>
</code></dt>
<dd>
<section class="desc"><p>"apply" method changes topic_model in way that is defined by one_cube_parameter.</p>
<div class="desc"><p>"apply" method changes topic_model in way that is defined by one_cube_parameter.</p>
<h2 id="parameters">Parameters</h2>
<dl>
<dt><strong><code>topic_model</code></strong> :&ensp;<code>TopicModel</code></dt>
<dd>topic model</dd>
<dt><strong><code>one_cube_parameter</code></strong> :&ensp;optional</dt>
<dt><strong><code>one_cube_parameter</code></strong> :&ensp;<code>optional</code></dt>
<dd>parameters of one experiment</dd>
<dt><strong><code>dictionary</code></strong> :&ensp;<code>dict</code></dt>
<dd>dictionary so that the it can be used
on the basis of the model (Default value = None)</dd>
<dt><strong><code>model_id</code></strong> :&ensp;<code>str</code></dt>
<dd>id of created model if necessary (Default value = None)</dd>
</dl>
<h2 id="returns">Returns</h2></section>
<h2 id="returns">Returns</h2></div>
<details class="source">
<summary>Source code</summary>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def apply(self, topic_model, one_cube_parameter, dictionary=None, model_id=None):
&#34;&#34;&#34;
&#34;apply&#34; method changes topic_model in way that is defined by one_cube_parameter.
Expand Down Expand Up @@ -838,15 +852,17 @@ <h2 id="returns">Returns</h2></section>
<span>def <span class="ident">get_jsonable_from_parameters</span></span>(<span>self)</span>
</code></dt>
<dd>
<section class="desc"><p>Transform self.parameters to something that can be downloaded as json.</p>
<div class="desc"><p>Transform self.parameters to something that can be downloaded as json.</p>
<h2 id="parameters">Parameters</h2>
<h2 id="returns">Returns</h2>
<dl>
<dt>optional</dt>
<dt><code>optional</code></dt>
<dd>something jsonable</dd>
</dl></section>
</dl></div>
<details class="source">
<summary>Source code</summary>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def get_jsonable_from_parameters(self):
&#34;&#34;&#34;
Transform self.parameters to something that can be downloaded as json.
Expand Down Expand Up @@ -902,7 +918,7 @@ <h4><code><a title="topicnet.cooking_machine.cubes.base_cube.BaseCube" href="#to
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.6.3</a>.</p>
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.8.1</a>.</p>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad()</script>
Expand Down
Loading

0 comments on commit cab4c5a

Please sign in to comment.