practical problems with chomsky-schützenberger parsing for … · 2021. 2. 12. ·...

60
Practical problems with Chomsky-Schützenberger parsing for weighted multiple context-free grammars 1 Tobias Denkinger [email protected] Institute of Theoretical Computer Science Faculty of Computer Science Technische Universität Dresden 2018-04-27 1 based on T. Denkinger (2017). “Chomsky-Schützenberger parsing for weighted multiple context-free languages”.

Upload: others

Post on 15-Mar-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Practical problemswith Chomsky-Schützenberger parsing

for weighted multiple context-free grammars1

Tobias [email protected]

Institute of Theoretical Computer ScienceFaculty of Computer Science

Technische Universität Dresden

2018-04-27

1based on T. Denkinger (2017). “Chomsky-Schützenberger parsing for weightedmultiple context-free languages”.

Page 2: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

The problem: 𝑘-best parsing

𝑘-best

parsing problem

[Huang and Chiang 2005]

Input:a

weighted

grammar 𝐺

a suitable partial order ⊴ on the weights

a number 𝑘 ∈ ℕ

a word 𝑤

Output:a

sequence of 𝑘 best

derivation

s2

of 𝑤 in 𝐺(not unique)

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 2 / 12

Page 3: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

The problem: 𝑘-best parsing

𝑘-best parsing problem [Huang and Chiang 2005]Input:

a weighted grammar 𝐺a suitable partial order ⊴ on the weights

a number 𝑘 ∈ ℕa word 𝑤

Output:a sequence of 𝑘 best derivations2 of 𝑤 in 𝐺

(not unique)

2w.r.t. weights and ⊴ (less is better)T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 2 / 12

Page 4: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Multiple context-free grammars

context-free grammars

𝐴 → a𝐴b𝐵 composes strings

𝐴 → [(𝑥, 𝑦) ↦ a𝑥b𝑦⏟⏟⏟⏟⏟⏟⏟𝛴∗×𝛴∗→𝛴∗

](𝐴, 𝐵)

multiple context-free grammars[Seki, Matsumura, Fujii, and Kasami 1991]

𝐴 → [((𝑥1, 𝑥2), (𝑦1, 𝑦2)) ↦ (a𝑥1𝑦2b, 𝑦1c𝑥2)⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟(𝛴∗×𝛴∗)×(𝛴∗×𝛴∗)→(𝛴∗×𝛴∗)

](𝐴, 𝐵)

composes tuples of strings

⟹ extra expressive power useful for natural language processing

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 3 / 12

Page 5: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Multiple context-free grammars

context-free grammars

𝐴 → a𝐴b𝐵 composes strings

𝐴 → [(𝑥, 𝑦) ↦ a𝑥b𝑦⏟⏟⏟⏟⏟⏟⏟𝛴∗×𝛴∗→𝛴∗

](𝐴, 𝐵)

multiple context-free grammars[Seki, Matsumura, Fujii, and Kasami 1991]

𝐴 → [((𝑥1, 𝑥2), (𝑦1, 𝑦2)) ↦ (a𝑥1𝑦2b, 𝑦1c𝑥2)⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟(𝛴∗×𝛴∗)×(𝛴∗×𝛴∗)→(𝛴∗×𝛴∗)

](𝐴, 𝐵)

composes tuples of strings

⟹ extra expressive power useful for natural language processing

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 3 / 12

Page 6: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Multiple context-free grammars

context-free grammars

𝐴 → a𝐴b𝐵 composes strings

𝐴 → [ a𝑥 b 𝑦 ](𝐴, 𝐵)

multiple context-free grammars[Seki, Matsumura, Fujii, and Kasami 1991]

𝐴 → [((𝑥1, 𝑥2), (𝑦1, 𝑦2)) ↦ (a𝑥1𝑦2b, 𝑦1c𝑥2)⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟(𝛴∗×𝛴∗)×(𝛴∗×𝛴∗)→(𝛴∗×𝛴∗)

](𝐴, 𝐵)

composes tuples of strings

⟹ extra expressive power useful for natural language processing

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 3 / 12

Page 7: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Multiple context-free grammars

context-free grammars

𝐴 → a𝐴b𝐵 composes strings

𝐴 → [ a𝑥 b 𝑦 ](𝐴, 𝐵)

multiple context-free grammars[Seki, Matsumura, Fujii, and Kasami 1991]

𝐴 → [((𝑥1, 𝑥2), (𝑦1, 𝑦2)) ↦ (a𝑥1𝑦2b, 𝑦1c𝑥2)⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟⏟(𝛴∗×𝛴∗)×(𝛴∗×𝛴∗)→(𝛴∗×𝛴∗)

](𝐴, 𝐵)

composes tuples of strings

⟹ extra expressive power useful for natural language processing

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 3 / 12

Page 8: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Multiple context-free grammars

context-free grammars

𝐴 → a𝐴b𝐵 composes strings

𝐴 → [ a𝑥 b 𝑦 ](𝐴, 𝐵)

multiple context-free grammars[Seki, Matsumura, Fujii, and Kasami 1991]

𝐴 → [ a𝑥1𝑦2b, 𝑦1c𝑥2 ](𝐴, 𝐵)

composes tuples of strings

⟹ extra expressive power useful for natural language processing

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 3 / 12

Page 9: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Multiple context-free grammars

context-free grammars

𝐴 → a𝐴b𝐵 composes strings

𝐴 → [ a𝑥 b 𝑦 ](𝐴, 𝐵)

multiple context-free grammars[Seki, Matsumura, Fujii, and Kasami 1991]

𝐴 → [ a𝑥1𝑦2b, 𝑦1c𝑥2 ](𝐴, 𝐵)

composes tuples of strings

⟹ extra expressive power useful for natural language processing

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 3 / 12

Page 10: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

The Chomsky-Schützenberger theorem

CS-theorems [Chomsky and Schützenberger 1963]

[Yoshinaka, Kaji, and Seki 2010]

Let 𝐿 be a language. T.f.a.e.

1. ∃

M

