I don't know of any existing script that would classify these types as you wish. You may need to create this function yourself based on the distinctions you require, e.g. application/msword -> office rather than application, etc.
As your classifications are fairly arbitrary and particular to your own use-case, you'll likely have to classify them yourself into your desired categories, e.g. by using a function something like the below:
/**
* Classify mime types into pre-determined categories
* 2-d array used for simplicity of example, error
* checking omitted so unrecognised string returns
* empty value here...
*/
function categorize_mime_types($mime)
{
// Classify mime types into desired categories, key-val pairings
$mimes = array("application/msword"=>"office",
"application/vnd.oasis.opendocument.text"=>"office",
....
"image/jpeg"=>"image");
return $mimes[$mime];
}
Collecting all of the mime types to do this could be quite time-consuming, although there are a number of website which have large lists to get you started.