|
1 | 1 | # FASTopic |
2 | 2 |
|
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. |
4 | 4 |
|
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> |
6 | 9 |
|
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 | +``` |
8 | 27 |
|
9 | 28 | ## References |
10 | 29 |
|
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 | + |
12 | 57 |
|
13 | 58 | ## API Reference |
14 | 59 |
|
|
0 commit comments