Share via


getSentiment: trasformazione dell'analizzatore valutazione di Machine Learning

Assegna un punteggio al testo in linguaggio naturale e crea una colonna contenente le probabilità che i sentiment nel testo siano positivi.

Utilizzo

  getSentiment(vars, ...)

Arguments

vars

Vettore di caratteri o elenco di nomi di variabili da trasformare. Se è denominato, i nomi rappresentano i nomi delle nuove variabili da creare.

...

Argomenti aggiuntivi inviati al motore di calcolo.

Dettagli

La trasformazione getSentiment restituisce la probabilità che la valutazione di un testo naturale sia positiva. Attualmente supporta
solo la lingua inglese.

Valore

Oggetto maml che definisce la trasformazione.

Autore/i

Microsoft Corporation Microsoft Technical Support

Vedi anche

rxFastTrees, rxFastForest, rxNeuralNet, rxOneClassSvm, rxLogisticRegression, rxFastLinear.

Esempi


 # Create the data
 CustomerReviews <- data.frame(Review = c(
   "I really did not like the taste of it",
   "It was surprisingly quite good!",
   "I will never ever ever go to that place again!!"),
   stringsAsFactors = FALSE)

 # Get the sentiment scores
 sentimentScores <- rxFeaturize(data = CustomerReviews, 
                                mlTransforms = getSentiment(vars = list(SentimentScore = "Review")))

 # Let's translate the score to something more meaningful
 sentimentScores$PredictedRating <- ifelse(sentimentScores$SentimentScore > 0.6, 
                                           "AWESOMENESS", "BLAH")

 # Let's look at the results
 sentimentScores