  Weak (Hopf) bialgebras are described as (Hopf) bimonoids in appropriate
duoidal (also known as 2-monoidal) categories. This interpretation is used to
define a category wba of weak bialgebras over a given field. As an application,
the "free vector space" functor from the category of small categories with
finitely many objects to wba is shown to possess a right adjoint, given by
taking (certain) group-like elements. This adjunction is proven to restrict to
the full subcategories of groupoids and of weak Hopf algebras, respectively. As
a corollary, we obtain equivalences between the category of small categories
with finitely many objects and the category of pointed cosemisimple weak
bialgebras; and between the category of small groupoids with finitely many
objects and the category of pointed cosemisimple weak Hopf algebras.
