7c3bebd23bbf2ac266aa543d73b959e5bcb77068,language/cloud-client/v1beta2/quickstart.py,,run_quickstart,#,18

Before Change


    from google.cloud import language

    // Instantiates a client with they v1beta2 version
    language_client = language.Client(api_version="v1beta2")

    // The text to analyze
    text = "Hallo Welt!"
    document = language_client.document_from_text(text, language="DE")

    // Detects the sentiment of the text
    sentiment = document.analyze_sentiment().sentiment

After Change



    // The text to analyze
    text = u"Hallo Welt!"
    document = types.Document(
        content=text,
        type=enums.Document.Type.PLAIN_TEXT,
        language="de")
    // Detects the sentiment of the text
    sentiment = client.analyze_sentiment(document).document_sentiment

    print("Text: {}".format(text))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 10

Instances


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 7c3bebd23bbf2ac266aa543d73b959e5bcb77068
Time: 2017-07-28
Author: dizcology@hotmail.com
File Name: language/cloud-client/v1beta2/quickstart.py
Class Name:
Method Name: run_quickstart


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 7c3bebd23bbf2ac266aa543d73b959e5bcb77068
Time: 2017-07-28
Author: dizcology@hotmail.com
File Name: language/cloud-client/v1beta2/snippets.py
Class Name:
Method Name: sentiment_text


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 7c3bebd23bbf2ac266aa543d73b959e5bcb77068
Time: 2017-07-28
Author: dizcology@hotmail.com
File Name: language/cloud-client/v1beta2/snippets.py
Class Name:
Method Name: syntax_text


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 7c3bebd23bbf2ac266aa543d73b959e5bcb77068
Time: 2017-07-28
Author: dizcology@hotmail.com
File Name: language/cloud-client/v1beta2/snippets.py
Class Name:
Method Name: entities_text