【问题标题】:OpenFST - creating FST's from list of wordsOpenFST - 从单词列表中创建 FST
【发布时间】:2021-02-12 22:23:42
【问题描述】:

我正在阅读最上面的示例:http://www.openfst.org/twiki/bin/view/FST/FstExamples 关于标记化。

在示例中,他们创建了三个 fst:Mars.fstMartian.fstman.fst,并手动运行一些 fst 命令将它们合并为一个大传感器。他们从wotw.syms 中得到“Mars”、“Martian”和“man”三个词,共有 7102 个词。

我的问题是,有没有一种聪明的方法可以为所有 7102 个单词创建一个 word.fst,以便所有 7102 个单词都可以组成一个大自动机,还是必须手动完成,就像他们为火星人、火星人和人三个词?

【问题讨论】:

    标签: openfst fst


    【解决方案1】:

    他们给出了一个脚本:https://www.openfst.org/twiki/pub/FST/FstExamples/makelex.py.txt 我们可以简单地:

    cat wotw.syms | python2 makelex.py > lexicons_text.fst
    fstcompile --isymbols=ascii.syms --osymbols=wotw.syms lexicon_text.fst lexicon.fst
    fstrmepsilon lexicon.fst | fstdeterminize | fstminimize >lexicon_opt.fst
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-07-26
      • 2016-03-08
      • 1970-01-01
      • 1970-01-01
      • 2013-02-03
      • 2018-08-10
      • 1970-01-01
      相关资源
      最近更新 更多