Skip to content
Discussion options

You must be logged in to vote

The particular way you're checking this returning false is a quirk of the implementation of the string store. "number" is one of the strings stored as a symbol, which means it is stored in a special way and won't come up if you iterate over the keys in the string store. On the other hand this is True:

import spacy

nlp = spacy.load('en_core_web_lg')

print("number" in nlp.vocab.strings) # True

I didn't address this last time because the issue just seemed resolved either way, but can you clarify why this is a problem for you? The string store is an implementation detail and the presence or absence of strings in it is basically arbitrary - it shouldn't be used to check if something is OOV …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@minimario
Comment options

@adrianeboyd
Comment options

Answer selected by polm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang / en English language data and models
3 participants
Converted from issue

This discussion was converted from issue #10117 on January 24, 2022 05:13.