Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
V

Viterbi

> 编程语言
Open source

An implementation of HMM-Viterbi Algorithm 通用的维特比算法实现

377 stars0 likes2 views
WebsiteGitHub

About

Viterbi

An implementation of HMM-Viterbi Algorithm

  • How to Use
java
public static void main(String[] args)
{
     int[] result = Viterbi.compute(observations, states, start_probability, transititon_probability, emission_probability);
     for (int r : result)
     {
        System.out.print(Weather.values()[r] + " ");
     }
}
  • About the algorithm

See Wiki

Viterbi

通用维特比算法的Java实现

  • 调用方法
java
public static void main(String[] args)
{
     int[] result = Viterbi.compute(observations, states, start_probability, transititon_probability, emission_probability);
     for (int r : result)
     {
        System.out.print(Weather.values()[r] + " ");
     }
}
  • 算法详解

代码本身没什么新意,看到Git上没有好用的Viterbi的Java实现,所以补个缺。特点是简单好懂,一个方法搞定。调用简单,往compute方法里填充HMM的五元组就能得到最佳标注序列。 附赠一个对经典天气预测问题的求解,问题的描述和思路详见前文: 详见《HMM与分词、词性标注、命名实体识别》

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javahmmhmm-viterbi-algorithmjavaviterbi

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言