from google.cloud import language
from google.cloud.language import enums
from google.cloud.language import types

def get_scores(text):
    client = language.LanguageServiceClient()

    document = types.Document(
        content = text,
        type = enums.Document.Type.PLAIN_TEXT)

    # Detects the sentiment of the text
    sentiment = client.analyze_sentiment(document=document).document_sentiment

    return sentiment.score
    
