In the example below, I've managed to align the words on the baseline and the nodes above them correctly by setting text height = \Aheight for the words (i.e. let the height of all words be equal to the character A) and text depth = 0pt for the nodes (i.e. let the center of all nodes be the same). What I don't know how to do is to adjust the vertical space between the words and the nodes above. I want to raise the nodes above to a more appropriate place.
\documentclass{article}
\usepackage{tikz}
\newlength{\Aheight}
\setlength{\Aheight}{\fontcharht\font`A}
\newcommand{\phraselabel}[2]{%
\begin{tikzpicture}[%
baseline = (word.base),
txt/.style = {inner sep = 0pt, text height = \Aheight, draw},
above/.style = {inner sep = 0pt, text depth = 0pt, draw}%
]
\node[txt] (word) {#1};
\node[above] at (word.north) {\footnotesize{#2}};
\end{tikzpicture}%
}
\begin{document}
\phraselabel{gg}{xxxxx} \phraselabel{aa}{jjjjj} \phraselabel{tt}{xxxxx} \phraselabel{bb}{xxxxx}.
\end{document}



positioning library, you can say e.g.\node [above=2pt of some node] {whatever}.... – cfr Apr 10 '15 at 21:12