Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
project_4
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
20200519088
project_4
Commits
a52f724c
Commit
a52f724c
authored
4 years ago
by
Yuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
f0c10f76
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
review
+29
-0
No files found.
review
0 → 100644
View file @
a52f724c
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
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment