Match : does not match a NP-group ?
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.9k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
For some reason MATCHING cant find the third {NP} ?
As you can see there is 3 NP chunks, so it should work !! Any idea ?
In [120]: s1 = Sentence(parse('The students consider the course a challenge'))
In [121]: s1.string
Out[121]: u'The students consider the course a challenge'
In [122]: m = match('{NP} {VB*} {NP} {NP}', s1)
In [123]: m.constituents()
Out[123]: [Chunk('The students/NP'), Chunk('consider/VP'), Chunk('the course/NP')]
In [125]: s1.chunks
Out[125]:
[Chunk('The students/NP'),
Chunk('consider/VP'),
Chunk('the course/NP'),
Chunk('a challenge/NP')]
In [126]: pprint(s1)
WORD TAG CHUNK ROLE ID PNP LEMMA
The DT NP - - - -
students NNS NP ^ - - - -
consider VB VP - - - -
the DT NP - - - -
course NN NP ^ - - - -
a DT NP - - - -
challenge NN NP ^ - - - -
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 by reproducing the example with parse(), Sentence, and match('{NP} {VB*} {NP} {NP}', s1), then trace the matching entry point and how constituents are returned. Done means the match includes all three NP chunks, including “a challenge,” with a regression check for this example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100