摘要:
def hmm_viterbi(A,B,pi,O): δ = np.zeros((len(O),len(A))) #第一个局部 Ψ = np.zeros((len(O),len(A))) #第二个局部 # 1、初始化t=1时刻维特比的两个局部变量 δ[0] = pi*B[:,O[0]] # 2、递归 阅读全文
摘要:
#coding=utf-8 import numpy as np import os import random from tfidf_model import TfIdf # a = np.array([0, 1, 2, 3, 1, 2, 2]) # print(a[[2,4,2,2,2,2]]) 阅读全文
摘要:
#coding=utf-8 import numpy as np import jieba class TfIdf: def __init__(self,doc): self.doc = doc self.get_dic() def get_dic(self): stop_path = 'stop_ 阅读全文
摘要:
文章参照 链接:https://www.cnblogs.com/pinard/p/6945257.html # coding=utf-8 import re import numpy as np class Hmm(object): def __init__(self, train_path): s 阅读全文