public Collection < String > nearestLabels ( LabelledDocument document , int topN ) { if ( document . getReferencedContent ( ) != null ) { return nearestLabels ( document . getReferencedContent ( ) , topN ) ; } else return nearestLabels ( document . getContent ( ) , topN ) ; }
This method returns top N labels nearest to specified document