# chapter13 Lexicalized PCFG

• Lexicalized PCFGs

• Lexicalization of a treebank： 给treebank添加head

• Lexicalized probabilistic context-free Grammars： Lexicalized PCFGs中的参数，也就是rules的概率

• Parsing with lexicalized PCFGs：使用动态规划CKY对测试集中的sentences寻找最优parse tree

• Parameter estimation in lexicalized probabilistic context-free grammars： 通过训练集，也就是语料库corpus得到Lexicalized PCFG的参数

• Accuracy of lexicalized PCFGs：测试集的准确率计算

• 相关研究

### Lexicalized PCFGs 词汇化PCFGs

#### Lexicalization of a treebank

• the central sub-constituent of each rule

• the sementic predicate in each rule

#### Lexicalized probabilistic context-free Grammars

1. Chomsky Normal Form

1. Lexicalized context-free grammars in chomsky normal form

1. Parameters in a Lexicalized PCFG

#### Parameter estimation in lexicalized probabilistic context-free grammars

1. 为什么 Lexicalized PCFGs 要好于 PCFG？

rules:

7个non-terminal:

$$S(saw)\rightarrow_2 NP(man)\ VP(saw)$$

$$NP(man)\rightarrow_2 DT(the)\ NN(man)$$

$$VP(saw)\rightarrow_1 VP(saw)\ PP(with)\tag{~}$$

$$VP(saw)\rightarrow_1 Vt(saw)\ NP(dog)\tag{~}$$

$$NP(dog)\rightarrow_2 DT(the)\ NN(dog)$$

$$PP(with)\rightarrow_1 IN(with)\ NP(telescope)$$

$$NP(telescope)\rightarrow_2 DT(with)\ NN(telescope)$$

9个terminal：

$$\cdots$$

7个non-terminal:

$$S(saw)\rightarrow_2 NP(man)\ VP(saw)$$

$$NP(man)\rightarrow_2 DT(the)\ NN(man)$$

$$VP(saw)\rightarrow_1 VP(saw)\ PP(dog)\tag{~}$$

$$NP(dog)\rightarrow_1 NP(dog)\ PP(with)\tag{~}$$

$$NP(dog)\rightarrow_2 DT(the)\ NN(dog)$$

$$PP(with)\rightarrow_1 IN(with)\ NP(telescope)$$

$$NP(telescope)\rightarrow_2 DT(with)\ NN(telescope)$$

9个terminal：

$$\cdots$$

1. 如何计算参数

$q(S(saw)\rightarrow_2 NP(man)\ VP(saw))$ 是条件概率，可以看做是已知S,saw,从CFG语法中选出 $S\rightarrow_2 NP\ VP$, 并且从NP的 word 中选出 man 的概率.

$$q(S(saw)\rightarrow_2 NP(man)\ VP(saw))=q(S\rightarrow_2 NP\ VP|S,saw) \times q(man|S\rightarrow_2NP\ VP,saw)$$

• 第一项： $q(S\rightarrow_2 NP\ VP|S,saw)=\dfrac{count(S(saw)\rightarrow_2 NP\ VP)}{count(S(saw))}$
• 第二项： $q(man|S\rightarrow_2NP\ VP,saw)=\dfrac{count(S(saw)\rightarrow_2 NP(man)\ VP(saw))}{count(S(saw)\rightarrow_2 NP\ VP,saw)}$

$$\lambda_1+\lambda_2=1$$

$$q_{ML}(S\rightarrow_2NP\ VP|S,saw)=\dfrac{count(S(saw)\rightarrow_2 NP\ VP)}{count(S(saw))}$$

$$q_{ML}(S\rightarrow_2NP\ VP|S) = \dfrac{count(S\rightarrow_2 NP\ VP)}{count(S)}$$

• deal with rules with more child

• incorporate parts of speech(useful in smoothing)

• encode preferences for close attachment

MIchael Collins.2003. Head-Driven Statistical Models for Natural Language Parsing.

#### Accuracy of lexicalized PCFGs

gold standard and parsing output:

reference:

Xie Pan

2018-04-22

2021-06-29