Estoy buscando un programa para la biblioteca que pueda tomar como entrada la sección del Wall Street Journal (WSJ) del Penn TreeBank (PTB) y generar las gramáticas probabilísticas libres de contexto (PCFG) correspondientes.
Si es posible:
Penn TreeBank consta de miles de oraciones anotadas. A continuación se muestran 3 de ellos:
( (S
(NP-SBJ
(NP (NNP Pierre) (NNP Vinken) )
(, ,)
(ADJP
(NP (CD 61) (NNS years) )
(JJ old) )
(, ,) )
(VP (MD will)
(VP (VB join)
(NP (DT the) (NN board) )
(PP-CLR (IN as)
(NP (DT a) (JJ nonexecutive) (NN director) ))
(NP-TMP (NNP Nov.) (CD 29) )))
(. .) ))
( (S
(NP-SBJ (NNP Mr.) (NNP Vinken) )
(VP (VBZ is)
(NP-PRD
(NP (NN chairman) )
(PP (IN of)
(NP
(NP (NNP Elsevier) (NNP N.V.) )
(, ,)
(NP (DT the) (NNP Dutch) (VBG publishing) (NN group) )))))
(. .) ))
( (S
(NP-SBJ-1
(NP (NNP Rudolph) (NNP Agnew) )
(, ,)
(UCP
(ADJP
(NP (CD 55) (NNS years) )
(JJ old) )
(CC and)
(NP
(NP (JJ former) (NN chairman) )
(PP (IN of)
(NP (NNP Consolidated) (NNP Gold) (NNP Fields) (NNP PLC) ))))
(, ,) )
(VP (VBD was)
(VP (VBN named)
(S
(NP-SBJ (-NONE- *-1) )
(NP-PRD
(NP (DT a) (JJ nonexecutive) (NN director) )
(PP (IN of)
(NP (DT this) (JJ British) (JJ industrial) (NN conglomerate) ))))))
(. .) ))
Esto suena como un trabajo para pythons SciKit Learn y Natural Language Toolkit ( NLKT ) ya que tiene sus propios módulos CFG y treebank como se muestra aquí .