Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to train a model using the whole corpus (ignoring partitions) #34

Closed
cayaluke opened this issue Oct 26, 2021 · 2 comments
Closed

how to train a model using the whole corpus (ignoring partitions) #34

cayaluke opened this issue Oct 26, 2021 · 2 comments

Comments

@cayaluke
Copy link

Dear Silvia,

Love your work!

I have a silly question. How do you train a model using the entire corpus (ignoring partitions)?

Thank you for your help.

Luke

@silviatti
Copy link
Collaborator

Hello!
Thank you for using OCTIS :)

Not a silly question because I've realized there's something to fix in the code and in the documentation :)
Every model has a method called "partitioning". If you pass "False" then the whole dataset will be used as training, the dataset will be split (as the default). You must call this method before training or optimization. For example:

model = ETM(num_topics=25) 
model.partitioning(False)
model_output = model.train_model(dataset) 

However, some models have also the parameter "use_partitions" in the initialization which can be set to "False" to obtain the same effect. I think this is probably the easiest way to do it, but not all models have this parameter (it seems everyone has it except LSI and LDA). I think I'm going to fix this for the next release. See the example below:

model = ETM(num_topics=25, use_partitions=False) 
model_output = model.train_model(dataset) 

Thank you for your patience.

Silvia

@cayaluke
Copy link
Author

Thank you for your response.

It worked.

Grazie mille!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants