CreateML标记化时出现“执行被中断”错误

时间:2018-12-28 01:26:39

标签: swift swift-playground coreml createml

我创建了一个简单的macOS游乐场来制作coreML文本分类器,如下所示:

import Cocoa
import CreateML

let url = URL(string: "https://github.com/novinfard/profiler-sentiment-analysis/raw/master/ml-model/essays.csv")
let data = try MLDataTable(contentsOf: url!)
let (trainingData, testingData) = data.randomSplit(by: 0.8, seed: 5)
let sentimentClassifier = try MLTextClassifier(trainingData: trainingData,
                                               textColumn: "TEXT",
                                               labelColumn: "cEXT")
// Training accuracy as a percentage
let trainingAccuracy = (1.0 - sentimentClassifier.trainingMetrics.classificationError) * 100

// Validation accuracy as a percentage
let validationAccuracy = (1.0 - sentimentClassifier.validationMetrics.classificationError) * 100

print("training accuracy -> \(trainingAccuracy) validation accuracy ->\(validationAccuracy)")

但是我收到“执行被中断”错误。

以下是该过程中的日志:

Parsing completed. Parsed 100 lines in 0.078347 secs.
Finished parsing file https://github.com/novinfard/profiler-sentiment-analysis/raw/master/ml-model/essays.csv
Parsing completed. Parsed 2467 lines in 0.113062 secs.
Automatically generating validation set from 5% of the data.
Tokenizing data and extracting features

我该如何解决?

0 个答案:

没有答案