Is there a quicker way to get a token's index from a doc?

后端 未结 0 1227
小蘑菇
小蘑菇 2020-12-24 07:30
for token in doc:
   if token.text = \'is\':
       print(token.i)

Given a token text, i.e. \'is\', is there a faster way to get its index instead o

相关标签:
回答
  • 消灭零回复
提交回复
热议问题