Difference between revisions of "Курсы машинного перевода для языков России/Раздел 0"

From Apertium
Jump to navigation Jump to search
m
Line 19: Line 19:
   
 
===Прямой===
 
===Прямой===
Прямой, или пословный машинный перевод осуществляется следующим образом: из языка источника считывается по одному слову за один раз, затем слово ищется в двуязычном списке слов of surface forms. Words may also be deleted, or left out, and maybe translated to one or more words. No grammatical analysis is done, so even simple errors, such as agreement in gender and number between a determiner and head noun will remain in the target language output.
+
Прямой, или пословный машинный перевод осуществляется следующим образом: из языка источника считывается по одному слову за один раз, затем слово ищется в двуязычном списке слов of surface forms. Слова могут быть удалены или не учтены, и, могут быть переведены одним или несколькими словами. Грамматический анализ не проводится, так что даже такие простые ошибки, как соглашение в роде и числе между существительным и определением к нему останется в языке перевода на выходе.
Слова могут быть удалены или не учтены, и, могут быть переведены одним или несколькими словами. Грамматический анализ не проводится, так что даже такие простые ошибки, как соглашение в роде и числе между существительным и определением к нему останется в языке перевода на выходе.
 
   
:EXEMPLE 1
+
:ПРИМЕР 1
   
 
:Heinrich köpeğine bir parça et verir.
 
:Heinrich köpeğine bir parça et verir.
Line 33: Line 32:
   
 
Transfer-based machine translation works by first converting the source language to a language-dependent intermediate representation, and then rules are applied to this intermediate representation in order to change the structure of the source language to the structure of the target language. The translation is generated from this representation using both bilingual dictionaries and grammatical rules.
 
Transfer-based machine translation works by first converting the source language to a language-dependent intermediate representation, and then rules are applied to this intermediate representation in order to change the structure of the source language to the structure of the target language. The translation is generated from this representation using both bilingual dictionaries and grammatical rules.
  +
Машинный перевод, основанные на transfer работает таким образом, что сначала язык-источник преобразовывается to a language-dependent промежуточное представление, а затем правила применяются уже к этому interm,represent с целью изменения структуры исходного языка на структуру языка перевода. Перевод происходит уже из этого representation на основе использования как двуязычных словарей, так и грамматических правил.
  +
   
 
There can be differences in the level of abstraction of the intermediate representation. We can distinguish two broad groups, shallow transfer, and deep transfer. In shallow-transfer MT the intermediate representation is usually either based on morphology or shallow syntax. In deep-transfer MT the intermediate representation usually includes some kind of parse tree or graph structure (see images on the right).
 
There can be differences in the level of abstraction of the intermediate representation. We can distinguish two broad groups, shallow transfer, and deep transfer. In shallow-transfer MT the intermediate representation is usually either based on morphology or shallow syntax. In deep-transfer MT the intermediate representation usually includes some kind of parse tree or graph structure (see images on the right).

Revision as of 17:43, 25 December 2011

Session 0: Обзор

В данном разделе будет дан краткий обзор такого метода как машинный перевод, основанный на использовании введенных правил и представлено как работает бесплатный open/source машинный переводчик на платформе Апертиум.

Существуют два принципиально отличающихся друг от друга вида машинного перевода:

  • Машинный перевод, основанный на правилах (RBMT), его также называют символьным машинным переводом; Аппертиум как раз относится к данному виду и этот раздел посвящено подвиду машинного перевода, основанного на правилах
  • Корпусный машинный перевод; при таком переводе для перевода новых предложений переводчик обращается к наборам из ранее переведенных предложений.

Если кратко представить корпусный МП, то его можно разделить на две главные подгруппы: подгруппа, в основе которой лежат статистические данные, и подгруппа, основанная на примерах. Теоретически, основной принцип работы статистического машинного перевода заключается в следующем: берется набор ранее переведенных предложений (параллельный корпус) и подсчитывается какие символы совпадают наиболее часто. Всем символам, которые совпадают, присваивается признак вероятности. При переводе нового предложения переводчик рассматривает все слова (символы), которым присвоен признак вероятности, их вероятности комбинируется, делается несколько вариантов возможных переводов и затем выбирается вариант перевода с самой высокой степенью вероятности. Первые системы статистического МП учитывали только совпадение слов, но более новые системы могут учитывать совпадения последовательных рядов слов (фраз) и иерархических деревьев.

В противовес этому, машинный перевод, основанный на анализе примеров может быть назван переводом по аналогии. В нем также используется параллельные корпуса, но, вместо того чтобы обращаться к признакам вероятности слов, переводчик учится делать анализ на основе примеров. Например, если будет дана пара предложений (A la chica le gustan los gatos(es) → Das Mädchen mag Katzen(de) и A la chica le gustan los elefantes → Das Mädchen mag Elefanten) переводчик может дать следующий пример перевода (A la chica le gustan X → Das Mädchen mag X). При переводе нового предложения, переводчик обращается и анализирует данные части предложения и заменяет их.

Автоматическое применение большего пула переводных текстов (переводной памяти) к тексту может быть также названо видом машинного перевода с использованием корпуса. На самом деле, границы между статистическим машинным переводом и переводом, которые использует и анализирует примеры достаточно размыты. И в том и в другом методе есть свои недостатки и преимущества. При использовании методов машинного перевода с использованием корпуса, переводной текст обычно выглядит более естественным, но может стардать сам смысл перевода, при использовании систем, которые используют метод, основанный на применении правил, перевод выглядит не таким гладким, но значение переводного текста ближе к языку оригинала.

Системы, основанные на правила, и системы, в которых используются корпус, могут быть объединены различными способами и представлять собой смешанную систему. Например, можно создать смешанную систему, где машинный перевод с использованием корпуса помогает найти эквиваленты, а затем может быть применен метод, основанные на правилах, в случае, если не найдено ни одного совпадающего образца.

Виды систем машинного перевода

Прямой

Прямой, или пословный машинный перевод осуществляется следующим образом: из языка источника считывается по одному слову за один раз, затем слово ищется в двуязычном списке слов of surface forms. Слова могут быть удалены или не учтены, и, могут быть переведены одним или несколькими словами. Грамматический анализ не проводится, так что даже такие простые ошибки, как соглашение в роде и числе между существительным и определением к нему останется в языке перевода на выходе.

ПРИМЕР 1
Heinrich köpeğine bir parça et verir.
<< TXUVAIX AQUÍ >>
Генрих сетö яй кусöк аслас понлы.
Heinrich antoi lihapalan koiralleen.
Генрих даёт кусок мяса своей собаке.

Transfer

Transfer-based machine translation works by first converting the source language to a language-dependent intermediate representation, and then rules are applied to this intermediate representation in order to change the structure of the source language to the structure of the target language. The translation is generated from this representation using both bilingual dictionaries and grammatical rules. Машинный перевод, основанные на transfer работает таким образом, что сначала язык-источник преобразовывается to a language-dependent промежуточное представление, а затем правила применяются уже к этому interm,represent с целью изменения структуры исходного языка на структуру языка перевода. Перевод происходит уже из этого representation на основе использования как двуязычных словарей, так и грамматических правил.


There can be differences in the level of abstraction of the intermediate representation. We can distinguish two broad groups, shallow transfer, and deep transfer. In shallow-transfer MT the intermediate representation is usually either based on morphology or shallow syntax. In deep-transfer MT the intermediate representation usually includes some kind of parse tree or graph structure (see images on the right).

EXEMPLE 2

Transfer-based MT usually works as follows: The original text is first analysed and disambiguated morphologically (and in the case of deep transfer, syntactically) in order to obtain the source language intermediate representation. The transfer process then converts this final representation (still in the source language) to a representation of the same level of abstraction in the target language. From the target language representation, the target language is generated.

Interlingual

In transfer-based machine translation, rules are written on a pair-by-pair basis, making them specific to a language pair. In the interlingua approach, the intermediate representation is entirely language independent. There are a number of benefits to this approach, but also disadvantages. The benefits are that in order to add a new language to an existing MT system, it is only necessary to write an analyser and generator for the new language, and not transfer rules between the new language and all the existing languages. The drawbacks are that it is very hard to define an interlingua which can truely represent all nuances of all natural languages, and in practice, interlingua systems are only used for limited translation domains.

Problems in machine translation

Analysis

Form does not entirely determine content.

This is also called the problem of ambiguity. The problem is that many sentences in natural language can have more than one interpretation, and these interpretations may be translated differently in different languages. Consider the following example:

EXEMPLE 3
Здесь нужен пример синтаксической неоднозначности на русском или на чувашском языке (чем проще, тем лучше)
Вот друг Саша, которого я вчера встретил.

Synthesis

Content does not entirely determine form.

This is the problem that in a given language there is usually more than one way to communicate the same meaning for any given meaning.

EXEMPLE 4
Эсир мӗнле пурӑнатӑр?
Мӗнле пурнӑҫсем?
Мӗнле халсем?
Мӗнле еҫсем?

All of these questions demand the same answer (how are you), but they may be more or less frequently used, or emphasise different things. In Apertium, for a given input sentence, one output sentence is produced. It is up to the designer of the translation system to choose which translation they want the system to produce. Often we recommend the most literal translation possible, as this reduces the necessity of transfer rules.

Transfer

The same content is represented differently in different languages.

Languages have different ways of expressing the same meaning. These ways are often incompatible between languages. Consider the following examples expressing the same content:

EXEMPLE 5

In Apertium, rules are applied which convert source language structure to target language structure using sequences of lexical forms as an intermediate representation. For further information see: Session 5: Structural transfer basics.

Description

Representing knowledge about the translation process in machine-readable form.

The final problem is that of description. In order to build a machine translation system it is necessary for people with knowledge of both languages to sit down and codify that knowledge in a form explicit and declarative enough for the machine to be able to process it.

While translation is often an unconscious process, we translate without reflecting on the rules that we use to translate, the machine does not have this unconsciousness, and must be told exactly what operations to perform. If these operations rely on information that the machine does not have, or cannot have, then a machine translation will not be possible.

But for many sentences, this information is not necessary:

EXEMPLE 6

Practice

Installation

For guidance on the installation process of Apertium, HFST and Constraint grammar, see the hand out.

Usage

To use Apertium, first open up a terminal. Now cd into the directory of the language pair you want to test.

$ cd apertium-aa-bb

You can test it with the following command:

$ echo "Text that you want to translate" | apertium -d . aa-bb

For example, from Turkish to Kyrgyz:

$ echo "En güzel kız evime geldi." | apertium -d . tr-ky
Эң жакшынакай кыз үйүмө келди. 

Directory layout

Below is a table which gives a description of the main data files that can be found in a typical language pair, and links to the sessions where they are described.

File Type Description Session(s)
apertium-tr-ky.ky.lexc Dictionary Kyrgyz morphotactic dictionary, used for analysis and generation 1 2
apertium-tr-ky.ky.twol Phonological rules Kyrgyz morphophonological rules 1 2
apertium-fr-es.tr.lexc Dictionary Turkish morphotactic dictionary, used for analysis and generation 1 2
apertium-tr-ky.tr.twol Phonological rules Turkish morphophonological rules 1 2
apertium-tr-ky.tr-ky.dix Dictionary Turkish—Kyrgyz bilingual dictionary, used for lexical transfer 4
apertium-tr-ky.tr.rlx Tagging rules Turkish constraint grammar, used for morphological disambiguation 3
apertium-tr-ky.ky.rlx Tagging rules Kyrgyz constraint grammar, used for morphological disambiguation 3
apertium-tr-ky.tr-ky.t1x Transfer rules Turkish→Kyrgyz first-level rule file, for structural transfer 5 6
apertium-tr-ky.ky-tr.t1x Transfer rules Kyrgyz→Turkish first-level rule file, for structural transfer 5 6