CFG 𝐺 s.t. 𝐿 = L(𝐺)2. ∃ regular language 𝑅,

multiple

Dyck language 𝐷,∃ homomorphism ℎs.t. 𝐿 = ℎ(𝑅 ∩ 𝐷)

Idea [Hulden 2011, for CFGs]Use the decomposition provided by (1. → 2.) for parsing.

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 4 / 12

Page 11: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

The Chomsky-Schützenberger theorem

CS-theorems [Chomsky and Schützenberger 1963][Yoshinaka, Kaji, and Seki 2010]

Let 𝐿 be a language. T.f.a.e.

1. ∃ MCFG 𝐺 s.t. 𝐿 = L(𝐺)2. ∃ regular language 𝑅,

∃ multiple Dyck language 𝐷,∃ homomorphism ℎs.t. 𝐿 = ℎ(𝑅 ∩ 𝐷)

Idea [Hulden 2011, for CFGs]Use the decomposition provided by (1. → 2.) for parsing.

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 4 / 12

Page 12: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

The Chomsky-Schützenberger theorem

CS-theorems [Chomsky and Schützenberger 1963][Yoshinaka, Kaji, and Seki 2010]

Let 𝐿 be a language. T.f.a.e.

1. ∃ MCFG 𝐺 s.t. 𝐿 = L(𝐺)2. ∃ regular language 𝑅,

∃ multiple Dyck language 𝐷,∃ homomorphism ℎs.t. 𝐿 = ℎ(𝑅 ∩ 𝐷)

Idea [Hulden 2011, for CFGs]Use the decomposition provided by (1. → 2.) for parsing.

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 4 / 12

Page 13: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

From the CS-theorem to CS-parsing

𝑤 ∈ L(𝐺)

⟺ 𝑤 ∈ ℎ(𝑅 ∩ 𝐷) (CS-theorem)

⟺ ∃𝑢 ∈ 𝑅 ∩ 𝐷: ℎ(𝑢) = 𝑤⟺ ∃𝑢 ∈ 𝑅 ∩ ℎ−1(𝑤): 𝑢 ∈ 𝐷

ObservationEach 𝑢 ∈ 𝑅 ∩ 𝐷 encodes a derivation of 𝐺.

𝑘-best CS-parsing

parse𝐺,wt,𝑘(𝑤)

= (toDeriv ∘ take𝑘 ∘ sortwt⊴ ∘ filter∩𝐷)(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sortwt⊴ )(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sort⊴)(𝑅wt B ℎ−1(𝑤))

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 5 / 12

Page 14: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

From the CS-theorem to CS-parsing

𝑤 ∈ L(𝐺) ⟺ 𝑤 ∈ ℎ(𝑅 ∩ 𝐷) (CS-theorem)

⟺ ∃𝑢 ∈ 𝑅 ∩ 𝐷: ℎ(𝑢) = 𝑤⟺ ∃𝑢 ∈ 𝑅 ∩ ℎ−1(𝑤): 𝑢 ∈ 𝐷

ObservationEach 𝑢 ∈ 𝑅 ∩ 𝐷 encodes a derivation of 𝐺.

𝑘-best CS-parsing

parse𝐺,wt,𝑘(𝑤)

= (toDeriv ∘ take𝑘 ∘ sortwt⊴ ∘ filter∩𝐷)(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sortwt⊴ )(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sort⊴)(𝑅wt B ℎ−1(𝑤))

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 5 / 12

Page 15: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

From the CS-theorem to CS-parsing

𝑤 ∈ L(𝐺) ⟺ 𝑤 ∈ ℎ(𝑅 ∩ 𝐷) (CS-theorem)

⟺ ∃𝑢 ∈ 𝑅 ∩ 𝐷: ℎ(𝑢) = 𝑤

⟺ ∃𝑢 ∈ 𝑅 ∩ ℎ−1(𝑤): 𝑢 ∈ 𝐷

ObservationEach 𝑢 ∈ 𝑅 ∩ 𝐷 encodes a derivation of 𝐺.

𝑘-best CS-parsing

parse𝐺,wt,𝑘(𝑤)

= (toDeriv ∘ take𝑘 ∘ sortwt⊴ ∘ filter∩𝐷)(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sortwt⊴ )(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sort⊴)(𝑅wt B ℎ−1(𝑤))

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 5 / 12

Page 16: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

From the CS-theorem to CS-parsing

𝑤 ∈ L(𝐺) ⟺ 𝑤 ∈ ℎ(𝑅 ∩ 𝐷) (CS-theorem)

⟺ ∃𝑢 ∈ 𝑅 ∩ 𝐷: ℎ(𝑢) = 𝑤⟺ ∃𝑢 ∈ 𝑅 ∩ ℎ−1(𝑤): 𝑢 ∈ 𝐷

ObservationEach 𝑢 ∈ 𝑅 ∩ 𝐷 encodes a derivation of 𝐺.

𝑘-best CS-parsing

parse𝐺,wt,𝑘(𝑤)

= (toDeriv ∘ take𝑘 ∘ sortwt⊴ ∘ filter∩𝐷)(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sortwt⊴ )(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sort⊴)(𝑅wt B ℎ−1(𝑤))

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 5 / 12

Page 17: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

From the CS-theorem to CS-parsing

𝑤 ∈ L(𝐺) ⟺ 𝑤 ∈ ℎ(𝑅 ∩ 𝐷) (CS-theorem)

⟺ ∃𝑢 ∈ 𝑅 ∩ 𝐷: ℎ(𝑢) = 𝑤⟺ ∃𝑢 ∈ 𝑅 ∩ ℎ−1(𝑤): 𝑢 ∈ 𝐷

ObservationEach 𝑢 ∈ 𝑅 ∩ 𝐷 encodes a derivation of 𝐺.

𝑘-best CS-parsing

parse𝐺,wt,𝑘(𝑤)

= (toDeriv ∘ take𝑘 ∘ sortwt⊴ ∘ filter∩𝐷)(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sortwt⊴ )(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sort⊴)(𝑅wt B ℎ−1(𝑤))

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 5 / 12

