Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CKY Algorithm? #1722

Closed
aetilley opened this issue May 15, 2017 · 5 comments
Closed

CKY Algorithm? #1722

aetilley opened this issue May 15, 2017 · 5 comments

Comments

@aetilley
Copy link
Contributor

I've noticed that there are a lot of bottom-up parsers, but I don't find the exact CKY parser anywhere or the associated 'inside algorithm' for sentence scoring.

I implemented this a year ago,
https://github.com/aetilley/pcfg

and I'd be happy to re-write it inside NLTK if people think it would be worthwhile.

I understand many of the other bottom-up- / chart - parsers tend to perform better than CKY, but I believe CKY is often one of the first taught.

Just a thought.

@stevenbird
Copy link
Member

👍

@alvations
Copy link
Contributor

alvations commented May 15, 2017

@aetilley It's a good idea to have a working CKY wrapper in NLTK like earleychart.py but do note the various data structures that are already implemented in NLTK; use these structures to keep the code compact without maintaining multiple classes of the same function and remain consistency with other parser interfaces, esp. Tree, CFG, PCFG and ChartParser objects.

Additionally, there's a ViterbiParser inside nltk.parse.viterbi and ChartParser that you might find useful.

Create a PR when the code is ready and someone will help review through it =)

Looking forward to the PR!

@aetilley
Copy link
Contributor Author

aetilley commented May 15, 2017

@alvations Great. Yes, I already noticed there's quite a bit done. Also it seems that there's already functionality for transforming an arbitrary CFG into Chomsky Normal Form, so I don't need to bring over that machinery.

I'll get on it.

@aetilley
Copy link
Contributor Author

(Just started a job so this might get delayed a bit, but I'm definitely still interested.)

@aetilley
Copy link
Contributor Author

Commented on #1884

Closing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants