• Keine Ergebnisse gefunden

7.4 Syntax manipulation

7.4.2 More complicated corpus

symbol-7.4. SYNTAX MANIPULATION 155 eigenstates. For a better comparison between the end state of affairs and the target state of affairs, the output, together with the target, is shown again in Figure 7.11. In the figure, the first two rows are the absolute values of components of the target (upper) and output (lower) state of affairs. The third and the fourth rows in the figures are the phases (arguments of complex numbers) of components of the target and output respectively. As can be seen in the figures, five eigenstates (|heleni,|isi, |killi,|byi,|dianei) have the most significant absolute values. The permutation thereof that is most similar to the state of affairs (i.e. that has the maximal complex inner product with the state of affairs vector) is taken as the orthographic form of the result of the syntax manipulation.

The generalization ability of the architecture is very good. For example, in the test set, an unseen sentence

chris kill john -> john is kill by chris

is visualized in Figure 7.12. As can be seen in the figure, there are hardly any differences between the absolute values of the output of the unseen sentence and that of the target.

There is significant variation of phases, however. Nevertheless, the target is still the best candidate for the orthographic output.

Category Instances

Person john michael helen diane chris Action love hit betray kill hug

Misc. is by

Table 7.1: Simple Syntax Corpus

156 CHAPTER 7. APPLICATION OF QT TO NLP

diane kill helen ->

helen is kill by diane

by diane

helen is kill

Re Im

Figure 7.10: An example of the training set shown as a series of vectors on complex plane.

the corpus used in the experiment discussed in this section was modified and extended, as described in the following paragraphs.

In this more complex corpus, an additional conjunction and is introduced and full verb conjugations are taken into account. There are 240 sentences in total. The vocabulary is summarized in Table 7.2. There is considerable variation added to the corpus as compared to that used in [66]. For instance, the past participle of hit is hit, but that of love is loved. In addition, the conjunction and introduces the plurality of actor and recipient.

A strategy that manipulates symbols simply on account of position will not work in this case. Moreover, hit (as past participle) and hit (as verb present plural) have the same eigenstate. In other words, they are indistinguishable according to the formulation operator F of common English. As for the verb love, there are three eigenstates associated with it (loves, love, loved). Some examples are listed below.

helen hits john <-> john is hit by helen helen loves john <-> john is loved by helen

john kills diane and michael <-> diane and michael are killed by john

architecture that is mostly being studied. In other words, symbols are already abstracted by the designer of the architecture and the actual forming of symbols from the bottom up is seldom addressed.

7.4. SYNTAX MANIPULATION 157

diane kill helen ->

helen is kill by diane

betray by chris diane helen hit hug is john kill love michael

Figure 7.11: An example of the training set.

Category Instances

Person john michael helen diane Action kill love betray hit Action Conjugated kills loves betrays hits Past Participle killed loved betrayed hit*

Conjunction and

Misc. is are by

Table 7.2: Vocabulary used in the more complex syntax corpus. Words marked with * are homonyms that are represented by identical eigenstate in the vocabulary.

Fifty-six sentences (23% of the corpus) have been randomly chosen as the training set.

The other 184 sentences are reserved as test. Using the same optimization algorithm as in the previous section, the quantum mechanical architecture can learn all the utterances in the training set. The architecture can generalize the task on all sentences in the test set (generalization rate is 100%). Given the complexity of the corpus (in comparison with that used in Chalmers’ study) and the small size of the training set, this is a very encouraging result.

A typical training curve is shown in Figure 7.13. Using the conjugate gradient method, for around 100 epochs the architecture can learn all the instances in the training set. To

158 CHAPTER 7. APPLICATION OF QT TO NLP

chris kill john ->

john is kill by chris

betray by chris diane helen hit hug is john kill love michael

Figure 7.12: An example of the test set.

visualize more details, the output of an utterance in the training set, helen and diane hit john -> john is hit by helen and diane

is shown in Figure 7.14, in which each component is illustrated as a vector on the complex plane. A comparison of the output to the target utterance is shown in Figure 7.15. The first two rows are the absolute squares (represented by the area of the black disks) of the targets and outputs respectively. As can be seen in the figure, seven eigenstates have the most significant coefficients. The lower two rows are the phases of target and output vector, respectively.

An output of an utterance in the test set,

john kills diane and michael <-> diane and michael are killed by john

is shown in Figure 7.16. The quantum architecture has never seen the utterance, it is remarkable that the differences in absolute squares and phases are hardly noticeable.

Theoretically, a quantum mechanical architecture can perform the reverse computation if time is reversed. In this case, if the output state of affairs is subject to the inverse of the

7.4. SYNTAX MANIPULATION 159

20 40 60 80 100 Epochs

10 20 30 40 Error

Figure 7.13: A typical training curve for the more complex syntax corpus.

unitary operator using

U−1 =eiHt~

one should have the original input utterance at the input side. This is, however, the ideal case only if the output state of affairs isnot formulated. If an orthographic output utterance is prepared according to the same procedure, there must be some minor difference between it and the genuine output state of affairs. This is shown in Figure 7.17. In this figure, the output utterance of same example of the training set above is prepared according to the standard procedure and then subject to the inverse of the unitary operator. The absolute squares and phases of the processed input are shown in the second and the fourth rows;

that of the original input state of affairs is shown in the first and the third rows.

If, however, the input is a well-formed sentence but cannot be transformed to the passive form in the language, such as,

john kills

the system can still arrive at some reasonable solution. This is shown in Figure 7.18 and Figure 7.19. As can be seen in Figure 7.18, four eigenstates (is, killed, by, john) have the most significant components in the end state of affairs vector. In a sense, it suggests a

160 CHAPTER 7. APPLICATION OF QT TO NLP

helen and diane hit john ->

john is hit by helen and diane

and by

diane helen

hit is john Re

Im

Figure 7.14: An example of the training set shown as a series of vectors on a complex plane.

well-formed utterance:

somebody is killed by john

However, in the miniature language we use here, it is not possible to identify who is killed.