In this paper we generalize the
notion of (weakly) almost periodic compactification of a semitopological semigroup to
the corresponding notion for transformation semigroups. The properties of
these compactifications are studied and applications are made to semidirect
products.