如何从哈希值取回String?

I am working in Natural Language Processing with spaCy How can I get back string value from hash?

这是我的代码以及python中的详细信息

# import spacy package for english language
from spacy.lang.en import English

# initialize nlp with English
nlp = English()

# get hash from string
cat_hash = nlp.vocab.strings["cat"]
print(cat_hash)

# Look up the cat_hash to get the string
cat_string = nlp.vocab.strings[cat_hash]
print(cat_string)
评论