\begin{algorithm}[t]
		\footnotesize
        \caption{Knowledge-Base Builder}
        \label{alg:extract_features}
		\begin{algorithmic}[1]
        \Require
	    	\Statex $D$ // corpus of tweets
			\Statex $C$ // census dataset % / activity taxonomy 
            
 		\State $K$ = empty dictionary;
        \State $A$ = empty dictionary;
        \State $T$ = empty dictionary;
        
        \ForEach {$tweet$ in $D$}
            \State $A[tweet.poi.type, tweet.act].time.append(tweet.time)$;
			\State $A[tweet.poi.type, tweet.act].frequency$ += $1$;
			\State $T[tweet.poi.type].frequency$ += $1$;
        \EndFor
         \For {$i$ = 0; $i < A.size()$; $i$ = $i$ + 1}
\State $ptype$ = $A.getPOIType(i)$;
\State $act$ = $A.getActivity(i)$;
\State $duration\_list$ = $C.getDuration(ptype, act)$;
\State $K[ptype, act].meanDuration$ = $mean(duration\_list)$;
\State $K[ptype, act].sdDuration$ = $sd(duration\_list)$;
\State $K[ptype, act].meanTime$ = $mean(A[ptype, act].time)$;
\State $K[ptype, act].sdTime$ = $sd(A[ptype, act].time)$;
\State $K[ptype, act].frequency$ = $A[ptype, act].frequency$ / $T[ptype].frequency$;
         \EndFor\\
		\Return $K$;
\end{algorithmic}
\end{algorithm}