Skip to content

Commit 796b003

Browse files
Added better FASTopic docs
1 parent e707316 commit 796b003

2 files changed

Lines changed: 49 additions & 4 deletions

File tree

docs/FASTopic.md

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,59 @@
11
# FASTopic
22

3-
FASTopic is a neural topic model based on Dual Semantic-relation Reconstruction.
3+
FASTopic (Wu et al., 2024) is a neural topic model based on Dual Semantic-relation Reconstruction.
44

5-
> Turftopic contains an implementation repurposed for our API, but the implementation is mostly from the [original FASTopic package](https://github.com/BobXWu/FASTopic).
5+
<figure>
6+
<img src="../images/fastopic.png", title="", style="width:1050px;padding:0px;border:none;"></img>
7+
<figcaption> Figure 1: Schematic Overview of the FASTopic Model.<br> <i>Figure from Wu et al. (2024)</i> </figcaption>
8+
</figure>
69

7-
:warning: This part of the documentation is still under construction :warning:
10+
FASTopic, instead of reconstructing Bag-of-words, like classical topic models or VAE-based models do, reconstructs the relations between topics words and documents.
11+
12+
Wu et al. (2025) express semantic relations for this model using the Embedding Transport Plan (ETP) method.
13+
14+
The model uses a combined loss function that helps the model learn semantic relations between topic and word embeddings, and learn to reconstruct these relations.
15+
16+
## Usage
17+
18+
```python
19+
from turftopic import FASTopic
20+
21+
documents = [...]
22+
23+
model = FASTopic(10)
24+
doc_topic_matrix = model.fit_transform(documents)
25+
model.print_topics()
26+
```
827

928
## References
1029

11-
Wu, X., Nguyen, T., Zhang, D. C., Wang, W. Y., & Luu, A. T. (2024). FASTopic: A Fast, Adaptive, Stable, and Transferable Topic Modeling Paradigm. ArXiv Preprint ArXiv:2405.17978.
30+
Please cite the authors of the paper, and Turftopic when using the FASTopic model:
31+
32+
```bibtex
33+
@inproceedings{
34+
wu2024fastopic,
35+
title={{FAST}opic: Pretrained Transformer is a Fast, Adaptive, Stable, and Transferable Topic Model},
36+
author={Xiaobao Wu and Thong Thanh Nguyen and Delvin Ce Zhang and William Yang Wang and Anh Tuan Luu},
37+
booktitle={The Thirty-eighth Annual Conference on Neural Information Processing Systems},
38+
year={2024},
39+
url={https://openreview.net/forum?id=7t6aq0Fa9D}
40+
}
41+
42+
@article{
43+
Kardos2025,
44+
title = {Turftopic: Topic Modelling with Contextual Representations from Sentence Transformers},
45+
doi = {10.21105/joss.08183},
46+
url = {https://doi.org/10.21105/joss.08183},
47+
year = {2025},
48+
publisher = {The Open Journal},
49+
volume = {10},
50+
number = {111},
51+
pages = {8183},
52+
author = {Kardos, Márton and Enevoldsen, Kenneth C. and Kostkan, Jan and Kristensen-McLachlan, Ross Deans and Rocca, Roberta},
53+
journal = {Journal of Open Source Software}
54+
}
55+
```
56+
1257

1358
## API Reference
1459

docs/images/fastopic.png

116 KB
Loading

0 commit comments

Comments
 (0)