While there are enormous resources to convert a CFG(Context Free Grammar) to language, there isn't any resource to create a CFG out of a given sentence. Basically, I am trying to use the grammar to do a CKY parsing and generate tree.
Currently, If I generate a grammar by hand, then it's not generating the correct tree. So, I was wondering if there is an online tool that generates a CFG from a given sentence, then it would be highly helpful.
Edit:
Sentence - I shot an elephant in my pajamas
Grammar
S -> NP VP
PP -> P NP
NP -> Det N
NP -> Det N PP
NP -> 'I'
VP -> V NP
VP -> VP PP
Det -> 'an'
Det -> 'my'
N -> 'elephant'
N -> 'pajamas'
V -> 'shot'
P -> 'in'