/** * Finds named entities (currently proper names and common nouns) in the text along with entity * types, salience, mentions for each entity, and other properties. * * <p>Sample code: * * <pre><code> * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { * Document document = Document.newBuilder().build(); * EncodingType encodingType = EncodingType.NONE; * AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(document, encodingType); * } * </code></pre> * * @param document Input document. * @param encodingType The encoding type used by the API to calculate offsets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeEntitiesResponse analyzeEntities( Document document, EncodingType encodingType) { AnalyzeEntitiesRequest request = AnalyzeEntitiesRequest.newBuilder() .setDocument(document) .setEncodingType(encodingType) .build(); return analyzeEntities(request); }
/** * Finds named entities (currently proper names and common nouns) in the text along with entity * types, salience, mentions for each entity, and other properties. * * <p>Sample code: * * <pre><code> * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { * Document document = Document.newBuilder().build(); * EncodingType encodingType = EncodingType.NONE; * AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(document, encodingType); * } * </code></pre> * * @param document Input document. * @param encodingType The encoding type used by the API to calculate offsets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeEntitiesResponse analyzeEntities( Document document, EncodingType encodingType) { AnalyzeEntitiesRequest request = AnalyzeEntitiesRequest.newBuilder() .setDocument(document) .setEncodingType(encodingType) .build(); return analyzeEntities(request); }