implement hierarchical phrase extract