How to get IOB chunk tag in parsetree?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.9k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
In the output of pattern.en.parsetree , the results all contains the IOB format tag.
When using chunks to get them out, the IOB format is lost, no matter in repr(s) or pprint(s). But when print out the sentence, the IOB format tag is there.
So how can I extract IOB format tags?
Original sentence:
This means the nucleus is either too big to hold itself together or has too many protons, electrons or neutrons.
repr(s) result
"[Sentence('This/DT/O/O/this means/VBZ/B-VP/O/mean the/DT/B-NP/O/the nucleus/NN/I-NP/O/nucleus is/VBZ/B-VP/O/be either/RB/B-ADJP/O/either too/RB/I-ADJP/O/too big/JJ/I-ADJP/O/big to/TO/B-VP/O/to hold/VB/I-VP/O/hold itself/PRP/B-NP/O/itself together/RB/B-ADVP/O/together or/CC/O/O/or has/VBZ/B-VP/O/have too/RB/B-NP/O/too many/JJ/I-NP/O/many protons/NNS/I-NP/O/proton ,/,/O/O/, electrons/NNS/B-NP/O/electron or/CC/I-NP/O/or neutrons/NNS/I-NP/O/neutron ././O/O/.')]"
pprint(s)
` WORD TAG CHUNK ROLE ID PNP LEMMA
This DT - - - - this
means VBZ VP - - - mean
the DT NP - - - the
nucleus NN NP ^ - - - nucleus
is VBZ VP - - - be
either RB ADJP - - - either
too RB ADJP ^ - - - too
big JJ ADJP ^ - - - big
to TO VP - - - to
hold VB VP ^ - - - hold
itself PRP NP - - - itself
together RB ADVP - - - together
or CC - - - - or
has VBZ VP - - - have
too RB NP - - - too
many JJ NP ^ - - - many
protons NNS NP ^ - - - proton
, , - - - - ,
electrons NNS NP - - - electron
or CC NP ^ - - - or
neutrons NNS NP ^ - - - neutron
. . - - - - .`
Also, what is ^ is the pprint result? And how are they displayed in this way?
Thank you very much.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the pattern.en.parsetree entry point and compare how chunk objects are rendered by repr, pprint, and print. Document how to extract IOB tags and explain what the ^ marker means in the pprint output; the issue is complete when both questions have a clear, reproducible answer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100