# Amharic _Adhoc_ Information Retrieval System Based on Morphological Features
## 5 Experiment
### Corpora Preparation
#### 5.1.2. Morphologically Annotated Corpora  
Annotated corpora play significant role in the development of NLP tools and the evaluation of tasks such as IR. Morphological analysis is one of the fundamental NLP process to derive stem, root and grammatical parts of words based on its internal structure [21]. This could be carried out manually, automatically by NLP tools such as a morphological analyzer, or semi-automatically. The existing Amharic morphological analyzers are limited in scope and function, and are unsuitable for query and document processing. We created stem-based and root-based morphologically annotated corpora using semi-automatic method. These documents are part of our 2 AIRTC collection. Each word in each document in the corpus are morphologically segmented into affixes and base (basic stems or roots). The stem and root extraction were performed by removing character(s), changing the shape of character, or simply segmenting stem from the rest of characters (affixes). Different word classes have different word structures during word formation, but many of them have prefix(s)-stem, stem-suffix(s), or prefix(s)-stem-suffix(s) word formation structures. The number of prefixes and suffixes varies from one to five [16]. The general structure of a morphologically annotated word \(W\) is:  
\[[p\_]^*w\ [\_s]^*\]  
where \(p\) is a prefix morpheme, \(\"\_\"\) is a morphological segment marker, \(w\) is the root or stem of \(W\), \(s\) is a suffix morpheme, \([\ \dots\ ]\) denotes optionality, and \({}^{*}\) denotes the possibility of multiple occurrence. For example, the verb \(\texttt{{W}}\texttt  
_Not-based corpus annotation_: Amharic roots are usually the base of stems and surface forms of words whereas stem is the base of surface forms of words. Thus, the origins of Amharic words are root rather than stems. Therefore, to analyses the impact of root for Amharic IR we created the root-based morphological annotated corpus which is part of 2 AIRTC. Each word in each document is annotated morphologically for segmenting the root of each word from the rest of morphemes in a word. Therefore, the root-based corpus contains roots of words and their affixes. For instance, the verb _MNKQAT-700_/_  
The stem-based and root-based corpora annotations were performed using stem-based and root-based lexicons, respectively. The lexicons were annotated manually whereas documents in the corpus were annotated automatically. Each lexicon contains surface words and their respective annotation forms. Each word in each document was replaced by the corresponding morphologically annotated form using Algorithm 1.  
```
Input: stem-based lexicon and row text corpus Output: stem-based annotated Corpus  Open a lexicon and read line by line For i\(\rightarrow\)1 to length of document in the corpus:  Open document D[i] and read words in the document For j\(\rightarrow\) 1 to number of words in document D[i]:  For k 1 to number of lines in the lexicon:  Segment line[k] into two using comma  If a word(j,D)==Lexicon_word[0][k]:  Word(j,D)= Lexicon_word[1][k]  End if End for End for End for
```  
**Algorithm 1** Procedure for morphological annotation.