Skip to content

Commit 78dabe0

Browse files
authored
Merge pull request #94 from AnFreTh/nstm
Nstm
2 parents e78ed8b + 8276201 commit 78dabe0

File tree

18 files changed

+824
-33
lines changed

18 files changed

+824
-33
lines changed

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<div align="center">
2-
<img src="./docs/images/logos/STREAM_2.jpg" width="400"/>
2+
<a href="#get-started">
3+
<img src="./assets/stream-topic-gif.gif" width="800"/>
4+
</a>
5+
36

47

58
[![PyPI](https://img.shields.io/pypi/v/stream_topic)](https://pypi.org/project/stream_topic)
@@ -24,14 +27,6 @@
2427
<p>We present STREAM, a Simplified Topic Retrieval, Exploration, and Analysis Module for User-Friendly and Interactive Topic Modeling and Visualization. Our paper can be found <a href="https://aclanthology.org/2024.acl-short.41.pdf">here</a>.</p>
2528

2629

27-
28-
<table>
29-
<tr>
30-
<td><img src="./docs/images/gif1.gif" alt="First GIF" width="400"/></td>
31-
<td><img src="./docs/images/gif2.gif" alt="Second GIF" width="400"/></td>
32-
</tr>
33-
</table>
34-
3530
<h2> Table of Contents </h2>
3631

3732

@@ -164,6 +159,10 @@ STREAM offers a variety of neural as well as non-neural topic models and we are
164159
<td><a href="https://arxiv.org/abs/1703.01488">NeuralLDA</a></td>
165160
<td>Autoencoding Variational Inference For Topic Models</td>
166161
</tr>
162+
<tr>
163+
<td><a href="https://arxiv.org/abs/2008.13537">NSTM</a></td>
164+
<td>Neural Topic Model via Optimal Transport</td>
165+
</tr>
167166
</tbody>
168167
</table>
169168
</div>

assets/stream-topic-gif.gif

4.45 MB
Loading

docs/api/models/models.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ Models
4444

4545
.. autoclass:: stream_topic.models.CBC
4646
:members:
47+
48+
.. autoclass:: stream_topic.models.NSTM
49+
:members:

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
"plotly",
6363
"matplotlib",
6464
"gensim",
65-
"octis",
6665
"nltk",
6766
"langdetect",
6867
"loguru",

docs/images/logos/gif1.gif

550 KB
Loading

docs/images/logos/gif2.gif

503 KB
Loading

docs/notebooks/examples.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@
273273
],
274274
"metadata": {
275275
"kernelspec": {
276-
"display_name": "db",
276+
"display_name": "Python (stream_topic_venv)",
277277
"language": "python",
278-
"name": "python3"
278+
"name": "stream_topic_venv"
279279
},
280280
"language_info": {
281281
"codemirror_mode": {

docs/notebooks/quickstart.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@
269269
],
270270
"metadata": {
271271
"kernelspec": {
272-
"display_name": "db",
272+
"display_name": "Python (stream_topic_venv)",
273273
"language": "python",
274-
"name": "python3"
274+
"name": "stream_topic_venv"
275275
},
276276
"language_info": {
277277
"codemirror_mode": {

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ torch==2.4.0
1313
transformers==4.40.2
1414
setfit==1.0.3
1515
gensim==4.2.0
16-
octis==1.13.1
1716
umap-learn==0.5.6
1817
wordcloud==1.9.3
1918

stream_topic/NAM/NAM.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ def __init__(
323323
columns=["text", "tokens"], errors="ignore"
324324
)
325325

326+
if "predictions" in self.structured_data.columns:
327+
self.structured_data = self.structured_data.drop(columns=["predictions"])
328+
326329
self.target_column = target_column
327330

328331
# Combine topic probabilities with structured data
@@ -520,7 +523,6 @@ def forward(self, x):
520523

521524
def training_step(self, batch, batch_idx):
522525
x, y = batch
523-
print(y)
524526
y_hat = self(x)
525527
loss = self.loss_fn(y_hat, y)
526528

0 commit comments

Comments
 (0)