[英]How do I correlate the `int` hash value of a spaCy Token `ent_type` to a string?
Is there some way to decode the hash of spaCy token entity types without accessing the ent_type_
attribute?是否有某种方法可以在不访问
ent_type_
属性的情况下解码 spaCy 令牌实体类型的 hash?
For example:例如:
for token in doc:
hash_val = token.ent_type
string_repr = some_map[hash_val]
It's stored in the vocab.它存储在词汇表中。
nlp.vocab.strings[token.ent_type] == token.ent_type_
Not sure why you would need to do that though.不知道为什么你需要这样做。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.