@@ -53,6 +53,40 @@ Consider using TopicNet if:
53
53
</em>
54
54
</p >
55
55
56
+ And here is sample code of the TopicNet baseline experiment:
57
+
58
+ ``` python
59
+ from topicnet.cooking_machine.config_parser import (
60
+ build_experiment_environment_from_yaml_config
61
+ )
62
+
63
+ from topicnet.cooking_machine.recipes import (
64
+ ARTM_baseline as config_string
65
+ )
66
+
67
+ dataset_path = ' /data/datasets/NIPS/dataset.csv'
68
+
69
+ specific_topics = [f ' spc_topic_ { i} ' for i in range (19 )]
70
+ background_topics = [f ' bcg_topic_ { i} ' for i in range ( 1 )]
71
+
72
+ config_string = config_string.format(
73
+ dataset_path = dataset_path,
74
+ modality_list = [' @word' ],
75
+ main_modality = ' @word' ,
76
+ specific_topics = specific_topics,
77
+ background_topics = background_topics,
78
+ )
79
+ experiment, dataset = (
80
+ build_experiment_environment_from_yaml_config(
81
+ yaml_string = config_string,
82
+ experiment_id = ' sample_config' ,
83
+ save_path = ' sample_save_path' ,
84
+ )
85
+ )
86
+ experiment.run(dataset)
87
+ best_model = experiment.select(' PerplexityScore@all -> min' )[0 ]
88
+ ```
89
+
56
90
57
91
## How to start
58
92
@@ -235,11 +269,11 @@ HTML(html_view)
235
269
236
270
# FAQ
237
271
238
- #### In the example we used to write vw modality like ** @modality ** , is it a VowpallWabbit format?
272
+ ### In the example we used to write vw modality like ** @modality ** , is it a VowpallWabbit format?
239
273
240
274
It is a convention to write data designating modalities with @ sign taken by TopicNet from BigARTM.
241
275
242
- #### CubeCreator helps to perform a grid search over initial model parameters. How can I do it with modalities?
276
+ ### CubeCreator helps to perform a grid search over initial model parameters. How can I do it with modalities?
243
277
244
278
Modality search space can be defined using standart library logic like:
245
279
0 commit comments