Page 18: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

From the CS-theorem to CS-parsing

𝑤 ∈ L(𝐺) ⟺ 𝑤 ∈ ℎ(𝑅 ∩ 𝐷) (CS-theorem)

⟺ ∃𝑢 ∈ 𝑅 ∩ 𝐷: ℎ(𝑢) = 𝑤⟺ ∃𝑢 ∈ 𝑅 ∩ ℎ−1(𝑤): 𝑢 ∈ 𝐷

ObservationEach 𝑢 ∈ 𝑅 ∩ 𝐷 encodes a derivation of 𝐺.

𝑘-best CS-parsing

parse𝐺,wt,𝑘(𝑤)

= (toDeriv ∘ take𝑘 ∘ sortwt⊴ ∘ filter∩𝐷)(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sortwt⊴ )(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sort⊴)(𝑅wt B ℎ−1(𝑤))

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 5 / 12

Page 19: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

From the CS-theorem to CS-parsing

𝑤 ∈ L(𝐺) ⟺ 𝑤 ∈ ℎ(𝑅 ∩ 𝐷) (CS-theorem)

⟺ ∃𝑢 ∈ 𝑅 ∩ 𝐷: ℎ(𝑢) = 𝑤⟺ ∃𝑢 ∈ 𝑅 ∩ ℎ−1(𝑤): 𝑢 ∈ 𝐷

ObservationEach 𝑢 ∈ 𝑅 ∩ 𝐷 encodes a derivation of 𝐺.

𝑘-best CS-parsing

parse𝐺,wt,𝑘(𝑤)= (toDeriv ∘ take𝑘 ∘ sortwt⊴ ∘ filter∩𝐷)(𝑅 ∩ ℎ−1(𝑤))

= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sortwt⊴ )(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sort⊴)(𝑅wt B ℎ−1(𝑤))

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 5 / 12

Page 20: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

From the CS-theorem to CS-parsing

𝑤 ∈ L(𝐺) ⟺ 𝑤 ∈ ℎ(𝑅 ∩ 𝐷) (CS-theorem)

⟺ ∃𝑢 ∈ 𝑅 ∩ 𝐷: ℎ(𝑢) = 𝑤⟺ ∃𝑢 ∈ 𝑅 ∩ ℎ−1(𝑤): 𝑢 ∈ 𝐷

ObservationEach 𝑢 ∈ 𝑅 ∩ 𝐷 encodes a derivation of 𝐺.

𝑘-best CS-parsing

parse𝐺,wt,𝑘(𝑤)= (toDeriv ∘ take𝑘 ∘ sortwt⊴ ∘ filter∩𝐷)(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sortwt⊴ )(𝑅 ∩ ℎ−1(𝑤))

= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sort⊴)(𝑅wt B ℎ−1(𝑤))

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 5 / 12

Page 21: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

From the CS-theorem to CS-parsing

𝑤 ∈ L(𝐺) ⟺ 𝑤 ∈ ℎ(𝑅 ∩ 𝐷) (CS-theorem)

⟺ ∃𝑢 ∈ 𝑅 ∩ 𝐷: ℎ(𝑢) = 𝑤⟺ ∃𝑢 ∈ 𝑅 ∩ ℎ−1(𝑤): 𝑢 ∈ 𝐷

ObservationEach 𝑢 ∈ 𝑅 ∩ 𝐷 encodes a derivation of 𝐺.

𝑘-best CS-parsing

parse𝐺,wt,𝑘(𝑤)= (toDeriv ∘ take𝑘 ∘ sortwt⊴ ∘ filter∩𝐷)(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sortwt⊴ )(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sort⊴)(𝑅wt B ℎ−1(𝑤))

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 5 / 12

Page 22: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

From the CS-theorem to CS-parsing

𝑤 ∈ L(𝐺) ⟺ 𝑤 ∈ ℎ(𝑅 ∩ 𝐷) (CS-theorem)

⟺ ∃𝑢 ∈ 𝑅 ∩ 𝐷: ℎ(𝑢) = 𝑤⟺ ∃𝑢 ∈ 𝑅 ∩ ℎ−1(𝑤): 𝑢 ∈ 𝐷

ObservationEach 𝑢 ∈ 𝑅 ∩ 𝐷 encodes a derivation of 𝐺.

𝑘-best CS-parsing

parse𝐺,wt,𝑘(𝑤)= (toDeriv ∘ take𝑘 ∘ sortwt⊴ ∘ filter∩𝐷)(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sortwt⊴ )(𝑅 ∩ ℎ−1(𝑤))= (toDeriv ∘ take𝑘 ∘ filter∩𝐷 ∘ sort⊴)(𝑅wt B ℎ−1(𝑤))

enumerate from a weighted finite-state automaton

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 5 / 12

Page 23: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Derivations and bracket words

