Commit a52f724c by Yuan

Add new file

parent f0c10f76
Summary:
代码写的有问题
Detailed Comments:
1、代码一运行就报如下错误:
108 for ner in ners:
109 print(ners)
--> 110 if ner[2] == 'lacation':
111 ner[3] = 'CITY'
112 seg_sentence = fool.cut(sentence)
IndexError: list index out of range
这个错误是因为fun_clean这个函数写的有问题,这里就是对数据进行清洗过滤,实体识别不用放在这个函数中;
2、就算你要写在这个函数中,你的这也需要做一个判断,如果ners为空呢,你这里就是因为ners为空所以报的错误
words, ners = fool.analysis(sentence)
for ner in ners:
print(ners)
if ner[2] == 'lacation':
ner[3] = 'CITY'
3、修改下代码吧,提交代码前 ,自己先测试一下
Overall Score: 76
--------------------------------------------------------------------------------------------------------------------------
Thanks for your efforts.
-Your instructor
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment