# Named Entity Recognition Using Conditional Random Fields
## 4 Urdu NER Using Condition Random Fields
### Feature Templates  
The effectiveness of machine learning techniques is heavily dependent upon the choice of appropriate features [36], that is, choosing the most informative and discriminating features may improve the performance of a machine technique, whereas a casual choice of features may impede the performance of the technique. Recognizing the importance of the choice of features, a plethora of studies were conducted to ascertain the most suitable  
Figure 1: Overall architecture of the proposed approach. feature set for a specific task. However, the set of features that are widely acknowledged as effective features for NER in Western languages is not applicable to Urdu NER due to three reasons. First, the Urdu language vocabulary, as well as its writing script, is entirely different from the Western languages. Therefore, the content-based features that play a prominent role in the identification of NE for the Western languages are not applicable to the Urdu language. Second, several structural features, such as capitalization, that can be effectively used for discriminating NE from the other text features used in Western languages are not available in the Urdu language. Third, similar to the structural features, other features, such as parts of speech tags, which play a prominent role in the identification of NE in Western languages, are not readily usable in the Urdu language due to the availability of accurate taggers. To this end, as a first contribution, we proposed the notion of a feature template. A feature template (FT) is a tuple of four elements that includes three compulsory elements and one optional element. The four elements are: prefix, identifier, position, and tag. Formally, it is defined in Equation (3). \[F_{T}=\langle P_{R},\;I_{D},\;P_{S},\;T_{G}\rangle \tag{3}\]  
where \(P_{R}\) represents the type of prefix, which depends upon the number of words to be used as a feature. There are two types of prefixes: a single-token prefix and a two-token prefix. An element is a single-token prefix if the candidate token is composed of a single-word feature, commonly known as a unigram, whereas this element is a two-token prefix if the candidate token is composed of a feature with two words, commonly known as a bigram. Formally, \(P_{R}\) is defined in Equation (4). \[P_{R}=\{U,\;B\} \tag{4}\]  
\(I_{D}\) is the identifier of the feature, which is used to distinguish between the types of feature templates. The value of the identifier is simply a serial number. Formally, it is defined in Equation (5). \[I_{D}=\{1,\;2,\;3\ldots n\} \tag{5}\]  
The third element in the tuple of the feature template is the word token at a position, which is represented by \(P_{S}\). The values of this feature are given by the lexical word at the \(x\)- and \(y\)-coordinates, where the values of \(x\) and \(y\) vary between \(-1\) and \(1\). Formally, it is defined in Equation (6). \[P_{S}=C_{W}([x,\;y]),\;\text{such that}\;x\in\{-1,\;0,\;1\}\;\text{and}\;y\in \{0,\;1\} \tag{6}\]  
The possible set of POS tags included in this study is presented below. \[T_{G}=\{\text{PPSP, VBI, VBF, CC, JJ, PRP, AUXA, PU, SC, RB, PDM, CD, PRT, APNA,} \tag{7}\]  
\[\text{PRR, AUXT, PRD, Q, AUM, SYM, NEG, AUXP, SCK, OD, FF, PRS,} \tag{8}\]  
\[\text{PRF, VALA, SCP, FR, PRE, INJ, QM} \tag{9}\]  
The possible combinations of \(x\) and \(y\) are presented in Table 3. \begin{table}
\begin{tabular}{c c} \hline \([x,y]\) & Description \\ \hline \([0,\;0]\) & Position of the current word \\ \([-1,\;0]\) & Position of the preceding word \\ \([1,\;0]\) & Represents the position of the next lexical word \\ \([-1,\;1]\) & Represents the position of the POS tag of the preceding word \\ \([0,\;1]\) & Represents the position of the POS tag of the current word \\ \([1,\;1]\) & Represents the position of the POS tag of the next lexical word \\ \hline \end{tabular}
\end{table} 
Table 3: Possible combinations of \(x\) and \(y\) for the third element.