Morphology - fine-grained features #9648
-
I'd like to ask about fine-grained morphological features. For part of speech, as described in https://spacy.io/api/token, there is However, description of Is there any way of these language-specific morphological features from spacy output which I've missed? If there is no official way, maybe it's still possible to get these tags as some kind of by-product. For example in Polish: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
If you have fine-grained tags saved as
If you have the mapping in the spacy v2 tag map or morph rules format, you can import those with the attribute ruler methods, too: https://spacy.io/api/attributeruler#load_from_tag_map But the mapping will come from an external source outside spacy itself, either from some source like the UD docs or written by hand. |
Beta Was this translation helpful? Give feedback.
If you have fine-grained tags saved as
token.tag
that could potentially map to other features liketoken.morph
, you can add rules that do this mapping in anattribute_ruler
component. If you want to see an example, we do this in several trained pipelines likeen_core_web_sm
. We don't have this stored anywhere in a better format, but you can check outnlp.get_pipe("attribute_ruler").patterns
to see the raw patterns. An example of one pattern is:If you have the mapping in the spacy v2 tag map or mor…