Chunking

En français

Шаблон:TOCD

## Поверхностный перевод

Поверхностный перевод означает отсутствие деревьев разбора (которые используются при "глубоком переводе"). Но как тогда будет происходить перестановка фраз?

Путем дробления (в три этапа): Сначала мы переставляем слова в блоке, затем переставляем блоки.

* Во-первых, мы сопоставляем шаблоны фраз, например, adj+noun или adj+adj+noun
* Из них мы создаем "псевдо лемму", с тегом, содержащим тип - обычно "SN" (фраза существительного) или SV (фраза глагола)
* Мы переводим, основываясь на эти псевдо-слова и разбивая язык на основные элементы, по существу

## Разбивка на части

Наши правила основаны на шаблонах исходного языка; нам нужно использовать разбивку на части, к примеру для Англо-Эсперанто, первая задача - выявить эти закономерности.

```
the man sees the girl

```

Chunking:

```
SN(the man) SV(sees) SN(the girl)

```

(Normally, in English those are 'NP' and 'VP' for 'noun phrase' and
'verb phrase' respectively, but we'll stick to the established
convention in apertium)

Two rules are needed to make those chunks: further chunking rules can
match 'the tall man' 'my favourite Spanish friend' 'the prettiest
Polish girl' etc. as SN; 'was going', 'had been going', 'must have
been going' as SV. We first consider these patterns separately, but
tag the chunks with whatever information will be useful later.

So the chunks are normally given a 'pseudo lemma' that matches the
pattern that matched them ('the man', 'my friend' will be put in a
chunk called 'det\_nom', etc.), the first tag added is the phrase type;
after that, tags that are needed in the next set of rules.
Essentially, we're treating phrase chunks in the same way that the
morphological analyser treats lexemes ('surface forms').

So, taking 'big cat', we would get:

```
^adj_nom<SN><sg><CD>{^granda<ad><2><3>$ ^kato<n><2><3>$}$

```

The numbers in the lemma tags (here <2><3>) mean 'take the information from chunk
tag number #'. CD means 'Case to be Determined (it's not fully
established, as GD and ND are, but it's the logical one to use).

So, with a simple SN SV SN, we can have a rule that outputs the same
things in the same order, but changes the 'CD' of SN number 1 to
'nom', and of SN number 2 to 'acc'.

## Example

```
I saw a signal

```

becomes after tagger disambiguation

```
^prpers<prn><subj><p1><mf><sg>$
^see<vblex><past>$
^a<det><ind><sg>$
^signal<n><sg>$.

```

which is transfered and chunked into

```
^prnpers<SN><p1><mf><sg>{^prpers<prn><subj><2><3><4>$}$
^verb<SV><past>{^vidi<vblex><past>$}$
^nom<SN><sg><nom>{^signalo<n><2><3><4>$}$.

```

and transformed by rule SN SV SN<nom> -> SN SV SN<acc>

```
^prnpers<SN><p1><mf><sg>{^prpers<prn><subj><2><3><4>$}$
^verb<SV><past>{^vidi<vblex><past>$}$
^nom<SN><sg><acc>{^signalo<n><2><3><4>$}$.

```

Note how the chunk has now tags nom<SN><sg><acc> and therefore ^signalo<n><2><3><4>$ gets these tags when unchunking:

```
^prpers<prn><subj><p1><mf><sg>$
^vidi<vblex><past>$
^signalo<n><sg><acc>$.

```

## See also

* Chunking: A full example
* Apertium stream format#Chunks
* Preparing to use apertium-transfer-tools
* English and Esperanto

## External links

* wikipedia
* Chunking (Natural Language Toolkit)
* CRFChunker (Conditional Random Fields English Phrase Chunker)
* JTextPro (A Java-based Text Processing Toolkit)