Skip to content

Commit 15f08be

Browse files
Added interactive figures to docs
1 parent ff2edfd commit 15f08be

5 files changed

Lines changed: 41 additions & 7 deletions

File tree

docs/KeyNMF.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,12 @@ pip install plotly
221221
```
222222

223223
```python
224-
model.plot_topics_over_time(top_k=5)
224+
model.plot_topics_over_time()
225225
```
226226

227227
<figure>
228-
<img src="../images/dynamic_keynmf.png" width="50%" style="margin-left: auto;margin-right: auto;">
229-
<figcaption>Topics over time on a Figure</figcaption>
228+
<iframe src="../images/dynamic_keynmf.html", title="Topics over time", style="height:800px;width:1000px;padding:0px;border:none;"></iframe>
229+
<figcaption> Topics over time in a Dynamic KeyNMF model. </figcaption>
230230
</figure>
231231

232232
### Online Topic Modeling

docs/dynamic.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ pip install plotly
7070
```
7171

7272
```python
73-
model.plot_topics_over_time(top_k=5)
73+
model.plot_topics_over_time()
7474
```
7575

7676
<figure>
77-
<img src="../images/dynamic_keynmf.png" width="80%" style="margin-left: auto;margin-right: auto;">
78-
<figcaption>Topics over time on a Figure</figcaption>
77+
<iframe src="../images/dynamic_keynmf.html", title="Topics over time", style="height:800px;width:1000px;padding:0px;border:none;"></iframe>
78+
<figcaption> Topics over time in a Dynamic KeyNMF model. </figcaption>
7979
</figure>
8080

8181
## API reference

docs/images/dynamic_keynmf.html

Lines changed: 14 additions & 0 deletions
Large diffs are not rendered by default.

docs/images/dynamic_s3.html

Lines changed: 14 additions & 0 deletions
Large diffs are not rendered by default.

docs/s3.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,12 @@ Temporally changing components are found using the following steps:
6666
3. Estimate term importances for each time slice the same way as the global model.
6767

6868
```python
69+
from datetime import datetime
6970
from turftopic import SemanticSignalSeparation
7071

72+
ts: list[datetime] = [datetime(year=2018, month=2, day=12), ...]
73+
corpus: list[str] = ["First document", ...]
74+
7175
model = SemanticSignalSeparation(10).fit_dynamic(corpus, timestamps=ts, bins=10)
7276
model.plot_topics_over_time()
7377
```
@@ -77,8 +81,10 @@ model.plot_topics_over_time()
7781
This is because topics are not proportional in $S^3$, and can tip below zero.
7882
In the timeslices where a topic is below zero, its **negative definition** is displayed.
7983

84+
85+
8086
<figure>
81-
<img src="../images/dynamic_s3.png" width="85%" style="margin-left: auto;margin-right: auto;">
87+
<iframe src="../images/dynamic_s3.html", title="Topics over time", style="height:800px;width:1000px;padding:0px;border:none;"></iframe>
8288
<figcaption> Topics over time in a dynamic Semantic Signal Separation model. </figcaption>
8389
</figure>
8490

0 commit comments

Comments
 (0)