Skip to content

Commit

Permalink
Added interactive figures to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
x-tabdeveloping committed Nov 25, 2024
1 parent ff2edfd commit 15f08be
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 7 deletions.
6 changes: 3 additions & 3 deletions docs/KeyNMF.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ pip install plotly
```

```python
model.plot_topics_over_time(top_k=5)
model.plot_topics_over_time()
```

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

### Online Topic Modeling
Expand Down
6 changes: 3 additions & 3 deletions docs/dynamic.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ pip install plotly
```

```python
model.plot_topics_over_time(top_k=5)
model.plot_topics_over_time()
```

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

## API reference
Expand Down
14 changes: 14 additions & 0 deletions docs/images/dynamic_keynmf.html

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions docs/images/dynamic_s3.html

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion docs/s3.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ Temporally changing components are found using the following steps:
3. Estimate term importances for each time slice the same way as the global model.

```python
from datetime import datetime
from turftopic import SemanticSignalSeparation

ts: list[datetime] = [datetime(year=2018, month=2, day=12), ...]
corpus: list[str] = ["First document", ...]

model = SemanticSignalSeparation(10).fit_dynamic(corpus, timestamps=ts, bins=10)
model.plot_topics_over_time()
```
Expand All @@ -77,8 +81,10 @@ model.plot_topics_over_time()
This is because topics are not proportional in $S^3$, and can tip below zero.
In the timeslices where a topic is below zero, its **negative definition** is displayed.



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

Expand Down

0 comments on commit 15f08be

Please sign in to comment.