%\usetikzlibrary{backgrounds} 
%\usetikzlibrary{fit}
\begin{tikzpicture}[scale=0.5]
	\tikzstyle{unit} = [draw,inner sep=1.2pt,font=\tiny,minimum height=1em]
	\tikzstyle{box} = [draw=blue!40,rectangle,inner xsep=1.4pt,inner ysep=3pt,line width=1.2pt]
	\tikzstyle{bad_tag} = [fill=red!15,inner sep=1pt,align=center,font=\tiny,text=red,minimum height=0.8em]
	\tikzstyle{ok_tag} = [fill=ugreen!15,inner sep=1pt,align=center,font=\tiny,text=ugreen,minimum height=0.8em]
	
	\coordinate (o) at (0, 0);
	
	\node[anchor=west,inner sep=0pt,align=center,font=\tiny] (n1_1) at ([yshift=8em]o.east){\textbf{Source}};
	\node[unit,anchor=west,fill=green!20](n1_2) at ([xshift=1.2em]n1_1.east){Bei};
	\node[unit,anchor=west,fill=green!20](n1_3) at ([xshift=0.4em]n1_2.east){Patienten};
	\node[unit,anchor=west,fill=green!20](n1_4) at ([xshift=0.4em]n1_3.east){mit};
	\node[unit,anchor=west,fill=green!20](n1_5) at ([xshift=1em]n1_4.east){eingeschränkter};
	\node[unit,anchor=west,fill=green!20](n1_6) at ([xshift=0.4em]n1_5.east){Nierenfunktion};
	\node[unit,anchor=west,fill=green!20](n1_7) at ([xshift=0.4em]n1_6.east){kann};
	\node[unit,anchor=west,fill=green!20](n1_8) at ([xshift=1em]n1_7.east){der};
	\node[unit,anchor=west,fill=green!20](n1_9) at ([xshift=0.4em]n1_8.east){Insulinbedarf};
	\node[unit,anchor=west,fill=green!20](n1_10) at ([xshift=1em]n1_9.east){infolge};
	\node[unit,anchor=west,fill=green!20](n1_11) at ([xshift=0.4em]n1_10.east){des};
	\node[unit,anchor=west,fill=green!20](n1_12) at ([xshift=1em]n1_11.east){verminderten};
	\node[unit,anchor=west,fill=green!20](n1_13) at ([xshift=1em]n1_12.east){Insulinabbaus};
	\node[unit,anchor=west,fill=green!20](n1_14) at ([xshift=1em]n1_13.east){verringert};
	\node[unit,anchor=west,fill=green!20](n1_15) at ([xshift=0.4em]n1_14.east){sein};
	
	\node[anchor=west,inner sep=0pt,align=center,font=\tiny] (n2_1) at ([yshift=-2em]o.east){\textbf{MT}};
	\node[unit,anchor=west,fill=red!20](n2_2) at ([xshift=3.4em]n2_1.east){In};
	\node[unit,anchor=west,fill=red!20](n2_3) at ([xshift=0.4em]n2_2.east){patients};
	\node[unit,anchor=west,fill=red!20](n2_4) at ([xshift=0.4em]n2_3.east){with};
	\node[unit,anchor=west,fill=red!20](n2_5) at ([xshift=1.6em]n2_4.east){renal};
	\node[unit,anchor=west,fill=red!20](n2_6) at ([xshift=0.4em]n2_5.east){impairment};
	\node[unit,anchor=west,fill=red!20](n2_7) at ([xshift=1em]n2_6.east){,};
	\node[unit,anchor=west,fill=red!20](n2_8) at ([xshift=1em]n2_7.east){insulin};
	\node[unit,anchor=west,fill=red!20](n2_9) at ([xshift=0.4em]n2_8.east){requirements};
	\node[unit,anchor=west,fill=red!20](n2_10) at ([xshift=0.4em]n2_9.east){may};
	\node[unit,anchor=west,fill=red!20](n2_11) at ([xshift=2.2em]n2_10.east){be};
	\node[unit,anchor=west,fill=red!20](n2_12) at ([xshift=2.2em]n2_11.east){diminished};
	\node[unit,anchor=west,fill=red!20](n2_13) at ([xshift=1.6em]n2_12.east){due};
	\node[unit,anchor=west,fill=red!20](n2_14) at ([xshift=0.4em]n2_13.east){to};
	\node[unit,anchor=west,fill=red!20](n2_15) at ([xshift=1.6em]n2_14.east){reduced};
	
	\begin{pgfonlayer}{background}
        \node [box] [fit = (n1_2) (n1_3) (n1_4)] (box1_1) {};
        \node [box] [fit = (n1_5) (n1_6) (n1_7)] (box1_2) {};
        \node [box] [fit = (n1_8) (n1_9)] (box1_3) {};
        \node [box] [fit = (n1_10) (n1_11) ] (box1_4) {};
        \node [box] [fit = (n1_12)] (box1_5) {};
        \node [box] [fit = (n1_13)] (box1_6) {};
        \node [box] [fit = (n1_14) (n1_15)] (box1_7) {};
        
        \node [box] [fit = (n2_2) (n2_3) (n2_4)] (box2_1) {};
        \node [box] [fit = (n2_5) (n2_6)] (box2_2) {};
        \node [box] [fit = (n2_8) (n2_9) (n2_10)] (box2_3) {};
        \node [box] [fit = (n2_11)] (box2_4) {};
        \node [box] [fit = (n2_12)] (box2_5) {};
        \node [box] [fit = (n2_13) (n2_14) ] (box2_6) {};
        \node [box] [fit = (n2_15)] (box2_7) {};
    \end{pgfonlayer}
	
	\node[bad_tag,anchor=north] at ([yshift=-2pt]box2_1.south){BAD\_word\_order};
	\node[bad_tag,anchor=north] at ([yshift=-2pt]box2_2.south){BAD};
	\node[ok_tag,anchor=north] at ([yshift=-2pt]box2_3.south){OK};
	\node[ok_tag,anchor=north] at ([yshift=-2pt]box2_4.south){OK};
	\node[ok_tag,anchor=north] at ([yshift=-2pt]box2_5.south){OK};
	\node[ok_tag,anchor=north] at ([yshift=-2pt]box2_6.south){OK};
	\node[ok_tag,anchor=north] (tag_1) at ([yshift=-2pt]box2_7.south){OK};
	
	\node[ok_tag,anchor=north] (gap_1) at ([xshift=-5.6em,yshift=-3em]box2_1.south){OK};
	\node[ok_tag,anchor=north] (gap_2) at ([xshift=5.1em,yshift=-3em]box2_1.south){OK};
	\node[ok_tag,anchor=north] (gap_3) at ([xshift=5.7em,yshift=-3em]box2_2.south){OK};
	\node[ok_tag,anchor=north] (gap_4) at ([xshift=7.5em,yshift=-3em]box2_3.south){OK};
	\node[bad_tag,anchor=north] (gap_5) at ([xshift=2.8em,yshift=-3em]box2_4.south){BAD\_omission};
	\node[ok_tag,anchor=north] (gap_6) at ([xshift=3.5em,yshift=-3em]box2_5.south){OK};
	\node[ok_tag,anchor=north] (gap_7) at ([xshift=2.7em,yshift=-3em]box2_6.south){OK};
	\node[ok_tag,anchor=north] (tag_2) at ([xshift=3.1em,yshift=-3em]box2_7.south){OK};
	
	\node[anchor=west,inner sep=0pt,align=center,font=\tiny] at ([xshift=3.6em]tag_1.east){\textbf{Phrase-target tags}};
	
	\node[anchor=west,inner sep=0pt,align=center,font=\tiny] at ([xshift=4.8em]tag_2.east){\textbf{Gap tags}};
	
	\draw[magenta!50,line width=1pt] (n1_2.south) -- (n2_2.north);
	\draw[magenta!50,line width=1pt] (n1_3.south) -- (n2_3.north);
	\draw[magenta!50,line width=1pt] (n1_3.south) -- (n2_4.north);
	\draw[magenta!50,line width=1pt] (n1_4.south) -- (n2_4.north);
	\draw[magenta!50,line width=1pt] (n1_5.south) -- (n2_5.north);
	\draw[magenta!50,line width=1pt] (n1_6.south) -- (n2_5.north);
	\draw[magenta!50,line width=1pt] (n1_6.south) -- (n2_6.north);
	\draw[magenta!50,line width=1pt] (n1_7.south) -- (n2_10.north);
	\draw[magenta!50,line width=1pt] (n1_8.south) -- (n2_12.north);
	\draw[magenta!50,line width=1pt] (n1_9.south) -- (n2_12.north);
	\draw[magenta!50,line width=1pt] (n1_10.south) -- (n2_13.north);
	\draw[magenta!50,line width=1pt] (n1_10.south) -- (n2_14.north);
	\draw[magenta!50,line width=1pt] (n1_12.south) -- (n2_15.north);
	\draw[magenta!50,line width=1pt] (n1_13.south) -- (n2_11.north);	
	
	\draw[dash pattern=on 2pt off 1pt,gray,line width=1pt](gap_1.north) -- ([yshift=3em]gap_1.north);
	\draw[dash pattern=on 2pt off 1pt,gray,line width=1pt](gap_2.north) -- ([yshift=3em]gap_2.north);
	\draw[dash pattern=on 2pt off 1pt,gray,line width=1pt](gap_3.north) -- ([yshift=3em]gap_3.north);
	\draw[dash pattern=on 2pt off 1pt,gray,line width=1pt](gap_4.north) -- ([yshift=3em]gap_4.north);
	\draw[dash pattern=on 2pt off 1pt,gray,line width=1pt]([xshift=-0.8em]gap_5.north) -- ([xshift=-0.8em,yshift=3em]gap_5.north);
	\draw[dash pattern=on 2pt off 1pt,gray,line width=1pt](gap_6.north) -- ([yshift=3em]gap_6.north);
	\draw[dash pattern=on 2pt off 1pt,gray,line width=1pt](gap_7.north) -- ([yshift=3em]gap_7.north);
	\draw[dash pattern=on 2pt off 1pt,gray,line width=1pt](tag_2.north) -- ([yshift=3em]tag_2.north);
	
	
\end{tikzpicture}
