You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -735,17 +736,18 @@ During the model training, all texts in the data have been assigned to a topic d
735
736
You can also use the model to infer the topics of previously unseen texts based on the same model:
736
737
737
738
```python
738
-
topics, probs = topic_model.transform(["A short text about scientific discoveries"])
739
+
topics, probs = topic_model.transform(["a short text about water"])
739
740
print(topics, probs)
740
741
```
741
742
742
743
```output
743
-
[31] [0.47929027]
744
+
[20] [1.]
744
745
```
745
746
746
-
This example was assigned to topic 31, with a probability of 0.479.
747
-
Again, these numbers will be slightly different per run.
748
-
The model can even assign multiple topics to a text, the `topics` and `probs` lists contain the according number of values.
747
+
This example was assigned to topic 20, with a score of 1.0.
748
+
Again, these numbers can vary per run.
749
+
For less trivial sentences, the model can assign multiple topics to a text.
750
+
In that case, the `topics` and `probs` lists contain the according number of values.
749
751
750
752
::: challenge
751
753
@@ -758,11 +760,15 @@ The model can even assign multiple topics to a text, the `topics` and `probs` li
758
760
::: solution
759
761
760
762
1. There is no general 'true' label for a topic, but looking at the top word of a topic should give an idea of the concept(s) it refers to, for instance:
761
-
`['mary', 'gloria', 'edna', 'miss', 'madame']` -> 'female names and titles'
0 commit comments