Thursday 12 March 2020

A Simple Algorithm for Automatic Answering


A Simple Algorithm for Automatic Answering

First of all a morphological and syntactical parse of the text must be done.  The parse should also make grammatical parsing including the subject-object determination.  I will assume these are done correctly given the text below.

Ali Ankara’ya gitti. Ali okula gitti. Ayşe okula gitti. Ali yemek yedi.

There must be an episodic memory which keeps the sentences as:

SentenceNo  1: Ali Ankara’ya gitti.
Sentence No 2: Ali okula gitti.
Sentence No 3: Ayşe okula gitti.
Sentence No 4: Ali yemek yedi.

There must be a semantical memory to which the items in these sentences are attached, such as Ali, Ayşe, okul, gitmek, etc. as seen in figure 1.  To these items, their occurence numbers as they appear in which sentences are attached.



Figure 1.

This structure must be built when the reference text is given.  Afterwards when the question is asked the question must be parsed similarly as seen in Figure2.

Figure 2.


The answer of the question is given from all the possible deepst common child leaves. That is sentence 1 and 2:
SentenceNo  1: Ali Ankara’ya gitti.
Sentence No 2: Ali okula gitti.


An other example question:

Figure 3.


The answer is sentence 2 and 3, that is:
Sentence No 2: Ali okula gitti.
Sentence No 3: Ayşe okula gitti.

More importantly:  If the semantic tree is well developed this structure can answer more abstract questions such as:
Kim hareket etti?
Ali ne yaptı?

Cheers.

Ali Riza SARAL