Skip to content

Commit ff2edfd

Browse files
Readded automated topic naming to readme
1 parent dee6294 commit ff2edfd

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,29 @@ model.print_topic_distribution(
133133

134134
</center>
135135

136+
#### Automated Topic Naming
137+
138+
Turftopic now allows you to automatically assign human readable names to topics using LLMs or n-gram retrieval!
139+
140+
```python
141+
from turftopic import KeyNMF
142+
from turftopic.namers import OpenAITopicNamer
143+
144+
model = KeyNMF(10).fit(corpus)
145+
146+
namer = OpenAITopicNamer("gpt-4o-mini")
147+
model.rename_topics(namer)
148+
model.print_topics()
149+
```
150+
151+
| Topic ID | Topic Name | Highest Ranking |
152+
| - | - | - |
153+
| 0 | Operating Systems and Software | windows, dos, os, ms, microsoft, unix, nt, memory, program, apps |
154+
| 1 | Atheism and Belief Systems | atheism, atheist, atheists, belief, religion, religious, theists, beliefs, believe, faith |
155+
| 2 | Computer Architecture and Performance | motherboard, ram, memory, cpu, bios, isa, speed, 486, bus, performance |
156+
| 3 | Storage Technologies | disk, drive, scsi, drives, disks, floppy, ide, dos, controller, boot |
157+
| | ... |
158+
136159
### Visualization
137160

138161
Turftopic does not come with built-in visualization utilities, [topicwizard](https://github.com/x-tabdeveloping/topicwizard), an interactive topic model visualization library, is compatible with all models from Turftopic.

0 commit comments

Comments
 (0)