Skip to main content
. 2023 Nov 4;9(11):e21828. doi: 10.1016/j.heliyon.2023.e21828
Algorithm 1: LDA's generative process
  • For each document d=1, ,M in the corpus C:
    • 1.
      Sample mixing probability θdDir(α)
    • 2.
      For each of V words wdi:
      • a)
        Select a topic zdi{1,,K} Multinomial (θd)
      • b)
        Select a word wdi{1,..,V} Multinomial (βzdi)