𝛼: 𝑆 → [ 𝑥1 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛾: 𝐴 → [ 𝜀 , 𝜀 ]()

𝑆1 𝑆1

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

automaton for 𝑅:

𝑆1

start

𝐴1

𝜀

a

𝐴1

𝜀

b 𝐴2

𝜀

c

𝐴2

𝜀

𝜀

𝑆1

𝜀

word 𝑤 =

aabbcc 𝑤′ = aaabbcc ∉ L(𝐺)

word 𝑢 = [1𝛼[1𝛼,1 [1𝛽 a[1𝛽,1 [1𝛽 a[1𝛽,1 [1𝛾]1𝛾 ]1𝛽,1b]1𝛽 ]1𝛽,1

b]1𝛽 ]1𝛼,1[1𝛼,2 [2𝛽 c[2𝛽,1 [2𝛽 c[2𝛽,1 [2𝛾]2𝛾 ]2𝛽,1]2𝛽 ]2𝛽,1]2𝛽 ]1𝛼,2]1𝛼

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 6 / 12

Page 24: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Derivations and bracket words

𝛼: 𝑆 → [ 𝑥1 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛾: 𝐴 → [ 𝜀 , 𝜀 ]()

𝑆1 𝑆1

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

automaton for 𝑅:

𝑆1

start

𝐴1

𝜀

a

𝐴1

𝜀

b 𝐴2

𝜀

c

𝐴2

𝜀

𝜀

𝑆1

𝜀

word 𝑤 =

aabbcc 𝑤′ = aaabbcc ∉ L(𝐺)

word 𝑢 = [1𝛼[1𝛼,1 [1𝛽 a[1𝛽,1 [1𝛽 a[1𝛽,1 [1𝛾]1𝛾 ]1𝛽,1b]1𝛽 ]1𝛽,1

b]1𝛽 ]1𝛼,1[1𝛼,2 [2𝛽 c[2𝛽,1 [2𝛽 c[2𝛽,1 [2𝛾]2𝛾 ]2𝛽,1]2𝛽 ]2𝛽,1]2𝛽 ]1𝛼,2]1𝛼

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 6 / 12

Page 25: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Derivations and bracket words

𝛼: 𝑆 → [ 𝑥1 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛾: 𝐴 → [ 𝜀 , 𝜀 ]()

𝑆1 𝑆1

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

automaton for 𝑅:

𝑆1

start

𝐴1

𝜀

a

𝐴1

𝜀

b 𝐴2

𝜀

c

𝐴2

𝜀

𝜀

𝑆1

𝜀

word 𝑤 =

aabbcc 𝑤′ = aaabbcc ∉ L(𝐺)

word 𝑢 = [1𝛼[1𝛼,1 [1𝛽 a[1𝛽,1 [1𝛽 a[1𝛽,1 [1𝛾]1𝛾 ]1𝛽,1b]1𝛽 ]1𝛽,1

b]1𝛽 ]1𝛼,1[1𝛼,2 [2𝛽 c[2𝛽,1 [2𝛽 c[2𝛽,1 [2𝛾]2𝛾 ]2𝛽,1]2𝛽 ]2𝛽,1]2𝛽 ]1𝛼,2]1𝛼

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 6 / 12

Page 26: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Derivations and bracket words

𝛼: 𝑆 → [ 𝑥1 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛾: 𝐴 → [ 𝜀 , 𝜀 ]()

𝑆1 𝑆1

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

automaton for 𝑅:

𝑆1

start

𝐴1

𝜀

a

𝐴1

𝜀

b 𝐴2

𝜀

c

𝐴2

𝜀

𝜀

𝑆1

𝜀

word 𝑤 =

aabbcc 𝑤′ = aaabbcc ∉ L(𝐺)

word 𝑢 = [1𝛼[1𝛼,1 [1𝛽 a[1𝛽,1 [1𝛽 a[1𝛽,1 [1𝛾]1𝛾 ]1𝛽,1b]1𝛽 ]1𝛽,1

b]1𝛽 ]1𝛼,1[1𝛼,2 [2𝛽 c[2𝛽,1 [2𝛽 c[2𝛽,1 [2𝛾]2𝛾 ]2𝛽,1]2𝛽 ]2𝛽,1]2𝛽 ]1𝛼,2]1𝛼

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 6 / 12

Page 27: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Derivations and bracket words

𝛼: 𝑆 → [ 𝑥1 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛾: 𝐴 → [ 𝜀 , 𝜀 ]()

𝑆1 𝑆1

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

automaton for 𝑅:

𝑆1

start

𝐴1

𝜀

a

𝐴1

𝜀

b 𝐴2

𝜀

c

𝐴2

𝜀

𝜀

𝑆1

𝜀

word 𝑤 =

aabbcc 𝑤′ = aaabbcc ∉ L(𝐺)

word 𝑢 = [1𝛼[1𝛼,1 [1𝛽 a[1𝛽,1 [1𝛽 a[1𝛽,1 [1𝛾]1𝛾 ]1𝛽,1b]1𝛽 ]1𝛽,1

b]1𝛽 ]1𝛼,1[1𝛼,2 [2𝛽 c[2𝛽,1 [2𝛽 c[2𝛽,1 [2𝛾]2𝛾 ]2𝛽,1]2𝛽 ]2𝛽,1]2𝛽 ]1𝛼,2]1𝛼

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 6 / 12

Page 28: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Derivations and bracket words

𝛼: 𝑆 → [ 𝑥1 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛾: 𝐴 → [ 𝜀 , 𝜀 ]()

𝑆1 𝑆1

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

automaton for 𝑅:

𝑆1

start

𝐴1

𝜀

a

𝐴1

𝜀

b 𝐴2

𝜀

c

𝐴2

𝜀

𝜀

𝑆1

𝜀

word 𝑤 =

aabbcc 𝑤′ = aaabbcc ∉ L(𝐺)

word 𝑢 = [1𝛼[1𝛼,1 [1𝛽 a[1𝛽,1 [1𝛽 a[1𝛽,1 [1𝛾]1𝛾 ]1𝛽,1b]1𝛽 ]1𝛽,1

b]1𝛽 ]1𝛼,1[1𝛼,2 [2𝛽 c[2𝛽,1 [2𝛽 c[2𝛽,1 [2𝛾]2𝛾 ]2𝛽,1]2𝛽 ]2𝛽,1]2𝛽 ]1𝛼,2]1𝛼

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 6 / 12

Page 29: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Derivations and bracket words

𝛼: 𝑆 → [ 𝑥1 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛾: 𝐴 → [ 𝜀 , 𝜀 ]()

𝑆1 𝑆1

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

automaton for 𝑅:

𝑆1

start

𝐴1

𝜀

a

𝐴1

𝜀

b 𝐴2

𝜀

c

𝐴2

𝜀

𝜀

𝑆1

𝜀

word 𝑤 = a

abbcc 𝑤′ = aaabbcc ∉ L(𝐺)

word 𝑢 = [1𝛼[1𝛼,1 [1𝛽 a[1𝛽,1 [1𝛽 a[1𝛽,1 [1𝛾]1𝛾 ]1𝛽,1b]1𝛽 ]1𝛽,1

b]1𝛽 ]1𝛼,1[1𝛼,2 [2𝛽 c[2𝛽,1 [2𝛽 c[2𝛽,1 [2𝛾]2𝛾 ]2𝛽,1]2𝛽 ]2𝛽,1]2𝛽 ]1𝛼,2]1𝛼

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 6 / 12

Page 30: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Derivations and bracket words

𝛼: 𝑆 → [ 𝑥1 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛾: 𝐴 → [ 𝜀 , 𝜀 ]()

𝑆1 𝑆1

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

automaton for 𝑅:

𝑆1

start

𝐴1

𝜀

a

𝐴1

𝜀

b 𝐴2

𝜀

c

𝐴2

𝜀

𝜀

𝑆1

𝜀

word 𝑤 = aa

bbcc 𝑤′ = aaabbcc ∉ L(𝐺)

word 𝑢 = [1𝛼[1𝛼,1 [1𝛽 a[1𝛽,1 [1𝛽 a[1𝛽,1 [1𝛾]1𝛾 ]1𝛽,1b]1𝛽 ]1𝛽,1

b]1𝛽 ]1𝛼,1[1𝛼,2 [2𝛽 c[2𝛽,1 [2𝛽 c[2𝛽,1 [2𝛾]2𝛾 ]2𝛽,1]2𝛽 ]2𝛽,1]2𝛽 ]1𝛼,2]1𝛼

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 6 / 12

Page 31: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Derivations and bracket words

𝛼: 𝑆 → [ 𝑥1 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛾: 𝐴 → [ 𝜀 , 𝜀 ]()

𝑆1 𝑆1

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

automaton for 𝑅:

𝑆1

start

𝐴1

𝜀

a

𝐴1

𝜀

b

𝐴2

𝜀

c

𝐴2

𝜀

𝜀

𝑆1

𝜀

word 𝑤 = aa

bbcc 𝑤′ = aaabbcc ∉ L(𝐺)

word 𝑢 = [1𝛼[1𝛼,1 [1𝛽 a[1𝛽,1 [1𝛽 a[1𝛽,1 [1𝛾]1𝛾 ]1𝛽,1b]1𝛽 ]1𝛽,1

b]1𝛽 ]1𝛼,1[1𝛼,2 [2𝛽 c[2𝛽,1 [2𝛽 c[2𝛽,1 [2𝛾]2𝛾 ]2𝛽,1]2𝛽 ]2𝛽,1]2𝛽 ]1𝛼,2]1𝛼

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 6 / 12

Page 32: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Derivations and bracket words

𝛼: 𝑆 → [ 𝑥1 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛾: 𝐴 → [ 𝜀 , 𝜀 ]()

𝑆1 𝑆1

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

automaton for 𝑅:

𝑆1

start

𝐴1

𝜀

a

𝐴1

𝜀

b

𝐴2

𝜀

c

𝐴2

𝜀

𝜀

𝑆1

𝜀

word 𝑤 = aa

bbcc 𝑤′ = aaabbcc ∉ L(𝐺)

word 𝑢 = [1𝛼[1𝛼,1 [1𝛽 a[1𝛽,1 [1𝛽 a[1𝛽,1 [1𝛾]1𝛾 ]1𝛽,1b]1𝛽 ]1𝛽,1

b]1𝛽 ]1𝛼,1[1𝛼,2 [2𝛽 c[2𝛽,1 [2𝛽 c[2𝛽,1 [2𝛾]2𝛾 ]2𝛽,1]2𝛽 ]2𝛽,1]2𝛽 ]1𝛼,2]1𝛼

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 6 / 12

Page 33: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Derivations and bracket words

𝛼: 𝑆 → [ 𝑥1 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛾: 𝐴 → [ 𝜀 , 𝜀 ]()

𝑆1 𝑆1

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

automaton for 𝑅:

𝑆1

start

𝐴1

𝜀

a

𝐴1

𝜀

b

𝐴2

𝜀

c

𝐴2

𝜀

𝜀

𝑆1

𝜀

word 𝑤 = aa

bbcc 𝑤′ = aaabbcc ∉ L(𝐺)

word 𝑢 = [1𝛼[1𝛼,1 [1𝛽 a[1𝛽,1 [1𝛽 a[1𝛽,1 [1𝛾]1𝛾 ]1𝛽,1b]1𝛽 ]1𝛽,1

b]1𝛽 ]1𝛼,1[1𝛼,2 [2𝛽 c[2𝛽,1 [2𝛽 c[2𝛽,1 [2𝛾]2𝛾 ]2𝛽,1]2𝛽 ]2𝛽,1]2𝛽 ]1𝛼,2]1𝛼

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 6 / 12

Page 34: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Derivations and bracket words

𝛼: 𝑆 → [ 𝑥1 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛾: 𝐴 → [ 𝜀 , 𝜀 ]()

𝑆1 𝑆1

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

automaton for 𝑅:

𝑆1

start

𝐴1

𝜀

a

𝐴1

𝜀

b

𝐴2

𝜀

c

𝐴2

𝜀

𝜀

𝑆1

𝜀

word 𝑤 = aab

bcc 𝑤′ = aaabbcc ∉ L(𝐺)

word 𝑢 = [1𝛼[1𝛼,1 [1𝛽 a[1𝛽,1 [1𝛽 a[1𝛽,1 [1𝛾]1𝛾 ]1𝛽,1b]1𝛽 ]1𝛽,1

b]1𝛽 ]1𝛼,1[1𝛼,2 [2𝛽 c[2𝛽,1 [2𝛽 c[2𝛽,1 [2𝛾]2𝛾 ]2𝛽,1]2𝛽 ]2𝛽,1]2𝛽 ]1𝛼,2]1𝛼

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 6 / 12

Page 35: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Derivations and bracket words

𝛼: 𝑆 → [ 𝑥1 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛾: 𝐴 → [ 𝜀 , 𝜀 ]()

𝑆1 𝑆1

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

automaton for 𝑅:

𝑆1

start

𝐴1

𝜀

a

𝐴1

𝜀

b 𝐴2

𝜀

c

𝐴2

𝜀

𝜀

𝑆1

𝜀

word 𝑤 = aabbcc

𝑤′ = aaabbcc ∉ L(𝐺)

word 𝑢 = [1𝛼[1𝛼,1 [1𝛽 a[1𝛽,1 [1𝛽 a[1𝛽,1 [1𝛾]1𝛾 ]1𝛽,1b]1𝛽 ]1𝛽,1

b]1𝛽 ]1𝛼,1[1𝛼,2 [2𝛽 c[2𝛽,1 [2𝛽 c[2𝛽,1 [2𝛾]2𝛾 ]2𝛽,1]2𝛽 ]2𝛽,1]2𝛽 ]1𝛼,2]1𝛼

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 6 / 12

Page 36: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Derivations and bracket words

𝛼: 𝑆 → [ 𝑥1 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛾: 𝐴 → [ 𝜀 , 𝜀 ]()

𝑆1 𝑆1

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

automaton for 𝑅:

𝑆1

start

𝐴1

𝜀

a

𝐴1

𝜀

b 𝐴2

𝜀

c

𝐴2

𝜀

𝜀

𝑆1

𝜀

word 𝑤 = aabbcc 𝑤′ = aaabbcc ∉ L(𝐺)

word 𝑢 = [1𝛼[1𝛼,1 [1𝛽 a[1𝛽,1 [1𝛽 a[1𝛽,1 [1𝛾]1𝛾 ]1𝛽,1b]1𝛽 ]1𝛽,1

b]1𝛽 ]1𝛼,1[1𝛼,2 [2𝛽 c[2𝛽,1 [2𝛽 c[2𝛽,1 [2𝛾]2𝛾 ]2𝛽,1]2𝛽 ]2𝛽,1]2𝛽 ]1𝛼,2]1𝛼

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 6 / 12

Page 37: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Derivations and bracket words

𝛼: 𝑆 → [ 𝑥1 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛽: 𝐴 → [ a 𝑥1 𝑏 , 𝑐 𝑥2 ](𝐴)

𝛾: 𝐴 → [ 𝜀 , 𝜀 ]()

𝑆1 𝑆1

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

𝐴1 𝐴1 𝐴2 𝐴2

automaton for 𝑅:

𝑆1

start

𝐴1

[1𝛼[1𝛼,1

[1𝛽 a[1𝛽,1

𝐴1

[1𝛾]1𝛾

]1𝛽,1b]1𝛽 𝐴2

]1𝛼,1[1𝛼,2

[2𝛽 c[2𝛽,1

𝐴2

[2𝛾]2𝛾

]2𝛽,1]2𝛽

𝑆1

]1𝛼,2]1𝛼

word 𝑤 = aabbcc 𝑤′ = aaabbcc ∉ L(𝐺)

word 𝑢 = [1𝛼[1𝛼,1 [1𝛽 a[1𝛽,1 [1𝛽 a[1𝛽,1 [1𝛾]1𝛾 ]1𝛽,1b]1𝛽 ]1𝛽,1

b]1𝛽 ]1𝛼,1[1𝛼,2 [2𝛽 c[2𝛽,1 [2𝛽 c[2𝛽,1 [2𝛾]2𝛾 ]2𝛽,1]2𝛽 ]2𝛽,1]2𝛽 ]1𝛼,2]1𝛼

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 6 / 12

Page 38: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Practical problems

… with the implementation of sortwt⊴ (𝑅 ∩ ℎ−1(𝑤))

𝑆1

start

𝐴1

[1𝛼[1𝛼,1

[1𝛽 a[1𝛽,1

𝐴1

[1𝛾]1𝛾

]1𝛽,1b]1𝛽 𝐴2

]1𝛼,1[1𝛼,2

[2𝛽 c[2𝛽,1

𝐴2

[2𝛾]2𝛾

]2𝛽,1]2𝛽

𝑆1

]1𝛼,2]1𝛼initial idea:

attach weights to[1𝜎-brackets

problem:

loops with weight 1

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 7 / 12

Page 39: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Practical problems

… with the implementation of sortwt⊴ (𝑅 ∩ ℎ−1(𝑤))

𝑆1

start

𝐴1

[1𝛼[1𝛼,1

[1𝛽 a[1𝛽,1

𝐴1

[1𝛾]1𝛾

]1𝛽,1b]1𝛽 𝐴2

]1𝛼,1[1𝛼,2

[2𝛽 c[2𝛽,1

𝐴2

[2𝛾]2𝛾

]2𝛽,1]2𝛽

𝑆1

]1𝛼,2]1𝛼

initial idea:

attach weights to[1𝜎-brackets

problem:

loops with weight 1

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 7 / 12

Page 40: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Practical problems

… with the implementation of sortwt⊴ (𝑅 ∩ ℎ−1(𝑤))

𝑆1

start

𝐴1

[1𝛼[1𝛼,1/wt𝛼

[1𝛽 a[1𝛽,1/wt𝛽

𝐴1

[1𝛾]1𝛾/wt𝛾

]1𝛽,1b]1𝛽/1 𝐴2

]1𝛼,1[1𝛼,2/1

[2𝛽 c[2𝛽,1/1

𝐴2

[2𝛾]2𝛾/1

]2𝛽,1]2𝛽/1

𝑆1

]1𝛼,2]1𝛼/1initial idea:

attach weights to[1𝜎-brackets

problem:

loops with weight 1

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 7 / 12

Page 41: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Practical problems

… with the implementation of sortwt⊴ (𝑅 ∩ ℎ−1(𝑤))

𝑆1

start

𝐴1

[1𝛼[1𝛼,1/wt𝛼

[1𝛽 a[1𝛽,1/wt𝛽

𝐴1

[1𝛾]1𝛾/wt𝛾

]1𝛽,1b]1𝛽/1 𝐴2

]1𝛼,1[1𝛼,2/1

[2𝛽 c[2𝛽,1/1

𝐴2

[2𝛾]2𝛾/1

]2𝛽,1]2𝛽/1

𝑆1

]1𝛼,2]1𝛼/1initial idea:

attach weights to[1𝜎-brackets

problem:

loops with weight 1

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 7 / 12

Page 42: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Solutions and workarounds I

… with the implementation of sortwt⊴ (𝑅 ∩ ℎ−1(𝑤))

𝑆1

start

𝐴1

[1𝛼[1𝛼,1/wt𝛼

[1𝛽 a[1𝛽,1/wt𝛽

𝐴1

[1𝛾]1𝛾/wt𝛾

]1𝛽,1b]1𝛽/1 𝐴2

]1𝛼,1[1𝛼,2/1

[2𝛽 c[2𝛽,1/1

𝐴2

[2𝛾]2𝛾/1

]2𝛽,1]2𝛽/1

𝑆1

]1𝛼,2]1𝛼/1

assume thatwt𝜎 ≠ 1 in loops

assume thatweights can befactorised

distribute factorsof wt𝜎 amongtransitions with[1𝜎, ]1𝜎, [2𝜎, ]2𝜎, …

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 8 / 12

Page 43: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Solutions and workarounds I

… with the implementation of sortwt⊴ (𝑅 ∩ ℎ−1(𝑤))

𝑆1

start

𝐴1

[1𝛼[1𝛼,1/wt𝛼

[1𝛽 a[1𝛽,1/wt𝛽

𝐴1

[1𝛾]1𝛾/wt𝛾

]1𝛽,1b]1𝛽/1 𝐴2

]1𝛼,1[1𝛼,2/1

[2𝛽 c[2𝛽,1/1

𝐴2

[2𝛾]2𝛾/1

]2𝛽,1]2𝛽/1

𝑆1

]1𝛼,2]1𝛼/1

assume thatwt𝜎 ≠ 1 in loops

assume thatweights can befactorised

distribute factorsof wt𝜎 amongtransitions with[1𝜎, ]1𝜎, [2𝜎, ]2𝜎, …

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 8 / 12

Page 44: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Solutions and workarounds I

… with the implementation of sortwt⊴ (𝑅 ∩ ℎ−1(𝑤))

𝑆1

start

𝐴1

[1𝛼[1𝛼,1/wt𝛼

[1𝛽 a[1𝛽,1/wt𝛽

𝐴1

[1𝛾]1𝛾/wt𝛾

]1𝛽,1b]1𝛽/1 𝐴2

]1𝛼,1[1𝛼,2/1

[2𝛽 c[2𝛽,1/1

𝐴2

[2𝛾]2𝛾/1

]2𝛽,1]2𝛽/1

𝑆1

]1𝛼,2]1𝛼/1

assume thatwt𝜎 ≠ 1 in loops

assume thatweights can befactorised

distribute factorsof wt𝜎 amongtransitions with[1𝜎, ]1𝜎, [2𝜎, ]2𝜎, …

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 8 / 12

Page 45: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Solutions and workarounds I

… with the implementation of sortwt⊴ (𝑅 ∩ ℎ−1(𝑤))

𝑆1

start

𝐴1

[1𝛼[1𝛼,1/ 2√wt𝛼

[1𝛽 a[1𝛽,1/ 4√wt𝛽

𝐴1

[1𝛾]1𝛾/ 2√wt𝛾

]1𝛽,1b]1𝛽/ 4√wt𝛽 𝐴2

]1𝛼,1[1𝛼,2/1

[2𝛽 c[2𝛽,1/ 4√wt𝛽

𝐴2

[2𝛾]2𝛾/ 2√wt𝛾

]2𝛽,1]2𝛽/ 4√wt𝛽

𝑆1

]1𝛼,2]1𝛼/ 2√wt𝛼

assume thatwt𝜎 ≠ 1 in loops

assume thatweights can befactorised

distribute factorsof wt𝜎 amongtransitions with[1𝜎, ]1𝜎, [2𝜎, ]2𝜎, …

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 8 / 12

Page 46: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Solutions and workarounds II

Assumption 1: weights wt𝜎 that occur in loops are ≠ 1

⟹ restrict the grammar

restricted weighted MCFGs:may not have derivations of the form

𝛼1𝛼2⋮𝛼𝑘

𝛼1⋮

with wt𝛼1= … = wt𝛼𝑘

= 1

proper implies restricted

𝔹-weighted MCFGs can be trans-formed to restricted ℕ-weightedMCFGs with the same support

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 9 / 12

Page 47: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Solutions and workarounds II

Assumption 1: weights wt𝜎 that occur in loops are ≠ 1⟹ restrict the grammar

restricted weighted MCFGs:may not have derivations of the form

𝛼1𝛼2⋮𝛼𝑘

𝛼1⋮

with wt𝛼1= … = wt𝛼𝑘

= 1

proper implies restricted

𝔹-weighted MCFGs can be trans-formed to restricted ℕ-weightedMCFGs with the same support

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 9 / 12

Page 48: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Solutions and workarounds II

Assumption 1: weights wt𝜎 that occur in loops are ≠ 1⟹ restrict the grammar

restricted weighted MCFGs:may not have derivations of the form

𝛼1𝛼2⋮𝛼𝑘

𝛼1⋮

with wt𝛼1= … = wt𝛼𝑘

= 1

proper implies restricted

𝔹-weighted MCFGs can be trans-formed to restricted ℕ-weightedMCFGs with the same support

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 9 / 12

Page 49: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Solutions and workarounds II

Assumption 1: weights wt𝜎 that occur in loops are ≠ 1⟹ restrict the grammar

restricted weighted MCFGs:may not have derivations of the form

𝛼1𝛼2⋮𝛼𝑘

𝛼1⋮

with wt𝛼1= … = wt𝛼𝑘

= 1

proper implies restricted

𝔹-weighted MCFGs can be trans-formed to restricted ℕ-weightedMCFGs with the same support

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 9 / 12

Page 50: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Solutions and workarounds II

Assumption 1: weights wt𝜎 that occur in loops are ≠ 1⟹ restrict the grammar

restricted weighted MCFGs:may not have derivations of the form

𝛼1𝛼2⋮𝛼𝑘

𝛼1⋮

with wt𝛼1= … = wt𝛼𝑘

= 1

proper implies restricted

𝔹-weighted MCFGs can be trans-formed to restricted ℕ-weightedMCFGs with the same support

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 9 / 12

Page 51: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Solutions and workarounds III

Assumption 2: weights can be factorised

⟹ restrict weight algebra

factorisable (multiplicative) monoid with zero 𝒜:

∀𝑎 ∈ 𝒜 ∖ {0, 1}: ∃𝑎1, 𝑎2 ∈ 𝒜 ∖ {1}: 𝑎1 ⋅ 𝑎2 = 𝑎

example algebra factorisation

(ℝ≥0, ⋅, 1, 0) 𝑎 = 2√

𝑎 ⋅ 2√

𝑎

(ℝ∞≥0, ⋅, 1, ∞) 𝑎 = 2

√𝑎 ⋅ 2

√𝑎

(ℝ−∞≥0 , +, 1, −∞) 𝑎 = 𝑎/2 + 𝑎/2

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 10 / 12

Page 52: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Solutions and workarounds III

Assumption 2: weights can be factorised⟹ restrict weight algebra

factorisable (multiplicative) monoid with zero 𝒜:

∀𝑎 ∈ 𝒜 ∖ {0, 1}: ∃𝑎1, 𝑎2 ∈ 𝒜 ∖ {1}: 𝑎1 ⋅ 𝑎2 = 𝑎

example algebra factorisation

(ℝ≥0, ⋅, 1, 0) 𝑎 = 2√

𝑎 ⋅ 2√

𝑎

(ℝ∞≥0, ⋅, 1, ∞) 𝑎 = 2

√𝑎 ⋅ 2

√𝑎

(ℝ−∞≥0 , +, 1, −∞) 𝑎 = 𝑎/2 + 𝑎/2

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 10 / 12

Page 53: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Solutions and workarounds III

Assumption 2: weights can be factorised⟹ restrict weight algebra

factorisable (multiplicative) monoid with zero 𝒜:

∀𝑎 ∈ 𝒜 ∖ {0, 1}: ∃𝑎1, 𝑎2 ∈ 𝒜 ∖ {1}: 𝑎1 ⋅ 𝑎2 = 𝑎

example algebra factorisation

(ℝ≥0, ⋅, 1, 0) 𝑎 = 2√

𝑎 ⋅ 2√

𝑎

(ℝ∞≥0, ⋅, 1, ∞) 𝑎 = 2

√𝑎 ⋅ 2

√𝑎

(ℝ−∞≥0 , +, 1, −∞) 𝑎 = 𝑎/2 + 𝑎/2

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 10 / 12

Page 54: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Solutions and workarounds III

Assumption 2: weights can be factorised⟹ restrict weight algebra

factorisable (multiplicative) monoid with zero 𝒜:

∀𝑎 ∈ 𝒜 ∖ {0, 1}: ∃𝑎1, 𝑎2 ∈ 𝒜 ∖ {1}: 𝑎1 ⋅ 𝑎2 = 𝑎

example algebra factorisation

(ℝ≥0, ⋅, 1, 0) 𝑎 = 2√

𝑎 ⋅ 2√

𝑎

(ℝ∞≥0, ⋅, 1, ∞) 𝑎 = 2

√𝑎 ⋅ 2

√𝑎

(ℝ−∞≥0 , +, 1, −∞) 𝑎 = 𝑎/2 + 𝑎/2

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 10 / 12

Page 55: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Conclusion

the CS-theorem can be used for parsing

problems arise from 1-weighted rules

⟹ can be circumvented by restrictingthe MCFG and the weight algebra

restrictions are not problematic in practice

Thank you for your attention.

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 11 / 12

Page 56: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Conclusion

the CS-theorem can be used for parsing

problems arise from 1-weighted rules

⟹ can be circumvented by restrictingthe MCFG and the weight algebra

restrictions are not problematic in practice

Thank you for your attention.

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 11 / 12

Page 57: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Conclusion

the CS-theorem can be used for parsing

problems arise from 1-weighted rules⟹ can be circumvented by restricting

the MCFG and the weight algebra

restrictions are not problematic in practice

Thank you for your attention.

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 11 / 12

Page 58: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Conclusion

the CS-theorem can be used for parsing

problems arise from 1-weighted rules⟹ can be circumvented by restricting

the MCFG and the weight algebra

restrictions are not problematic in practice

Thank you for your attention.

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 11 / 12

Page 59: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

Conclusion

the CS-theorem can be used for parsing

problems arise from 1-weighted rules⟹ can be circumvented by restricting

the MCFG and the weight algebra

restrictions are not problematic in practice

Thank you for your attention.

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 11 / 12

Page 60: Practical problems with Chomsky-Schützenberger parsing for … · 2021. 2. 12. · Theproblem:𝑘-bestparsing 𝑘-best parsingproblem [HuangandChiang2005] Input: a weighted grammar𝐺

References

Chomsky, N. and M. P. Schützenberger (1963). “The algebraic theory of context-freelanguages”. doi: 10.1016/S0049-237X(09)70104-1.

Denkinger, T. (2017). “Chomsky-Schützenberger parsing for weighted multiple context-freelanguages”. doi: 10.15398/jlm.v5i1.159.

Huang, L. and D. Chiang (2005). “Better k-best Parsing”.Hulden, M. (2011). “Parsing CFGs and PCFGs with a Chomsky-Schützenberger

Representation”. doi: 10.1007/978-3-642-20095-3_14.Seki, H., T. Matsumura, M. Fujii, and T. Kasami (1991). “On multiple context-free grammars”.

doi: 10.1016/0304-3975(91)90374-B.Yoshinaka, R., Y. Kaji, and H. Seki (2010). “Chomsky-Schützenberger-type characterization of

multiple context-free languages”. doi: 10.1007/978-3-642-13089-2_50.

T. Denkinger: Practical problems with CS-parsing for wMCFGs 2018-04-27 12 / 12