This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from konlpy.tag import Kkma | |
from konlpy.utils import pprint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import matplotlib.pyplot as plt | |
import math | |
import numpy as np | |
from sklearn.datasets import load_iris | |
data=load_iris() |