Coder Social home page Coder Social logo

scir-training-day's People

Contributors

carfly avatar jiangfeng1124 avatar liu946 avatar oneplus avatar wenhycs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scir-training-day's Issues

4-HMM练习问题

HMM那块又有个编译问题,文章中写的这句代码运行有错误,还是看不懂

$python eval_gene_tagger.py gene.key gene.dev
Could not align gold standard and predictions in line 1.
Gold standard: BACKGROUND  Prediction file:

最大正向匹配算法-测试错误

你好,在正向最大匹配分词练习里,我在文件eval.py遇到了编译错误,错误如下:

Traceback (most recent call last):
  File "eval.py", line 175, in <module>
    num_recall, num_pred, num_gold = evaluate(pred_inst, gold_inst, opt.mode)
  File "eval.py", line 34, in evaluate
    assert (pred.raw == gold.raw)
AssertionError

我的最大匹配分词代码如下:

def max_match_segment(line, dic):
    # write your code here
    # line = line.decode('utf-8')
    s = "" # pattern正常窗口
    s_f = "" # pattern前倾一位窗口
    ret = []
    tmp = set()
    for cur_word in line:  # line 为str
        s = s_f
        s_f += cur_word # s_f前倾一位
        if len(tmp) == 0: # 新词典为空,构建新词典 s_f是word子串,把word加入新词典
            tmp = set([word for word in dic if s_f in word])
        else: # 新词典不为空,遍历对比, 移除词典中不符合条件的词
            tmp = set([elem for elem in tmp if s_f in elem])

        if len(tmp) == 0: # 匹配到最大词,加入列表
            ret.append(s)
            s_f = "" + cur_word # 重置前倾
    return ret

我是mac系统,最后输出到output.dat文件中是乱码的,在decode再encode成UTF-8编码后虽然文字没问题,但是运行python eval.py --format=segment --mode=segment --eval=output.dat --gold=eval.dat依旧是同样的编译错误,不知道是什么原因呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.