Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tesorflow版本的utilit下的 get_entities()函数的bug #29

Open
wujixian opened this issue Aug 28, 2019 · 0 comments
Open

tesorflow版本的utilit下的 get_entities()函数的bug #29

wujixian opened this issue Aug 28, 2019 · 0 comments

Comments

@wujixian
Copy link

def get_entity(x,y,id2tag):
entity=""
res=[]
for i in range(len(x)): #for every sen
for j in range(len(x[0])): #for every word
...
...
这两个for循环中第一个是没问题的,因为统一batchsize大小了,但第二个for循环就有问题了,
因为x[0]的大小可能会大于60 这里没有做cut操作,因此j会大于60 导致y[i][j]数组越界,希望楼主可以更改一下。加上一个判断
for i in range(len(x)): #for every sen
if len(x[0]) > 60:
num = 60
else:
num = len(x[0])
for j in range(num): #for every word

这样都保证为60,就不会出现y[i][j]数组越界的问题了额

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant