I want to split a table in two part as shown below. How do i split a cell so that i can write "Inferred" and "Ground truth" as shown in following picture.

I want to split a table in two part as shown below. How do i split a cell so that i can write "Inferred" and "Ground truth" as shown in following picture.

Package slashbox.sty is available from http://mirror.ctan.org/macros/latex/contrib/slashbox, if it is not installed in your system
\documentclass{article}
\usepackage{slashbox,pict2e}
\begin{document}
\begin{tabular}{@{}c|ccc|c@{}}
\backslashbox{\tabular{@{}l@{}}Ground\\truth\endtabular}{Inferred}
& 1& 2& 3& \\\hline
1 & & & & \\
2 & & & & \\
3 & & & & \\\hline
& & & & Total
\end{tabular}
\end{document}
