public function annotateText($document, $features, array $optionalArgs = [])
    {
        $request = new AnnotateTextRequest();
        $request->setDocument($document);
        $request->setFeatures($features);
        if (isset($optionalArgs['encodingType'])) {
            $request->setEncodingType($optionalArgs['encodingType']);
        }

        return $this->startCall(
            'AnnotateText',
            AnnotateTextResponse::class,
            $optionalArgs,
            $request
        )->wait();
    }