Skip to content

Instantly share code, notes, and snippets.

@fitomad fitomad/createml-2_ios-predict.swift Secret
Last active Sep 28, 2018

What would you like to do?
import NaturalLanguage
Consulta al modelo acerca de la categoría a la
que pertenece la reseña que acaba de escribir el
@IBAction private func handlePredictButtoTap(sender: UIButton) -> Void
self.labelRating.text = ""
guard let model = try? NLModel(mlModel: SentimentReview().model),
let review = self.textviewReview.text
if let rating = model.predictedLabel(for: review), let rate = Rate(rawValue: rating)
self.labelRating.text = "(\(rating))\(rate)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.