How to convert taxonomy term name to term id at time of importing and create custom node from csv in drupal?
This function will return the term object if you pass it the term name:
https://api.drupal.org/api/drupal/modules%21taxonomy%21taxonomy.module/function/taxonomy_get_term_by_name/7

There is an example at the bottom of that link