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

Can CTM return topic_significance_uniform score? #23

Closed
inceatakan opened this issue Jul 7, 2021 · 1 comment
Closed

Can CTM return topic_significance_uniform score? #23

inceatakan opened this issue Jul 7, 2021 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@inceatakan
Copy link

  • OCTIS version:
  • Python version:
  • Operating System:

Description

Currently, CTM returns only topic_significance_background score. Is it possible to get topic_significance_uniform score (per topic)?

Thanks,
-Atakan

What I Did

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
@silviatti silviatti self-assigned this Jul 8, 2021
@silviatti silviatti added the question Further information is requested label Jul 8, 2021
@silviatti
Copy link
Collaborator

Hi, what do you mean by "CTM returns only topic_significance_background score"? Can you show a code snippet?
Once you get the model output, you can use it to compute every other evaluation metric that you like. For example:

from octis.evaluation_metrics.significance_metrics import KL_uniform
from octis.evaluation_metrics.significance_metrics import KL_background

kl_u = KL_uniform() # Initialize metric
kl_b = KL_background() # Initialize metric

model = CTM(num_topics=25)  
model_output = model.train_model(dataset) 
kl_b_score = kl_b.score(model_output) # Compute KL-background score
kl_u_score = kl_u.score(model_output,per_topic=true) # Compute KL-uniform score

Hope this helped :)

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

No branches or pull requests

2 participants