Somali pirates have released a Taiwanese ship that they seized off the coast of Somalia more than five months ago .