luopeixiang / named_entity_recognition

中文命名实体识别(包括多种模型:HMM,CRF,BiLSTM,BiLSTM+CRF的具体实现)
2.14k stars 538 forks source link

运行main.py时报错:not enough values to unpack #22

Closed iblackholmes closed 4 years ago

iblackholmes commented 4 years ago

运行'python main.py'时,出现如下错误:

>python main.py
读取数据...
Traceback (most recent call last):
  File "main.py", line 73, in <module>
    main()
  File "main.py", line 14, in main
    build_corpus("train")
  File "data.py", line 16, in build_corpus
    word, tag = line.strip('\n').split()
ValueError: not enough values to unpack (expected 2, got 0)
iblackholmes commented 4 years ago

噢,问题解决了。参考#15。 是data.py第16行,识别空行的判别改成" if line != '\r\n'"即可。