Is there a reason for the lack of "case" dependency in spacy.symbol? #8583
-
Hi to all, We recently found out that there is not a symbol in "spacy.symbol" for some dependencies. For instance "case" dependency. We would like to do operations like the following with case:
Is there a reason for this? Is there a workaround to solve this in a clean way without using the string and "dep_" attribute? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
There is no 'case' in spacy, it is replaced by 'prep' and 'poss'. |
Beta Was this translation helpful? Give feedback.
-
This is more for historical reasons than anything, and whether a string is in You should always get the same integer from |
Beta Was this translation helpful? Give feedback.
This is more for historical reasons than anything, and whether a string is in
spacy.symbols
only matters for the symbols inspacy.attrs
at this point. We haven't removed any symbols to maintain backwards compatibility, but with the string hashes introduced in spacy v2, many of these symbols aren't really needed anymore.You should always get the same integer from
nlp.vocab.strings["case"]
for the label you're interested in, so I wouldn't usespacy.symbols
for this. If you want to be sure that you're using valid labels, you can refer to the model's labels (nlp.get_pipe("parser").labels
) and convert them to integers withnlp.vocab.strings[label]
. All internal integer representations of thes…