text = text.decode("utf-8")
// Instantiates a plain text document.
document = language_client.document_from_text(text)
// Detects sentiment in the document. You can also analyze HTML with:
// document.doc_type == language.Document.HTML
sentiment = document.analyze_sentiment().sentiment
After Change
// Instantiates a plain text document.
// [START migration_document_text]
// [START migration_analyze_sentiment]
document = types.Document(
content=text,
type=enums.Document.Type.PLAIN_TEXT)
// [END migration_document_text]
// Detects sentiment in the document. You can also analyze HTML with:
// document.type == enums.Document.Type.HTML