public ServiceCall < ClassificationCollection > classifyCollection ( ClassifyCollectionOptions classifyCollectionOptions ) { Validator . notNull ( classifyCollectionOptions , "classifyCollectionOptions cannot be null" ) ; String [ ] pathSegments = { "v1/classifiers" , "classify_collection" } ; String [ ] pathParameters = { classifyCollectionOptions . classifierId ( ) } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments , pathParameters ) ) ; Map < String , String > sdkHeaders = SdkCommon . getSdkHeaders ( "natural_language_classifier" , "v1" , "classifyCollection" ) ; for ( Entry < String , String > header : sdkHeaders . entrySet ( ) ) { builder . header ( header . getKey ( ) , header . getValue ( ) ) ; } builder . header ( "Accept" , "application/json" ) ; final JsonObject contentJson = new JsonObject ( ) ; contentJson . add ( "collection" , GsonSingleton . getGson ( ) . toJsonTree ( classifyCollectionOptions . collection ( ) ) ) ; builder . bodyJson ( contentJson ) ; return createServiceCall ( builder . build ( ) , ResponseConverterUtils . getObject ( ClassificationCollection . class ) ) ; }
Classify multiple phrases .