Skip to content

Instantly share code, notes, and snippets.

View eomlocal's full-sized avatar

Eom Local eomlocal

  • Seoul, South Korea
View GitHub Profile
from konlpy.tag import Kkma
from konlpy.utils import pprint
from collections import Counter
import random
def p_topic_given_document(topic, d, alpha=0.1):
return ((document_topic_counts[d][topic] + alpha) /
(document_lengths[d] + K * alpha))
def p_word_given_topic(word, topic, beta=0.1):
return ((topic_word_counts[topic][word] + beta) /
(topic_counts[topic] + V * beta))
import tensorflow as tf
import matplotlib.pyplot as plt
import math
import numpy as np
from sklearn.datasets import load_iris
data=load_iris()