noun_chunks function return a empty list #6337
Replies: 5 comments
-
The If you'd like noun chunks, you'd need to implement the noun chunks iterator. Here's the English implementation as an example: We'd be happy to accept a PR that added this for Chinese! |
Beta Was this translation helpful? Give feedback.
-
@adrianeboyd I'm trying to implement this on Brazilian Portuguese (I believe lang/pt), but it's not working. I copy exact english syntax_iterators.py, compile spacy again (I don't know if it's really necessary) but not works. Chunks is still empty. Am I doing right way? |
Beta Was this translation helpful? Give feedback.
-
You also have to import it in spaCy/spacy/lang/en/__init__.py Line 29 in cd61d26 (If you're just changing Because English uses a different set of dependency labels (not UD), you'd be better off starting with another language that uses UD labels as an example, maybe French is a good example? (I think the French one is simpler than the Spanish one, which uses a different approach that I'm not sure is 100% working as intended at this point.) |
Beta Was this translation helpful? Give feedback.
-
@adrianeboyd Thank you so much! I just need to improve, but at least it's working. In fact, Spanish is more similar to Portuguese than French. Thanks again! |
Beta Was this translation helpful? Give feedback.
-
Yes, Spanish is more similar, but I think that the French noun chunks iterator may be a better starting point. I don't think the noun chunk definition is going to be that different here, since it's mostly about the UD dependencies. You can test both, though. In particular with the Spanish version, check carefully to make sure it's not producing overlapping noun chunks when you have nested NPs. |
Beta Was this translation helpful? Give feedback.
-
I use a chinese model called zh-core-web-sm2.3.1,
and when I call the nonu_chunks function to get nouns phase, I just find get a empty list.
so someone know the right way to get nouns phases.
Beta Was this translation helpful? Give feedback.
All reactions