Bialgebraic Semantics for String Diagrams